|
[Sponsors] |
![]() |
![]() |
#1 |
Member
Join Date: Mar 2021
Posts: 39
Rep Power: 6 ![]() |
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; } } // ************************************************************************* // 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, 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 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; } } // ************************************************************************* // 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 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. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Klaus
Join Date: Mar 2009
Posts: 293
Rep Power: 23 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#3 | |
Member
Join Date: Feb 2020
Posts: 90
Rep Power: 7 ![]() |
Quote:
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? |
||
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Klaus
Join Date: Mar 2009
Posts: 293
Rep Power: 23 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Member
Join Date: Feb 2020
Posts: 90
Rep Power: 7 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
bercan siyahhan
Join Date: Oct 2009
Posts: 3
Rep Power: 17 ![]() |
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.
|
|
![]() |
![]() |
![]() |
![]() |
#8 |
Member
Hüseyin Can Önel
Join Date: Sep 2018
Location: Ankara, Turkey
Posts: 63
Rep Power: 8 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#9 |
Senior Member
|
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. |
|
![]() |
![]() |
![]() |
![]() |
#10 | |
Member
Hüseyin Can Önel
Join Date: Sep 2018
Location: Ankara, Turkey
Posts: 63
Rep Power: 8 ![]() |
Quote:
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. |
||
![]() |
![]() |
![]() |
![]() |
#11 | |
Senior Member
|
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:
|
||
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |