CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Steady-State and Transient Solvers (https://www.cfd-online.com/Forums/openfoam-solving/114645-steady-state-transient-solvers.html)

 70m1 March 14, 2013 15:47

Steady-State and Transient Solvers

Could someone please explain the differences between steady-state solvers and Transient solvers also when is best to use each (specifically pisoFoam and SimpleFoam).

So far I understand that Steady-State is much faster and transient uses a timestep deltaT. But I am struggling to find any information past this.

Thanks in advance.

 NickolasPl March 14, 2013 17:11

Greetings Thomas,

The terms steady state and transient have to do on if time is a parameter or not (very roughly). This has to do with the phenomena that you are studying.....if your physical flow does not change over time then you can see it as steady state. So in either case you must know before you do the simulation if your "real" flow is steady or transient and then procceed with the solvers you talked about. Poiseuille flow for example is treated as steady state.

Regards,

Nickolas

 70m1 March 14, 2013 17:18

Thanks for clearing this up for me. One thing remains though, how can turbulent flow be considered steady state?

Tom

 NickolasPl March 14, 2013 17:35

Well in the way you are posing this is very general. Maybe you can tell some information on what you have in mind to simulate. For example, if you process is a continuous process but the phenomena created are turbulent (very high Reynolds number) you can approximate it as steady state (since it is continuous) and insert a turbulent model such the Reynolds averaged stresses.
But all these are very general assumptions. With simpleFoam solver, which is steady state, you can switch between laminar and turbulent flow.

Nickolas

 70m1 March 14, 2013 17:58

I am doing air flow over a small air vehicle. Reynolds 120,000 15deg angle of attack. Would I be right in saying that due to the air flow separation and turbulence this would be a non-continuous simulation?

 heliana60 January 21, 2014 05:16

time evolution PisoFoam

Hello there,

I am struggling a little bit with the meaning of time in transient solvers like PisoFoam. I am new to openfoam and I am checking pisofoam for a transient newtonian flow. The problem is that whenever I decrease the time step on a pressure-driven flow the steady state is reached faster and the time scale changes dramatically. When I compare my results with analytic ones I find drastic differences, like if time would be scaled by a factor. Does someone know if the time that openFoam prints has a physical direct meaning?:confused::confused::confused:

 wyldckat January 21, 2014 16:37

Greetings to all!

@Heliana: I got your private message and went looking for any posts you had made about this question.

There are a few very important details that I need to ask, in order to assess what might be the problem:
1. Did you study the 3 tutorials from the OpenFOAM User Guide? Or at least the first tutorial?
2. Which OpenFOAM tutorial are you using as a reference for your case?
3. Did you first use a case from simpleFoam and then adapt to use in pisoFoam?
1. If so, which changes did you make?
4. Mesh is extremely important for any and all CFD cases. Did you follow the explanations described in the first tutorial of the User Guide?
1. More specifically, what is the mesh resolution in your case and what flow speeds are involved?
5. What do these files contain in your case:
• system/fvSchemes
• system/fvSolution
• system/controlDict
6. Is the case 2D or 3D?
7. Which turbulence model are you using?
Best regards,
Bruno

 heliana60 February 25, 2014 12:35

Hello Bruno!!

I am so sorry for the late reply, i was on holidays :S

My case is a pressure driven Newtonian flow. This is how I defined the mesh:

Code:

``` /*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM Extend Project: Open Source CFD        | |  \\    /  O peration    | Version:  1.6-ext                              | |  \\  /    A nd          | Web:      www.extend-project.de                | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      dictionary;     object      blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.01; vertices (     (0 0 0)  // 0     (1 0 0)  // 1     (0 0.5 0)  // 2     (1 0.5 0)  // 3     //Front     (0 0 0.01)  // 4     (1 0 0.01)  // 5     (0 0.5 0.01)  // 6     (1 0.5 0.01)  // 7     ); blocks (     hex (0 1 3 2 4 5 7 6) (50 20 1) simpleGrading (1 1 1))```
So it has 3050 cells. 2D model.

These are the answers:
1. I studied the three tutorials :)
2. in the cavity case I compared also time scales between simpleFoam and pisoFoam and I found time differences regarding the time needed to get to steady state.
3. I checked both simpleFoam and pisoFoam for this case. Always simpleFoam would take importantly more time to get to steady state than pisoFoam (by a factor of approx. 100).
4. what do you mean by flow speeds?
5. these are my files more or less for pisoFoam

controlDict
Code:

```FoamFile {     version    2.0;     format      ascii;     class      dictionary;     location    "system";     object      controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application    pisoFoam; //startFrom      latestTime; startFrom startTime; startTime      0; stopAt          endTime; endTime        0.001; deltaT          1e-6; writeControl    adjustableRunTime; writeInterval  0.0001; purgeWrite      0; writeFormat    ascii; writePrecision  6; writeCompression off; timeFormat      general; timePrecision  6; runTimeModifiable true; adjustTimeStep no; maxCo          0.7; maxDeltaT      0.001;}```
Code:

``` FoamFile {     version    2.0;     format      ascii;     class      dictionary;     location    "system";     object      fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes {     default        Euler; } gradSchemes {     default        Gauss linear;     grad(p)        Gauss linear; /*    grad(U)        Gauss linear;*/ } divSchemes {     default        none;     div(phi,U)      Gauss upwind; /*    div(phi,k)      Gauss limitedLinear 1;*/ /*    div(phi,epsilon) Gauss limitedLinear 1;*/ /*    div(phi,R)      Gauss limitedLinear 1;*/ /*    div(R)          Gauss linear;*/ /*    div(phi,nuTilda) Gauss limitedLinear 1;*/   div((nuEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes {     default        none;     laplacian(nuEff,U) Gauss linear corrected;     laplacian((1|A(U)),p) Gauss linear corrected; /*    laplacian(DkEff,k) Gauss linear corrected;*/ /*    laplacian(DepsilonEff,epsilon) Gauss linear corrected;*/ /*    laplacian(DREff,R) Gauss linear corrected;*/ /*    laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;*/ } interpolationSchemes {     default        linear;     interpolate(U)  linear; } snGradSchemes {     default        corrected; } fluxRequired {     default        no;     p              ; }```
Code:

```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  2.2.0                                | |  \\  /    A nd          | Web:      www.OpenFOAM.org                      | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      dictionary;     location    "system";     object      fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers {     p     {           solver PCG;           preconditioner DIC;           tolerance 1e-08;           relTol 0;     }     pFinal     {         solver          PCG;         preconditioner  DIC;         tolerance      1e-06;         relTol          0;     }     U     {         solver          PBiCG;         preconditioner        DILU;         tolerance      1e-08;         relTol          0;     } } /*SIMPLE*/ /*{*/ /*    nNonOrthogonalCorrectors 0;*/ /*    pRefCell        0;*/ /*    pRefValue      0;*/ /*    residualControl*/ /*    {*/ /*        p              1e-8;*/ /*        U              1e-8;*/ /*    }*/ /*}*/ PISO {     nCorrectors    5;     nNonOrthogonalCorrectors 0;     pRefCell        0;     pRefValue      0;  residualControl     {         p              1e-2;         U              1e-2;     } } relaxationFactors {     fields     {         p              0.3;     }     equations     {         U              0.7;     } }```
Code:

``` /*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  2.2.0                                | |  \\  /    A nd          | Web:      www.OpenFOAM.org                      | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      dictionary;     location    "system";     object      fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers {     p     {           solver PCG;           preconditioner DIC;           tolerance 1e-08;           relTol 0;     }     pFinal     {         solver          PCG;         preconditioner  DIC;         tolerance      1e-06;         relTol          0;     }     U     {         solver          PBiCG;         preconditioner        DILU;         tolerance      1e-08;         relTol          0;     } } /*SIMPLE*/ /*{*/ /*    nNonOrthogonalCorrectors 0;*/ /*    pRefCell        0;*/ /*    pRefValue      0;*/ /*    residualControl*/ /*    {*/ /*        p              1e-8;*/ /*        U              1e-8;*/ /*    }*/ /*}*/ PISO {     nCorrectors    5;     nNonOrthogonalCorrectors 0;     pRefCell        0;     pRefValue      0;  residualControl     {         p              1e-2;         U              1e-2;     } } relaxationFactors {     fields     {         p              0.3;     }     equations     {         U              0.7;     } }```
7. turbulence Model, Newtonian, RASmodel, laminar, turbulence off.

Sorry uff it all sounds like too much. From simpleFoam to pisoFoam I changed the ddtSchemes from steadyState to Euler. in simpleFoam the div(phi,U) is bounded Gauss upwind and in pisoFoam it is just gauss upwind and fvSolution is the same. Actually the most different is fvSchemes for simpleFoam:

Code:

```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  2.2.0                                | |  \\  /    A nd          | Web:      www.OpenFOAM.org                      | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      dictionary;     location    "system";     object      fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes {     default        steadyState; } gradSchemes {     default        Gauss linear;     grad(p)        Gauss linear;     grad(U)        Gauss linear; } divSchemes {     default        none;     div(phi,U)      bounded Gauss upwind;     div(phi,k)      bounded Gauss upwind;     div(phi,epsilon)  bounded Gauss upwind;     div(phi,R)      bounded Gauss upwind;     div(R)          Gauss linear;     div(phi,nuTilda)  bounded Gauss upwind;     div((nuEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes {     default        none;     laplacian(nuEff,U) Gauss linear corrected;     laplacian((1|A(U)),p) Gauss linear corrected;     laplacian(DkEff,k) Gauss linear corrected;     laplacian(DepsilonEff,epsilon) Gauss linear corrected;     laplacian(DREff,R) Gauss linear corrected;     laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; } interpolationSchemes {     default        linear;     interpolate(U)  linear; } snGradSchemes {     default        corrected; } fluxRequired {     default        no;     p              ; }```
what do you think??

sorry for the overload!! :s

have a nice day!!

heliana

 wyldckat March 2, 2014 11:39

Hi Heliana,

Quote:
 Originally Posted by heliana60 (Post 476746) 2. in the cavity case I compared also time scales between simpleFoam and pisoFoam and I found time differences regarding the time needed to get to steady state. 3. I checked both simpleFoam and pisoFoam for this case. Always simpleFoam would take importantly more time to get to steady state than pisoFoam (by a factor of approx. 100).
Something is definitely not right here. Did you notice that the mesh is being scaled down by a factor of 0.01?
Code:

`convertToMeters 0.01;`
And that the cells are not uniformly shaped? The number of cells over Y should be 25 and not 20.

With a "MaxCo" set to 0.7, the maximum velocity should be... I haven't done the math, but likely the maximum allowed velocity in the "U" field would be something like 0.1 to 0.01 m/s.

Quote:
 Originally Posted by heliana60 (Post 476746) 4. what do you mean by flow speeds?
The values for the "U" field :)

I don't have time to set-up these cases myself, but I assume you're basing yourself on the tutorial "incompressible/pisoFoam/ras/cavity", correct? If you could share the cases, it would it easier for anyone to see and test this.

Best regards,
Bruno

 heliana60 March 5, 2014 10:01

Hello Bruno,

Thank you for answering. Well I am using a better mesh, more uniform, and I am actually working more studying a pressure driven flow through a simple pipe. I am also very much aware of the convertToMetres command, though I tried to simplify more my mesh file. Now that the mesh is better I still find differences regarding the evolution of velocity when I decrease the timeStep / Courant number. Does that make sense? I mean for every time-step I use the velocity I am waiting for is eventually reached, but with low time-steps (1e-6) the steady state is reached faster which tends to be similar to the analytic result.

What do you think? Thank you for your patience :)

 wyldckat March 5, 2014 15:54

Hi Heliana,

Quote:
 Originally Posted by heliana60 (Post 478296) I still find differences regarding the evolution of velocity when I decrease the timeStep / Courant number. Does that make sense? I mean for every time-step I use the velocity I am waiting for is eventually reached, but with low time-steps (1e-6) the steady state is reached faster which tends to be similar to the analytic result.
The trick to ascertain what is right and what is wrong is usually to use the following settings in "controlDict" (when using a transient solver, that is):
1. Use:
Code:

`adjustTimeStep yes;`
To let the solver adjust the time step automatically.
2. Use:
Code:

`maxCo          0.5;`
It's the value that usually works for most of the cases. In certain situations, this value should be lower and in others it can be higher, but that depends on one's experience on this topic.
Using these settings you'll get a more accurate indication of what is correct.

Because if you are enforcing a fixed time step and are not careful with keeping the Courant Number below the 0.5 mark, then your solution is simply wrong. There is a specific line that tells you this, namely the one mentioning the word "continuity". If you look at that line in each time step, what values are you getting?

Best regards,
Bruno

 heliana60 March 6, 2014 05:09

Hi Bruno!

Well, I have been using really low time steps, in the order of 10^-6 amd for the time continuity errors I get something like this:

time step continuity errors : sum local = 1.17661e-22, global = 9.15827e-25, cumulative = 3.50451e-17
DICPCG: Solving for p, Initial residual = 1.33849e-07, Final residual = 1.33849e-07, No Iterations 0
time step continuity errors : sum local = 3.74667e-22, global = 9.26575e-25, cumulative = 3.50451e-17

Which sounds pretty low. I am going to adjustTimeStep to see what happens :)

I will let you know then !

Cheers,

Heliana

 msuaeronautics March 6, 2014 15:54

A more basic way of classifying the differences is this:

-If you care about observing time-accurate flow development, then you would use a transient solver (pisoFoam, pimpleFoam, etc) with a 2nd-order temporal scheme.

-If you only care about reaching a "steady-state" and do not wish to observe anything that goes on between the beginning and end states, then it is much better to choose one of the steady-state solvers (simpleFoam etc).

Transient solvers generally go hand-in-hand with DES and LES simulations, while steady-state solvers are better coupled with RANS simulations.

 pbachant March 6, 2014 18:14

Quote:
 Originally Posted by msuaeronautics (Post 478616) A more basic way of classifying the differences is this: -If you care about observing time-accurate flow development, then you would use a transient solver (pisoFoam, pimpleFoam, etc) with a 2nd-order temporal scheme.
Can you expand on the importance of the order of the temporal scheme? It seems many of the OpenFOAM tutorials for pimpleFoam use an Euler scheme for time discretization.

 msuaeronautics March 6, 2014 20:29

Quote:
 Originally Posted by pbachant (Post 478638) Can you expand on the importance of the order of the temporal scheme? It seems many of the OpenFOAM tutorials for pimpleFoam use an Euler scheme for time discretization.
Many of the OpenFOAM tutorials possibly use Euler because it is the most stable, and they leave it up to the user to change to a higher order if desired. You might also notice that many of the tutorials come with very coarse grids- all of these just for ease of use.

One example where having a 2nd-order temporal scheme is important is when predicting the Strouhal number (St) of oscillation in the flow past a sphere using DES or LES. This is simply a measure of wake shedding frequencies. If you choose Euler, at the very least you'll certainly experience a lag/errors in the time history of St with respect to experiment.

 pbachant March 7, 2014 18:59

Quote:
 Originally Posted by msuaeronautics (Post 478649) Many of the OpenFOAM tutorials possibly use Euler because it is the most stable, and they leave it up to the user to change to a higher order if desired. You might also notice that many of the tutorials come with very coarse grids- all of these just for ease of use. One example where having a 2nd-order temporal scheme is important is when predicting the Strouhal number (St) of oscillation in the flow past a sphere using DES or LES. This is simply a measure of wake shedding frequencies. If you choose Euler, at the very least you'll certainly experience a lag/errors in the time history of St with respect to experiment.
Which temporal scheme in OpenFOAM would you recommend for use with PIMPLE and a low Re mesh on an airfoil?

 msuaeronautics March 7, 2014 20:32

Quote:
 Originally Posted by pbachant (Post 478879) Which temporal scheme in OpenFOAM would you recommend for use with PIMPLE and a low Re mesh on an airfoil?
Personally, I make it a point to use three-point backward differencing (denoted by the keyword backward) for every transient problem of mine. It's generally very stable and appears to be slightly more accurate and less computationally expensive than Crank-Nicolson.

In cases where backward is unstable, you may desire to use Crank-Nicolson and blend it with Euler (using the coefficient 0 to 1) if that doesn't work either.

 heliana60 March 11, 2014 06:21

Hi guys, thank you so much for answering, it has been really helpful... Well, I was checking my files and I found a mistake I have made (i feel really embarrassed). I was using relaxation factors so my transients were affected... when I removed them it worked just fine.

My goal is actually use the viscoelasticFluidFoam solver using a modified Maxwell model, and that is suposed to be a transient solver as far as I understood. Is any of you familiar with that solver??

cheers !

 pbachant March 11, 2014 15:31

Is that a general principle--that relaxation factors should not be used on unsteady problems?

 msuaeronautics March 25, 2014 23:24

Quote:
 Originally Posted by pbachant (Post 479415) Is that a general principle--that relaxation factors should not be used on unsteady problems?
It is still acceptable to use relaxation factors on unsteady problems, but their use is often problem-dependent. I would do a small study to determine what's right for your case, and it often comes down to how much stability you need vs. how much accuracy you desire.

 All times are GMT -4. The time now is 11:59.