diff --git a/applications/solvers/compressible/rhoPimpleFoam/Allwmake b/applications/solvers/compressible/rhoPimpleFoam/Allwmake index 29bc918085481fa710a95e1f48eeb37f74e16c55..e47a184d7a10af357a2c9079c5c308107361774b 100755 --- a/applications/solvers/compressible/rhoPimpleFoam/Allwmake +++ b/applications/solvers/compressible/rhoPimpleFoam/Allwmake @@ -3,6 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory set -x wmake +wmake rhoLTSPimpleFoam wmake rhoPorousMRFPimpleFoam # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/files b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..ff61e6022f6a5fae2729c5bd287c2ddacd2390b1 --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/files @@ -0,0 +1,3 @@ +rhoLTSPimpleFoam.C + +EXE = $(FOAM_APPBIN)/rhoLTSPimpleFoam diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/options b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..d16a0ee1d88a2d9a037f976e6f5b9bc7c7074261 --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/options @@ -0,0 +1,15 @@ +EXE_INC = \ + -I.. \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ + -I$(LIB_SRC)/finiteVolume/cfdTools \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lbasicThermophysicalModels \ + -lspecie \ + -lcompressibleTurbulenceModel \ + -lcompressibleRASModels \ + -lcompressibleLESModels \ + -lfiniteVolume \ + -lmeshTools diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/rhoLTSPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/rhoLTSPimpleFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..20870bc650a0b41906a4bc6033306e763c6798c7 --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/rhoLTSPimpleFoam.C @@ -0,0 +1,117 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. + \\/ 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 <http://www.gnu.org/licenses/>. + +Application + rhoLTSPimpleFoam + +Description + Transient solver for laminar or turbulent flow of compressible fluids + for HVAC and similar applications. + + Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and + pseudo-transient simulations with support for local time-stepping for + efficient steady-state solution. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "basicPsiThermo.H" +#include "turbulenceModel.H" +#include "fvcSmooth.H" +#include "bound.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readPIMPLEControls.H" + #include "setInitialrDeltaT.H" + #include "createFields.H" + #include "initContinuityErrs.H" + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readTimeControls.H" + #include "readPIMPLEControls.H" + #include "compressibleCourantNo.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + #include "setrDeltaT.H" + + #include "rhoEqn.H" + + // --- Pressure-velocity PIMPLE corrector loop + for (int oCorr=0; oCorr<nOuterCorr; oCorr++) + { + bool finalIter = oCorr == nOuterCorr-1; + if (finalIter) + { + mesh.data::add("finalIteration", true); + } + + if (nOuterCorr != 1) + { + p.storePrevIter(); + rho.storePrevIter(); + } + + #include "UEqn.H" + #include "hEqn.H" + + // --- PISO loop + for (int corr=0; corr<nCorr; corr++) + { + #include "pEqn.H" + } + + turbulence->correct(); + + if (finalIter) + { + mesh.data::remove("finalIteration"); + } + } + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setInitialrDeltaT.H b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setInitialrDeltaT.H new file mode 100644 index 0000000000000000000000000000000000000000..6a397be9c299bf5d8803e914319c6e65f5fb85e0 --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setInitialrDeltaT.H @@ -0,0 +1,19 @@ +scalar maxDeltaT +( + pimple.lookupOrDefault<scalar>("maxDeltaT", GREAT) +); + +volScalarField rDeltaT +( + IOobject + ( + "rDeltaT", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + 1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT), + zeroGradientFvPatchScalarField::typeName +); diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setrDeltaT.H b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setrDeltaT.H new file mode 100644 index 0000000000000000000000000000000000000000..42fbe7e76b161cb1fe55fad00166dfe89dca0119 --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setrDeltaT.H @@ -0,0 +1,79 @@ +{ + scalar maxCo + ( + pimple.lookupOrDefault<scalar>("maxCo", 0.8) + ); + + scalar rDeltaTSmoothingCoeff + ( + pimple.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.02) + ); + + scalar rDeltaTDampingCoeff + ( + pimple.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1.0) + ); + + scalar maxDeltaT + ( + pimple.lookupOrDefault<scalar>("maxDeltaT", GREAT) + ); + + volScalarField rDeltaT0 = rDeltaT; + + // Set the reciprocal time-step from the local Courant number + rDeltaT.dimensionedInternalField() = max + ( + 1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT), + fvc::surfaceSum(mag(phi))().dimensionedInternalField() + /((2*maxCo)*mesh.V()*rho.dimensionedInternalField()) + ); + + if (transonic) + { + surfaceScalarField phid + ( + "phid", + fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf()) + ); + + rDeltaT.dimensionedInternalField() = max + ( + rDeltaT.dimensionedInternalField(), + fvc::surfaceSum(mag(phid))().dimensionedInternalField() + /((2*maxCo)*mesh.V()*psi.dimensionedInternalField()) + ); + } + + // Update tho boundary values of the reciprocal time-step + rDeltaT.correctBoundaryConditions(); + + Info<< "Flow time scale min/max = " + << gMin(1/rDeltaT.internalField()) + << ", " << gMax(1/rDeltaT.internalField()) << endl; + + if (rDeltaTSmoothingCoeff < 1.0) + { + fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff); + } + + Info<< "Smoothed flow time scale min/max = " + << gMin(1/rDeltaT.internalField()) + << ", " << gMax(1/rDeltaT.internalField()) << endl; + + // Limit rate of change of time scale + // - reduce as much as required + // - only increase at a fraction of old time scale + if + ( + rDeltaTDampingCoeff < 1.0 + && runTime.timeIndex() > runTime.startTimeIndex() + 1 + ) + { + rDeltaT = rDeltaT0*max(rDeltaT/rDeltaT0, 1.0 - rDeltaTDampingCoeff); + + Info<< "Damped flow time scale min/max = " + << gMin(1/rDeltaT.internalField()) + << ", " << gMax(1/rDeltaT.internalField()) << endl; + } +} diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/T b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/T new file mode 100644 index 0000000000000000000000000000000000000000..04da8a4eb235c8b03820395521779081f72eeb27 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/T @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 293; + +boundaryField +{ + + front + { + type zeroGradient; + } + back + { + type zeroGradient; + } + wall + { + type zeroGradient; + } + porosityWall + { + type zeroGradient; + } + + inlet + { + type fixedValue; + value $internalField; + } + outlet + { + type inletOutlet; + value $internalField; + inletValue $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U new file mode 100644 index 0000000000000000000000000000000000000000..a6d6006af995695ffd4e84811ed950278f2e4e1c --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + front + { + type fixedValue; + value uniform (0 0 0); + } + back + { + type fixedValue; + value uniform (0 0 0); + } + wall + { + type fixedValue; + value uniform (0 0 0); + } + porosityWall + { + type slip; + value uniform (0 0 0); + } + inlet + { + type flowRateInletVelocity; + flowRate 0.1; + value uniform (0 0 0); + } + outlet + { + type fluxCorrectedVelocity; //inletOutlet; + value uniform (0 0 0); + inletValue uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/alphat b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/alphat new file mode 100644 index 0000000000000000000000000000000000000000..440c84f8ffd0594518db025143e06bb17be6d34f --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/alphat @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + front + { + type alphatWallFunction; + value uniform 0; + } + back + { + type alphatWallFunction; + value uniform 0; + } + wall + { + type alphatWallFunction; + value uniform 0; + } + porosityWall + { + type alphatWallFunction; + value uniform 0; + } + inlet + { + type calculated; + value uniform 0; + } + outlet + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/epsilon b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/epsilon new file mode 100644 index 0000000000000000000000000000000000000000..d81f1db665f9fe345e6698dc74c3107b78fe9029 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/epsilon @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 200; + +boundaryField +{ + front + { + type compressible::epsilonWallFunction; + value uniform 200; + } + back + { + type compressible::epsilonWallFunction; + value uniform 200; + } + wall + { + type compressible::epsilonWallFunction; + value uniform 200; + } + porosityWall + { + type compressible::epsilonWallFunction; + value uniform 200; + } + inlet + { + type compressible::turbulentMixingLengthDissipationRateInlet; + mixingLength 0.005; + value uniform 200; + } + outlet + { + type inletOutlet; + inletValue uniform 200; + value uniform 200; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/k b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/k new file mode 100644 index 0000000000000000000000000000000000000000..1d958cfff977a6e21ea087bcec4441c11b61fa3e --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/k @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 1; + +boundaryField +{ + front + { + type compressible::kqRWallFunction; + value uniform 1; + } + back + { + type compressible::kqRWallFunction; + value uniform 1; + } + wall + { + type compressible::kqRWallFunction; + value uniform 1; + } + porosityWall + { + type compressible::kqRWallFunction; + value uniform 1; + } + inlet + { + type turbulentIntensityKineticEnergyInlet; + intensity 0.05; + value uniform 1; + } + outlet + { + type inletOutlet; + inletValue uniform 1; + value uniform 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/mut b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/mut new file mode 100644 index 0000000000000000000000000000000000000000..0e11f50c543b6b9fed18e7f6afce14b1dfde5b3a --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/mut @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object mut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + front + { + type mutkWallFunction; + value uniform 0; + } + back + { + type mutkWallFunction; + value uniform 0; + } + wall + { + type mutkWallFunction; + value uniform 0; + } + porosityWall + { + type mutkWallFunction; + value uniform 0; + } + inlet + { + type calculated; + value uniform 0; + } + outlet + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/p b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/p new file mode 100644 index 0000000000000000000000000000000000000000..2e94ff795e0789405d87da2dc1c73d8d49fd88be --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/p @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1.0e5; + +boundaryField +{ + front + { + type zeroGradient; + } + back + { + type zeroGradient; + } + wall + { + type zeroGradient; + } + porosityWall + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + outlet + { + type fixedValue; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/Allrun b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..d72de07446f00476a4cecc6dba8604076989857e --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/Allrun @@ -0,0 +1,9 @@ +cd ${0%/*} || exit 1 # run from this directory + +m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh +runApplication `getApplication` diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/RASProperties b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/RASProperties new file mode 100644 index 0000000000000000000000000000000000000000..67d4d8212cef0a0fb77f4e4205b3237e3e9bbacb --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/RASProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kEpsilon; + +turbulence on; + +printCoeffs on; + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 new file mode 100644 index 0000000000000000000000000000000000000000..fb67da75dadc3bff07ef6a1043acfd66b2c49011 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 @@ -0,0 +1,165 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ 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 +// +dnl> ----------------------------------------------------------------- +dnl> <STANDARD DEFINTIONS> +dnl> +changecom(//)changequote([,]) dnl> +define(calc, [esyscmd(perl -e 'print ($1)')]) dnl> +define(VCOUNT, 0) dnl> +define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) dnl> +dnl> +define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl> +define(quad2D, ($1f $1b $2b $2f)) dnl> +define(frontQuad, ($1f $2f $3f $4f)) dnl> +define(backQuad, ($4b $3b $2b $1b)) dnl> +dnl> +dnl> </STANDARD DEFINTIONS> +dnl> ----------------------------------------------------------------- +dnl> +define(ncells, 20) dnl> +define(ninlet, 15) dnl> +define(nporo, 20) dnl> +define(noutlet, 20) dnl> +dnl> +define(x0,0) dnl> +define(y0,0) dnl> +define(y0,0) dnl> +define(Cos,0.7071067812) dnl> == cos(45) +define(Sin,0.7071067812) dnl> == sin(45) +dnl> +define(width,50) dnl> +define(zBack,calc(-width/2)) dnl> +define(zFront,calc(width/2)) dnl> +define(leninlet,150)dnl> +define(lenporo,100)dnl> +define(lenoutlet,100)dnl> +dnl> +define(xhyp,calc(Sin*width)) dnl> +define(yhyp,calc(Cos*width)) dnl> +define(xinlet,leninlet)dnl> +define(xporo,calc(Cos*lenporo)) dnl> +define(yporo,calc(Sin*lenporo)) dnl> +define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl> +define(youtlet,calc(yporo + Sin*lenoutlet)) dnl> +dnl> + +convertToMeters 0.001; + +vertices +( + // inlet region + ( -xinlet y0 zBack ) vlabel(in1b) + ( -xinlet yhyp zBack ) vlabel(in2b) + ( -xinlet y0 zFront ) vlabel(in1f) + ( -xinlet yhyp zFront ) vlabel(in2f) + + // join inlet->outlet + ( x0 y0 zBack ) vlabel(join1b) + ( -xhyp yhyp zBack ) vlabel(join2b) + ( x0 y0 zFront ) vlabel(join1f) + ( -xhyp yhyp zFront ) vlabel(join2f) + + // porosity ends ->outlet + ( xporo yporo zBack ) vlabel(poro1b) + ( calc(xporo - xhyp) calc(yporo + yhyp) zBack ) vlabel(poro2b) + ( xporo yporo zFront ) vlabel(poro1f) + ( calc(xporo - xhyp) calc(yporo + yhyp) zFront ) vlabel(poro2f) + + // outlet + ( xoutlet youtlet zBack ) vlabel(out1b) + ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b) + ( xoutlet youtlet zFront ) vlabel(out1f) + ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f) +); + +blocks +( + // inlet block + hex2D(in1, join1, join2, in2) + inlet ( ninlet ncells ncells ) simpleGrading (1 1 1) + + // porosity block + hex2D(join1, poro1, poro2, join2) + porosity ( nporo ncells ncells ) simpleGrading (1 1 1) + + // outlet block + hex2D(poro1, out1, out2, poro2) + outlet ( noutlet ncells ncells ) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + // is there no way of defining all my 'defaultFaces' to be 'wall'? + wall front + ( + // inlet block + frontQuad(in1, join1, join2, in2) + // outlet block + frontQuad(poro1, out1, out2, poro2) + ) + + wall back + ( + // inlet block + backQuad(in1, join1, join2, in2) + // outlet block + backQuad(poro1, out1, out2, poro2) + ) + + wall wall + ( + // inlet block + quad2D(in1, join1) + quad2D(join2, in2) + // outlet block + quad2D(poro1, out1) + quad2D(out2, poro2) + ) + + wall porosityWall + ( + // porosity block + frontQuad(join1, poro1, poro2, join2) + // porosity block + backQuad(join1, poro1, poro2, join2) + // porosity block + quad2D(join1, poro1) + quad2D(poro2, join2) + ) + + patch inlet + ( + quad2D(in2, in1) + ) + + patch outlet + ( + quad2D(out2, out1) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/boundary b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..dc9ecffb7b801511bd4073b501bb3c346fb6a8aa --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/boundary @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +6 +( + front + { + type wall; + nFaces 700; + startFace 63400; + } + back + { + type wall; + nFaces 700; + startFace 64100; + } + wall + { + type wall; + nFaces 1400; + startFace 64800; + } + porosityWall + { + type wall; + nFaces 1600; + startFace 66200; + } + inlet + { + type patch; + nFaces 400; + startFace 67800; + } + outlet + { + type patch; + nFaces 400; + startFace 68200; + } +) + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/porousZones b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/porousZones new file mode 100644 index 0000000000000000000000000000000000000000..02c2bd82cb64ab5319f1a4817209a4f19030ba3a --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/porousZones @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object porousZones; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +1 +( + porosity + { + coordinateSystem + { + e1 (0.70710678 0.70710678 0); + e2 (0 0 1); + } + + Darcy + { + d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000); + f f [0 -1 0 0 0 0 0] (0 0 0); + } + } +) + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/thermophysicalProperties b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..686497a1c7dd90b9709462e28e8cbff7a23befe1 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/thermophysicalProperties @@ -0,0 +1,31 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>; + +mixture +{ + nMoles 1; + molWeight 28.9; + Cp 1007; + Hf 0; + As 1.4792e-06; + Ts 116; +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/turbulenceProperties b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..3e945495c5107c31176f627d29157d32d6b70eb9 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/controlDict b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..ad6e941334f8abe5567a9d7175881ba4b6f7bcf9 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/controlDict @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application rhoLTSPimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 500; + +deltaT 1; + +writeControl adjustableRunTime; + +writeInterval 50; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSchemes b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..e2381721e84173133c461df5325b1440bc14b1ea --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSchemes @@ -0,0 +1,76 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default localEuler rDeltaT; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; + div(phid,p) Gauss upwind; + div(phiU,p) Gauss linear; + div(phi,h) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(phi,R) Gauss upwind; + div(phi,omega) Gauss upwind; + div((rho*R)) Gauss linear; + div(R) Gauss linear; + div(U) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(muEff,U) Gauss linear corrected; + laplacian(mut,U) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; + laplacian(DomegaEff,omega) Gauss linear corrected; + laplacian((rho*(1|A(U))),p) Gauss linear corrected; + laplacian(alphaEff,h) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSolution b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..7367176b724fb916a5322123dcae91ab1e94bf19 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSolution @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0.1; + } + + pFinal + { + $p; + tolerance 1e-06; + relTol 0.1; + } + + "(rho|U|h|k|epsilon|omega)" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + "(rho|U|h|k|epsilon|omega)Final" + { + $U; + tolerance 1e-05; + relTol 0.1; + } + +} + +PIMPLE +{ + momentumPredictor yes; + nOuterCorrectors 1; + nCorrectors 1; + nNonOrthogonalCorrectors 0; + rhoMin rhoMin [ 1 -3 0 0 0 ] 0.5; + rhoMax rhoMax [ 1 -3 0 0 0 ] 2.0; + + maxCo 0.8; + rDeltaTSmoothingCoeff 0.02; + rDeltaTDampingCoeff 1; + maxDeltaT 1; +} + + +// ************************************************************************* //