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

Transient simulation time stepping

Register Blogs Community New Posts Updated Threads Search

Like Tree18Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 27, 2016, 20:06
Default Transient simulation time stepping
  #1
Member
 
Ferruccio Rossi
Join Date: Jun 2016
Location: Melbourne, FL USA
Posts: 91
Rep Power: 9
frossi is on a distinguished road
Hi everyone,

I have a general idea of CFX time stepping which I got from different sources. I hope someone can clarify some of my doubts regarding the subject.

1. I know that Min Coeff. Loop and Max Coeff. Loop are the number of iterations for each time step. If I specify Max Coeff. Loop to be 5 (random example), what happens if the convergence criteria is not met within those 5 iterations? What is an ideal value for Min Coeff. Loop and Max Coeff. Loop?

2. What is a good way to define a correct total time and time step size? I generally use a total time between 5 and 10 seconds, with a time step size of 2.5E-2. My idea is that the best result is produced with a large total time and a small time step size. Is this correct?

Thank you
frossi is offline   Reply With Quote

Old   June 28, 2016, 01:18
Default
  #2
Senior Member
 
urosgrivc
Join Date: Dec 2015
Location: Slovenija
Posts: 365
Rep Power: 11
urosgrivc is on a distinguished road
-Total time is totaly dependant of your problem.
-If the convergence criteria is not meet betveen 3 to 5 iterations you should reduce the timestep size and convergence will get better.
-Also look at the courant number, it is outputed at each timestep
if it is too high you will have problems with convergence, Courant number is dependant on (timestep size, grid size, velocity of the flow), RMS and max CFL number is outputed, as it waries with those parameters threw the domain.
more here -> http://www.cfd-online.com/Forums/ope...nt-number.html
When you will satisfy CFL number~1 your timestep should have a proper size.

-Acoustic courant number is also activated when you switch to compressible flow, to achieve Acoustic courant number of 1 is extremly difficult as you need timesteps that are far smaller (100 or 1000 times) than those to achieve normal courant number =1, But you dont need to have Acoustic courant nuber of 1 for most of the problems, with this you can simulate how the sound pressure waves propegate threw the domain.

Your computational time will get very long when you will satisfy all of these criteria.
That is why even 5s of transient simulation can take weeks to compute, but this is again dependant of of your problem, grid size, hardware...
urosgrivc is offline   Reply With Quote

Old   June 28, 2016, 01:26
Default
  #3
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,728
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
If you set Max coeff loops = 5 then it will declare that time step converged at 5 coeff loops regardless of what the residuals are. It will then proceed to the next time step.

Total time - you have to define that depending on what you want to model.

Time step size - two options are available:
1) Use adaptive time stepping, homing in on 3-5 coeff loops per iteration; OR
2) Do a time step sensitivity analysis.

Do not guess a time step based on what you think is "reasonable". You will get it wrong, it is a common beginner mistake.

Quote:
My idea is that the best result is produced with a large total time and a small time step size. Is this correct?
I do not know what you are modelling and what you are trying to learn from the model, so cannot say.
aero_head likes this.
ghorrocks is offline   Reply With Quote

Old   June 28, 2016, 01:31
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,728
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Quote:
When you will satisfy CFL number~1 your timestep should have a proper size.
This is not correct for CFX for most simulations. CFX does not require CFL = ~1. This requirement applies to explicit solvers and CFX is implicit. The approaches I described in the previous post are applicable to CFX.

(Small note: the only exception I am aware of in CFX is surface tension modelling. In CFX this behaves in an explicit manner and does require Courant/CFL =~1. But this only applies to surface tension modelling)

Courant number and CFL are not very useful in CFX as it is not a good predictor of whether the time step will be numerically stable or accurate. Therefore I do not recommend using it.
hwangpo and aero_head like this.
ghorrocks is offline   Reply With Quote

Old   June 28, 2016, 01:57
Default
  #5
Senior Member
 
urosgrivc
Join Date: Dec 2015
Location: Slovenija
Posts: 365
Rep Power: 11
urosgrivc is on a distinguished road
Dear Mr. Glenn

Thank you for correcting my statements.

But than it must be a coincidence, as every time I do a transient analisis, When I reach rmsCFL~1 proper convergence is reached within 3 to 5 itterations.
It happend to me so many timmes I thought it is a general rule of thumb at least.
urosgrivc is offline   Reply With Quote

Old   June 28, 2016, 05:46
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,728
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
What sort of simulations is that for? In my experience incompressible flows have appropriate time steps larger than Courant number (by a factor of 5 to 100). Compressible flows which are subsonic can have time steps bigger than CFL by 10 to 1000 times, but when you get shock waves you have to go back to closer to CFL =~1.
ghorrocks is offline   Reply With Quote

Old   June 28, 2016, 06:10
Default
  #7
Senior Member
 
urosgrivc
Join Date: Dec 2015
Location: Slovenija
Posts: 365
Rep Power: 11
urosgrivc is on a distinguished road
I am confused now, are you sure you aren`t talking about ACOUSTIC courant number, than i would agree.

But in my (rotating domain, heat transfer, air, subsonic (max 70m/s) compresible flow) problems if i set the timestep size so the CFL is even 5, than It does not converge not even within 20 itterations so I am forced to go down till i reach rmscfl~1.15 than it is OK. Though I do hawe wery complicated geometry and wery fine mesh elements if that is the problem, and i get wright down to 0.00008s to run smoothly. While acoustic courant number is still at 999+
urosgrivc is offline   Reply With Quote

Old   June 28, 2016, 06:29
Default
  #8
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,728
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
I use Courant Number = u * dt/ dx for incompressible flows

and

(u+a) * dt / dx for compressible flows

Where u = fluid velocity, a = acoustic velocity, dt = time step and dx = mesh size.

I suspect I am being a little loose with terminology, Courant number is the non-dimensional number and CFL is the critereon which defines what the Courant number must be kept below to ensure numeric stability. So you are right, for the compressible flows it is better described as acoustic Courant number.
Sakun and aero_head like this.
ghorrocks is offline   Reply With Quote

Old   June 28, 2016, 14:20
Default
  #9
Member
 
Ferruccio Rossi
Join Date: Jun 2016
Location: Melbourne, FL USA
Posts: 91
Rep Power: 9
frossi is on a distinguished road
Thank you both for your answers.

To be more detailed about my problem, I am modeling airflow over a 3D wing at Mach 0.4.

I was hoping you guys could suggest a good strategy to determine:
1. Total time
2. Time step size
3. Min and Max Coeff. Loops

Also, I would like to know:

4. Where do I have to look (what monitor) in order to know if the time step converged within the number of iterations I specified?

5. ghorrocks, what does it mean when you say
Quote:
Do a time step sensitivity analysis.
?

Thank you both
frossi is offline   Reply With Quote

Old   June 28, 2016, 20:03
Default
  #10
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,728
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Q1 - You run the total time required for what you are analysing. I have no idea what you are analysing so cannot say what total time is required.

Q2 - My post #3 has my recommendations for time step size.

Q3 - I recommend not using a minimum, and a maximum of maybe 10 (assuming you are converging with 3-5 coeff loops per iteration).

Q4 - Residuals is a common thing to look at, also parameters of interest to you. For an airfoil that is probably lift, drag and maybe moments. What ever is important to your analysis.

Q5 - To do a time step sensitivity analysis you do a simulation at a certain time step. Then repeat it using half the time step size. Compare parameters of interest to you between these two simulations (lift, drag, moments, whatever is relevant). If the two results are the same within a tolerance you are happy to live with then the first time step size is good to use. If the result varies then you have to halve the time step size again and repeat until it does reduce the changes to within your tolerance.

Note that you need to do significant changes in time step size (ie double, half), and that the acceptance tolerance depends on what you require (a quick initial simulation could be OK with 10% error, a precision analysis might need 0.1% error; it depends on what you are trying to do).
frossi and Sakun like this.
ghorrocks is offline   Reply With Quote

Old   June 29, 2016, 01:32
Default
  #11
Senior Member
 
urosgrivc
Join Date: Dec 2015
Location: Slovenija
Posts: 365
Rep Power: 11
urosgrivc is on a distinguished road
-Definitly make monitor points
It is even easier to export transient data (that you need) from the solver manager than it is from cfxpost (It is just wery usefull i can explain more about this if necesary...)

-And to get the wright timestep size it is best to change the timestep size [while] the simulation is running from the [edit run in progress] window you can reduce your size there till you reach convergence within 3-5 iterations that is the simple way of finding the corect timestep size.
Adoptive timestep size with bad initial size can take longer than doing it by hand.
(and monitoring the CFL number can tell you almost axactly what you need to do to the size of the timestep.(this is what I was talking about in previous threads) if the rmsCFL number is 65 than reduce the timestep by a factor of 65)
"Hey well if simulation will will have good convergence at avgcfl=100 than you are lucky as you will get your results 100times faster than at avgcfl=1 , but I doubt that will hapen"
This way you can get to the wright timestep size within [three tries] althoe you can set ansys to do it for you)

It is probably a good idea to start with a static solution than initialize the transient one with results from the static one, as the flow needs to develope threw time and it will be faster that way.

-Are you going to do diferent angles of attack?
if so than you are going to need wery fine mesh elements near wall and a wery slow growth rate.
-In CFXpre you should switch to air ideal gas to include density diferences as your speeds are relatively high.
-Your domain should hawe sufficient size so it does not influence your results.
-What were you thinking about turb model...sas sst, les, des ?
-Personaly i would use sas sst and would switch on the gama-theta (laminar-tubulent) transition model (ads two equations)
I would be glad if Mr. Glenn would coment this last one.

-And for the total time: You wil be able to see from the results that your monitor points of lift and grag will [fluctuate] (if thes are not fluctuating than steady state simulation would be apropriate)
As you probably need an average over time to get normal lift data you will want to average a few of these fluctuations
these fluctuation will have somewhat fixed frequency.
So your total time will be few of these fluctuations. it depends how long one takes (geometry and speed of the flow) that is why we can not give you a number but it probably wont be more than 0,2second (your wing travels 24m in that time) if you will initiate your results with a static analisis as the flow first needs to dewelope even from a static solution-> than when it becomes deweloped and somewhat constant fluctuations begin that is when your results should be taken out and you should leave out the (developing flow) at the begining of the transient solution.
This time is a wery coarse astiment as I dont know the details of your problem (length of your wing etc.).

example:
This is a wery crappy simulation (definitly useles) (wals are too close, outlet is just wrong and to close...)-> https://www.youtube.com/watch?v=4z1STnnA3aM
BUT!! the flow dewelopment is wery nicely seen and fluctuations probably start at t>20s and data could be taken at t>30s
just so you get the better feeling. And this is how simulation would look like if you would NOT initiate it properly
with proper inicialization these times can get smaller and computing time can be reduced by a lot.
frossi likes this.

Last edited by urosgrivc; June 29, 2016 at 03:43.
urosgrivc is offline   Reply With Quote

Old   June 29, 2016, 06:01
Default
  #12
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,728
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Quote:
Personaly i would use sas sst and would switch on the gama-theta (laminar-tubulent) transition model (ads two equations)
I would be glad if Mr. Glenn would coment this last one.
I would not recommend the turbulence transition model or SAS until you are experienced in CFD and know things like modelling laminar separation bubbles, turbulence spectrums, near wall modelling for LES and so on.

So for now I recommend you simply use the SST turbulence model as it covers most applications reasonably well whilst being reasonable easy to use. It can also be extended later to include more complex models if required.
ghorrocks is offline   Reply With Quote

Old   June 29, 2016, 16:24
Default
  #13
Member
 
Ferruccio Rossi
Join Date: Jun 2016
Location: Melbourne, FL USA
Posts: 91
Rep Power: 9
frossi is on a distinguished road
urosgrivc and ghorrocks,

those are some really good explanations you just gave me. Thanks a lot! Sorry if I keep asking but I am new to CFX and you guys seem to know it very well.
I ran a one way FSI using a NACA 0012 wing with 40 degrees winglet (wing length = 5 ft, winglet length = 1 ft). I attached pictures so you guys can have a look at my monitors. I need to find moment about the wing root, drag, lift, and equivalent stress. For the simulation I used:
RMS tolerance: 1E-4
CFX Total time = 7 s
CFX time step size = 5E-2 s
CFX Max Loop Coeff. = 20 (is it bad to have such large Max loop coeff? I just wanted to make sure it converged before skipping to the next iteration)
Static structural total time = 7 s

1. urosgrivc, I am monitoring the normal forces and normal moment (see picture). Are those the monitor points that you mean? (I assume normal force-x to be drag, normal force-y to be lift). Also, how do I look at the results of moment, lift and drag in CFX post? I can't figure it out.

2. urosgrivc, I am confused by your terminology. You say to reduce step size so that it converges in 3-5 iterations. You are referring to the iterations within the same time step (loop coeff. iterations), correct? So I should use a maximum coeff. loop of 5? what benefit does this give me against a max coeff. loop of 20?
The RMS of my first time step are not below 1E-4 by the time the solver reached the Max loop coeff. iteration(20), so it skips to the next time step even though convergence is not achieved. How bad is this?
Then, for the second time step, the RMS converge at the 10 loop coeff iteration, and then it skips to the next time step. What confuses me is that while the mass and momentum have converged, the turbulence equations are above 1E-4!!! (see picture) but the solver still skips to the next time step. Why did it skip, if turbulence has not converged?

3. Ok, I will look at CFL as well. But what is CFL and where do I monitor it?
Also, my RMS courant number is 879, while the max is 999. What does it mean?

4. Can you please clarify the purpose of using a steady state to initialize a transient one? Also, how do I set a previous steady state simulation as the starting point for a transient one?

5. Yes, I am using an angle of attack of 5 degrees.

6. I am already using ideal gas, but I though using air at a specific temperature would be more precise, because it's more similar to the real world. Is this right?

7. I am using a k-epsilon turbulence model because I found on some sources that it is usually recommended. What do you guys think?

8. The monitors of the RMS and forces become a flat line almost immediately (see pictures), so does that mean convergence is happening almost immediately? if convergence has happened, why then the solver keeps working, even though the line is already flat?

9. For what concerns my monitors points, I would please ask you to look at the pictures and tell me what you think. To me they look good, because they are flat lining. So I assume they converged to a specific value. But why are they converging so quickly? Both the monitor points and the RMS are converging extremely quickly. Why is that?


I am really grateful to both of you for your help. I learned a lot from your posts.
Attached Images
File Type: jpg Momentum and Mass.jpg (129.5 KB, 127 views)
File Type: png turbolence convergence.png (42.4 KB, 62 views)
File Type: jpg Normal forces.jpg (130.6 KB, 82 views)
File Type: jpg Moment.jpg (130.2 KB, 85 views)
File Type: png Max loop Coeff.png (38.3 KB, 90 views)
frossi is offline   Reply With Quote

Old   June 29, 2016, 18:25
Default
  #14
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,728
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Regarding flatlining: FAQ http://www.cfd-online.com/Wiki/Ansys...gence_criteria

But you have achieved an RMS residual of around 1e-7. This is almost certainly tighter than is required for convergence. So your simulation converged ages ago.
frossi likes this.
ghorrocks is offline   Reply With Quote

Old   June 29, 2016, 18:58
Default
  #15
Member
 
Ferruccio Rossi
Join Date: Jun 2016
Location: Melbourne, FL USA
Posts: 91
Rep Power: 9
frossi is on a distinguished road
Thanks ghorrocks, but what confuses me is how is it possible that the simulation converged so quickly? And after it converged, why did it keep flat lining instead of stopping?

I looked at the documentation you provided, but I could not find any reference to flat lining. Am I correct by assuming that flat lining is a good convergence indicator if it happens below my convergence tolerance of 1E-4?

thank you
frossi is offline   Reply With Quote

Old   June 29, 2016, 19:37
Default
  #16
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,728
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
The title of the FAQ is "My steady state solution converges for a while but stops converging before reaching my convergence criteria". This is exactly what you are seeing.

No, flat lining is not converging. It means the numerics is unable to converge tighter because something is stopping continuing converging.

You can't assume that 1e-4 is a good convergence tolerance - but it will probably be around there. You need to do a sensitivity study on convergence tolerance to find out what your simulation requires.
frossi likes this.
ghorrocks is offline   Reply With Quote

Old   June 29, 2016, 19:56
Default
  #17
Member
 
Ferruccio Rossi
Join Date: Jun 2016
Location: Melbourne, FL USA
Posts: 91
Rep Power: 9
frossi is on a distinguished road
I think I was misunderstanding the significance of the word "converging" for the all time. I interpreted it as getting closer and closer to a constant residual value, thus I was expecting convergence to happen only when the plot flat lined.

But flat lining is not a requirements for convergence. In fact, if the plot flat lines, it just means that the solution has stopped converging further. At that point, if I am satisfied with the convergence tolerance, I can stop the simulation.

Am I correct now?
frossi is offline   Reply With Quote

Old   June 30, 2016, 01:31
Default
  #18
Senior Member
 
urosgrivc
Join Date: Dec 2015
Location: Slovenija
Posts: 365
Rep Power: 11
urosgrivc is on a distinguished road
Timestep is way too big!
that is probably why you get a line, as you are skiping fast forward mising all the details of the flow.
Your wing moves 6 [m] within one timestep. (and yes I ment coefficient loop itterations, with itterations)
In my opinion it should move a fev [mm].
That is why you wont be able to compute 7s of the simulation, as this is extreemly computationaly demanding.
-Why are you doing a transient anyway (does it not converge as a static)? (at 5deg AOE static solution should converge) (at 25deg it wont becouse of seperation buble-transient fenomena)
-are you triing to simulate transient FSI than again this wont work as for this case you woul need TWOway transientFSI simulation (but I doubt that you have a supercomputer) ?
oneway FSI with a static solution will work (if it suits your needs) to see the deflection of the wing.

From this simulation (0,4Mach, CFL880, Ts0,05s) I can calculate that your average mesh size is about 7,2mm
I do think that a real transient simulation for your case should have a timestep of about ~5,7*10^-5 that would mean that for 7s of simulation you would need
123000 timesteps and for each timestep you would need 4Itter -> 0,5Milion iterations (imposible to solve a 3D transient on a normal computer)(fev months maybe)

I dont know If mr. Glenn agrees but that is my opinion (6m per iteration will not give you anything) please correct me if I am wrong I`m learning asweal.

-In CFXpost you can draw vectors of force acting on your surfaces.
-Monitor points are good yes
-answer to (2)->Max coef loops should newer be reached (seting max to 5 is bad), simulation should be set that way that you are able to set max coef loops to (let say 200) it should still converge vithin 3-5itters- (it does depend on the phisics a bit so it can be up to 10iters per timestep)
a bit tighter convergence than e-4 is better let say e-5 or where imbalances are low enough. (I usualy set max coef loops to 10) but is never reached maybe in the first fev timesteps.
If you shorten the time ie size of the timstep enough it will converge within 3-5 you just need to find the corect timestep size (but you will need to shorten it, my prediction is about 880 times)

read this it is usefull http://www.racfd.com/cfx/CFX12_08_Transient.ppt
It explains a lot
frossi and aero_head like this.

Last edited by urosgrivc; June 30, 2016 at 03:07.
urosgrivc is offline   Reply With Quote

Old   June 30, 2016, 16:52
Default
  #19
Member
 
Ferruccio Rossi
Join Date: Jun 2016
Location: Melbourne, FL USA
Posts: 91
Rep Power: 9
frossi is on a distinguished road
Once again, your suggestions have been extremely helpful.

I am running a one-way transient FSI because I want to simulate the loads and stresses on a wing. I chose one-way transient FSI because people in different tutorials used this configuration.

I didn't try the static simulation. Why should the static simulastion converge at 5 deg and not 25 deg? I thought boundary layer separation was a transient phenomenon, and it occurs in 5 deg as well, although the separation is not as great as 25 deg. Could you please explain me your opinion on this subject, please?

No, unfortunately I don't have a super computer. Why a one-way transient FSI is not a good simulation for my case?
Do you know a better way to find the equivalent stress and loads on the wing to produce more accurate results? I would appreciate a lot if you could suggest what you would do.

For what concerns the time steps, what you say makes perfect sense. I will run the simulation for a shorter time.
What I don't understand is this: how can a small fraction of time (1 second) be enough to capture the details of the flow? Even though I use very small time steps, doesn't the flow develops further once it passes the 1 second mark? (I say this thinking about airfoil tests in a wind tunnel). Please correct me if I am wrong.


Thank you urosgrivc for your very detailed answers. I learned a lot from your posts.
frossi is offline   Reply With Quote

Old   June 30, 2016, 19:48
Default
  #20
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,728
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Quote:
Why should the static simulastion converge at 5 deg and not 25 deg?
At 5 deg the fluid flow is likely to be steady with attached flow. At 25 deg the flow is likely to be stall, and therefore transient. You can't do a steady state simulation of a transient flow. But this is just an educated guess, your configuration may be different. Give it a go and see if it works - a steady simulation is much easier than a transient one.

Quote:
doesn't the flow develops further once it passes the 1 second mark? (I say this thinking about airfoil tests in a wind tunnel).
You need to run a transient simulation for long enough to get to the situation you are looking for. If you want the psuedo-steady state response then you need to run it long enough to get to that state. You should run it for as long as your wind tunnel experience tells you is required for pseudo-steady state.
ghorrocks 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
Unexpected deltaT decrease in pimpleFoam simulation robyTKD OpenFOAM Running, Solving & CFD 9 June 27, 2014 06:52
Question on transient simulation in OpenFOAM and FLUENT nicklj OpenFOAM Running, Solving & CFD 4 May 8, 2014 22:30
Unstabil Simulation with chtMultiRegionFoam mbay101 OpenFOAM Running, Solving & CFD 13 December 28, 2013 13:12
Transient simulation : Static temperature and time averaged static temperature saisanthoshm88 CFX 4 July 4, 2013 02:18
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 07:56


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