CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Computing Courant number (https://www.cfd-online.com/Forums/openfoam-pre-processing/121982-computing-courant-number.html)

Many August 9, 2013 09:50

Computing Courant number
 
Hi everyone,

I have one question related to Courant number. I am trying to simulate a flow in a complex channel with icoFoam, and Courant number is giving me some problems.

I have info about pressure on both inlet and outlet, but no velocity values are given. Also I have made a tetrahedral mesh and on another stage a hybrid mesh (tetra+prism). In order to satisfy stability criterion based on Courant<1, I am not sure about:

1. Which is delta_x? The maximum edge lenght of tetrahedrons?Minimum? This is an unstructured mesh so delta_x is not fixed!

2. How can I stablish a characteristic velocity magnitude for the formula if I donīt have any info about velocity values? (pressure driven flow)

3. IS there any way of fixing the maximum Courant number (less than 0.75 for example) in all mesh and let OpenFOAM work with time step?

Sorry for that stupids questions, but the beginnings are always hard...:eek:

Thank you so much in advance!

Benedikt September 12, 2013 06:18

First about the mesh: I'm not sure, but I reckon in general a hexaedral mesh should work better than a tetrahedral mesh.

The courant number will be calculated for each cell.
I would suggest to just run the solver and have a look at the logfile afterwards. There you can see the mean Courant number and the max Courant number. If it is too high, decrease deltaT or change the mesh. It is also possible to have a look in paraview in which cell the Courant number is too high. See http://www.cfd-online.com/Forums/ope...nt-number.html

Regarding question 3. Have a look at the systemDic.
There is an entry called "adjustTimeStep".

GerhardHolzinger September 12, 2013 06:48

Quote:

Originally Posted by Many (Post 444734)
Hi everyone,

I have one question related to Courant number. I am trying to simulate a flow in a complex channel with icoFoam, and Courant number is giving me some problems.

I have info about pressure on both inlet and outlet, but no velocity values are given. Also I have made a tetrahedral mesh and on another stage a hybrid mesh (tetra+prism). In order to satisfy stability criterion based on Courant<1, I am not sure about:

1. Which is delta_x? The maximum edge lenght of tetrahedrons?Minimum? This is an unstructured mesh so delta_x is not fixed!

2. How can I stablish a characteristic velocity magnitude for the formula if I donīt have any info about velocity values? (pressure driven flow)

3. IS there any way of fixing the maximum Courant number (less than 0.75 for example) in all mesh and let OpenFOAM work with time step?

Sorry for that stupids questions, but the beginnings are always hard...:eek:

Thank you so much in advance!


icoFoam is a transient solver that used fixed time steps. You need to use e.g. simpleFoam for transient simulations with variable time steps. Then you can specify a maximum Courant number and OF will compute the appropriate time step size.

According to my studies of the sources, the Courant number is computed by OF using the flux, the cell volume instead of velocity and discretization length.

Co = \frac{u \Delta t}{\Delta x} = \frac{u \Delta t}{\Delta x} \frac{A}{A} = \frac{\phi \Delta t}{\Delta V}

The above equation is strictly true only for homogeneous uniform hex-grids. However, it demonstrates how you can calculate a Courant number from fluxes and cells volumes.

So your first question is handled by OF. It computes the Courant number of all cells and then looks for the maximum value. delta_x is not used in the equations.

Is your second question related to estimating the allowed time step size prior to the simulation? With variable time step size solvers, the initial time step size is not that important. If it is too big, you will see it in the solver output, when the solver drastically reduces time step size to match the maxCo criterion.


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