CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   Courant Number (http://www.cfd-online.com/Forums/cfx/19747-courant-number.html)

Aaron Latty July 2, 2003 11:29

Courant Number
 
Hello all:

Is there a way in CFX (using v5.6) to specify a value for the courant number so that the solver will adjust the timestep accordingly to maintain the value?

Thanks,

Aaron

Robin July 2, 2003 16:47

Re: Courant Number
 
CFX-5 is fully implicit, why would you want to do this?

Robin

Jan Rusås July 2, 2003 17:36

Re: Courant Number
 
Robin, Could you please explain your comment a bit more detailed. I did beleive that when doing a transient calculation that the Courant number was important (less or equal to 1 or 5 depending on time scheme) Regards Jan

Aaron Latty July 3, 2003 06:02

Re: Courant Number
 
Even though a scheme might be implicit, if you are doing a transient calculation, the courant number will be important within a given time step. Otherwise, you won't capture the transient behaviour between the timesteps.

Aaron


Robin July 3, 2003 09:33

Re: Courant Number
 
This is true of explicit methods, but is not the case for a fully implicit code. Since CFX-5 solves the mass and momentum equations in a coupled-implicit manor, you are not restricted by the Courant Number.

Rather, you need to ensure that the equations are converging within your timestep. You should choose a timestep that is small enough to converge within 3 to 5 coefficient loops in order to accurately resolve the transient physics.

Robin


Neale July 4, 2003 00:06

Re: Courant Number
 
Yes, but, as Robin pointed out already in the other post, since CFX-5 is fully implicit, if you take a timestep small enough and converge the solution within a timestep (i.e. global balances and RMS residuals are low enought that you have "solved" the equations) then you do not need to worry about the Courant number.

Furthermore, if the convergence condition within a timestep is achieved then it basically means that you are taking a timestep which is adequately resolving the transient physics. If your timestep is too big then you will not converge within a timestep. Given it's "linear" scheme nature, the Courant number on it's own can never be an adequate measure of how well you are solving an inherently non-linear problem.

Neale.

Jan Rusås July 4, 2003 03:32

Re: Courant Number
 
Thanks for your reply Robin, I am happy with your answer, cause normally I just calculate the Courant number just to get an idea about the size of if. It is other parameters that determine the size of the time step. I guess the confusion comes from, as I understand it, that the Courant number rather is a stability criteria more than a measure for the transient behaviour of the flow.

henry July 10, 2003 02:05

what is Courant Number
 
What exactly is this courant number, can someone throw some light in this regard?

thanks henry

pharg_yrartibra August 15, 2012 11:41

Quote:

Originally Posted by Robin (Post 66775)
CFX-5 is fully implicit, why would you want to do this?

Robin

What does it mean that the solver is implicit? Does implicit mean the same thing here as in implicit Runge–Kutta methods?

If so, how does this implicit method work? All I know is that backward (or implicit) Euler for example, tends to reverse the energy development of a signal that is being transported (since it's working backwards) if ideally the energy development would be zero. So for example if normal Euler is unstable and will make the energy of the signal exponentially increase, as in an UPWIND scheme with a Courant number > 1, backward Euler would reverse the energy development and instread exponentially decrease it, and tend to low-pass filter the signal that is transported. But for a Courant number < 1, UPWIND is stable and will low-pass filter the signal, thus making the energy exponentially decrease, so wouldn't an implicit method in this case make the energy exponentially increase and thus be unstable?

ghorrocks August 15, 2012 18:44

Explicit methods take gradients at the current time step and extraplote that forward in time to get the next time step. So the fundamental solution procedure is algebraic. This approach is limited to a Courant number (of CFL number if compressible) of 1.0.

Implicit methods solve the next time step as a set of simultaneous equations, with gradients calculated back to the previous time step. This means a matrix solution is required, but also means the Courant number/CFL number limit does not apply.

If you want a more detailed explanation than that I will refer you to any reasonable CFD textbook. The difference between implicit and explicit methods is basic numerical methods.

Crank-Shaft November 11, 2012 19:39

Quote:

Originally Posted by ghorrocks (Post 377277)
Explicit methods take gradients at the current time step and extraplote that forward in time to get the next time step. So the fundamental solution procedure is algebraic. This approach is limited to a Courant number (of CFL number if compressible) of 1.0.

Implicit methods solve the next time step as a set of simultaneous equations, with gradients calculated back to the previous time step. This means a matrix solution is required, but also means the Courant number/CFL number limit does not apply.

If you want a more detailed explanation than that I will refer you to any reasonable CFD textbook. The difference between implicit and explicit methods is basic numerical methods.

Great reply Ghorrocks as always mate.

I needed to know whether the comment regarding the selection of appropriate time steps to allow convergence within 3-5 iterations is verified and widely accepted.

I have been trying to analyse flow over a ramp geometry which induces separation and would like to capture any resulting vortex shedding. Currently using transient simulation, pressure-based, SIMPLE pressure-velocity correction algorithm with all transport and turbulence scalar equations set to second-order upwind.

I started to use the time-steps which allows the stream-wise, free-stream velocity to traverse the smallest cell size in step. This resulted in 0.002s steps and I have iterations at 40 max/timestep. I did this as a maximal value and there are many time-steps which do not really converge even after 40 iterations.

Even after very long runs of 100 time-steps, the residuals for all the transport equations and scalars are all oscillating at a constant frequency. Is there a way to identify what I could be doing wrong here? Should I alter the time-step size to follow the 3-5 iteration convergence guideline?

ghorrocks November 11, 2012 19:51

Quote:

I needed to know whether the comment regarding the selection of appropriate time steps to allow convergence within 3-5 iterations is verified and widely accepted.
It is the recommended approach in the CFX documentation. I have been preaching it for many years and it has never let me down in my modelling using it. In a very small number of simulations I have had to increase it to 5-10 coeff loops per time step but that is very rare.

Quote:

Currently using transient simulation, pressure-based, SIMPLE pressure-velocity correction algorithm
I presume this work is not using CFX then. CFX does not use SIMPLE.

Quote:

Even after very long runs of 100 time-steps, the residuals for all the transport equations and scalars are all oscillating at a constant frequency. Is there a way to identify what I could be doing wrong here?
I suspect your time step is too big for reliable convergence.

Quote:

Should I alter the time-step size to follow the 3-5 iteration convergence guideline?
Of course, I would not be saying if I thought otherwise :)

You will probably find 3-5 coeff loops approach give you much smaller time steps, but very fast and reliable convegence in each time step. This is faster, more accurate and more reliable than larger time steps with longer convergence per time step.

If you do not believe me then do a simple benchmark simulation where you play with the number of coeff loops and look at the final result. Best do this on a benchmark where you have good reliable benchmark data to compare to - maybe vortex shedding off a cylinder or something like that. Then you can explore this for yourself and I suspect you will too will believe.

Crank-Shaft November 11, 2012 22:18

Quote:

Originally Posted by ghorrocks (Post 391531)
It is the recommended approach in the CFX documentation. I have been preaching it for many years and it has never let me down in my modelling using it. In a very small number of simulations I have had to increase it to 5-10 coeff loops per time step but that is very rare.



I presume this work is not using CFX then. CFX does not use SIMPLE.



I suspect your time step is too big for reliable convergence.



Of course, I would not be saying if I thought otherwise :)

You will probably find 3-5 coeff loops approach give you much smaller time steps, but very fast and reliable convegence in each time step. This is faster, more accurate and more reliable than larger time steps with longer convergence per time step.

If you do not believe me then do a simple benchmark simulation where you play with the number of coeff loops and look at the final result. Best do this on a benchmark where you have good reliable benchmark data to compare to - maybe vortex shedding off a cylinder or something like that. Then you can explore this for yourself and I suspect you will too will believe.

I have used a Fluent Solver for this and I do my post-processing in CFX post. I have found this to be much more flexible and gave me better control over all of the simulations settings.

I will basically need to perform convergence/sensitivity analysis for this rather than blindly using the time-step suggested by the CFL criteria of 1 (as per my previous attempt). The only problem I imagine is the long lead times involved in trying to identify an appropriate time-step by trial and error. Do you use a general guideline or ratio that is suitable for the refinement or coarsening of the time-steps in such a case, when trying to identify suitable time-steps?

I currently don't have access to multiple computers or a cluster so I am stuck with a single workstation so the turnaround for something like this is important. I currently have 4 levels of mesh refinement which relate to each of the steps in my grid convergence and independence study. Should I include all of these in my attempts to find the appropriate time-steps or choose the one deemed 'fine enough'? I am not too sure about this however, I imagine we should use a grid which would completely isolate any convergence issues to the time-step changes rather than due to lack of resolution/discretisation.

Comments are greatly appreciated everyone.

ghorrocks November 11, 2012 22:54

If you are using Fluent then my comments are not applicable. SIMPLE is very different to the coupled solver in CFX and requires a different approach. You might get similar behaviour using the coupled solver in Fluent but I cannot guarantee it.

But your comment is totally right - blindly applying Courant number =1 is not useful. Best to do a sensitivity analysis and determine for yourself what time step it needs. Between mesh sizes you can use Curant number to give you a starting point but it is preferable to repeat the sensitivyt analysis.

For general comments on CFD accuracy see "Computational Fluid Mechanics" by Roache, or the excellent summary which has become the Journal of Fluids Engineering Editorial policy: http://journaltool.asme.org/Template...umAccuracy.pdf

Crank-Shaft November 11, 2012 23:36

Quote:

Originally Posted by ghorrocks (Post 391545)
If you are using Fluent then my comments are not applicable. SIMPLE is very different to the coupled solver in CFX and requires a different approach. You might get similar behaviour using the coupled solver in Fluent but I cannot guarantee it.

But your comment is totally right - blindly applying Courant number =1 is not useful. Best to do a sensitivity analysis and determine for yourself what time step it needs. Between mesh sizes you can use Curant number to give you a starting point but it is preferable to repeat the sensitivyt analysis.

For general comments on CFD accuracy see "Computational Fluid Mechanics" by Roache, or the excellent summary which has become the Journal of Fluids Engineering Editorial policy: http://journaltool.asme.org/Template...umAccuracy.pdf

Well since I am still in the process of learning about CFD I might even try out the coupled solver in Fluent and check whether a similar strategy yields quicker convergence. I imagine each iteration of the coupled solver will take a significantly longer time however, if the time steps are adjusted to converge in <10 iterations I will be a happy man.

The prospect of having to repeat the time-step sensitivity study for each of the meshes is quite daunting though, as previously mentioned. Ultimately the objective of the grid-independence study was to settle on a mesh to use for the simulation so that reliable results could be quoted. I may do this only if the convergent time-step is quite similar to the initial value used with CFL=1, otherwise I will have study the finest mesh and use it's time-step for the others.

I already read through the Journal's policy, guidelines and the paper by Roache. Most of his work is very fundamental and given his reputation, they are definitely important to consider however, I am just concerned whether or not it is worth trying to achieve this level of verification given the time limitations of my undergraduate research topic?

ghorrocks November 12, 2012 05:54

The CFX coupled solver should solve to a defined convergence level much faster than the SIMPLE based methods, but each coeff loop will take much longer. In the end you generally get steady state flows converging considerably faster with a coupled solver, but results are variable with transient simulations - some are faster and some are slower.

Yes, the time step sensitivity study for each mesh level is daunting, that's why in CFX you use 3-5 coeff loops per iteration and then the solver automatically takes care of it. Very nice, removes a degree of freedom, so to speak. But yes, if you take the fine mesh time step and apply that to everything you will probably be OK - just watch out for round-off errors causing convergence difficulties.

If you use even a few of Roache/Celik's techniques to validate your code that would be impressive for an undergraduate project. The Richardson extrapolation technique is a very nice one which is simple in concept and powerful - check it out.

Crank-Shaft November 12, 2012 19:27

Quote:

Originally Posted by ghorrocks (Post 391605)
The CFX coupled solver should solve to a defined convergence level much faster than the SIMPLE based methods, but each coeff loop will take much longer. In the end you generally get steady state flows converging considerably faster with a coupled solver, but results are variable with transient simulations - some are faster and some are slower.

Yes, the time step sensitivity study for each mesh level is daunting, that's why in CFX you use 3-5 coeff loops per iteration and then the solver automatically takes care of it. Very nice, removes a degree of freedom, so to speak. But yes, if you take the fine mesh time step and apply that to everything you will probably be OK - just watch out for round-off errors causing convergence difficulties.

If you use even a few of Roache/Celik's techniques to validate your code that would be impressive for an undergraduate project. The Richardson extrapolation technique is a very nice one which is simple in concept and powerful - check it out.

I definitely want to use such techniques to add more credibility and quantify the uncertainty in my work. Hopefully I can still manage to achieve the overall objectives and make significant conclusions on my study without getting too distracted by it all.

Last night, I used another mesh which is slightly coarser than the previous with ~1.3M cells. This used the same time-step of 0.002 s and this finally converged within 4-5 iterations on each time-step. Another interesting technique I have been using is that the steady state solver was used to initialise the URANS simulations. Hence, the URANS was initiated after 1000 steady-state iterations.

I am happy with the progress so far and now I will seriously explore my validation options. Thanks for all your guidance everyone.


All times are GMT -4. The time now is 16:43.