diff --git a/applications/solvers/compressible/rhoPimpleFoam/Allwmake b/applications/solvers/compressible/rhoPimpleFoam/Allwmake index 241e22eb1b..f6f8ad3635 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 rhoPimplecFoam wmake rhoPorousMRFPimpleFoam wmake rhoPorousMRFLTSPimpleFoam diff --git a/applications/solvers/compressible/rhoPimpleFoam/UEqn.H b/applications/solvers/compressible/rhoPimpleFoam/UEqn.H index 1e39e983e4..b7b4b04db5 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/UEqn.H @@ -4,13 +4,12 @@ tmp UEqn ( fvm::ddt(rho, U) + fvm::div(phi, U) + - fvm::Sp(fvc::ddt(rho) + fvc::div(phi), U) + turbulence->divDevRhoReff(U) ); UEqn().relax(); -volScalarField rAU(1.0/UEqn().A()); - if (pimple.momentumPredictor()) { solve(UEqn() == -fvc::grad(p)); diff --git a/applications/solvers/compressible/rhoPimpleFoam/hEqn.H b/applications/solvers/compressible/rhoPimpleFoam/hEqn.H index b1d9e4e8b0..57d72887e6 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/hEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/hEqn.H @@ -3,10 +3,14 @@ ( fvm::ddt(rho, h) + fvm::div(phi, h) + - fvm::Sp(fvc::ddt(rho) + fvc::div(phi), h) - fvm::laplacian(turbulence->alphaEff(), h) == dpdt - - (fvc::ddt(rho, K) + fvc::div(phi, K)) + - ( + fvc::ddt(rho, K) + fvc::div(phi, K) + - (fvc::ddt(rho) + fvc::div(phi))*K + ) ); hEqn.relax(); diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index cfe34f2873..3d324e085b 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -3,6 +3,7 @@ rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); +volScalarField rAU(1.0/UEqn().A()); volVectorField HbyA("HbyA", U); HbyA = rAU*UEqn().H(); @@ -23,13 +24,15 @@ if (pimple.transonic()) ) ); + volScalarField Dp("Dp", rho*rAU); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) ); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); @@ -52,6 +55,8 @@ else ) ); + volScalarField Dp("Dp", rho*rAU); + while (pimple.correctNonOrthogonal()) { // Pressure corrector @@ -59,7 +64,7 @@ else ( fvm::ddt(psi, p) + fvc::div(phiHbyA) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) ); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C index 26d11a14aa..28787716e0 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,7 +66,10 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - #include "rhoEqn.H" + if (pimple.nCorrPIMPLE() <= 1) + { + #include "rhoEqn.H" + } // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/Make/files b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/Make/files new file mode 100644 index 0000000000..5bb1f8d023 --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/Make/files @@ -0,0 +1,3 @@ +rhoPimplecFoam.C + +EXE = $(FOAM_APPBIN)/rhoPimplecFoam diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/Make/options b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/Make/options new file mode 100644 index 0000000000..d16a0ee1d8 --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/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/rhoPimplecFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H new file mode 100644 index 0000000000..7ef1b62533 --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H @@ -0,0 +1,117 @@ +rho = thermo.rho(); +rho = max(rho, rhoMin); +rho = min(rho, rhoMax); +rho.relax(); + +volScalarField rAU(1.0/UEqn().A()); +volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1())); + +volVectorField HbyA("HbyA", U); +HbyA = rAU*UEqn().H(); + +if (pimple.nCorrPIMPLE() <= 1) +{ + UEqn.clear(); +} + +if (pimple.transonic()) +{ + surfaceScalarField phid + ( + "phid", + fvc::interpolate(psi) + *( + (fvc::interpolate(HbyA) & mesh.Sf()) + + fvc::ddtPhiCorr(rAU, rho, U, phi) + ) + ); + + surfaceScalarField phic + ( + "phic", + fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf() + ); + + HbyA -= (rAU - rAtU)*fvc::grad(p); + + volScalarField Dp("Dp", rho*rAtU); + + while (pimple.correctNonOrthogonal()) + { + fvScalarMatrix pEqn + ( + fvm::ddt(psi, p) + + fvm::div(phid, p) + + fvc::div(phic) + - fvm::laplacian(Dp, p) + ); + + // Relax the pressure equation to maintain diagonal dominance + pEqn.relax(); + + pEqn.solve(); + + if (pimple.finalNonOrthogonalIter()) + { + phi == phic + pEqn.flux(); + } + } +} +else +{ + surfaceScalarField phiHbyA + ( + "phiHbyA", + fvc::interpolate(rho) + *( + (fvc::interpolate(HbyA) & mesh.Sf()) + + fvc::ddtPhiCorr(rAU, rho, U, phi) + ) + ); + + phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf(); + HbyA -= (rAU - rAtU)*fvc::grad(p); + + volScalarField Dp("Dp", rho*rAtU); + + while (pimple.correctNonOrthogonal()) + { + fvScalarMatrix pEqn + ( + fvm::ddt(psi, p) + + fvc::div(phiHbyA) + - fvm::laplacian(Dp, p) + ); + + pEqn.solve(); + + if (pimple.finalNonOrthogonalIter()) + { + phi = phiHbyA + pEqn.flux(); + } + } +} + +#include "rhoEqn.H" +#include "compressibleContinuityErrs.H" + +// Explicitly relax pressure for momentum corrector +p.relax(); + +U = HbyA - rAtU*fvc::grad(p); +U.correctBoundaryConditions(); +K = 0.5*magSqr(U); + +dpdt = fvc::ddt(p); + +// Recalculate density from the relaxed pressure +rho = thermo.rho(); +rho = max(rho, rhoMin); +rho = min(rho, rhoMax); + +if (!pimple.transonic()) +{ + rho.relax(); +} + +Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/rhoPimplecFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/rhoPimplecFoam.C new file mode 100644 index 0000000000..0b01f51c82 --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/rhoPimplecFoam.C @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 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 "basicPsiThermo.H" +#include "turbulenceModel.H" +#include "bound.H" +#include "pimpleControl.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + + pimpleControl pimple(mesh); + + #include "createFields.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 "hEqn.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/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/rhoPorousMRFLTSPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/rhoPorousMRFLTSPimpleFoam.C index de32f1f5c6..e305916f29 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/rhoPorousMRFLTSPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/rhoPorousMRFLTSPimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,7 +74,10 @@ int main(int argc, char *argv[]) #include "setrDeltaT.H" - #include "rhoEqn.H" + if (pimple.nCorrPIMPLE() <= 1) + { + #include "rhoEqn.H" + } // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/UEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/UEqn.H index c63f0f8e4b..c24b1f587a 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/UEqn.H @@ -13,8 +13,6 @@ UEqn().relax(); mrfZones.addCoriolis(rho, UEqn()); pZones.addResistance(UEqn()); -volScalarField rAU(1.0/UEqn().A()); - if (pimple.momentumPredictor()) { solve(UEqn() == -fvc::grad(p)); diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H index c5c7602a43..3c75e87e64 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H @@ -25,13 +25,15 @@ if (pimple.transonic()) ); mrfZones.relativeFlux(fvc::interpolate(psi), phid); + volScalarField Dp("Dp", rho*rAU); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) ); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); @@ -56,6 +58,8 @@ else mrfZones.relativeFlux(fvc::interpolate(rho), phiHbyA); + volScalarField Dp("Dp", rho*rAU); + while (pimple.correctNonOrthogonal()) { // Pressure corrector @@ -63,7 +67,7 @@ else ( fvm::ddt(psi, p) + fvc::div(phiHbyA) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) ); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C index 068de89952..e02787c35d 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,7 +69,10 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - #include "rhoEqn.H" + if (pimple.nCorrPIMPLE() <= 1) + { + #include "rhoEqn.H" + } // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) diff --git a/applications/solvers/compressible/rhoSimpleFoam/hEqn.H b/applications/solvers/compressible/rhoSimpleFoam/hEqn.H index 879578cf49..92cea341ca 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/hEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/hEqn.H @@ -11,7 +11,6 @@ ); hEqn.relax(); - hEqn.solve(); thermo.correct(); diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/createFields.H b/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/createFields.H deleted file mode 100644 index 46a382864e..0000000000 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/createFields.H +++ /dev/null @@ -1,61 +0,0 @@ - Info<< "Reading thermophysical properties\n" << endl; - - autoPtr pThermo - ( - basicPsiThermo::New(mesh) - ); - basicPsiThermo& thermo = pThermo(); - - volScalarField rho - ( - IOobject - ( - "rho", - runTime.timeName(), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE - ), - thermo.rho() - ); - - volScalarField& p = thermo.p(); - volScalarField& h = thermo.h(); - const volScalarField& psi = thermo.psi(); - - Info<< "Reading field U\n" << endl; - volVectorField U - ( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - #include "compressibleCreatePhi.H" - - label pRefCell = 0; - scalar pRefValue = 0.0; - setRefCell(p, simple.dict(), pRefCell, pRefValue); - - dimensionedScalar rhoMax(simple.dict().lookup("rhoMax")); - dimensionedScalar rhoMin(simple.dict().lookup("rhoMin")); - - Info<< "Creating turbulence model\n" << endl; - autoPtr turbulence - ( - compressible::RASModel::New - ( - rho, - U, - phi, - thermo - ) - ); - - dimensionedScalar initialMass = fvc::domainIntegrate(rho); diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H index 44babc3a6b..8c7405c346 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H @@ -3,11 +3,11 @@ rho = max(rho, rhoMin); rho = min(rho, rhoMax); rho.relax(); -volScalarField AU(UEqn().A()); -volScalarField AtU(AU - UEqn().H1()); +volScalarField rAU(1.0/UEqn().A()); +volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1())); volVectorField HbyA("HbyA", U); -HbyA = UEqn().H()/AU; +HbyA = rAU*UEqn().H(); UEqn.clear(); @@ -15,30 +15,32 @@ bool closedVolume = false; if (simple.transonic()) { + surfaceScalarField phid + ( + "phid", + fvc::interpolate(psi)*(fvc::interpolate(HbyA) & mesh.Sf()) + ); + + surfaceScalarField phic + ( + "phic", + fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf() + ); + + HbyA -= (rAU - rAtU)*fvc::grad(p); + + volScalarField Dp("Dp", rho*rAtU); + while (simple.correctNonOrthogonal()) { - surfaceScalarField phid - ( - "phid", - fvc::interpolate(psi)*(fvc::interpolate(HbyA) & mesh.Sf()) - ); - - surfaceScalarField phic - ( - "phic", - fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf() - ); - - HbyA -= fvc::grad(p)*(1.0/AU - 1.0/AtU); - fvScalarMatrix pEqn ( fvm::div(phid, p) + fvc::div(phic) - - fvm::laplacian(rho/AtU, p) + - fvm::laplacian(Dp, p) ); - // Relax the pressure equation to ensure diagonal-dominance + // Relax the pressure equation to maintain diagonal dominance pEqn.relax(); pEqn.setReference(pRefCell, pRefValue); @@ -53,25 +55,25 @@ if (simple.transonic()) } else { + surfaceScalarField phiHbyA + ( + "phiHbyA", + fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf()) + ); + + closedVolume = adjustPhi(phiHbyA, U, p); + + phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf(); + HbyA -= (rAU - rAtU)*fvc::grad(p); + + volScalarField Dp("Dp", rho*rAtU); + while (simple.correctNonOrthogonal()) { - surfaceScalarField phiHbyA - ( - "phiHbyA", - fvc::interpolate(rho)*fvc::interpolate(HbyA) & mesh.Sf() - ); - - closedVolume = adjustPhi(phiHbyA, U, p); - - phiHbyA += - fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf(); - - HbyA -= fvc::grad(p)*(1.0/AU - 1.0/AtU); - fvScalarMatrix pEqn ( fvc::div(phiHbyA) - - fvm::laplacian(rho/AtU, p) + - fvm::laplacian(Dp, p) ); pEqn.setReference(pRefCell, pRefValue); @@ -85,14 +87,14 @@ else } } -// The incompressibe for of the continuity error check is appropriate for +// The incompressibe form of the continuity error check is appropriate for // steady-state compressible also. #include "incompressible/continuityErrs.H" // Explicitly relax pressure for momentum corrector p.relax(); -U = HbyA - fvc::grad(p)/AtU; +U = HbyA - rAtU*fvc::grad(p); U.correctBoundaryConditions(); // For closed-volume cases adjust the pressure and density levels @@ -103,6 +105,7 @@ if (closedVolume) /fvc::domainIntegrate(psi); } +// Recalculate density from the relaxed pressure rho = thermo.rho(); rho = max(rho, rhoMin); rho = min(rho, rhoMax); diff --git a/applications/solvers/compressible/sonicFoam/pEqn.H b/applications/solvers/compressible/sonicFoam/pEqn.H index 46cc36216c..aeebee2df5 100644 --- a/applications/solvers/compressible/sonicFoam/pEqn.H +++ b/applications/solvers/compressible/sonicFoam/pEqn.H @@ -14,13 +14,16 @@ surfaceScalarField phid ) ); + +volScalarField Dp("Dp", rho*rAU); + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) ); pEqn.solve(); diff --git a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H index cad5bb7217..21dc48614e 100644 --- a/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H +++ b/applications/solvers/compressible/sonicFoam/sonicDyMFoam/pEqn.H @@ -14,13 +14,15 @@ surfaceScalarField phid ) ); +volScalarField Dp("Dp", rho*rAU); + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( fvm::ddt(psi, p) + fvm::div(phid, p) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) ); pEqn.solve(); diff --git a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C b/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C index 6388caea69..19a530a6aa 100644 --- a/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C +++ b/applications/solvers/compressible/sonicFoam/sonicLiquidFoam/sonicLiquidFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,13 +85,14 @@ int main(int argc, char *argv[]) ); phi = (rhoO/psi)*phid; + volScalarField Dp("Dp", rho*rAU); fvScalarMatrix pEqn ( fvm::ddt(psi, p) + fvc::div(phi) + fvm::div(phid, p) - - fvm::laplacian(rho*rAU, p) + - fvm::laplacian(Dp, p) ); pEqn.solve(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C index 638323c47b..0348035314 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C @@ -139,7 +139,7 @@ void Foam::cylindricalInletVelocityFvPatchVectorField::updateCoeffs() (rpm*constant::mathematical::pi/30.0)*(hatAxis) ^ d ); - operator==(tangVel + axis_*axialVelocity + radialVelocity*d); + operator==(tangVel + hatAxis*axialVelocity + radialVelocity*d/mag(d)); fixedValueFvPatchField::updateCoeffs(); } diff --git a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes index 56aebd7a94..de66185079 100644 --- a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes @@ -42,7 +42,7 @@ laplacianSchemes { default none; laplacian(muEff,U) Gauss linear corrected; - laplacian((rho*(1|A(U))),p) Gauss linear corrected; + laplacian(Dp,p) Gauss linear corrected; laplacian(alphaEff,h) Gauss linear corrected; laplacian(DkEff,k) Gauss linear corrected; laplacian(DBEff,B) Gauss linear corrected; diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/U b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/U index 0d8701320a..84b8f75f3c 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/U +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/U @@ -48,7 +48,7 @@ boundaryField } outlet { - type fluxCorrectedVelocity; //inletOutlet; + type pressureInletOutletVelocity; value uniform (0 0 0); inletValue uniform (0 0 0); } diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSchemes index 1772c2a3fd..391c95e6dc 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSchemes @@ -52,7 +52,7 @@ laplacianSchemes 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(Dp,p) Gauss linear corrected; laplacian(alphaEff,h) Gauss linear corrected; } diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSolution b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSolution index 859a3d0464..084c382e84 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSolution +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/system/fvSolution @@ -52,6 +52,7 @@ solvers PIMPLE { momentumPredictor yes; + transonic no; nOuterCorrectors 50; nCorrectors 1; nNonOrthogonalCorrectors 0; @@ -66,6 +67,8 @@ PIMPLE tolerance 0.0001; } } + + turbOnFinalIterOnly off; } relaxationFactors diff --git a/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes index da4ffa1eaa..0fa6ebaf33 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/ras/cavity/system/fvSchemes @@ -52,7 +52,7 @@ laplacianSchemes laplacian(DepsilonEff,epsilon) Gauss linear orthogonal; laplacian(DREff,R) Gauss linear orthogonal; laplacian(DomegaEff,omega) Gauss linear orthogonal; - laplacian((rho*(1|A(U))),p) Gauss linear orthogonal; + laplacian(Dp,p) Gauss linear orthogonal; laplacian(alphaEff,h) Gauss linear orthogonal; } diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/T b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/T new file mode 100644 index 0000000000..561ca236be --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/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.org | +| \\/ 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/rhoPimplecFoam/angledDuct/0/U b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/U new file mode 100644 index 0000000000..84b8f75f3c --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/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.org | +| \\/ 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 constant 0.1; + value uniform (0 0 0); + } + outlet + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + inletValue uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/alphat b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/alphat new file mode 100644 index 0000000000..f609fa6c14 --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/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.org | +| \\/ 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/rhoPimplecFoam/angledDuct/0/epsilon b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/epsilon new file mode 100644 index 0000000000..e4dccfe577 --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/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.org | +| \\/ 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/rhoPimplecFoam/angledDuct/0/k b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/k new file mode 100644 index 0000000000..655a91bb45 --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/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.org | +| \\/ 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/rhoPimplecFoam/angledDuct/0/mut b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/mut new file mode 100644 index 0000000000..0cea2db2d2 --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/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.org | +| \\/ 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/rhoPimplecFoam/angledDuct/0/p b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/p new file mode 100644 index 0000000000..21db04d610 --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/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.org | +| \\/ 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/rhoPimplecFoam/angledDuct/Allrun b/tutorials/compressible/rhoPimplecFoam/angledDuct/Allrun new file mode 100755 index 0000000000..c9fa982557 --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/Allrun @@ -0,0 +1,10 @@ +#!/bin/sh +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/rhoPimplecFoam/angledDuct/constant/RASProperties b/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/RASProperties new file mode 100644 index 0000000000..a4937b503a --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/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.org | +| \\/ 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/rhoPimplecFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 b/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 new file mode 100644 index 0000000000..79da11e10a --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/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.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 +// +dnl> ----------------------------------------------------------------- +dnl> +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> +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/rhoPimplecFoam/angledDuct/constant/polyMesh/boundary b/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/boundary new file mode 100644 index 0000000000..0abd1608ab --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/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.org | +| \\/ 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/rhoPimplecFoam/angledDuct/constant/porousZones b/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/porousZones new file mode 100644 index 0000000000..afeb6461e1 --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/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.org | +| \\/ 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/rhoPimplecFoam/angledDuct/constant/thermophysicalProperties b/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/thermophysicalProperties new file mode 100644 index 0000000000..d6d597d433 --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/thermophysicalProperties @@ -0,0 +1,40 @@ +/*--------------------------------*- 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; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType hPsiThermo>>>>; + +mixture +{ + specie + { + nMoles 1; + molWeight 28.9; + } + thermodynamics + { + Cp 1007; + Hf 0; + } + transport + { + As 1.4792e-06; + Ts 116; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/turbulenceProperties b/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/turbulenceProperties new file mode 100644 index 0000000000..3721a46a2e --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/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.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/controlDict b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/controlDict new file mode 100644 index 0000000000..bbcbeb2543 --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/controlDict @@ -0,0 +1,55 @@ +/*--------------------------------*- 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; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application rhoPimplecFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 10; + +deltaT 1; + +writeControl adjustableRunTime; + +writeInterval 10; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +adjustTimeStep no; + +maxCo 10; + +maxDeltaT 1; + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSchemes b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSchemes new file mode 100644 index 0000000000..391c95e6dc --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/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.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; + div(phid,p) Gauss upwind; + div(phi,K) 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(Dp,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/rhoPimplecFoam/angledDuct/system/fvSolution b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSolution new file mode 100644 index 0000000000..4a126ed8e4 --- /dev/null +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/system/fvSolution @@ -0,0 +1,89 @@ +/*--------------------------------*- 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; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0.01; + } + + pFinal + { + $p; + tolerance 1e-06; + relTol 0; + } + + "(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; + } + +} + +PIMPLE +{ + momentumPredictor yes; + transonic no; + nOuterCorrectors 50; + nCorrectors 1; + nNonOrthogonalCorrectors 0; + rhoMin rhoMin [ 1 -3 0 0 0 ] 0.1; + rhoMax rhoMax [ 1 -3 0 0 0 ] 3.0; + + residualControl + { + "(U|k|epsilon)" + { + relTol 0; + tolerance 0.0001; + } + } + + turbOnFinalIterOnly off; +} + +relaxationFactors +{ + fields + { + "p.*" 1; + "rho.*" 1; + } + equations + { + "(U|h|k|epsilon|omega).*" 0.85; + "p.*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPorousMRFLTSPimpleFoam/angledDuct/system/fvSchemes b/tutorials/compressible/rhoPorousMRFLTSPimpleFoam/angledDuct/system/fvSchemes index 00981f61fc..62fadfb8ca 100644 --- a/tutorials/compressible/rhoPorousMRFLTSPimpleFoam/angledDuct/system/fvSchemes +++ b/tutorials/compressible/rhoPorousMRFLTSPimpleFoam/angledDuct/system/fvSchemes @@ -52,7 +52,7 @@ laplacianSchemes 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(Dp,p) Gauss linear corrected; laplacian(alphaEff,h) Gauss linear corrected; } diff --git a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSchemes b/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSchemes index dbca5c1607..d49880685b 100644 --- a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSchemes +++ b/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/system/fvSchemes @@ -40,7 +40,7 @@ laplacianSchemes { default none; laplacian(muEff,U) Gauss linear corrected; - laplacian((rho*(1|A(U))),p) Gauss linear corrected; + laplacian(Dp,p) Gauss linear corrected; laplacian(alphaEff,h) Gauss linear corrected; laplacian(DkEff,k) Gauss linear corrected; laplacian(DepsilonEff,epsilon) Gauss linear corrected; diff --git a/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctExplicit/system/fvSchemes b/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctExplicit/system/fvSchemes index d237bd7361..711e4e3233 100644 --- a/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctExplicit/system/fvSchemes +++ b/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctExplicit/system/fvSchemes @@ -39,7 +39,6 @@ laplacianSchemes { laplacian(muEff,U) Gauss linear corrected; laplacian(alphaEff,h) Gauss linear corrected; - laplacian((rho|A(U)),p) Gauss linear corrected; laplacian((rho*rAU),p) Gauss linear corrected; laplacian(DepsilonEff,epsilon) Gauss linear corrected; laplacian(DkEff,k) Gauss linear corrected; diff --git a/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctImplicit/constant/polyMesh/boundary b/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctImplicit/constant/polyMesh/boundary index 0abd1608ab..a664893343 100644 --- a/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctImplicit/constant/polyMesh/boundary +++ b/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctImplicit/constant/polyMesh/boundary @@ -8,7 +8,7 @@ FoamFile { version 2.0; - format ascii; + format binary; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; diff --git a/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes b/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes index b4cf8d2e38..51799627c8 100644 --- a/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes +++ b/tutorials/compressible/sonicFoam/laminar/forwardStep/system/fvSchemes @@ -40,7 +40,7 @@ divSchemes laplacianSchemes { default none; - laplacian((rho*(1|A(U))),p) Gauss linear corrected; + laplacian(Dp,p) Gauss linear corrected; laplacian(muEff,U) Gauss linear corrected; laplacian(alphaEff,e) Gauss linear corrected; } diff --git a/tutorials/compressible/sonicFoam/laminar/shockTube/system/fvSchemes b/tutorials/compressible/sonicFoam/laminar/shockTube/system/fvSchemes index 616ee4aa1b..52cd939723 100644 --- a/tutorials/compressible/sonicFoam/laminar/shockTube/system/fvSchemes +++ b/tutorials/compressible/sonicFoam/laminar/shockTube/system/fvSchemes @@ -40,7 +40,7 @@ divSchemes laplacianSchemes { default none; - laplacian((rho*(1|A(U))),p) Gauss linear orthogonal; + laplacian(Dp,p) Gauss linear orthogonal; laplacian(muEff,U) Gauss linear orthogonal; laplacian(alphaEff,e) Gauss linear orthogonal; } diff --git a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSchemes b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSchemes index b12dc45dcf..4f1434c479 100644 --- a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSchemes +++ b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/system/fvSchemes @@ -46,7 +46,7 @@ laplacianSchemes laplacian(DkEff,k) Gauss linear limited 0.5; laplacian(DREff,R) Gauss linear limited 0.5; laplacian(DepsilonEff,epsilon) Gauss linear limited 0.5; - laplacian((rho*(1|A(U))),p) Gauss linear limited 0.5; + laplacian(Dp,p) Gauss linear limited 0.5; laplacian(alphaEff,e) Gauss linear limited 0.5; } diff --git a/tutorials/compressible/sonicFoam/ras/prism/system/fvSchemes b/tutorials/compressible/sonicFoam/ras/prism/system/fvSchemes index e7b5a41a60..6aa61d831a 100644 --- a/tutorials/compressible/sonicFoam/ras/prism/system/fvSchemes +++ b/tutorials/compressible/sonicFoam/ras/prism/system/fvSchemes @@ -46,7 +46,7 @@ laplacianSchemes laplacian(DkEff,k) Gauss linear corrected; laplacian(DREff,R) Gauss linear corrected; laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian((rho*(1|A(U))),p) Gauss linear corrected; + laplacian(Dp,p) Gauss linear corrected; laplacian(alphaEff,e) Gauss linear corrected; } diff --git a/tutorials/compressible/sonicLiquidFoam/decompressionTank/system/fvSchemes b/tutorials/compressible/sonicLiquidFoam/decompressionTank/system/fvSchemes index d7aad508a2..d1a9bb7aa1 100644 --- a/tutorials/compressible/sonicLiquidFoam/decompressionTank/system/fvSchemes +++ b/tutorials/compressible/sonicLiquidFoam/decompressionTank/system/fvSchemes @@ -37,7 +37,7 @@ laplacianSchemes { default none; laplacian(mu,U) Gauss linear corrected; - laplacian((rho*(1|A(U))),p) Gauss linear corrected; + laplacian(Dp,p) Gauss linear corrected; } interpolationSchemes