Note: This discussion is about an older version of the COMSOL Multiphysics^{®} software. The information provided may be out of date.

**Discussion Closed** This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

## Why Comsol

Posted Apr 28, 2010, 7:46 AM EDT Fluid, Computational Fluid Dynamics (CFD), Parameters, Variables, & Functions, Studies & Solvers Version 4.2a 27 Replies

Thank you,

Riani

here is the link to the set of equations (for flow problems) that Fluent solves for :

hpce.iitm.ac.in/website/Manuals/Fluent_6.3/Fluent.Inc/fluent6.3/help/html/ug/node382.htm

while the set of equations that are defined in comsol are also same... !

So by FEM & FVM comparison .. do i mean that direct discretisation of PDEs are made in COMSOL (FEM) while in FLUENT (FVM) the equations are integrated and approximated by stokes theorem and then volme averaged and then discretised ... ?

Please let me understand the exact difference between FVM and FEM . please

The answer to your next question is essentially yes. Not precisely yes, but almost.

We don't have the time or space to get into an extensive discussion on the difference between FEM and FVM methods here.

In simplistic terms, the way I like to look at it is that a FVM method is zeroth order with a node in the centroid of a finite volume. If the finite volume and finite element are descretized with the exact same geometry, then the finite volume can be thought of as a finite element. A linear-basis finite element uses a linear interpolation between the node points on the finite element which are located at each corner instead of the FVM centroid. Thus you have eight nodes instead of one node in the equivalent finite element (volume).Thus the accuracy is that much more greater for the FEM method.

COMSOL, being a true finite element code, also includes quadratic, cubic, and greater basis functions. For example the quadratic basis in 3D includes nodes at the midpoints between the lines connecting the corner nodes so you have 27 nodes in the same finite element and a quadratic interpolation between all the nodes. The accuracy is even greater as you use the increased interpolation functions.

Back to the Navier Stokes equations. These equations are nonlinear. perhaps the most difficult to solve, and require high accuracy to solve precisely to the desired levels. Hence, the FEM is superior for doing so.

The faster solution time is not due to the finite volume method having fewer degrees of freedom, but being better suited for iterative (non-direct) solvers. It is common for example to use segregated solvers that solve for each flow direction separately for finite volumes but not for finite elements. Higher order elements (a big advantage of the FEM as James mentioned above) are not suitable for certain flow problems (such as turbulence or shock waves) due to the relatively sharp gradients in solution.

Finite element methods for fluid flows are catching up though and are now very competitive with finite volumes. The finite element method is also a more suitable choice for multiphysics problems, in my opinion, so that we don’t end up with one physics field discretized differently from the rest. The interface between fluids and solids will also be inconvenient if the fluid has cell-based finite volume degrees of freedom, and the solid has node-based finite element degrees of freedom (there are vertex/node based finite volume methods but they are less popular).

Nagi Elabbasi

Veryst Engineering

However, I do argue against a couple of your points directly and right away. My own dissertation utilized a segregated sweeping in two dimensions as you mentioned, and the same technique is used in 3D by other researchers. However, it is not suitable for unstructured meshes. COMSOL does not have this algorithm but I think may have something similar for laminar Navier Stokes (have not checked in current version, but it did in an older version). Also, I would argue just the opposite, that is, higher order elements are indeed, much more accurate for flows, including shocks as well, since I also found this in my same dissertation. The price paid here though is a much more dense solution matrix and higher degrees of freedom. I have not tried the shock capturing capabilities in COMSOL, but it would be interesting to see how well it works using the higher-order bases.

cfdlab.utk.edu/html/thesis/thesis.htm

I agree that FVM can indeed be faster running, but at the price of being more diffusive and less consistent with the true answers, and can be misleading in interpreting results.

I think the decision comes down to the desire for accuracy.

Thanks to " Nagi" and "James"

Finally i feel the difference .. !

James, thanks for the feedback, and for your thesis reference. Like you, I agree that FEM is overall more accurate and versatile. However, for some complex 3D problems I set the mesh size based on the anticipated solution time. That results in a finer mesh for the faster solving FVM and it “gains” accuracy (and reduces numerical diffusion) that way. A faster solving FEM would be great and we’re heading that way.

I tried to see just now if COMSOL has a default segregated solver setting which separates the velocity directions and I could not find any. It can be manually set up of course but I never tried it. I would be interested to know how well it works, even if only for structured or predominantly structured meshes.

The default discretization for fluid flow in COMSOL is using linear elements except in creeping flow and I agree with that. I have not had that much luck with quadratic elements for turbulent flow, and I don’t have much experience with shock-type flows. If they work consistently (and converge) better than linear elements, as you show in your thesis, that would be great.

By the way, there is another reason, in my opinion, for the widespread use of FVM in fluid flow, and that is momentum, and I don’t mean the momentum equation! It’s the fact that FVM in fluid flow became widespread earlier than FEM, and it is hard even for superior methods to overcome that momentum. That being said however, FVM researchers in solid mechanics use the same argument to make their case for the FVM!

Nagi Elabbasi

Veryst Engineering

Nagi, I agree with you about the momentum effect ! We see a lot of that around here.

Also, I believe that the segregated solver that I had referred to is no longer present in the current version.

There was a solver in an earlier version of the v4 series (was not in v3.5a) whereby a laminar flow could be solved for u, v, and w separately much like the FVM solvers. This method did not extend to turbulent or even non-isothermal flows, but only worked for isothermal, laminar, NS. One could save a lot of memory and cpu time if he did not have to load the entire u-p matrix !

It would be interesting to find out why this solver was removed and if they are planning to add it back at a later time with more versatility (non-isothermal, turbulent, etc.).

Perhaps its worth sending the question to support ;)

We all might get an interesting answer

--

Good luck

Ivar

Hi

Perhaps its worth sending the question to support ;)

We all might get an interesting answer

--

Good luck

Ivar

It is still there. See page 620 in COMSOL Multiphysics Users Guide. You can activate it by setting the equation to Projection method and selecting a time discrete solver. This wil set up a segregated solver which is more memory efficient.

Best regards

Bertil

Thanks for the precision (one should always re-read the doc, but 2x per year with 5000+ multiphysics pages is tought to catch everything in there ;)

Will try it one of these days

--

Good luck

Ivar

Yes ! This is the method I was thinking of. I just could not find it in the v4.2a interface. Indeed, it looks like lots of improvements have been made here. I wonder why we didn't hear about this in the release notes ? It looks like turbulence has been added for k-e. Do you know the following:

1) will non-isothermal interface with this projection method ?

2) will Low-Reynolds k-e solve with projection method ?

3) if 1) and 2) are no, do you know if there are plans to add these to this method ?

4) do you know if an iterative SS method (using multigrid or Vanka preconditioner) is more or less efficient than this projection method ? I guess it depends on the memory limitations since this projection method certainly uses much less memory

It would be interesting to hear if this projection method is similar to the methods you remember about FVM methods ? I faintly remember seeing CFX and FLUENT iterate in a similar manner as COMSOL is doing with this projection method. I suspect the type of performance you were discussing is what is in this method.

Nagi Elabbasi

Veryst Engineering

>It would be interesting to find out why this solver was removed and if they are planning to add it back at a later time >with more versatility (non-isothermal, turbulent, etc.).

It is still there. See page 620 in COMSOL Multiphysics Users Guide. You can activate it by setting the equation to Projection method and selecting a time discrete solver. This wil set up a segregated solver which is more memory efficient.

Best regards

Bertil

Thanks a lot :)

i tried the time discrete solver ... it did nt solve even for a single case .. ? did i commit any blunder ? not did the usual "time - dependent" worked .. should i go for even more finer time size ??

Attachments:

I also tried it for a simple 3D pipe, laminar flow, isothermal. It worked quite well, and used very little memory. It is certainly slower than a direct solver, but not sure how it might compare to an iterative solver. this problem simply uses the transient solver to arrive at a steady state. The first few iterations are fairly "interesting", to say the least, on how the algorithm iterates. Then, as the solution approaches a steady state, it is very fast and only iterates one time per time step. I used the default solver settings. Please find the model file attached with solution, mesh, and history cleared.

Attachments:

cantyou run it and solve it ? Normally we clear the solution and the mesh when we upload, in V4 its then just to run the simulation ;)

--

Good luck

Ivar

Hi

cantyou run it and solve it ? Normally we clear the solution and the mesh when we upload, in V4 its then just to run the simulation ;)

--

Good luck

Ivar

the problem its been running for almost 2 hrs and still its just half solved ... i thought i need nt wait for a simple laminar flow problem this long ... :D !!

Another impressive and emerging technology is Lattice Boltzman Transport modeling. It requires dense regular meshing, but utilizes distributed parallel processing very efficiently. I think the beginnings of this technology are showing up in the COMSOL microfluidics module. There are lots of u-tube videos of LBT examples.

The LBM solves the discrete Boltzmann equations that govern the dynamics of particle distributions. Is it based on the more fundamental Boltzmann transport equation. Its main drawback is that it can only solve the transient problem, so no steady state solution. I also think they are not suitable for incompressible flow as well since the pressure is obtained from the density distribution. As far as I know, the method is also still insufficiently validated. Their main advantage is good parallel scalability, multiphase flow, and less sensitivity to geometric complexity. The examples shown on the web seem to focus on these areas of strength.

The Lattice Boltzmann method in general uses a simple grid mesh, so describing XFLOW as “meshfree” seems to me to be more for marketing purposes. Many other meshfree methods exist for solid mechanics and Navier-Stokes fluid mechanics (where a simple grid mesh is not the norm) but they are not yet available in widely used commercial codes, and have their own advantages and disadvantages.

Nagi Elabbasi

Veryst Engineering

Please check out the Microfluidics Module User's Guide > Theory for the Transitional Flow Interface > Overview of the Lattice Boltzmann Method

Note that while COMSOL employees may participate in the discussion forum, COMSOL^{®} software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.

## Suggested Content

- KNOWLEDGE BASE Why do I receive License error -9 after upgrading to Mac OS X 10.10 Yosemite, Mac OS X 10.9 Mavericks, or Mac OS X 10.8 Mountain Lion?
- KNOWLEDGE BASE The COMSOL Desktop graphics window becomes scrambled after upgrading to Mac OS X 10.8 Mountain Lion
- BLOG Why Should You Simulate Fatigue?
- KNOWLEDGE BASE Error: Internal Error in Geometry Decomposition
- FORUM Unit syntax error, not sure why