From 8cad93c7248746602c620f8323e4c6e52f97cc24 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sat, 27 Jun 2015 16:26:51 +0100 Subject: [PATCH] rhoPimpleFoam: Added "consistent" option to replace rhoPimplecFoam e.g. in tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS PIMPLE { momentumPredictor yes; transonic no; nOuterCorrectors 50; nCorrectors 1; nNonOrthogonalCorrectors 0; consistent yes; rhoMin 0.5; rhoMax 2.0; residualControl { "(U|k|epsilon)" { relTol 0; tolerance 0.0001; } } turbOnFinalIterOnly off; } relaxationFactors { fields { "p.*" 0.9; "rho.*" 1; } equations { "U.*" 0.9; "h.*" 0.7; "(k|epsilon|omega).*" 0.8; } } --- .../{rhoPimplecFoam/pEqn.H => pcEqn.H} | 0 .../rhoPimpleFoam/rhoPimpleFoam.C | 9 +- .../rhoPimpleFoam/rhoPimplecFoam/Make/files | 3 - .../rhoPimpleFoam/rhoPimplecFoam/Make/options | 22 --- .../rhoPimplecFoam/rhoPimplecFoam.C | 108 ------------- .../ras/angledDuctLTS}/0/T | 0 .../ras/angledDuctLTS}/0/U | 0 .../ras/angledDuctLTS}/0/alphat | 0 .../ras/angledDuctLTS}/0/epsilon | 0 .../ras/angledDuctLTS}/0/k | 0 .../ras/angledDuctLTS}/0/nut | 0 .../ras/angledDuctLTS}/0/p | 0 .../ras/angledDuctLTS}/Allrun | 0 .../ras/angledDuctLTS}/constant/fvOptions | 0 .../angledDuctLTS/constant/polyMesh/boundary | 62 ++++++++ .../constant/thermophysicalProperties | 0 .../constant/turbulenceProperties | 0 .../ras/angledDuctLTS/system/blockMeshDict | 147 ++++++++++++++++++ .../angledDuctLTS}/system/blockMeshDict.m4 | 0 .../ras/angledDuctLTS}/system/controlDict | 2 +- .../ras/angledDuctLTS}/system/fvSchemes | 0 .../ras/angledDuctLTS}/system/fvSolution | 17 +- 22 files changed, 228 insertions(+), 142 deletions(-) rename applications/solvers/compressible/rhoPimpleFoam/{rhoPimplecFoam/pEqn.H => pcEqn.H} (100%) delete mode 100644 applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/Make/files delete mode 100644 applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/Make/options delete mode 100644 applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/rhoPimplecFoam.C rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/0/T (100%) rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/0/U (100%) rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/0/alphat (100%) rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/0/epsilon (100%) rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/0/k (100%) rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/0/nut (100%) rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/0/p (100%) rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/Allrun (100%) rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/constant/fvOptions (100%) create mode 100644 tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/constant/polyMesh/boundary rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/constant/thermophysicalProperties (100%) rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/constant/turbulenceProperties (100%) create mode 100644 tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/blockMeshDict rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/system/blockMeshDict.m4 (100%) rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/system/controlDict (97%) rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/system/fvSchemes (100%) rename tutorials/compressible/{rhoPimplecFoam/angledDuct => rhoPimpleFoam/ras/angledDuctLTS}/system/fvSolution (87%) diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H similarity index 100% rename from applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H rename to applications/solvers/compressible/rhoPimpleFoam/pcEqn.H diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C index 170a7eaa6f..b9f20d3835 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C @@ -83,7 +83,14 @@ int main(int argc, char *argv[]) // --- Pressure corrector loop while (pimple.correct()) { - #include "pEqn.H" + if (pimple.consistent()) + { + #include "pcEqn.H" + } + else + { + #include "pEqn.H" + } } if (pimple.turbCorr()) diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/Make/files b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/Make/files deleted file mode 100644 index 5bb1f8d023..0000000000 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -rhoPimplecFoam.C - -EXE = $(FOAM_APPBIN)/rhoPimplecFoam diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/Make/options b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/Make/options deleted file mode 100644 index 47357b963c..0000000000 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/Make/options +++ /dev/null @@ -1,22 +0,0 @@ -EXE_INC = \ - -I.. \ - -I$(LIB_SRC)/transportModels/compressible/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ - -I$(LIB_SRC)/finiteVolume/cfdTools \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ - -I$(LIB_SRC)/fvOptions/lnInclude - -EXE_LIBS = \ - -lcompressibleTransportModels \ - -lfluidThermophysicalModels \ - -lspecie \ - -lturbulenceModels \ - -lcompressibleTurbulenceModels \ - -lfiniteVolume \ - -lmeshTools \ - -lsampling \ - -lfvOptions diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/rhoPimplecFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/rhoPimplecFoam.C deleted file mode 100644 index 8f6a1deb60..0000000000 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/rhoPimplecFoam.C +++ /dev/null @@ -1,108 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Application - rhoPimplecFoam - -Description - Transient solver for laminar or turbulent flow of compressible fluids - for HVAC and similar applications. - - Uses the flexible PIMPLEC (PISOC-SIMPLEC) solution for time-resolved and - pseudo-transient simulations. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "psiThermo.H" -#include "turbulentFluidThermoModel.H" -#include "bound.H" -#include "pimpleControl.H" -#include "fvIOoptionList.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "setRootCase.H" - #include "createTime.H" - #include "createMesh.H" - - pimpleControl pimple(mesh); - - #include "createFields.H" - #include "createMRF.H" - #include "createFvOptions.H" - #include "initContinuityErrs.H" - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.run()) - { - #include "readTimeControls.H" - #include "compressibleCourantNo.H" - #include "setDeltaT.H" - - runTime++; - - Info<< "Time = " << runTime.timeName() << nl << endl; - - if (pimple.nCorrPIMPLE() <= 1) - { - #include "rhoEqn.H" - } - - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { - #include "UEqn.H" - #include "EEqn.H" - - // --- Pressure corrector loop - while (pimple.correct()) - { - #include "pEqn.H" - } - - if (pimple.turbCorr()) - { - turbulence->correct(); - } - } - - runTime.write(); - - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/T b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/T similarity index 100% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/0/T rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/T diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/U b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/U similarity index 100% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/0/U rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/U diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/alphat b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/alphat similarity index 100% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/0/alphat rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/alphat diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/epsilon b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/epsilon similarity index 100% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/0/epsilon rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/epsilon diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/k b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/k similarity index 100% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/0/k rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/k diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/nut b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/nut similarity index 100% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/0/nut rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/nut diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/p b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/p similarity index 100% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/0/p rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/0/p diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/Allrun b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/Allrun similarity index 100% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/Allrun rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/Allrun diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/fvOptions b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/constant/fvOptions similarity index 100% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/constant/fvOptions rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/constant/fvOptions diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/constant/polyMesh/boundary b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/constant/polyMesh/boundary new file mode 100644 index 0000000000..7a2d7d0e5e --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/constant/polyMesh/boundary @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +6 +( + front + { + type wall; + inGroups 1(wall); + nFaces 700; + startFace 63400; + } + back + { + type wall; + inGroups 1(wall); + nFaces 700; + startFace 64100; + } + walls + { + type wall; + inGroups 1(wall); + nFaces 1400; + startFace 64800; + } + porosityWall + { + type wall; + inGroups 1(wall); + nFaces 1600; + startFace 66200; + } + inlet + { + type patch; + nFaces 400; + startFace 67800; + } + outlet + { + type patch; + nFaces 400; + startFace 68200; + } +) + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/thermophysicalProperties b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/constant/thermophysicalProperties similarity index 100% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/constant/thermophysicalProperties rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/constant/thermophysicalProperties diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/turbulenceProperties b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/constant/turbulenceProperties similarity index 100% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/constant/turbulenceProperties rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/constant/turbulenceProperties diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/blockMeshDict new file mode 100644 index 0000000000..085d4d5f1a --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/blockMeshDict @@ -0,0 +1,147 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// block definition for a porosity with an angled inlet/outlet +// the porosity is not aligned with the main axes +// + +convertToMeters 0.001; + +vertices +( + // inlet region + ( -150 0 -25 ) // pt 0 (in1b) + ( -150 35.35533906 -25 ) // pt 1 (in2b) + ( -150 0 25 ) // pt 2 (in1f) + ( -150 35.35533906 25 ) // pt 3 (in2f) + + // join inlet->outlet + ( 0 0 -25 ) // pt 4 (join1b) + ( -35.35533906 35.35533906 -25 ) // pt 5 (join2b) + ( 0 0 25 ) // pt 6 (join1f) + ( -35.35533906 35.35533906 25 ) // pt 7 (join2f) + + // porosity ends ->outlet + ( 70.71067812 70.71067812 -25 ) // pt 8 (poro1b) + ( 35.35533906 106.06601718 -25 ) // pt 9 (poro2b) + ( 70.71067812 70.71067812 25 ) // pt 10 (poro1f) + ( 35.35533906 106.06601718 25 ) // pt 11 (poro2f) + + // outlet + ( 141.42135624 141.42135624 -25 ) // pt 12 (out1b) + ( 106.06601718 176.7766953 -25 ) // pt 13 (out2b) + ( 141.42135624 141.42135624 25 ) // pt 14 (out1f) + ( 106.06601718 176.7766953 25 ) // pt 15 (out2f) +); + +blocks +( + // inlet block + hex (0 4 5 1 2 6 7 3) + inlet ( 15 20 20 ) simpleGrading (1 1 1) + + // porosity block + hex (4 8 9 5 6 10 11 7) + porosity ( 20 20 20 ) simpleGrading (1 1 1) + + // outlet block + hex (8 12 13 9 10 14 15 11) + outlet ( 20 20 20 ) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + // is there no way of defining all my 'defaultFaces' to be 'wall'? + front + { + type wall; + faces + ( + // inlet block + (2 6 7 3) + // outlet block + (10 14 15 11) + ); + } + + back + { + type wall; + faces + ( + // inlet block + (1 5 4 0) + // outlet block + (9 13 12 8) + ); + } + + walls + { + type wall; + faces + ( + // inlet block + (2 0 4 6) + (7 5 1 3) + // outlet block + (10 8 12 14) + (15 13 9 11) + ); + } + + porosityWall + { + type wall; + faces + ( + // porosity block + (6 10 11 7) + // porosity block + (5 9 8 4) + // porosity block + (6 4 8 10) + (11 9 5 7) + ); + } + + inlet + { + type patch; + faces + ( + (3 1 0 2) + ); + } + + outlet + { + type patch; + faces + ( + (15 13 12 14) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/blockMeshDict.m4 b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/blockMeshDict.m4 similarity index 100% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/system/blockMeshDict.m4 rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/blockMeshDict.m4 diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/controlDict b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/controlDict similarity index 97% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/system/controlDict rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/controlDict index bbcbeb2543..124eddf8db 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/controlDict +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application rhoPimplecFoam; +application rhoPimpleFoam; startFrom startTime; diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/fvSchemes similarity index 100% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSchemes rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/fvSchemes diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSolution b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/fvSolution similarity index 87% rename from tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSolution rename to tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/fvSolution index 34ece62e64..879c2a07f9 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSolution +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuctLTS/system/fvSolution @@ -46,16 +46,17 @@ solvers tolerance 1e-06; relTol 0; } - } PIMPLE { - momentumPredictor yes; - transonic no; - nOuterCorrectors 50; - nCorrectors 1; + momentumPredictor yes; + transonic no; + nOuterCorrectors 50; + nCorrectors 1; nNonOrthogonalCorrectors 0; + consistent yes; + rhoMin 0.5; rhoMax 2.0; @@ -75,12 +76,14 @@ relaxationFactors { fields { - "p.*" 0.3; + "p.*" 0.9; "rho.*" 1; } equations { - "(U|h|k|epsilon|omega).*" 0.7; + "U.*" 0.9; + "h.*" 0.7; + "(k|epsilon|omega).*" 0.8; } }