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

Running pimpleFoam in steady state

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree5Likes
  • 1 Post By klausb
  • 1 Post By klausb
  • 2 Post By hconel
  • 1 Post By hconel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 27, 2021, 10:28
Default Running pimpleFoam in steady state
  #1
Member
 
Join Date: Mar 2021
Posts: 39
Rep Power: 6
trailer is on a distinguished road
Hello to all,


I am new to OpenFOAM and CFD in general.


I am currently working with pimpleFoam, and would like to now if I can run pimpleFoam as a steady-state solver to compare it with simpleFoam (the one commonly used for steady-state analysis of incompressible flows).


The case I am using has, the same geometry, boundary conditions, material parameters and discretization schemes.


The fvSolutions for simpleFoam is:


Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2012                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver           GAMG;
        smoother         DICGaussSeidel;
        tolerance        1e-12;
        relTol           0.01;
     }

    U
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-12;
        relTol          0.1;
    }
}

SIMPLE
{
    momentumPredictor     yes;
    nNonOrthogonalCorrectors 2;

    residualControl
    {
        p               1e-7;
        U               1e-7;
    }
}

relaxationFactors
{
    fields
    {
        p         0.2;
    }
    equations
    {
        U         0.8;
    }
}
// ************************************************************************* //
And the fvSolution for pimpleFoam is:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2012                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver           GAMG;
        smoother         DICGaussSeidel;
        tolerance        1e-12;
        relTol           0.01;
    }

    pFinal
    {
        $p;
        relTol          0;
    }

    U
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-12;
        relTol          0.1;
    }

    UFinal
    {
        $U;
        relTol          0;
    }
}

PIMPLE
{
    momentumPredictor     yes;
    nNonOrthogonalCorrectors 0;
    nCorrectors          3;
    nOuterCorrectors    5000; 

    residualControl
    {
        p
        {
            tolerance 1e-7;
            relTol 0;
        }  

        U
        {
            tolerance 1e-7;
            relTol 0;
        }               
    }
}

relaxationFactors
{
    fields
    {
        "p.*"         0.2;
    }
    equations
    {
        "U.*"         0.8;
    }
}
// ************************************************************************* //
Since I am considering the simulation to be in steady-state, I set a big number for the nOuterCorrectors to be able to reach the value of convergence (1e-7). Since I will be doing 3 corrections to the pressure value in simpleFoam, I placed the same number in pimpleFoam.


Now, if I relax p field and the U equation but not the pFinal and UFinal (relaxation value of 1), the residuals will shoot up in the last iteration.



Code:
PIMPLE: iteration 1349
smoothSolver:  Solving for Ux, Initial residual = 8.19246e-08, Final residual = 5.7518e-10, No Iterations 1000
smoothSolver:  Solving for Uy, Initial residual = 8.17515e-08, Final residual = 7.9777e-10, No Iterations 1000
GAMG:  Solving for p, Initial residual = 0.00157036, Final residual = 1.10094e-05, No Iterations 3
time step continuity errors : sum local = 2.48645e-07, global = -2.4261e-07, cumulative = -0.000346783
GAMG:  Solving for p, Initial residual = 0.00052824, Final residual = 1.99901e-06, No Iterations 4
time step continuity errors : sum local = 4.51441e-08, global = 2.00348e-08, cumulative = -0.000346763
GAMG:  Solving for p, Initial residual = 0.000149263, Final residual = 9.10383e-13, No Iterations 16
time step continuity errors : sum local = 2.58752e-14, global = 1.97548e-14, cumulative = -0.000346763
PIMPLE: converged in 1349 iterations
ExecutionTime = 253.46 s  ClockTime = 262 s
I checked the maximum difference between the calculated pressure field between simpleFoam and pimpleValue, whos value is: 0.00222 Pa.




I redid the pimpleFoam simulation, but this time with pFinal and UFinal with the same relaxation factor:


Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2012                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver           GAMG;
        smoother         DICGaussSeidel;
        tolerance        1e-12;
        relTol           0.01;
    }

    pFinal
    {
        $p;
        relTol          0;
    }

    U
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-12;
        relTol          0.1;
    }

    UFinal
    {
        $U;
        relTol          0;
    }
}

PIMPLE
{
    momentumPredictor     yes;
    nNonOrthogonalCorrectors 0;
    nCorrectors          3;
    nOuterCorrectors    5000; 

    residualControl
    {
        p
        {
            tolerance 1e-7;
            relTol 0;
        }  

        U
        {
            tolerance 1e-7;
            relTol 0;
        }               
    }
}

relaxationFactors
{
    fields
    {
        "p.*"         0.2;
    }
    equations
    {
        "U.*"         0.8;
    }
}
// ************************************************************************* //
Now the residuals, do not shoot up (as would be expected)

Code:
PIMPLE: iteration 1348
smoothSolver:  Solving for Ux, Initial residual = 1.09084e-08, Final residual = 1.03204e-09, No Iterations 3
smoothSolver:  Solving for Uy, Initial residual = 1.08885e-08, Final residual = 1.03056e-09, No Iterations 3
GAMG:  Solving for p, Initial residual = 1.65431e-07, Final residual = 8.08242e-10, No Iterations 3
time step continuity errors : sum local = 1.46057e-11, global = 8.30149e-13, cumulative = -0.000346541
GAMG:  Solving for p, Initial residual = 1.02425e-07, Final residual = 7.95361e-10, No Iterations 2
time step continuity errors : sum local = 1.43732e-11, global = 1.05386e-12, cumulative = -0.000346541
GAMG:  Solving for p, Initial residual = 9.97459e-08, Final residual = 5.08921e-13, No Iterations 8
time step continuity errors : sum local = 1.6224e-14, global = 8.66275e-15, cumulative = -0.000346541

PIMPLE: iteration 1349
smoothSolver:  Solving for Ux, Initial residual = 1.08227e-08, Final residual = 6.33477e-13, No Iterations 13
smoothSolver:  Solving for Uy, Initial residual = 1.0803e-08, Final residual = 6.2313e-13, No Iterations 13
GAMG:  Solving for p, Initial residual = 1.57387e-07, Final residual = 9.22866e-10, No Iterations 3
time step continuity errors : sum local = 1.66775e-11, global = 1.47003e-12, cumulative = -0.000346541
GAMG:  Solving for p, Initial residual = 1.2202e-07, Final residual = 6.1291e-10, No Iterations 3
time step continuity errors : sum local = 1.10757e-11, global = 1.14102e-12, cumulative = -0.000346541
GAMG:  Solving for p, Initial residual = 1.20591e-07, Final residual = 3.98623e-13, No Iterations 10
time step continuity errors : sum local = 1.48153e-14, global = 5.29874e-15, cumulative = -0.000346541
PIMPLE: converged in 1349 iterations
ExecutionTime = 244.99 s  ClockTime = 254 s
Now the maximum difference between simpleFoam and pimpleFoam is 0.00001 Pa.


Is it Ok for me to assume that, if I want to want to run steady-state simulations with pimpleFoam I should relax both fields and equations (p, pFinal and U, UFinal)?


Additionally, is there any keyword to stop the pimple solver if the difference between the initial residual of consecutive time steps is less than a tolerance?


Kind Regards.
trailer is offline   Reply With Quote

Old   April 30, 2021, 16:36
Default
  #2
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 293
Rep Power: 23
klausb will become famous soon enough
I recommend to read through this: https://openfoamwiki.net/index.php/O...hm_in_OpenFOAM
to better understand what's the intended use-case of PIMPLE.
Sakun likes this.
klausb is offline   Reply With Quote

Old   May 1, 2021, 14:02
Default
  #3
Member
 
Join Date: Feb 2020
Posts: 90
Rep Power: 7
Shibi is on a distinguished road
Quote:
Originally Posted by klausb View Post
I recommend to read through this: https://openfoamwiki.net/index.php/O...hm_in_OpenFOAM
to better understand what's the intended use-case of PIMPLE.

From what I could understand, Pimple is using the PISO with SIMPLE advantages (under-relaxation within one time step) so that we can surpass the limitation of Co < 1.


With this in mind, if I want to use pimpleFoam to run a steady-state analysis I can do the above approach. Correct?
Shibi is offline   Reply With Quote

Old   May 2, 2021, 05:23
Default
  #4
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 293
Rep Power: 23
klausb will become famous soon enough
What is the purpose of your comparison?

PIMPLE uses SIMPLE at each timestep and can be configured to run in PISO mode, too. It's not designed for steady-state-simulations. It can be an option to speed-up certain transient flow simulations compared to PISO.

pimpleFoam

Transient solver for incompressible, turbulent flow of Newtonian fluids, with optional mesh motion and mesh topology changes.


simpleFoam

Steady-state solver for incompressible, turbulent flow, using the SIMPLE algorithm.
saidc. likes this.
klausb is offline   Reply With Quote

Old   May 2, 2021, 05:43
Default
  #5
Member
 
Join Date: Feb 2020
Posts: 90
Rep Power: 7
Shibi is on a distinguished road
Hi,



I understand that pimpleFoam is designed for transient simulations. But the steadyState option is available in the discretization schemes. As such, I was just checking how to setup the case to make both solvers get the same results.
Shibi is offline   Reply With Quote

Old   May 2, 2021, 12:33
Default
  #6
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16
Bazinga is on a distinguished road
I guess klausb question is why you would be interested in this comparison. PIMPLE is the transient version of SIMPLE, hence, why bother comparing if you already have the steady state algorithm.

You do you, but you could maybe consider that this comparison might be a bit tedious.
Bazinga is offline   Reply With Quote

Old   January 24, 2023, 03:07
Default
  #7
New Member
 
bercan siyahhan
Join Date: Oct 2009
Posts: 3
Rep Power: 17
bsiyahhan is on a distinguished road
One advantage of using pimpleFoam as a steady state solver could be to do adaptive mesh refinement for a steady state case without having to modify the code of simpleFoam.
bsiyahhan is offline   Reply With Quote

Old   February 5, 2025, 03:23
Default
  #8
Member
 
Hüseyin Can Önel
Join Date: Sep 2018
Location: Ankara, Turkey
Posts: 63
Rep Power: 8
hconel is on a distinguished road
I do not understand why people "judge" the questions in these forums. Yes, we know what simpleFoam and pimpleFoam are, and their use cases. Yes, we know they are intended for unsteady and steady states respectively. The user is not asking "is pimpleFoam a steady state solver", he is asking if he can run it with zero time derivative.

This is still a logical and valid question. The user might be trying to perform a simulation that needs an unsteady solver (such as adaptive mesh refinement, dynamic/deforming mesh, etc.), but the nature of the problem might be steady, so he might not want to be bothered by the time derivatives and is only interested in the steady state. So running pimpleFoam with steadyState time discretization becomes very reasonable.

To answer the question: yes, you can theoretically run pimpleFoam with steadyState ddt scheme. It does not throw an error. And if I'm correct, you can get a result with this setting, if the nature of the problem is really steady state.

A note: if I'm correct, steadyState ddt scheme simply sets ddt terms to zero. Even if you run pimpleFoam with, say, Euler ddt, if the simulation reaches steady state, ddt terms actually go to zero, and you get a "converged" message which ends the simulation. So, steadyState ddt scheme should theoretically get you the same effect, with only difference being the fact that the time derivatives are forced to be zero, and the intermediate solutions you get will not be physical: only the "converged" (i.e. steady state) solution will be.
dlahaye and Sakun like this.
hconel is offline   Reply With Quote

Old   February 5, 2025, 04:00
Default
  #9
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 844
Blog Entries: 1
Rep Power: 19
dlahaye is on a distinguished road
I do agree with hconel's comments.

A better understanding of why and how exactly pimpleFoam fails with ddtSchemes set to steadyState would be very valuable to have.

As hconel does point out, a steady state approximation to a transient problem would be very valuable to have. We ran into precisely this problem in reactive flow problems.
dlahaye is offline   Reply With Quote

Old   February 5, 2025, 05:27
Default
  #10
Member
 
Hüseyin Can Önel
Join Date: Sep 2018
Location: Ankara, Turkey
Posts: 63
Rep Power: 8
hconel is on a distinguished road
Quote:
Originally Posted by dlahaye View Post
I do agree with hconel's comments.

A better understanding of why and how exactly pimpleFoam fails with ddtSchemes set to steadyState would be very valuable to have.

As hconel does point out, a steady state approximation to a transient problem would be very valuable to have. We ran into precisely this problem in reactive flow problems.
Indeed, this is a valuable discussion.
OP already states that he is able to successfully get some sensible results with steadyState pimpleFoam using a large number of outerCorrections. So basically, the whole simpleFoam iterations are squeezed into a single pimple outer loop.
Now, the question that pops up in my mind is: what about if the simulation is turbulent? Because AFAIK the pimple loop performs a turbulence calculation (e.g. k, epsilon, omega, nuTilda) at the end of an outer loop. So it would be a valuable information if someone performs a simple turbulent flow simulation using these settings and compare the results to a simpleFoam solution.
dlahaye likes this.
hconel is offline   Reply With Quote

Old   February 5, 2025, 05:53
Default
  #11
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 844
Blog Entries: 1
Rep Power: 19
dlahaye is on a distinguished road
I suggest to define a test case.

Below is pimpleFoam with ddtSchemes set to steadyState applied to out-of-box simpleFoam (yes, steady state simpleFoam) Pitz-Dally test case.

Q1: do you see the same?

Q2: can we explain why in the first (number 1) PIMPLE iteration the solver for the velocity reaches 1000 (thousand) (bound set in fvSolutions solvers.U dictionary) iterations, clearly indicating something off?

Quote:
PIMPLE: Operating solver in PISO mode

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RAS
Selecting RAS turbulence model kEpsilon
RAS
{
RASModel kEpsilon;
turbulence on;
printCoeffs on;
Cmu 0.09;
C1 1.44;
C2 1.92;
C3 0;
sigmak 1;
sigmaEps 1.3;
}

No MRF models present

No finite volume options present
Courant Number mean: 0.000874894 max: 0.315889

Starting time loop

Courant Number mean: 0.000874894 max: 0.315889
deltaT = 0.000120048
Time = 0.000120048

PIMPLE: iteration 1
smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 0.00580074, No Iterations 1000
smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 0.000239223, No Iterations 1000
GAMG: Solving for p, Initial residual = 1, Final residual = 0.00693832, No Iterations 7
time step continuity errors : sum local = 0.000282295, global = -4.80354e-05, cumulative = -4.80354e-05
GAMG: Solving for p, Initial residual = 0.196569, Final residual = 6.51866e-08, No Iterations 27
time step continuity errors : sum local = 1.33977e-08, global = 1.78003e-09, cumulative = -4.80337e-05
smoothSolver: Solving for epsilon, Initial residual = 0.510746, Final residual = 9.44158e-06, No Iterations 110
smoothSolver: Solving for k, Initial residual = 1, Final residual = 7.54983e-06, No Iterations 18
ExecutionTime = 7.36 s ClockTime = 8 s

Courant Number mean: 0.562604 max: 10.2245
deltaT = 0.000117368
Time = 0.000237416
dlahaye is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Domain Reference Pressure and mass flow inlet boundary AdidaKK CFX 75 August 20, 2018 05:37
Convergence in steady state simulations vs transient ones cardioCFD CFX 5 January 21, 2018 10:59
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56
steady state, laminar vof_model Garima Chaudhary FLUENT 0 May 24, 2007 03:11
About the difference between steady and unsteady problems Lisa Main CFD Forum 11 July 5, 2000 14:37


All times are GMT -4. The time now is 10:06.