Dear Forum,
We are facing issues with the local time stepping for buoyancy driven flow (and conjugate heat transfer). From our understanding the local time step would be calculated as follow :
- dtCFL = max( min(CFL*dX/U, tref * fmax) , tref * fmin)
- for the solid an analogous relation based on Fourier number
1 - Is this relation true ?
2 - what does the Time step maximal variation parameters ? Is it a smoothing coefficient that prevents the time step to vary too quickly between two iterations ?
3- What are the recommendations and best-practices for a proper usage of LTS ?
In our simulations we note a great variability of the results depending on all the parameters : the solution doesn't converge to the same state if we change fmin from 0.01 to 0.001 for instance. The gap between solutions can be very large...
Best regards
How to properly use LTS
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
Yvan Fournier
- Posts: 4295
- Joined: Mon Feb 20, 2012 3:25 pm
Re: How to properly use LTS
Hello,
1) I did not check the exact formulas used (the code is in cs_time_step_compute.cpp, but also has additional layers in cs_matrix_time_step calls), but by default, there is indeed both a Courant and Fourier limitation. In the solid zone, the CFL should be zero, so only the Fourier part is used. I assume that if the max Courant and/or Fourier is not used and there is no limitation, the time step will not be modified.
2) Yes, the maximum variation parameters prevent too rapid changes, and too strong differences with the initial value (so the initial choice of reference time step is always important as the local time step is bound in the [ref*min_factor, ref*max_factor].
3) The main recommendation would be to try to possibly try different reference time steps and min/max factors, to see what gets closest to CFL 1 in a majority of cells.
The gap between solutions can be due to the limitations of the Rhie & Chow filter itself, which introduces a (usually very small) time dependency in the solution, The same gap could probably occur between highly different constant time step values, though this is hard to test as the code would probably diverge with very different values. When you observe very different results, are the mean and min/max CFL values in the log very different ? There might also be a bifurcation effect.
Also, when comparing results, do you time-average them ? Even with a local time step, time averaging has no physical meaning, but may smoothe fluctuating solution fields... You can check for fluctuations using probes, or 2nd order time moments (i.e. variances).
Best regards,
Yvan
Best regards,
1) I did not check the exact formulas used (the code is in cs_time_step_compute.cpp, but also has additional layers in cs_matrix_time_step calls), but by default, there is indeed both a Courant and Fourier limitation. In the solid zone, the CFL should be zero, so only the Fourier part is used. I assume that if the max Courant and/or Fourier is not used and there is no limitation, the time step will not be modified.
2) Yes, the maximum variation parameters prevent too rapid changes, and too strong differences with the initial value (so the initial choice of reference time step is always important as the local time step is bound in the [ref*min_factor, ref*max_factor].
3) The main recommendation would be to try to possibly try different reference time steps and min/max factors, to see what gets closest to CFL 1 in a majority of cells.
The gap between solutions can be due to the limitations of the Rhie & Chow filter itself, which introduces a (usually very small) time dependency in the solution, The same gap could probably occur between highly different constant time step values, though this is hard to test as the code would probably diverge with very different values. When you observe very different results, are the mean and min/max CFL values in the log very different ? There might also be a bifurcation effect.
Also, when comparing results, do you time-average them ? Even with a local time step, time averaging has no physical meaning, but may smoothe fluctuating solution fields... You can check for fluctuations using probes, or 2nd order time moments (i.e. variances).
Best regards,
Yvan
Best regards,
Re: How to properly use LTS
Dear Yvan,
Thanks for your very useful feedback. We compare the evolution of temperature probes and note an important time dependency (time average) depending on LTS settings. We are still investigating the gap between solutions. Currently, this seems to be related to the choice of the time step parameters. As you said I don't think such a gap between solution could be caused by the Rhie & Chow filter (from my knowledge based on OpenFOAM the time dependency between a consistent and non-consistent momentum interpolation is very small in practice). From what you says I understand that code_saturne use a non-consistent momentum interpolation. Is it true ?
1) The Fourier number in solid region is zero on post-processing on paraview. We are on code_saturne 9.0. From our tests the maximal value of Fourier number seems to play a role in the fluid region solving. Moving from the base value of 10 to 500 leads to 4 times more iterations for solving the pressure (I guess the Poisson equation). This implies that the Fourier number is involved in the fluid time step calculation. What do you think ?
2) The default settings are very dangerous in our opinion. Having reference time step of 0.1 sec and a minimal time step factor of 0.1 give a minimal time step of 0.01 sec. Most of the time this value is way bigger than the minimal time step value required to respect a maximum Courant number of 1 (default CFL). I think the default value for the minimal time step factor should be 0 or a very small value. In comparison, OpenFOAM doesn't have such a limitation of the time step from the bottom.
Best regards
Thanks for your very useful feedback. We compare the evolution of temperature probes and note an important time dependency (time average) depending on LTS settings. We are still investigating the gap between solutions. Currently, this seems to be related to the choice of the time step parameters. As you said I don't think such a gap between solution could be caused by the Rhie & Chow filter (from my knowledge based on OpenFOAM the time dependency between a consistent and non-consistent momentum interpolation is very small in practice). From what you says I understand that code_saturne use a non-consistent momentum interpolation. Is it true ?
1) The Fourier number in solid region is zero on post-processing on paraview. We are on code_saturne 9.0. From our tests the maximal value of Fourier number seems to play a role in the fluid region solving. Moving from the base value of 10 to 500 leads to 4 times more iterations for solving the pressure (I guess the Poisson equation). This implies that the Fourier number is involved in the fluid time step calculation. What do you think ?
2) The default settings are very dangerous in our opinion. Having reference time step of 0.1 sec and a minimal time step factor of 0.1 give a minimal time step of 0.01 sec. Most of the time this value is way bigger than the minimal time step value required to respect a maximum Courant number of 1 (default CFL). I think the default value for the minimal time step factor should be 0 or a very small value. In comparison, OpenFOAM doesn't have such a limitation of the time step from the bottom.
Best regards
-
Yvan Fournier
- Posts: 4295
- Joined: Mon Feb 20, 2012 3:25 pm
Re: How to properly use LTS
Hello,
I would be surprised if we did not use a consistent momentum interpolation, though I am not an expert in that part of the code.
For 1), yes, the Fourier number may be involved in the time step computation for the fluid region. This may cause issues in some cases where turbulent models lead to very high turbulent diffusivity values. Looking at the code, if you set a negative value for the maximum Fourier number, the Fourier criteria will be ignored.
For 2), there are no true "default" options regarding the reference time step. The default of 0.1 often works fine with very coarse meshes used in tutorials, but not in general for production meshes. For this, we have plans to add a potential solver so as to compute the initial time step automatically, but currently, this value is completely arbitrary, and must be adjusted by the user. This is why it is always recommended to check the CFL number when running a few initial iterations, then adjust it, before actually running a production computation.
Best regards,
Yvan
I would be surprised if we did not use a consistent momentum interpolation, though I am not an expert in that part of the code.
For 1), yes, the Fourier number may be involved in the time step computation for the fluid region. This may cause issues in some cases where turbulent models lead to very high turbulent diffusivity values. Looking at the code, if you set a negative value for the maximum Fourier number, the Fourier criteria will be ignored.
For 2), there are no true "default" options regarding the reference time step. The default of 0.1 often works fine with very coarse meshes used in tutorials, but not in general for production meshes. For this, we have plans to add a potential solver so as to compute the initial time step automatically, but currently, this value is completely arbitrary, and must be adjusted by the user. This is why it is always recommended to check the CFL number when running a few initial iterations, then adjust it, before actually running a production computation.
Best regards,
Yvan
Re: How to properly use LTS
Hello,
Thanks you for the clear answer.
1) thanks for the tips. Regarding the solid region in Paraview we always have a Fourier of 0. Should I understand that the Fourier number is not involved in the calculation of the time step in solid regions ? In that case how it's determined ?
2) Yes we are checking the max CFL now. Maybe I am missing something but I don't understand why having a minimal time step factor is required. Without this parameter we would be sure that the CFL number entered in code_saturne is truly used for the time step calculation and that this is this only parameter that drives the simulation. In that case with CFL = 1 we are sure that we can't be too wrong.
From the user perspective this parameters seems very dangerous (most of CFD users run simulations with default solver settings without going deeper). I do think this parameter could be removed or the default value could be 0.
Thanks you for the clear answer.
1) thanks for the tips. Regarding the solid region in Paraview we always have a Fourier of 0. Should I understand that the Fourier number is not involved in the calculation of the time step in solid regions ? In that case how it's determined ?
2) Yes we are checking the max CFL now. Maybe I am missing something but I don't understand why having a minimal time step factor is required. Without this parameter we would be sure that the CFL number entered in code_saturne is truly used for the time step calculation and that this is this only parameter that drives the simulation. In that case with CFL = 1 we are sure that we can't be too wrong.
From the user perspective this parameters seems very dangerous (most of CFD users run simulations with default solver settings without going deeper). I do think this parameter could be removed or the default value could be 0.
-
Yvan Fournier
- Posts: 4295
- Joined: Mon Feb 20, 2012 3:25 pm
Re: How to properly use LTS
Hello,
1) I am not sure how this is computed. I will check, but will probably not be able to look at this in detail before 10 days or so.
2) Without this parameter, I assume the risk is to have very strong variations in some matrix coefficients, but I am not sure we ever tested the feature without this limiter. Actually, if the time step is smaller in small terms, the 1/dt term becomes smaller, so vol/dt varies less, which might actually be a good thing. But someone would need to check this.
Best regards,
Yvan
1) I am not sure how this is computed. I will check, but will probably not be able to look at this in detail before 10 days or so.
2) Without this parameter, I assume the risk is to have very strong variations in some matrix coefficients, but I am not sure we ever tested the feature without this limiter. Actually, if the time step is smaller in small terms, the 1/dt term becomes smaller, so vol/dt varies less, which might actually be a good thing. But someone would need to check this.
Best regards,
Yvan