From 46895490c7d6402c25f9b7da0ddc232ec8290aff Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 18 Feb 2022 10:33:40 +0000 Subject: [PATCH] Compressible solver pEqn.H: Standardised the treatment of density In rhoPimpleFoam, rhoSimpleFoam, buoyantPimpleFoam and buoyantSimpleFoam the density prediction step at the start of pEqn.H is now consistent between these solvers and the other compressible solvers. If the density is relaxed in the corrector it is now also relaxed following the predictor which improves consistency, stability and convergence. --- applications/solvers/compressible/rhoPimpleFoam/pEqn.H | 6 ++++-- applications/solvers/compressible/rhoSimpleFoam/pEqn.H | 7 +++++-- .../solvers/heatTransfer/buoyantPimpleFoam/pEqn.H | 6 ++++-- .../solvers/heatTransfer/buoyantSimpleFoam/pEqn.H | 5 +++++ .../angledDuctExplicitFixedCoeff/system/fvSolution | 4 ++-- .../circuitBoardCooling/system/fvSolution | 9 ++++----- .../buoyantSimpleFoam/iglooWithFridges/system/fvSchemes | 2 +- .../buoyantSimpleFoam/iglooWithFridges/system/fvSolution | 5 +++-- 8 files changed, 28 insertions(+), 16 deletions(-) diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index ae356931b0..6ea8cc76e3 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -1,6 +1,8 @@ -if ((!mesh.steady() && !pimple.simpleRho()) || pimple.consistent()) +rho = thermo.rho(); + +if (!pimple.transonic()) { - rho = thermo.rho(); + rho.relax(); } // Thermodynamic density needs to be updated by psi*d(p) after the diff --git a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H index 3659ac444f..6ea12ab40e 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H @@ -1,8 +1,11 @@ -if (simple.consistent()) +rho = thermo.rho(); + +if (!simple.transonic()) { - rho = thermo.rho(); + rho.relax(); } + const volScalarField rAU("rAU", 1.0/UEqn.A()); const surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H index 871af7fe39..f960c7831e 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H @@ -1,6 +1,8 @@ -if (!mesh.steady() && !pimple.simpleRho()) +rho = thermo.rho(); + +if (!pimple.transonic()) { - rho = thermo.rho(); + rho.relax(); } // Thermodynamic density needs to be updated by psi*d(p) after the diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index 8a37080900..80a9cd8ac6 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -1,5 +1,10 @@ rho = thermo.rho(); +if (!simple.transonic()) +{ + rho.relax(); +} + const volScalarField rAU("rAU", 1.0/UEqn.A()); const surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution index db633aca51..3a52cc71cc 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution @@ -70,13 +70,13 @@ relaxationFactors fields { p 0.3; - rho 0.05; + rho 0.01; } equations { U 0.7; + e 0.7; "(k|epsilon)" 0.7; - e 0.5; } } diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/fvSolution index 004b36ac1f..9a30a32fe1 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/fvSolution +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/fvSolution @@ -18,12 +18,11 @@ solvers { p_rgh { - solver GAMG; - tolerance 1e-7; - relTol 0.01; - - smoother DICGaussSeidel; + solver GAMG; + smoother DICGaussSeidel; + tolerance 1e-7; + relTol 0.01; } "(U|h|k|epsilon|omega)" diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/iglooWithFridges/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/iglooWithFridges/system/fvSchemes index 3a621d6270..fa2f10d0b0 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/iglooWithFridges/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantSimpleFoam/iglooWithFridges/system/fvSchemes @@ -34,7 +34,7 @@ divSchemes div(phi,k) bounded Gauss upwind; div(phi,epsilon) bounded Gauss upwind; - div(phi,Ekp) bounded Gauss linear; + div(phi,Ekp) Gauss linear; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; } diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/iglooWithFridges/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/iglooWithFridges/system/fvSolution index 86a36193b9..3b3483bde9 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/iglooWithFridges/system/fvSolution +++ b/tutorials/heatTransfer/buoyantSimpleFoam/iglooWithFridges/system/fvSolution @@ -18,8 +18,9 @@ solvers { p_rgh { - solver PCG; - preconditioner DIC; + solver GAMG; + smoother DICGaussSeidel; + tolerance 1e-8; relTol 0.01; }