|
[Sponsors] |
How do unsteady CFD simulations work? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 11, 2015, 07:57 |
How do unsteady CFD simulations work?
|
#1 |
New Member
Join Date: Jan 2015
Posts: 2
Rep Power: 0 |
Hi all,
I'm having a bit of trouble trying to get my head around how unsteady cfd simulations work. Could someone shed some light on this and explain to me what is actually happening in terms of the flow progressing through the grid, and the flow progressing through time? What does inner iterations mean and how does that compare to outer iterations? Also what does having for example 10 time steps mean compared to having 20 time steps? Is it how long we allow for the flow to reach steady state? What does the time step size mean in terms of the flow? Is it how long it takes for the flow to travel over the body in terms of computer time and then this is repeated in the next time step but with the flow evolved? I might be on the right track but a full explanation is appreciated.. I used to think that the grid is divided into number of time steps and the flow progresses through each but I know this is wrong, yet don't know what actually happens.. I know it's a bit of a questionnaire rather than a question but any help is much appreciated! Thank you all for your support. |
|
February 11, 2015, 10:19 |
|
#2 |
Senior Member
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25 |
Seems like you have a fundamental misunderstanding about the CFD starting points. Read this first:
http://www.bakker.org/dartmouth06/engs150/01-intro.pdf The solution variables are defined on a spatial grid and have some grid spacing (or equivalently, some cell size) associated with them. The spatial derivative terms are evaluated using approximations applied to the spatial grid. Timesteps are like frames of a movie showing the flow evolution. Smaller timesteps take more work but give better results. "Small" and "large" are determined by the characteristic times of the flow. If you are using SIMPLE-type solvers in say Fluent or StarCCM+, the timestepping and iterations look like this (assuming 2D, segregated solver): Code:
for (time=0;time<endTime;time += dt) { while (nonLinearResiduals > nonLinearResidualLimits) { buildLinearEquations(); while (linearUMomentumResidual > linearMomentuemResidualLimit) { iterateLinearUmomentumEquation(); } while (linearVMomentumResidual > linearMomentuemResidualLimit) { iterateLinearVmomentumEquation(); } while (linearPressureResidual > linearPressureResidualLimit) { iterateLinearPressureEquation(); } correctVelocityField(); updateNonlinearResiduals(); } writeOutTimeStepData(); moveToNextTimeStep(); } The iterate*Equation() would represent, say, a single conjugate gradient iteration, an AMG sweep, or SOR iteration. Those innermost iterations are "linear" iterations because they are improving the solution to the linear systems. correctVelocityField() uses the new pressure field to enforce continuity on the velocity field. updateNonlinearResiduals() re-evaluates the error using the new field values from the linear system solutions. That outer while loops represents the "nonlinear" iterations because the linear solutions insides only represent successive corrections to the full nonlinear system. Finally, when the nonlinear system is sufficiently converged, there is a function to write out the new time step data (writeOutTimeStepData)--it usually does that only occassionally, say every 100 timesteps. And then there is moveToNextTimeStep(); That makes the NEW fields into the OLD fields. Then the for loop advances the solution time and then works to solve for the NEW field values again. So, this is for classic transient SIMPLE-type codes. PISO, fractional-step, NITA in Fluent, and others do not have a while loop to converge the non-linear residuals, or do only a fixed number of iterations. If you are taking small enough time steps, this can be justified. Some of the OpenFOAM solvers even skip the converged solution of the linear momentum equations and replace it with a single relaxation step. This was a long answer, but I hope it lays it out for you how everything works and should answer most of your questions. Evolution to steady state is a function of the flow and geometry. There is some theoretical guidance based on timescale of your system. Say your velocity is roughly 10 m/s and your flow domain is 100 meters long. It makes sense that you will need to evolve the system to at least 10 seconds to reach one "flow-through time." and have all of the transient effects. Normally, you need to run for several flow-through times to get reliable results that are unpolluted by your guesses as initial conditions. Last edited by mprinkey; February 12, 2015 at 11:50. |
|
February 13, 2015, 12:11 |
|
#3 |
New Member
Join Date: Jan 2015
Posts: 2
Rep Power: 0 |
Hello Mr Prinkey, thank you so much for taking the time write such an explanation, I didn't expect someone to take time and explain the answer in such a detailed way and for that I'm very grateful to you! The use of the computer code helped me understand it even more and I went back to the fundamentals of CFD and then reading your reply after that made me understand a lot of other questions that I've been having as well. So again, thank you very much!
|
|
August 3, 2021, 13:47 |
|
#4 |
New Member
Join Date: Aug 2021
Posts: 5
Rep Power: 5 |
Hello
I am looking for answers about the unsteady solving process in softwares like Fluent or StarCcm+. Based on the previous posts and CFD documention guides ( finite volume method theory ) I still do not understand how the software processes are solving problems. For a steady simulation, only spatial discretization matters. So why do we need a CFL criteria ? If we compare steady and transient simulations, the first one need ( for instance : 1000 iterations to converge to a solution) while for an unsteady simulation, we split the problem into “frame” during which there are very few iteration per time split. Is a Urans simu, a simulation during which each step is solved like a RANS simulation ? T= 0 : a first rans simulation T= dt : the next rans simulation ( based on the first simulation results ) T=2dt : the next and so on If it doesn’t work like this could you please enlighten me ? Your explanation will help me to understand the theory, the principles and how softwares are procedings. Thank you in advance for your help, |
|
August 3, 2021, 15:02 |
|
#5 | ||
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,762
Rep Power: 66 |
Quote:
Quote:
The key is to look at (and possible yourself do) an implicit temporal discretization. When you do this, you get a linear system that needs to be solved at each cell. And then you take a step back and realize that for both steady and unsteady problems you solve a very similar looking linear system. Once you are dealing with the discretized linear system, you can't really tell anymore (simply from the coefficients in the system) whether that system comes from a steady problem or an unsteady problem. The difference is that you choose the size of the time-advancement when you do in transient calculations, the equivalent time-step for steady calculations is whatever it happens to be depending on the local cell velocities and such. |
|||
August 4, 2021, 02:27 |
|
#6 | |
New Member
Join Date: Aug 2021
Posts: 5
Rep Power: 5 |
Thank you for your complete reply.
Quote:
How is it possible for a RANS simulation to need 1000iterations to converge while for a URANS a especially one time step only 5 to 10 iterations are needed to converge ? There is something I missed. Sorry if the question is basic but I received different wrong explanations about unsteady simulations that I want to understand the process. For instance I once heard that for a Urans the software solve step by step the firsts cells range then the second range then the thirs etc ( from the inlet to the oulet). After reading theoriy I new that is not how it works. Do you know where I can find figures to help to understand how the process works ? Thank you in advance |
||
August 4, 2021, 05:30 |
|
#7 | |
Senior Member
|
Quote:
|
||
August 4, 2021, 05:41 |
|
#8 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
Quote:
First of all, the RANS and URANS solution converge to the same results? What about you guess (RANS) and initial condition (URANS)? Theoretically the steady state equations produce a non-linear algebric system of equations, the convergence in a certain number of iterations depends also on the guess (initial) solution you provide. The time dependent equations can or not produce a steady state solution. Again, there is a characteristic time due to the physics. The number of time steps depends on some numerics, too. |
||
August 4, 2021, 15:30 |
|
#9 | |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,762
Rep Power: 66 |
Quote:
Maybe you are forgetting that you need to provide an initial guess. You can get a RANS simulation to converge in 1 iteration if your initial guess happens to be the solution. In RANS however, most people start with an initial guess that looks nothing like what the eventual flow field will be. Heck, most people forget that an initial guess is formally needed. They just click the initialization button in their software. But... your initial guess could be anything. In a transient calculation, instead of an initial guess, there is an strict dependence on the previous timesteps (according to whatever is your temporal discretization). And as long as you pick a small enough dT, it can converge quickly. |
||
August 4, 2021, 15:34 |
|
#10 | |
Senior Member
|
Quote:
|
||
August 5, 2021, 02:15 |
|
#11 | |
New Member
Join Date: Aug 2021
Posts: 5
Rep Power: 5 |
Quote:
|
||
August 5, 2021, 02:22 |
|
#12 | |
New Member
Join Date: Aug 2021
Posts: 5
Rep Power: 5 |
Quote:
One solution is time dependant while the other is not so the results won’t be equals Last edited by drhouse007; August 9, 2021 at 02:07. |
||
August 5, 2021, 05:28 |
|
#13 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
Quote:
Let me try to explain in a more theoretical framework, forget about URANS/RANS and consider a general evolution equation like this du/dt=f The transient is resolved exactly by u(t+dt)=u(t)+Int[t;t+dt] f dt that is the update depends on the change of f in the whole time interval. Any numerical method approximates the time-integral, the way that is done defines the scheme. You need the initial condition to be prescribed and if you provide the steady state solution as initial condition, your numerical method must stop. In a steady state approach you simply search for the zero of the equation f=0. Since an iterative method is often used you need to start from a guess solution. Again, if you provide the steady state solution you have a one-step convergence. In conclusion, you should run the URANS code until a steady state is reached and compare to RANS. I know that the concept of a steady URANS solution is misleading but this is a furthere topic... |
||
August 5, 2021, 10:36 |
|
#14 | |
Senior Member
Blanco
Join Date: Mar 2009
Location: Torino, Italy
Posts: 193
Rep Power: 17 |
Quote:
Hi, if the first guess at t=0 is wrong then realistically 20 inner iterations are not sufficient to achieve a good convergence in the first time-step, therefore the solution at t+Dt after those 20 iterations will be...wrong! That's why it is a good practice to initialize a transient simulation with the results of a steady-state simulation, so that the error at t=0 will be minimized (it is not zero in any case most of the times). Additionally, it is a good practice to allow the very first time-steps in the transient simulation to run w/ a higher number of inner iterations, to be sure that the convergence achieved after the initialization is good enough. The number of inner iterations can be reduced afterwards for successive time-steps, and it is up to the analyst to judge how much the reduction is acceptable. Another option is to let the transient simulation proceed form a wrong initialization, knowing that the results achieved will be unphysical for a while, but this is a risky path because it's up to the analyst to verify how long the solutions is unphysical...not to say that the time evolution of the solution could also remain unphysical and diverge in case of very poor initialization |
||
August 5, 2021, 11:48 |
|
#15 | ||
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,762
Rep Power: 66 |
There isn't an initial guess in a transient calculation. You don't really give a transient calculation a wrong initial guess. Whatever is the initial state is strictly formally declared. An analogue is prescribing the wrong boundary condition in a boundary value problem. Of course the solution will evolve differently. But it is simply a different wrong problem. To be even more clear, it is as if I wanted to solve what happens with a velocity inlet of 1 m/s, but I prescribe as a BC instead 2 m/s just to see what happen. That's what you are doing when you prescribe something at t=0 that is different than it should be. The solution and how it evolves in time is indeed irrelevant.
Quote:
Quote:
Steady calculations involve 1000's of iterations because the change that u has to go through from the initial guess to the final converged state is (usually) very large because people generally provide very poor initial guesses (at least I know I do!). It's like root finding again, but you can also be very near or very far from the root. And usually we are very far from the root because we're all bad at initialization. Some of us are just more bad than others. |
|||
August 9, 2021, 02:09 |
|
#16 |
New Member
Join Date: Aug 2021
Posts: 5
Rep Power: 5 |
Thank you everybody for your help. It helps to better understand this numerical method !
|
|
August 10, 2021, 21:15 |
|
#17 |
New Member
Join Date: Aug 2021
Posts: 2
Rep Power: 0 |
Hello everyone,
Please correct me if I’m wrong. As far as I know, the Courant number stability criterion is applicable only for explicit time integration of differential equations. For a flow field, this would correspond to limit the time step to a certain limit where a fluid particle would not skip any cells along its trajectory throughout the time step integrations. If the implicit method is used, an iterative scheme is applied to solve a system of differential equations, so one can advance in time with larger time steps, and even calculate a steady state solution. When calculating a flow field over time with the implicit method, the lower the time increment, the lower will be the number of iterations for convergence to the next time increment. I preferably don’t like the explicit time integration because if the turbulence model used has a restriction on the y+ of mesh adjacent to walls (like the k-omega SST), the tiny cells in the boundary layer will make the time step drop significantly in order to meet the Courant stability criterion. Thanks and regards |
|
August 11, 2021, 07:11 |
|
#18 |
Senior Member
|
Basically, yes. Some details are:
- not all the explicit methods have the exact same restriction, and it also depends from the spatial scheme, this especially being the case for viscous problems, where it is not the convective time scale to drive the restriction but the diffusive one - implicit is guaranteed to work just for linear problems; non linear ones still have some practical limits in certain cases |
|
August 11, 2021, 09:54 |
|
#19 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
According to Paolo, you should never forget that the stability region is a complex cfl(Re_h) map.
|
|
August 11, 2021, 20:02 |
|
#20 |
New Member
Join Date: Aug 2021
Posts: 2
Rep Power: 0 |
Thanks Paolo and Filippo for the explanations! Diffusion is another important phenomenon that I didn't take into account, and it is more clear to me that not only convection drives the explicit time step limit for stability. Best regards
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFD Salary | CFD | Main CFD Forum | 17 | January 3, 2017 18:09 |
Do all CFD analysts have to do some hands-on work except PhDs? | e13drd | Main CFD Forum | 2 | March 17, 2014 15:56 |
CFD work flow | jmjohansen | ANSYS | 0 | April 26, 2013 13:08 |
STAR-Works : Mainstream CAD with CFD | CD adapco Group Marketing | Siemens | 0 | February 13, 2002 13:23 |
Where do we go from here? CFD in 2001 | John C. Chien | Main CFD Forum | 36 | January 24, 2001 22:10 |