
[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,911
Rep Power: 28 
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 (current status: http://albertopassalacqua.com/?p=1541) 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,911
Rep Power: 28 
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 (current status: http://albertopassalacqua.com/?p=1541) 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: http://www.cfdonline.com/Forums/ope...estepping.html 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,911
Rep Power: 28 
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 (current status: http://albertopassalacqua.com/?p=1541) 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,911
Rep Power: 28 
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 (current status: http://albertopassalacqua.com/?p=1541) 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: 3 

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. 

June 21, 2017, 22:29 
Bug in openfoam simulation

#12 
New Member
Golden
Join Date: Jun 2017
Posts: 4
Rep Power: 2 
Hello everyone, I am doing a simple jet combustion with the following boundary. The mesh was converted to FOAM. The simulation runs. But it is showing, Pimple iteration 1: and it is not converged. The system directory was same to basic tutorial. Do i need to change fvscheme directory and solution directory or anything?
/** C++ **\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 2.4.0   \\ / A nd  Web: www.OpenFOAM.org   \\/ M anipulation   \**/ FoamFile { version 2.0; format ascii; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 ( outlet { type patch; nFaces 6416; startFace 7736555; } sides { type wall; inGroups 1(wall); nFaces 64638; startFace 7742971; } base { type patch; inGroups 1(patch); nFaces 6292; startFace 7807609; } inlet { type patch; nFaces 6; startFace 7813901; } ) // ************************************************** *********************** // 

September 25, 2017, 18:02 

#13  
New Member
Patrick
Join Date: Apr 2016
Posts: 6
Rep Power: 3 
Quote:
I just stumbled onto this thread you posted last year. I am relatively new with OpenFoam. I use steady state solver for channel flow simulation. Normally I will expect the computation to complete after convergence (depending on the residual control value, usually in the order of 10^5) or when i dont notice reasonable changes in flow distribution from one time step to the next. But from your statement, am i right to deduce that convergence is not necessary? In which case, what could be a reasonable iteration time for steady state computation if one is not aiming for convergence? Thanks for time Patrick 

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 