CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Time steps in stationary solver

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By Friendly
  • 4 Post By RobertHB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 19, 2017, 17:15
Default Time steps in stationary solver
  #1
Member
 
Join Date: Jun 2017
Posts: 73
Rep Power: 8
Friendly is on a distinguished road
Hi,

I have just read that simpleFOAM is a stationary solver and not transient in OpenFOAM. Therefore it is not possible to calculate a Courant Number e.g. But why do I have to define time steps? How do they affect my calculation? My output are also time steps, but I just dont understand why time steps are used in a stationary calculation. Does it make sense?

I hope somebody can enlighten me.


Greetings

Friendly
SimonStar likes this.
Friendly is offline   Reply With Quote

Old   November 21, 2017, 00:27
Default
  #2
Senior Member
 
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 24
me3840 is on a distinguished road
The timesteps are just a programming name. To a lot of OpenFOAM whether you're working with timesteps or iterations is arbitrary, it just needs some convention of the advancement of the solution. It's easier just to use one convention for all simulations.

If you use the SteadyState time discretization just leave the timestep as 1 and it's basically an iteration. Your outputs are not timesteps, they're just named that.
me3840 is offline   Reply With Quote

Old   November 21, 2017, 10:05
Default
  #3
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 11
RobertHB is on a distinguished road
Hello friendly,

for transient cases you can e.g. start at 0 and go to 10. Which means your solver calculates 10 seconds of flow at a given timestep, eg. 0.25 sec. At the end of your simulation you will see how your flow looks like after 10 sec. For each timestep, here 0.25 sec., it will spend as many iterations as you have defined in your PISO or PIMPLE settings in fvSolution.

If you use a steady-state solver like simpleFoam and go from 0 to 10 your solver will spend 10 iterations on your solution. To determine if your solution is converged, you have to take a look at your residuals. You should at least reach a value of 1e-4. If your solver isnt converged after 10 iterations, simply add more.

The difference: A transient solver may need a lot of time to reach a steady state, while a steady-state solver takes less. But, using a steady-state solver, you loose the information after which time your flow becomes steady.
RobertHB is offline   Reply With Quote

Old   November 21, 2017, 15:06
Default
  #4
Member
 
Join Date: Jun 2017
Posts: 73
Rep Power: 8
Friendly is on a distinguished road
Thank you me3840 for your explaination!
Friendly is offline   Reply With Quote

Old   November 21, 2017, 15:07
Default
  #5
Member
 
Join Date: Jun 2017
Posts: 73
Rep Power: 8
Friendly is on a distinguished road
Hi Robert,

thank you very much for your explaination! How do I differ between these Iterations and the Iterations the solver does to achieve a lower Residual?

E.G.:

Code:
DILUPBiCG:  Solving for Ux, Initial residual = 0.00523418, Final residual = 8.35748e-09, No Iterations 14
DILUPBiCG:  Solving for Uy, Initial residual = 0.016785, Final residual = 4.31635e-09, No Iterations 15
DILUPBiCG:  Solving for Uz, Initial residual = 0.0142151, Final residual = 7.23241e-09, No Iterations 15
DICPCG:  Solving for p, Initial residual = 0.210076, Final residual = 9.98951e-07, No Iterations 410
DICPCG:  Solving for p, Initial residual = 0.0293915, Final residual = 9.95438e-07, No Iterations 382
time step continuity errors : sum local = 1.2629e-11, global = 1.24732e-13, cumulative = -3.35426e-13
ExecutionTime = 17436.1 s  ClockTime = 17455 s
Friendly is offline   Reply With Quote

Old   November 22, 2017, 04:35
Default
  #6
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 11
RobertHB is on a distinguished road
Hello Friendly,
I’m not sure about the No Iterations in the log file. If I understand the references correctly, its the number of calculations for the given variable until either the tolerance or relTol setting in your fvSolution are satisfied (see OpenFoam User Guide 2.1.7.2 and this .pdf from Chalmers, Slide 24).

In your case it took your solver 15 iterations to find a solution for each of the velocity components and roundabout 400 iterations to find a solution for the pressure field for that time. Than it continued with the next timestep.

Now, where your solvers differ is in how they handle time. Whether they are transient or steadyState. Look at your fvSchemes ddtSchemes entry. Every time derivation scheme, but steadyState, is transient. Transient simulations convey a time information. You get the precise field for that time.
In contrast, a steadyState solver is used to find the stable solution for you simulation. The result you get has no information about time. You can think of it as the mean of a (transient) velocity/pressure field after an infinitely long time.

/edit: There is a Masters Thesis by Andreas Persson in which the "workflow" of the piso (transient) and simple (steadyState) algorithm is explained. You can find it here.

/edit2: Here is another great link concerning the fvSolution settings: LINK

Last edited by RobertHB; November 22, 2017 at 05:40.
RobertHB is offline   Reply With Quote

Old   November 22, 2017, 15:32
Default
  #7
Member
 
Join Date: Jun 2017
Posts: 73
Rep Power: 8
Friendly is on a distinguished road
Hello Robert,

thanks for the references, they are indeed great!

Ok I think I almost got it. The iterations for Ux and so on are to achieve my tolerance, in my case 1x10^-5. But I have still the problem to understand how these Iterations differ from my "time step iterations". Lets say I tell the solver to start from 0 and go to 5000 second using a delta_t of 1, so I get 5000 iterations. But what is the difference between this iterations and the iterations the solver does for Ux?

You have said: "In your case it took your solver 15 iterations to find a solution for each of the velocity components and roundabout 400 iterations to find a solution for the pressure field for that time. Than it continued with the next timestep."

But I dont have a real timestep in this case, cause its stationary. This is the point I still dont really get.
Friendly is offline   Reply With Quote

Old   November 23, 2017, 04:57
Default
  #8
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 292
Rep Power: 11
RobertHB is on a distinguished road
Hey there,
i did a bit of digging and a think i found an answer to your question. I will attach an image i found in this talk. The same graphic can be found in other sources (1, 2) as well.

At the beginning of the "timestep" you hand over an initial velocity solution (Momentum matrix). This gives you the Initial residual. SimpleFoam than solves the inner loop (see image) between Momentum matrix and Momentum/flux corrector. This inner loop reduces your final residual until your tolerance/relTol settings are met. Than you hand your solution to the next timestep with a new initial residual.
Code:
Time = 1
smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = 0.07971432446, No Iterations 5
You can see the new Initial residual is lower than at Time = 1 but not converged. You would assume that your solution is converged if the Inti. residual hits at least 1e-4. Your inner loop continues anew. Until the final residual is met and you continue with Time = 3.
Code:
Time = 2
smoothSolver:  Solving for Ux, Initial residual = 0.2242597146, Final residual = 0.01971119697, No Iterations 9
Where your Initial residual is again lower, but not converged.
Code:
Time = 3
smoothSolver:  Solving for Ux, Initial residual = 0.1014834932, Final residual = 0.008384452314, No Iterations 10
Why does simpleFoam have inner/outer loops? Good question, i would assume it improves numerical stability.
Attached Images
File Type: png Simple.png (69.3 KB, 39 views)
RobertHB is offline   Reply With Quote

Old   November 28, 2017, 04:00
Default
  #9
Member
 
Join Date: Jun 2017
Posts: 73
Rep Power: 8
Friendly is on a distinguished road
Hello,

sry for my late reply, I have had some Problems.

Thank your very much! I am aware of the inner and outer loops of simple, or piso and pimple. It is still interesting that timesteps are not included in simpleFOAM. If I remember right, e.g. piso is theoretically the same as simple, but with an additional outer loop (same for pimple, but with n loops). Thats why a have Troubles to understand why simple is just for steady calculations and piso for transient.

I have also troubles to understand how a flow can change without any progress in time. So simpleFOAM is skipping the transient part till the flow becomes steady by applying outer loops to the flow field at the same timestep. This is an interesting approach.
Friendly is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script for pseudo-parallel usage of reconstructPar kwardle OpenFOAM Post-Processing 41 August 23, 2023 02:48
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 02:20
[solidMechanics] solidMechanics gear contact in rotation nlc OpenFOAM CC Toolkits for Fluid-Structure Interaction 3 January 11, 2015 06:41
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 00:01
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07


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