CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Resolving from a previous timestep (https://www.cfd-online.com/Forums/openfoam-solving/58671-resolving-previous-timestep.html)

juho August 6, 2008 08:55

How could I create an adaptive
 
How could I create an adaptive timestepping that would restart the calculation from the previous time step?

I'm having trouble making a satisfactory system just based on the values of the already calculated timestep (like the Courant number) and would like to adjust the time step and resolve if nonconverging/nonphysical values are met.

Time.H seems to have functions to reset the time and to create subcycles. Could these be used? How are the previous timesteps stored?

benk June 1, 2010 09:55

I know this post is a ocuple of years old now but I'm interested in doing this too.

I want to use large time steps in my model but if I find that the model starts to diverge, I want to restart based on the last succesful time step and readjust my dt to a smaller one.

I know I can use runTime.setDeltaT() to set my time step, but how do I tell the solver to restart based on the last succesful time iteration?

benk June 2, 2010 09:34

So I think I figured out how to do this but maybe there's a better way.

The command runTime.setTime(lastTime, lastTime); will reset the simulation to the last good time step as long as you set the argument lastTime equal to the last good time step using something like lastTime = runTime.value(); after each succesful time iteration.

benk June 2, 2010 15:50

Actually, upon further investigation, it seems as if the method I described above will reset the time but it doesn't take the solution from that old timestep, it will continue with the previous bad solution...so now the question is: How can I use the last good solution?


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