CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

How to determine time step size and Max. iterations per time step.

Register Blogs Community New Posts Updated Threads Search

Like Tree66Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2013, 15:16
Default
  #21
Senior Member
 
Tanjina Afrin
Join Date: May 2013
Location: South Carolina
Posts: 169
Rep Power: 13
Tanjina is on a distinguished road
And yes, when I select non-iterative time , these are the default solution method.
Tanjina is offline   Reply With Quote

Old   June 23, 2013, 06:13
Default
  #22
Member
 
Yash Ganatra
Join Date: Mar 2013
Posts: 67
Rep Power: 13
yashganatra is on a distinguished road
I will try to help. You can post more details
yashganatra is offline   Reply With Quote

Old   June 23, 2013, 07:44
Default
  #23
Far
Senior Member
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,558
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
Quote:
Originally Posted by Tanjina View Post
Hi,

I have also similar question, but couldn't find any definite answer. i am trying to model a flow through a circular pipe from a rectangular reservoir. I used workbench for meshing. It's triangular mesh. element size is 6e-3m. How can I determine time step. I modeled 3D. I couldn't find any option called iteration/time step, but in may tutorial I saw it.
Quote:
Originally Posted by cfd seeker View Post
I want to ask what is the role of Courant No. in determining the time step size??
As we know Courant No. = velocity*delta(t)/delta(x), by this equation time step size is directly proportional to Courant No, so can we use bigger time step size by increasing the Courant No. ???
There is no definite answer !!!!! Why?

Because for each situation you will have different flow physics/solver requirment and which dictates the time step size and no of time steps.

First few general rules:

1. It is better to lower the time step instead of increasing the no of iterations

2. Lowering the time step will enhance convergence.

3. Use better initial conditions (get from steady state solution)

4. If you experience difficulty in getting convergence for desired time step, use lower time step for initial transients. once you get good convergence gradually increase time step to required value.

5. Adaptive time stepping will give you faster and automatic transient simulation to desired time step.

6. Use 2nd order implicit scheme.


Now few situations:

1. LES, explicit and implicit schemes.

For LES, the condition for time step selection is based on cournt number and CLF < 0.2. For explicit scheme, used when you have advantage of faster convergence for flows where flow delta T is of same order as dictated by CFL otherwise use implicit scheme.

For explicit scheme delta T is determined by CFL < 1 by stability constraint.

For implicit scheme delta T is determined by the flow feature you are interested in.

2. General time step calculation for arbitrary flows

Delta T = (1/3) * (L/V) or lower value

3. Turbo-machinery : (1/10) * ( number of blades/rotational velocity)

I typically use this time step calculation method for sliding mesh problems:

total time to pass one blade pitch (if you have equal no of stator and rotor blades) = pitch in meters / velocity in m/s

Now If you want to resolve it in 20 steps, time step would be total time / 20. For better resolution if you want to use 100 steps per wake passing, time step would be total time/100.

4. Vortex shedding: Time step can be found from strouhal number in indirect manner. From strouhal number (fix the density, viscosity and velocity and known value of diameter of chord length) find out the frequency of vortex shedding. Inverse of it is the total time of vortex shedding period. Lets we have f = 0.2 therefore total time is 5s. Now if use at-least 25 time steps to represent vortex shedding sequence we will have the 5/25 = 0.2 sec for each time step. That is delta T = 0.2 seconds

Judging the convergence, time step dependence
You can judge convergence by plotting surface monitor of variable of interest at particular boundary, line or point. If solution starts to have periodic behaviour, then you have reached convergence.


What should come first : Mesh independence or time step independence study?

My vote goes for mesh independence for sample flow conditions. then go for time step dependence study.

Post precessing of unsteady flows:

Post processing can be done in Fluent, CFD-post and tecplot. For nicer pics, I prefer tecplot.

For post processing of some variable, you need to turn-on data sampling for time statistics . If you want some additional variable you should make the custom field function and enable it in sampling option panel for "custom field function"

For post processing you should run simulation for long enough time and when you start to observe the periodic solution, then turn on data sampling. And take data sample for alteast 5-8 cycles.
rgd, FJSJ, yashganatra and 10 others like this.
Far is offline   Reply With Quote

Old   June 23, 2013, 07:46
Default
  #24
Far
Senior Member
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,558
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
Quote:
Originally Posted by Tanjina View Post
And yes, when I select non-iterative time , these are the default solution method.
Is this a default option for your settings?
Far is offline   Reply With Quote

Old   June 23, 2013, 23:20
Default
  #25
Senior Member
 
Tanjina Afrin
Join Date: May 2013
Location: South Carolina
Posts: 169
Rep Power: 13
Tanjina is on a distinguished road
@ Far,

Yup, when I select Non -iterative time advancement, these are the default settings except "scheme" where default setting is PISO, I made it fractional step manually.

"4. If you experience difficulty in getting convergence for desired time step, use lower time step for initial transients. once you get good convergence gradually increase time step to required value."

how can I do it ?

@Yashganatra,

I am trying to model a flow through a circular pipe from a rectangular reservoir. I used pressure inlet.At first reservoir is full of water. I want that water level will be down with time since no water will enter into reservoir and air will replace the place of water. I used workbench for meshing. It's triangular mesh. Element size is 6e-3m. attached image is showing the result after 1400 run ( when I used water volume fraction 0 in inlet). result was almost same for 2000 run, 500 run...
Attached Images
File Type: jpg air_transient_1400.jpg (51.6 KB, 58 views)
Tanjina is offline   Reply With Quote

Old   June 24, 2013, 05:56
Default
  #26
Far
Senior Member
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,558
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
Quote:
"4. If you experience difficulty in getting convergence for desired time step, use lower time step for initial transients. once you get good convergence gradually increase time step to required value."

how can I do it ?
for example if your required time step is 0.001 and you have convergence problems in beginning of solution, then just reduce time step to 0.0001 or 0.00001 and once solution is stabilized, change time step to 0.001 gradually.


Quote:
I am trying to model a flow through a circular pipe from a rectangular reservoir. I used pressure inlet.At first reservoir is full of water. I want that water level will be down with time since no water will enter into reservoir and air will replace the place of water. I used workbench for meshing. It's triangular mesh. Element size is 6e-3m. attached image is showing the result after 1400 run ( when I used water volume fraction 0 in inlet). result was almost same for 2000 run, 500 run..
Maybe you need a UDF or multiphase model, so that the empty area is replaced with Air. I have never tried it, but I am interested to see how this can be done in Fluent
Far is offline   Reply With Quote

Old   June 24, 2013, 08:01
Default
  #27
Member
 
Yash Ganatra
Join Date: Mar 2013
Posts: 67
Rep Power: 13
yashganatra is on a distinguished road
Hi Tanjina
Due to the pressure difference water will flow down, the outlet is open to atmosphere? From the image, time elapsed is 1.4e-3, it's very less. Maybe you will need multiphase or a UDF needs to be written as was said above.
yashganatra is offline   Reply With Quote

Old   June 24, 2013, 10:45
Default
  #28
Senior Member
 
Tanjina Afrin
Join Date: May 2013
Location: South Carolina
Posts: 169
Rep Power: 13
Tanjina is on a distinguished road
@Yash ganatra,

Since I am using workbench and mesh shape is triangular , I don't understand what will be the mesh size. From body sizing, I use element size 6e-3 m and I used it as del x. using courant number , I found del t=0.001, but when I use this time step, it says divergence in X-momentum , then I reduce relaxation factor for momentum from 1 to 0.1, 0.7 , 0.3 etc. after some run, it showed some other problem ... so I use very small time step.


for this small time step, it takes lots of time to complete 2000-3000 run. Should I use 5000-10000 run with this time step ?


@ Far,

I am using VOF multiphase model. I don't know how to write UDF . It will be great if you suggest any site from where I can learn writing UDF. And simultaneously I am searching for UDF learning site.

" for example if your required time step is 0.001 and you have convergence problems in beginning of solution, then just reduce time step to 0.0001 or 0.00001 and once solution is stabilized, change time step to 0.001 gradually. "

I still don't understand this part . After starting the "run calculation" how can I change the time step without stopping the run ? And it is possible with 0.00001 time step I run 1000 run, then next 1000 run I will continue with large time step ?

@Yashganatra and Far, I am a very new user of Fluent, may be I am bothering you so much..... I am sorry for that.
rgd likes this.
Tanjina is offline   Reply With Quote

Old   June 24, 2013, 14:30
Default
  #29
Senior Member
 
Tanjina Afrin
Join Date: May 2013
Location: South Carolina
Posts: 169
Rep Power: 13
Tanjina is on a distinguished road
Should I use "open channel flow" option here ? But it's not a open channel flow, is it ?
Tanjina is offline   Reply With Quote

Old   June 24, 2013, 17:46
Default
  #30
Far
Senior Member
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,558
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
i sent you some material on multiphase through pm
Far is offline   Reply With Quote

Old   June 25, 2013, 02:30
Default
  #31
Member
 
Yash Ganatra
Join Date: Mar 2013
Posts: 67
Rep Power: 13
yashganatra is on a distinguished road
Tanjina,
Even I am a beginner so not a problem. For writing UDF, download FLUENT UDF Manual. It is comprehensive. Also it has a section on basics of C Programming

Yash
yashganatra is offline   Reply With Quote

Old   June 25, 2013, 18:16
Default
  #32
Senior Member
 
Tanjina Afrin
Join Date: May 2013
Location: South Carolina
Posts: 169
Rep Power: 13
Tanjina is on a distinguished road
@ Far and Yashganatra,

Thanks you guys a lot. My model is working now ( in 2D) without any UDF. Trying to run in 3D. Attached is the image of residual of my model . Shouldn't it be converged ? Please enlighten me.
Attached Images
File Type: jpg 2D_residual.jpg (100.7 KB, 97 views)
File Type: jpg Solution.jpg (93.2 KB, 68 views)
Tanjina is offline   Reply With Quote

Old   June 25, 2013, 19:45
Default
  #33
Far
Senior Member
 
Sijal
Join Date: Mar 2009
Location: Islamabad
Posts: 4,558
Blog Entries: 6
Rep Power: 54
Far has a spectacular aura aboutFar has a spectacular aura about
Send a message via Skype™ to Far
also try time step = 0.001
Far is offline   Reply With Quote

Old   June 26, 2013, 02:29
Default
  #34
Member
 
Yash Ganatra
Join Date: Mar 2013
Posts: 67
Rep Power: 13
yashganatra is on a distinguished road
That's great. What changes did you make?
yashganatra is offline   Reply With Quote

Old   July 3, 2013, 10:54
Default
  #35
Senior Member
 
Tanjina Afrin
Join Date: May 2013
Location: South Carolina
Posts: 169
Rep Power: 13
Tanjina is on a distinguished road
@ yashganatra, I didn't check the "implicit body force" and "operating density condition" , after checking this two point, model gave the expected results. Thank you all for your kind help.
Tanjina is offline   Reply With Quote

Old   July 15, 2013, 18:11
Default perforated pipe time step.
  #36
Senior Member
 
Tanjina Afrin
Join Date: May 2013
Location: South Carolina
Posts: 169
Rep Power: 13
Tanjina is on a distinguished road
Hi all,

I tried to model a perforated pipe in 2D, thats why I make some opening and flow was okay at the beginning, when I make time step 0.0001, though the residual was like attached image. then I increase time step time gradually, when I make it 0.01, after some iteration, it just hanged up. What can I do? Before hang up, the image was like the attached image 2. Any help will be really appreciated.
Attached Images
File Type: jpg residual porous.jpg (94.9 KB, 47 views)
File Type: jpg perforated pipe.jpg (96.3 KB, 42 views)
Tanjina is offline   Reply With Quote

Old   January 7, 2014, 01:33
Default water hammer simulation
  #37
New Member
 
mohamed abdelrahman
Join Date: Feb 2013
Posts: 3
Rep Power: 13
mhd.abdo is on a distinguished road
Hi all
am on my last step on my master degree and iwoud like to simulate water hammer in pipe in cfx line coud any one give me more datails about that
itray before but ididn't get good reslt ....
plz
mhd.abdo is offline   Reply With Quote

Old   August 28, 2014, 06:49
Default
  #38
New Member
 
Thomas Green
Join Date: Aug 2014
Posts: 7
Rep Power: 12
.Thomas. is on a distinguished road
Dear All,
I have the same problem of DIVERGENCE DETECTED IN AMG SOLVER: y-momentum.
I am simulating a constant flow profile but I would like to analyze it in transient mode.
My mass flow inlet is of 0.000001 kg/s, I thought that using an adaptive time step that change from 0.001 for the first second to something bigger for the rest of the simulation (for instance 10 seconds) because the fluid flow will be developed.

Solution Method (in order): PISO (Skewness Correction & Neighbor Correction = 1), Least Squares Cell Based, Second Order, Second Order Upwind, First Order Implicit.
Run Calculation: Adaptive Time Stepping Method (deltat); Time Step Size (s)=0.001 (because I have to select the initial time step); Number of Time Step=1000, Max Iterations/Time Step=200.

My code for the adaptive time stepping is:

#include "udf.h"
DEFINE_DELTAT(deltat,d){
real time_step;
real tx=CURRENT_TIME;
if ( tx<=1 ) {
time_step=0.001;
}
else{
time_step=10;
return time_step;
}
}


I don`t get very well what is wrong in what I am doing, anybody has suggestions?
Thank you so much.

Thomas
.Thomas. is offline   Reply With Quote

Old   February 11, 2015, 07:44
Default
  #39
Member
 
enass
Join Date: Feb 2015
Location: Alexandria-Egypt
Posts: 30
Rep Power: 11
enass massoud is on a distinguished road
If i have a case file how can i know the smallest cell size?
enass massoud is offline   Reply With Quote

Old   September 27, 2016, 05:58
Default
  #40
Member
 
annn
Join Date: Jun 2016
Posts: 40
Rep Power: 10
cleoo is on a distinguished road
Quote:
Originally Posted by ghost82 View Post
Hi,
A rule of thumb is to set time step< deltax/u
where deltax is the smallest cell size and u is the velocity.
what if you don't know the velocity?
cleoo 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
Time step size and max iterations per time step pUl| FLUENT 31 October 23, 2020 23:50
icoLagrangianFoam OF1.6 myNewParticleSolver heavy_user OpenFOAM 23 June 2, 2020 03:18
Transient simulation not converging skabilan OpenFOAM Running, Solving & CFD 14 December 17, 2019 00:12
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
Time step size, number of time steps and max iterations per time step guido_88 FLUENT 4 August 30, 2012 15:49


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