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

Courant Number Decreasing Causing Slow Progress

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By alexvaleije
  • 1 Post By nandhakumar
  • 1 Post By alexvaleije
  • 1 Post By alexvaleije

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2017, 13:14
Default Courant Number Decreasing Causing Slow Progress
  #1
New Member
 
Join Date: Jun 2016
Posts: 9
Rep Power: 9
wididid is on a distinguished road
Hello,

I have been simulating a rocket thrusting into oncoming flow using rhoCentralFoam. I have been trying to use the max courant number setting in controlDict to cap the time steps. This has previously been working fine by having the simulation run at the largest time step for the courant number. However, after some time, the simulation drops to a very small courant number and time step causing the simulation to make almost no progress. For now I have simply fixed the deltaT to allow the simulation to continue, but what is the reason for this drop in courant number after a while of simulation?

Thank you
wididid is offline   Reply With Quote

Old   September 26, 2017, 08:37
Default
  #2
Member
 
Alejandro Valeije
Join Date: Nov 2014
Location: Spain
Posts: 52
Rep Power: 11
alexvaleije is on a distinguished road
Hi there,

Since the Courant number depends on:

1º velocity
2º cell size
3º time step

it is very likely that u have some cells with a very high velocity value. Due to that, the code lowers the time step to adjust it to the maximum Courant number that you have previuosly set.

I hope that info could help u,

Alex
the_ichthyologist likes this.
alexvaleije is offline   Reply With Quote

Old   September 26, 2017, 14:56
Default
  #3
New Member
 
Join Date: Jun 2016
Posts: 9
Rep Power: 9
wididid is on a distinguished road
Thank you for the reply.

The maximum courant number that I have specified is .5. After running at this courant number for a while, the courant number drops to a very low number, something like 1e-17(Order may be wrong, but it is still a small number). If this is because the simulation is detecting that velocity and the cell size require a very small courant number to proceed, is there a fix I can apply to my problem?
wididid is offline   Reply With Quote

Old   September 27, 2017, 02:18
Default
  #4
New Member
 
CFDfreak
Join Date: Dec 2016
Posts: 15
Rep Power: 9
nandhakumar is on a distinguished road
Hello

1. Try to change your mesh sizes that is alter your mesh size as per velocity. At high velocity region dont use very fine mesh. Actually reduction in time step indicates solution blow up(apparently i think). So try running in pimpleFoam with high value of nOuterCorrectors like 50-100.


2. Try to initialize proper boundary condition, like k and epsilon value if it is a turbulent model.


3. Try to use lower order schemes for divergence (i.e bounded gauss upwind).


update the results




Thank you
the_ichthyologist likes this.
nandhakumar is offline   Reply With Quote

Old   September 27, 2017, 06:36
Default
  #5
Member
 
Alejandro Valeije
Join Date: Nov 2014
Location: Spain
Posts: 52
Rep Power: 11
alexvaleije is on a distinguished road
Quote:
Originally Posted by nandhakumar View Post
Hello

1. Try to change your mesh sizes that is alter your mesh size as per velocity. At high velocity region dont use very fine mesh. Actually reduction in time step indicates solution blow up(apparently i think). So try running in pimpleFoam with high value of nOuterCorrectors like 50-100.


2. Try to initialize proper boundary condition, like k and epsilon value if it is a turbulent model.


3. Try to use lower order schemes for divergence (i.e bounded gauss upwind).


update the results




Thank you

In addition to this, another thing you can do is checking where your high Courant number values are very high. This can be done with "postProcess -func CourantNo -time XXXX".

With this you can check with paraview where this is happening, and if it is only a small zone or if it is a general thing. In case it is only a small, non important zone, you could try to fix the time step value instead of setting it according to the maximum Courant value.


Alex
Teosim likes this.
alexvaleije is offline   Reply With Quote

Old   September 28, 2017, 17:42
Default
  #6
New Member
 
Join Date: Jun 2016
Posts: 9
Rep Power: 9
wididid is on a distinguished road
I tried running "postProcess -func CourantNo" (I wasn't sure what to put in "XXXX". Is this for specifying a single time step?) and it failed to execute because "CourantNO cannot find required object phi of type surfaceScalarField". What is the issue here?

Thanks
wididid is offline   Reply With Quote

Old   September 29, 2017, 04:10
Default
  #7
Member
 
Alejandro Valeije
Join Date: Nov 2014
Location: Spain
Posts: 52
Rep Power: 11
alexvaleije is on a distinguished road
Quote:
Originally Posted by wididid View Post
I tried running "postProcess -func CourantNo" (I wasn't sure what to put in "XXXX". Is this for specifying a single time step?) and it failed to execute because "CourantNO cannot find required object phi of type surfaceScalarField". What is the issue here?

Thanks
I've just checked your problem and u are completely right. This is because the solver "rhoCentralFoam" doesn't write the field "phi", although, of course, it is needed to calculate the solution.

If you still want to do this, the easiest way to go is modyfing the solver, making a small change in the createFields.H to make phi writable. In OF 4.1 the line which defines phi is this:

surfaceScalarField phi("phi", fvc::flux(rhoU));

You'd have to comment it and put something like this instead

volScalarField phi
(
IOobject
(
"phi",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
fvc::flux(rhoU)
);


Also, you would havce to compile it under a new name and all that, I don't know if you know how to do that. There's a lot of info of how to do that, but if u are not quite sure, come over here again.

Once the field phi is calculated and written in the temporal folders, you should be able of postprocessig the Courant.


PS: the XXX refers to the name of the folder you want to postpro. If you don't specify a value, the function will calculate it for all of them

Example:

postProcess -func CourantNo -time 25.1 (this will calculate for time 25.1)

postProcess -func CourantNo (this will calculate for all of them)


Alex
Perpetual likes this.
alexvaleije is offline   Reply With Quote

Old   January 24, 2023, 02:10
Default
  #8
Member
 
atelcikti1's Avatar
 
Join Date: Mar 2017
Posts: 61
Rep Power: 9
atelcikti1 is on a distinguished road
Quote:
Originally Posted by wididid View Post
Hello,

I have been simulating a rocket thrusting into oncoming flow using rhoCentralFoam. I have been trying to use the max courant number setting in controlDict to cap the time steps. This has previously been working fine by having the simulation run at the largest time step for the courant number. However, after some time, the simulation drops to a very small courant number and time step causing the simulation to make almost no progress. For now I have simply fixed the deltaT to allow the simulation to continue, but what is the reason for this drop in courant number after a while of simulation?

Thank you


Hi wididid,

Could you solve this problem? I have similar issue. I checked the replies into this post, but they didnt help my problem. I am expecting large values of velocity in domain and i cant do anything about it. My time steps, courant number also decreases to 1e-13s which solution does not progress.
atelcikti1 is offline   Reply With Quote

Old   January 24, 2023, 11:55
Default
  #9
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
Is it possible, that something else limits Co Number?

Which Di Number do you have?

Post one step of your log file.

Or try something like:

// Maximum diffusion number
maxDi 1000;

in your controlDict.

Or simply turn off the adjustTimeStep using:

adjustTimeStep no;

Regards

Peter

Last edited by peterhess; January 26, 2023 at 12:48.
peterhess is offline   Reply With Quote

Old   January 25, 2023, 05:27
Default
  #10
Member
 
atelcikti1's Avatar
 
Join Date: Mar 2017
Posts: 61
Rep Power: 9
atelcikti1 is on a distinguished road
Hi Peter,

I have tried constant time steps at 1e-8, but they didn't work at past. Now, i am trying your maxDi trick on control dict. It seems going well now, but i am not sure, solution needs some time.

What does that diffusion number mean? It seems obviously not physical mass/thermal diff number. I couldn't find any explanation on internet. Can you share some document or link?
atelcikti1 is offline   Reply With Quote

Old   January 25, 2023, 15:39
Default
  #11
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
If it works, please confirm, so that others can use the suggestion.

You may use a finer mesh by the way, that could also help.

If not working, run checkMesh please and post the output, to see if your mesh is fine or not.

https://www.researchgate.net/post/Wh...rical-solution

Regards

Peter

Last edited by peterhess; January 25, 2023 at 17:32.
peterhess is offline   Reply With Quote

Old   February 6, 2023, 03:15
Default
  #12
Member
 
atelcikti1's Avatar
 
Join Date: Mar 2017
Posts: 61
Rep Power: 9
atelcikti1 is on a distinguished road
Quote:
Originally Posted by peterhess View Post
If it works, please confirm, so that others can use the suggestion.

You may use a finer mesh by the way, that could also help.

If not working, run checkMesh please and post the output, to see if your mesh is fine or not.

https://www.researchgate.net/post/Wh...rical-solution

Regards

Peter

Hi Peter,

I have tried and get the correct solution. I can confirm maxDi (limiting diffusion number) didn't help. Indeed, solution is very sensitive to initial conditions. So I patch the domain with inlet properties (total press, temperature, very low velocity, inlet species mol fractions etc.), then i get the solution and my timesteps didn't drop below 4e-8. However, obviously this method is not time accurate in terms of initial conditions.
atelcikti1 is offline   Reply With Quote

Reply


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
TwoPhaseEulerFoam high courant number mwaqas OpenFOAM Running, Solving & CFD 11 July 11, 2017 14:19
multiphaseEulerFoam high Courant number Frenk_T OpenFOAM 5 November 24, 2016 03:23
foam-extend_3.1 decompose and pyfoam warning shipman OpenFOAM 3 July 24, 2014 08:14
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15


All times are GMT -4. The time now is 05:07.