CFD Online Discussion Forums

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

fimbull November 18, 2016 23:56

Courant number in OpenFOAM
 
When do i need the folowing equation?



https://openfoamwiki.net/images/math...d5a50a961b.png

And what does it mean?

is there Delta V the cell volume and Delta S a area from the cell surface? What means the f in sum_f.

Could somebody explain it with a cell with the size a*b*c

found it on:

https://openfoamwiki.net/index.php/Co

and also in CourantNo.C

Code:


tmp<volScalarField::Internal> Coi

Code:

               
(
                                 
  byRho

  (
    (0.5*mesh_.time().deltaT())
    *fvc::surfaceSum(mag(phi))()()                                       
    /mesh_.V()

  )
                             
);


floquation November 21, 2016 02:52

The Courant number provides a stability criterion, which is especially important if you use an explicit time scheme. If Co>1, you may expect your simulation to diverge. See:
https://en.wikipedia.org/wiki/Couran...Lewy_condition
Intuitively, it says that within a given timestep \Delta t, fluid may flow a distance U\Delta t of one cell \Delta x at most (if Co=1). In practice, we limit the Courant number to be smaller than 0.1~0.5.

In your equation
\Delta x = \Delta V / \Delta S,
where \Delta S is the surface area of a face. Plugging in your abc, you will find that a=abc/bc (for example).
This expression should be evaluated for each face f, because (again, see the link above) in more dimensions you should sum the contributions of each dimension. The factor 0.5 is presumably there to prevent double-counting opposite faces (west and east), as they belong to the same direction.


When do you need it? You don't.
In controlDict, set
Code:

adjustTimeStep  yes;
maxCo          0.25;

and OpenFoam will automatically limit \Delta t as to have a Courant number below "maxCo".

fimbull November 21, 2016 04:39

Well this is everything i need t know. Thank you.

HappyS5 July 1, 2018 16:45

Automatic Control of Courant Number
 
Quote:

Originally Posted by floquation (Post 626157)

When do you need it? You don't.
In controlDict, set
Code:

adjustTimeStep  yes;
maxCo          0.25;

and OpenFoam will automatically limit \Delta t as to have a Courant number below "maxCo".

At what point in the Control Dictionary does this go. I tried to use it with icoFoam and still had severe convergence problems.

Thanks in advance.

superkelle June 26, 2020 05:04

The factor of 0.5 is just because we summed over the magnitude of the phi, since the phi_in hast to be equal to phi_out. Is that correct?

geth03 June 26, 2020 06:04

Quote:

Originally Posted by superkelle (Post 776086)
The factor of 0.5 is just because we summed over the magnitude of the phi, since the phi_in hast to be equal to phi_out. Is that correct?

yes Sir, thats correct.

otaolafr June 28, 2021 02:00

Quote:

Originally Posted by HappyS5 (Post 697831)
At what point in the Control Dictionary does this go. I tried to use it with icoFoam and still had severe convergence problems.

Thanks in advance.

Hello,
icoFoam has not this feautre implemented, if you want "icoFoam with adjustable time" you should run pimpleFoam in ico foam setting and pimple has adjustable time build in.
best regards


All times are GMT -4. The time now is 04:30.