
[Sponsors] 
December 16, 2009, 22:37 
Time in OpenFOAM

#1 
Senior Member

In steady state simulations the time really isnt important. Basicaly your best solution is the most recent time stamp.
But when you get into time dependent simulations how do you get all of your time steps to be of equal accuracy? Fluent would let you define the accptable amount of error per time step and would itterate that timestep until it was within range then moved on to the next one. How does OpenFOAM go about this? Is it different for each solver? Thanks! 

December 17, 2009, 01:00 

#2  
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 27 
Quote:
In transient solvers using the PIMPLE/unsteady SIMPLE approach you can specify a number of subiterations per time step. In all the cases, there is no explicit control on the residuals, which however can be easily added. Residuals can be retrieved easily defining a "solverPerformance" object Code:
lduMatrix::solverPerformance sp; Code:
sp = solve ( /* Your equation here */); Code:
sp.initialResidual() Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

December 17, 2009, 13:48 

#3 
Senior Member

Using the CFL condition to set the delta T seems like a good approach.
(U * deltaT)/deltaX < Courant <1 So for 10m/s and 1mm resolution, the time step must be less than 0.0001. Simple enough. So if i am going to solve a transient problem, do i have to initialize with a steady state solution? or do i just disregard the first 50 or so time steps? Wikipedia also presents a twodimensional equation. Does this equation need to be used for 2D problems or can I just use the magnitude (a^2 + b^2 = c^2) of the vectorial flow in the 1D equation? I will try out your residual control code as I get further along in my project. Why do i want to view the initial residuals instead of the final ones? Thanks for your post Alberto, it was most helpful! 

December 18, 2009, 08:12 

#4  
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 27 
Quote:
Quote:
Quote:
The "final" residual returned by solverPerformance is very small anyway, since it is the residual the linear solver returns after solving the linear system. Quote:
Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

December 18, 2009, 19:52 
using adaptive time step?

#5 
Senior Member

How do i "turn the adaptive time step on "?
I read this forum: Adaptive timestepping It said to include readTimeControls.H, CourantNo.H and setDeltaT.H, but it was a little brief. Turning it "on" sounds a lot more friendly. Could you please explain. Thanks again for your help Alberto! 

December 18, 2009, 20:02 

#6 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 27 
What solver are you using?
Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

December 18, 2009, 23:52 

#7 
Senior Member

Though i have not started this simulation yet, i currently plan to use pisoFoam.
I am planning on using a rotating reference frame so my solver may change in order to accommodated that aspect. Lots of variables to consider when your getting started Thanks again Alberto! 

December 19, 2009, 00:30 

#8 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 27 
To "turn" the adaptive time step on in pisoFoam add
Code:
adjustTimeStep yes; maxCo 1; maxDeltaT 1e03; Of course the values of Co (Courant number) and the maximum time step are examples. Best,
__________________
Alberto Passalacqua GeekoCFD  A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats. OpenQBMM  An opensource implementation of quadraturebased moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. 

December 19, 2009, 00:39 

#9 
Senior Member

Thanks for all the excellent help Alberto!
I will give your code a try 

August 24, 2016, 08:19 

#10 
New Member
larmes
Join Date: Aug 2016
Posts: 26
Rep Power: 2 

August 25, 2016, 03:16 

#11 
Senior Member

By definition, a steady state solution does not consider time. If said conditions exist for infinite time I will arrive at an unchanging "steady state".
A better phrasing would be: "your solution is the most recent iteration as it has undergone the most iterations and will be most accurate." Many solvers use a timestep variable to track iterations to get to steady state. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Time step size and max iterations per time step  pUl  FLUENT  31  August 21, 2015 04:46 
Superlinear speedup in OpenFOAM 13  msrinath80  OpenFOAM Running, Solving & CFD  18  March 3, 2015 06:36 
air bubble is disappear increasing time using vof  xujjun  CFX  9  June 9, 2009 07:59 
DPM UDF particle position using the macro P_POS(p)[i]  dm2747  FLUENT  0  April 17, 2009 01:29 
The OpenFOAM extensions project  mbeaudoin  OpenFOAM  16  October 9, 2007 09:33 