CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   COMSOL (https://www.cfd-online.com/Forums/comsol/)
-   -   Why COMSOL use FEM instead of FVM? (https://www.cfd-online.com/Forums/comsol/197380-why-comsol-use-fem-instead-fvm.html)

FIRE January 3, 2018 15:24

Why COMSOL use FEM instead of FVM?
 
Hi,
Why COMSOL use FEM instead of FVM?
Is FEM has any advantageous over FVM?
Thx

mprinkey January 3, 2018 21:33

COMSOL is a multiphysics code first and a cfd code second. Solid mechanics and most electromagnetics solvers are FEM-based. There are FEM-based CFD solvers (using, say, Streamwise-Upwind Petrov Galerkin for convection) that have been around since the 1990s, so that fluids capability is a known quantity. In fact, FIDAP was a commercial CFD code back in the 90s. Practically, a multi-physics code should use the same mesh and the same data location points for all of its fields so interphysics coupling can be done in a consistent way. That makes FEM treatments the obvious choice.

FVM approaches for solid mechanics, EM, etc. are, of course, possible in principle, but are not as widely used and haven't had the same years of accumulated experience. IMO, FEM is a poor choice for pure CFD versus FVM or Discontinuous Galerkin Method, but COMSOL isn't pure CFD.

toodles January 5, 2018 17:52

Quote:

Originally Posted by mprinkey (Post 676869)
COMSOL is a multiphysics code first and a cfd code second. Solid mechanics and most electromagnetics solvers are FEM-based. There are FEM-based CFD solvers (using, say, Streamwise-Upwind Petrov Galerkin for convection) that have been around since the 1990s, so that fluids capability is a known quantity. In fact, FIDAP was a commercial CFD code back in the 90s. Practically, a multi-physics code should use the same mesh and the same data location points for all of its fields so interphysics coupling can be done in a consistent way. That makes FEM treatments the obvious choice.

FVM approaches for solid mechanics, EM, etc. are, of course, possible in principle, but are not as widely used and haven't had the same years of accumulated experience. IMO, FEM is a poor choice for pure CFD versus FVM or Discontinuous Galerkin Method, but COMSOL isn't pure CFD.

Just out of curiosity, why do you think it is a poor choice?

mprinkey January 5, 2018 18:17

Quote:

Originally Posted by toodles (Post 677093)
Just out of curiosity, why do you think it is a poor choice?

FEM lacks a fundamental statement of conservation. FVM (and DG) are axiomatically conservative based on face flux integrals. FEM is defined as a minimization problem--find the solution that best reduces the Galerkin (or Least-Squares) residual of this system. For solid mechanics, that minimization statement makes a lot of sense--configuration of solid mechanical systems map nicely to variational formulations. Conservation equations, however, do not.

For simple flow physics, the difference is not really that important. FEM with linear shape functions *may* be a little more accurate than 2nd order FVM on a per-DOF basis. The FVM code will probably run a bit faster. But, the FVM code will *precisely* (to round-off error) conserve the mass entering and exiting a system. FEM will not be absolutely conservative, without some additional tweaking--using dark arts that I know not. This really becomes an issue with reacting flows, say, where trace concentrations of species can make significant differences. A one-part-in-ten-thousand mass imbalance is inconsequential in external aero or a lid driven cavity, but it could create a dramatic difference in flame shape or attachment points.

Another reason is that FVM solvers are highly optimized for solving flow problems, by basically cutting every corner possible. Segregated solution methods, projection methods, frozen field preconditioning for Newton Krylov...the list is very long. FEM doesn't have these and they do not automatically transfer. FEM tends to do a great job of handling inter-field coupling because it creates a large stiffness matrix using all of the d.o.f.s, solving the system in a coupled manner. And while that is perfect for enforcing solid mechanics constitutive laws, that coupled approach *tends* to be suboptimal from a pure convergence/performance standpoint. The details of these differences are difficult to cover without really getting into the weeds. Suffice to say, FEM methods have grown one way to serve primarily solid mechanics. FVM methods have grown another way (really TWO other ways, as density-based and pressure-based solvers are hugely different in their own right). These decades of accumulated differences has resulted in tool specialization that is hard to overcome.

Jonas Holdeman January 6, 2018 10:14

Quote:

Originally Posted by mprinkey (Post 677096)
. . . But, the FVM code will *precisely* (to round-off error) conserve the mass entering and exiting a system. FEM will not be absolutely conservative, without some additional tweaking--using dark arts that I know not. ...

There is an FE method that is absolutely/precisely mass-conservative for incompressible flow in a pointwise sense, not just flow "entering and exiting a system". Using primitive variables, the basis functions are the curl of a stream function or vector potential element. To see code examples, go to cfd-online -> wiki -> source code archive -> educational -> {2D ... & 3D...}. Straight finite elements, no tweaking or dark arts involved, only thinking outside the box.

FMDenaro January 6, 2018 10:54

Just to add a note: FVM can be see as a special case of FEM when the equations is projected along step-wise shape functions

mprinkey January 6, 2018 15:23

Quote:

Originally Posted by Jonas Holdeman (Post 677141)
There is an FE method that is absolutely/precisely mass-conservative for incompressible flow in a pointwise sense, not just flow "entering and exiting a system". Using primitive variables, the basis functions are the curl of a stream function or vector potential element. To see code examples, go to cfd-online -> wiki -> source code archive -> educational -> {2D ... & 3D...}. Straight finite elements, no tweaking or dark arts involved, only thinking outside the box.

I remember that, now that you mention it. Is there a version for (weakly) compressible flow? That would need to involve some interesting basis functions. Conservation issues really come back to reacting flows and those are often variable density, subsonic flows--I'm thinking of natural gas burners, etc.
And of course, all of these problems go away with DG. So, why not just use DG.

selig5576 January 6, 2018 17:25

DG and FVM
 
Do you think DG will eventually replace FVM? DG combines the features of both FEM and FVM, but still seems to be a relatively new competitor in the scene.

praveen January 6, 2018 23:34

DG allows to go beyond second order even upto to the boundary. But this requires high order meshes which is not so well developed. Efficient implicit solvers is another obstacle. For real applications using RANS, the major issue is turbulence modelling, and having a high order method may not gain you much. Where high order methods may be more useful is in LES and of course DNS.

FMDenaro January 7, 2018 04:49

At the best of my knowledge, owing to the dissipative character, DG is mainly used in ILES approach. See for example: P. Fernandez, N.C. Nguyen, J. Peraire,The hybridized Discontinuous Galerkin method for Implicit Large-Eddy Simulation of transitional turbulent flows. J. Comp. Phys., 336, Pages 308-329, 2017.

I recently revised a PhD thesis about this issue and I think DG still needs some analyses in terms of LES formulation

praveen January 7, 2018 04:56

High order schemes are an active area of research, see these workshops

1) http://dept.ku.edu/~cfdku/hiocfd.html
3) https://www.grc.nasa.gov/hiocfd/
4) https://how4.cenaero.be
5) https://how5.cenaero.be (in 2018)

The older ones have presentation slides and some status report also.

arjun January 7, 2018 08:29

Quote:

Originally Posted by praveen (Post 677192)
High order schemes are an active area of research, see these workshops

1) http://dept.ku.edu/~cfdku/hiocfd.html
3) https://www.grc.nasa.gov/hiocfd/
4) https://how4.cenaero.be
5) https://how5.cenaero.be (in 2018)

The older ones have presentation slides and some status report also.


What I find interesting is that most of these higher order methods are for Euler solvers with density based approach.

I have been very slowly working on third order version of Wildkatze solver with pressure based approach. (SIMPLE type). Thought the base version is ready it need verifications so i would see if the solver could be validated and released to others.
(Due to personal problems could not work for last 1.5 months but i will soon pick up).

Having said this, do you know someone (or some place) where they are working on higher order solver with pressure based approach?

Jonas Holdeman January 7, 2018 09:06

Quote:

Originally Posted by mprinkey (Post 677165)
I remember that, now that you mention it. Is there a version for (weakly) compressible flow? That would need to involve some interesting basis functions. Conservation issues really come back to reacting flows and those are often variable density, subsonic flows--I'm thinking of natural gas burners, etc.

I don't know what the core issues are in weakly compressible flow, except that a number of terms vanish in the limit in the asymptotic expansion of the NS equation in terms of Mach number, which can cause numerical problems. The divergence-free elements in primitive variables are necessarily of the Hermite type. One can write constant-divergence Lagrange elements for which the divergence vanishes pointwise when the net flow into an element is zero. These would seem to be useful in that they are pointwise divergence-free in a limit, but still allow for coarse compressibility. I have used these in an intermediate step in the derivation of "serendipity" classes of divergence-free elements.

jmaeng January 9, 2018 14:03

Quote:

Originally Posted by arjun (Post 677202)
What I find interesting is that most of these higher order methods are for Euler solvers with density based approach.

I have been very slowly working on third order version of Wildkatze solver with pressure based approach. (SIMPLE type). Thought the base version is ready it need verifications so i would see if the solver could be validated and released to others.
(Due to personal problems could not work for last 1.5 months but i will soon pick up).

Having said this, do you know someone (or some place) where they are working on higher order solver with pressure based approach?

I'm not too familiar with pressure based approaches for high-order methods. Many high-order methods for compressible and high-speed flows, of interest for many researchers, are designed to solve conservation systems, for example, the Euler equations. That being said, the main focus of Euler solvers, or inviscid flux component of the N/S solvers, is to design "conservative" methods, which are invariably in terms of density and conservation of mass, momentum, and energy, resulting from the conservation laws.

praveen January 10, 2018 08:18

A lot of the high order research is focused on aerospace applications which need compressible solvers.

But there are some highly regarded high order solvers for incompressible flows,

nek5000: https://nek5000.mcs.anl.gov

Nektar: https://www.nektar.info

And both are open source :-)

selig5576 January 11, 2018 10:32

Spectral Element
 
Do spectral elements suffer from the same types of issues as spectral methods, i.e. shock waves? Something I dislike about spectral methods is the need for smoothness u \in C^{\infty}. I think the spectral element is attractive due to spectral convergence, but how would it compare to a discontinuous galerkin method?

FMDenaro January 11, 2018 10:42

Quote:

Originally Posted by selig5576 (Post 677722)
Do spectral elements suffer from the same types of issues as spectral methods, i.e. shock waves? Something I dislike about spectral methods is the need for smoothness u \in C^{\infty}. I think the spectral element is attractive due to spectral convergence, but how would it compare to a discontinuous galerkin method?

not an expert about spectral elements methods but I think that for solution with singularity you cannot use that without to separate the spectral reconstruction in the regions of regular solutions...
I could immagine a spectral reconstruction on average values that are regularized but it would be useful to check in the literature

arjun January 11, 2018 21:50

Quote:

Originally Posted by jmaeng (Post 677482)
I'm not too familiar with pressure based approaches for high-order methods. Many high-order methods for compressible and high-speed flows, of interest for many researchers, are designed to solve conservation systems, for example, the Euler equations. That being said, the main focus of Euler solvers, or inviscid flux component of the N/S solvers, is to design "conservative" methods, which are invariably in terms of density and conservation of mass, momentum, and energy, resulting from the conservation laws.


pressure based approach is also FV approach and shall be conservative.

arjun January 11, 2018 21:53

Quote:

Originally Posted by praveen (Post 677573)
A lot of the high order research is focused on aerospace applications which need compressible solvers.

But there are some highly regarded high order solvers for incompressible flows,

nek5000: https://nek5000.mcs.anl.gov

Nektar: https://www.nektar.info

And both are open source :-)


Both are finite element too. These are indeed incompressible flow solvers.

Still though pressure based finite volume is missing. So far I am not able to find someone who is working on pressure based third order or higher.

andy_ January 13, 2018 08:57

Quote:

Originally Posted by FIRE (Post 676847)
Hi,
Why COMSOL use FEM instead of FVM?
Is FEM has any advantageous over FVM?

COMSOL uses FEM because of how it evolved from the structural side where FEM has been the practical solution since the 60s. The fluid side is expressed in FEM speak/data structures to aid the multiphysics but if the implementations are efficient they will have a lot in common with FVM/FD codes. FEM is a general mathematical approach and as someone mentioned above one can express FVM/FD methods with it. Back in the 80s the company I worked for employed a university maths group to analyse the scheme of one of their internal FVM CFD codes that appeared to work well but unusually used upwinded control volumes which tended to sow a bit of doubt. The first thing the group did was express it as an equivalent FEM scheme because the FEM analysis tools were better developed.


All times are GMT -4. The time now is 13:19.