CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Courant number in OpenFOAM

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree9Likes
  • 8 Post By floquation
  • 1 Post By otaolafr

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 19, 2016, 00:56
Default Courant number in OpenFOAM
  #1
New Member
 
Felix
Join Date: Sep 2015
Location: Hannover, Berlin
Posts: 23
Rep Power: 11
fimbull is on a distinguished road
When do i need the folowing equation?





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()
   )                               
);
fimbull is offline   Reply With Quote

Old   November 21, 2016, 03:52
Default
  #2
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21
floquation will become famous soon enough
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".
tiam, Thamali, fimbull and 5 others like this.
floquation is offline   Reply With Quote

Old   November 21, 2016, 05:39
Default
  #3
New Member
 
Felix
Join Date: Sep 2015
Location: Hannover, Berlin
Posts: 23
Rep Power: 11
fimbull is on a distinguished road
Well this is everything i need t know. Thank you.
fimbull is offline   Reply With Quote

Old   July 1, 2018, 17:45
Default Automatic Control of Courant Number
  #4
Member
 
Chris Harding
Join Date: Dec 2016
Posts: 76
Rep Power: 9
HappyS5 is on a distinguished road
Quote:
Originally Posted by floquation View Post

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.

Last edited by HappyS5; July 1, 2018 at 18:54. Reason: More descriptive
HappyS5 is offline   Reply With Quote

Old   June 26, 2020, 06:04
Default
  #5
Member
 
alexander thierfelder
Join Date: Dec 2019
Posts: 71
Rep Power: 7
superkelle is on a distinguished road
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?
superkelle is offline   Reply With Quote

Old   June 26, 2020, 07:04
Default
  #6
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 368
Rep Power: 8
geth03 is on a distinguished road
Quote:
Originally Posted by superkelle View Post
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.
geth03 is offline   Reply With Quote

Old   June 28, 2021, 03:00
Default
  #7
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 7
otaolafr is on a distinguished road
Quote:
Originally Posted by HappyS5 View Post
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
laurentb likes this.
otaolafr is offline   Reply With Quote

Old   July 18, 2024, 09:41
Default Is it possible to define different Co_max depending on regions ?
  #8
New Member
 
Wilfried B.
Join Date: May 2024
Posts: 5
Rep Power: 2
wolf.bkh is on a distinguished road
Quote:
Originally Posted by floquation View Post
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".
Hi,

I am a beginner on OpenFOAM an I am working on gas Leakage and Dispersion into a room. As the source of leakage can be very small (for example a source of 10 mm of diametrer in a room of 10 m3)I am obliged to apply a high refinement around the source . So I would like to know if it is possible to set different Co_max number and how ?

Best Regards,

Wilfried B.
wolf.bkh is offline   Reply With Quote

Old   July 18, 2024, 10:26
Default
  #9
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 741
Rep Power: 14
Tobermory will become famous soon enough
It depends.

Do you need to model the transient behaviour in a time accurate fashion? If so, then Co must be less than one, and a max of 0.5 is often sufficient to prevent the solution blowing up.

If you are only interested in the final, steady state condition, then you can use the PIMPLE algorithm and sometimes get away with a much higher Courant number ... or just use a steady state solver instead.
Tobermory is offline   Reply With Quote

Old   July 18, 2024, 11:00
Default
  #10
New Member
 
Wilfried B.
Join Date: May 2024
Posts: 5
Rep Power: 2
wolf.bkh is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
It depends.

Do you need to model the transient behaviour in a time accurate fashion? If so, then Co must be less than one, and a max of 0.5 is often sufficient to prevent the solution blowing up.

If you are only interested in the final, steady state condition, then you can use the PIMPLE algorithm and sometimes get away with a much higher Courant number ... or just use a steady state solver instead.
Thanks for the feedback. At the moment I'm working on a test case, so I'm much more interested in the final result, before making my parameters more complex.

Best Regards,
wolf.bkh is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 10:42
decomposePar -allRegions stru OpenFOAM Pre-Processing 2 August 25, 2015 04:58
SigFpe when running ANY application in parallel Pj. OpenFOAM Running, Solving & CFD 3 April 23, 2015 15:53
[blockMesh] --> foam fatal error: lillo763 OpenFOAM Meshing & Mesh Conversion 0 March 5, 2014 11:27
decomposePar pointfield flying OpenFOAM Running, Solving & CFD 28 December 30, 2013 16:05


All times are GMT -4. The time now is 15:49.