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 Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By klausb

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: 5
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: 250
Rep Power: 22
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.
klausb is offline   Reply With Quote

Old   May 1, 2021, 14:02
Default
  #3
Member
 
Join Date: Feb 2020
Posts: 90
Rep Power: 6
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: 250
Rep Power: 22
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: 6
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: 15
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: 16
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

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
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 17:14.