CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   about calculations of Courant number in openfoam (https://www.cfd-online.com/Forums/openfoam/121650-about-calculations-courant-number-openfoam.html)

openfoammaofnepo August 2, 2013 06:14

about calculations of Courant number in openfoam
 
Hi All,

I am wondering why the factor 0.5 is needed in the expression of Courant number in Openfoam?

scalar CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();

scalar meanCoNum =
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();

Removing the factors seems correct when the above expressions are compared with the definition of CFL number. Thank you very much if someone can give some comments.

Bernhard August 2, 2013 08:11

For a cubic cell, you will add up the magnitude of the velocities on the six faces (because of surfaceSum). So by the factor 0.5, you make sure you use the average value of the velocity of opposite face when calculating (u_x/dx+u_y/dy+u_z/dz)*dt.

openfoammaofnepo August 2, 2013 11:49

Thank you very much! Here the velocity is the normal velocity for each face that encloses a complete cell. Is my understanding correct? If yes, how can we directly add the velocity to get the average values? If the cell is tetrehral, how is this averaging performed? Thank you!

Quote:

Originally Posted by Bernhard (Post 443486)
For a cubic cell, you will add up the magnitude of the velocities on the six faces (because of surfaceSum). So by the factor 0.5, you make sure you use the average value of the velocity of opposite face when calculating (u_x/dx+u_y/dy+u_z/dz)*dt.


Bernhard August 2, 2013 11:52

Let me remind you that phi=U_f . A_f, so normal velocity times area. This is why you divide by volume. How is the Courant number defined for tet-cells?

openfoammaofnepo August 2, 2013 11:57

In openfoam, it seems that the Courant number is not particular for tet cells. So in that case, how does the factor 0.5 come from? Thanks.


All times are GMT -4. The time now is 00:01.