Merged vanilla compatibility branch. Author: Henrik Rusche, FSB team. Merge: Henrik Rusche

Conflicts:
	applications/solvers/incompressible/channelFoam/channelFoam.C
	applications/solvers/incompressible/icoFoam/icoFoam.C
	applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C
	applications/solvers/incompressible/pimpleDyMFoam/UEqn.H
	applications/solvers/incompressible/pimpleDyMFoam/pimpleDyMFoam.C
	applications/solvers/incompressible/pimpleFoam/UEqn.H
	applications/solvers/incompressible/pimpleFoam/pEqn.H
	applications/solvers/incompressible/simpleFoam/UEqn.H
	applications/solvers/incompressible/simpleFoam/pEqn.H
	src/foam/fields/GeometricFields/GeometricTensorNFields/GeometricTensorNFields.H
	src/turbulenceModels/compressible/RAS/LRR/LRR.C
	src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C
	src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C
	src/turbulenceModels/incompressible/LES/GenEddyVisc/GenEddyVisc.C
	src/turbulenceModels/incompressible/LES/Smagorinsky2/Smagorinsky2.C
	src/turbulenceModels/incompressible/LES/SpalartAllmaras/SpalartAllmaras.C
	src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C
	src/turbulenceModels/incompressible/LES/laminar/laminar.C
	src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C
	src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C
	src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C
	src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C
	src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C
	src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C
	src/turbulenceModels/incompressible/RAS/coupledKEpsilon/coupledKEpsilon.C
	src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C
	src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C
	src/turbulenceModels/incompressible/RAS/laminar/laminar.C
	src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C
	src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C
	src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C
	tutorials/basic/laplacianFoam/Case1.1_mixingPlane_sector_AB_60deg/system/fvSchemes
	tutorials/compressible/dbnsFoam/forwardStep/system/fvSchemes
	tutorials/compressible/dbnsFoam/shockTube/system/fvSchemes
	tutorials/compressible/dbnsTurbFoam/naca0012/system/fvSchemes
	tutorials/compressible/rhoPimpleFoam/angledDuct/system/fvSchemes
	tutorials/immersedBoundary/backwardStepShortTurbulentSimpleIbFoam/system/fvSchemes
	tutorials/immersedBoundary/pitzDailyBodyFitted/system/fvSchemes
	tutorials/immersedBoundary/pitzDailyLaminarSimpleIbFoam/system/fvSchemes
	tutorials/immersedBoundary/pitzDailyTurbulentSimpleIbFoam/system/fvSchemes
	tutorials/immersedBoundary/porousBumpChannelBodyFitted/system/fvSchemes
	tutorials/immersedBoundary/porousBumpChannelIb/system/fvSchemes
	tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/system/fvSchemes
	tutorials/incompressible/boundaryFoam/boundaryLaunderSharma/system/fvSchemes
	tutorials/incompressible/boundaryFoam/boundaryTwoWallsFlowSolution/system/fvSchemes
	tutorials/incompressible/boundaryFoam/boundaryWallFunctions/system/fvSchemes
	tutorials/incompressible/channelFoam/channel395/system/fvSchemes
	tutorials/incompressible/icoFoam/elbow/constant/polyMesh/boundary
	tutorials/incompressible/pimpleDyMFoam/axialTurbine/system/fvSchemes
	tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSchemes
	tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSolution
	tutorials/incompressible/pimpleDyMFoam/movingCylinders/system/fvSchemes
	tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/constant/polyMesh/boundary
	tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/fvSchemes
	tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/constant/polyMesh/boundary
	tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/system/fvSchemes
	tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/constant/polyMesh/boundary
	tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/fvSchemes
	tutorials/incompressible/pimpleFoam/t-junction/system/fvSchemes
	tutorials/incompressible/pisoFoam/les/pitzDaily/system/fvSchemes
	tutorials/incompressible/pisoFoam/les/pitzDailyDirectMapped/system/fvSchemes
	tutorials/incompressible/pisoFoam/ras/cavity/system/fvSchemes
	tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSchemes
	tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSchemes
	tutorials/incompressible/porousSimpleFoam/beaverJoseph/system/fvSchemes
	tutorials/incompressible/porousSimpleFoam/porousPlug/system/fvSchemes
	tutorials/incompressible/simpleFoam/mixingPlaneAxial/system/fvSchemes
	tutorials/incompressible/simpleFoam/mixingPlaneDomADomB/system/fvSchemes
	tutorials/incompressible/simpleFoam/motorBike/system/fvSchemes
	tutorials/incompressible/simpleFoam/pitzDaily/system/fvSchemes
	tutorials/incompressible/simpleFoam/pitzDaily3Blocks/system/fvSchemes
	tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/fvSchemes
	tutorials/incompressible/simpleSRFFoam/mixer/system/fvSchemes

Fixing compilation of DBNS
This commit is contained in:
Henrik Rusche 2016-05-24 15:47:39 +02:00
commit ec515b441f
431 changed files with 5266 additions and 2984 deletions

View file

@ -30,7 +30,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -41,6 +41,9 @@ int main(int argc, char *argv[])
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
simpleControl simple(mesh);
# include "createFields.H" # include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -51,9 +54,7 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readSIMPLEControls.H" while (simple.correctNonOrthogonal())
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
solve solve
( (

View file

@ -34,6 +34,8 @@
fvc::makeAbsolute(phi, U); fvc::makeAbsolute(phi, U);
} }
mesh.schemesDict().setFluxRequired(pcorr.name());
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pcorrEqn fvScalarMatrix pcorrEqn

View file

@ -48,3 +48,4 @@
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -34,6 +34,7 @@ Author
#include "fvCFD.H" #include "fvCFD.H"
#include "dynamicFvMesh.H" #include "dynamicFvMesh.H"
#include "pisoControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,6 +46,9 @@ int main(int argc, char *argv[])
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
# include "createDynamicFvMesh.H" # include "createDynamicFvMesh.H"
pisoControl piso(mesh);
# include "createFields.H" # include "createFields.H"
# include "initTotalVolume.H" # include "initTotalVolume.H"
@ -54,7 +58,6 @@ int main(int argc, char *argv[])
while (runTime.loop()) while (runTime.loop())
{ {
# include "readPISOControls.H"
# include "checkTotalVolume.H" # include "checkTotalVolume.H"
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
@ -75,7 +78,7 @@ int main(int argc, char *argv[])
// Solve potential flow equations // Solve potential flow equations
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++) while (piso.correctNonOrthogonal())
{ {
p.storePrevIter(); p.storePrevIter();
@ -98,7 +101,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (piso.finalNonOrthogonalIter())
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }

View file

@ -50,3 +50,4 @@
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -31,6 +31,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,8 +44,10 @@ int main(int argc, char *argv[])
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
simpleControl simple(mesh);
# include "createFields.H" # include "createFields.H"
# include "readSIMPLEControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,7 +55,7 @@ int main(int argc, char *argv[])
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++) while (simple.correctNonOrthogonal())
{ {
p.storePrevIter(); p.storePrevIter();
@ -75,7 +78,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (simple.finalNonOrthogonalIter())
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }

View file

@ -30,6 +30,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -39,6 +40,9 @@ int main(int argc, char *argv[])
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
simpleControl simple(mesh);
# include "createFields.H" # include "createFields.H"
@ -52,9 +56,7 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readSIMPLEControls.H" while (simple.correctNonOrthogonal())
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
solve solve
( (

View file

@ -77,7 +77,7 @@ int main(int argc, char *argv[])
# include "readGravitationalAcceleration.H" # include "readGravitationalAcceleration.H"
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "readTimeControls.H" # include "createTimeControls.H"
# include "CourantNo.H" # include "CourantNo.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"

View file

@ -80,7 +80,7 @@ int main(int argc, char *argv[])
# include "createFields.H" # include "createFields.H"
# include "readPISOControls.H" # include "readPISOControls.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "readTimeControls.H" # include "createTimeControls.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"
scalar StCoNum = 0.0; scalar StCoNum = 0.0;

View file

@ -9,7 +9,7 @@
UEqn.relax(); UEqn.relax();
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
} }

View file

@ -55,6 +55,7 @@ Description
#include "laminarFlameSpeed.H" #include "laminarFlameSpeed.H"
#include "ignition.H" #include "ignition.H"
#include "Switch.H" #include "Switch.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -64,11 +65,14 @@ int main(int argc, char *argv[])
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
pimpleControl pimple(mesh);
# include "readCombustionProperties.H" # include "readCombustionProperties.H"
# include "readGravitationalAcceleration.H" # include "readGravitationalAcceleration.H"
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "readTimeControls.H" # include "createTimeControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"
@ -79,7 +83,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
# include "readTimeControls.H" # include "readTimeControls.H"
# include "readPISOControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setDeltaT.H" # include "setDeltaT.H"
@ -87,7 +90,7 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++) while (pimple.loop())
{ {
# include "rhoEqn.H" # include "rhoEqn.H"
# include "UEqn.H" # include "UEqn.H"
@ -103,7 +106,7 @@ int main(int argc, char *argv[])
} }
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) while (pimple.correct())
{ {
# include "pEqn.H" # include "pEqn.H"
} }

View file

@ -132,3 +132,5 @@
fields.add(b); fields.add(b);
fields.add(h); fields.add(h);
fields.add(hu); fields.add(hu);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rUA = 1.0/UEqn.A(); volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H(); U = rUA*UEqn.H();
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -15,7 +15,7 @@ if (transonic)
) )
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -26,7 +26,7 @@ if (transonic)
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -41,7 +41,7 @@ else
+ fvc::ddtPhiCorr(rUA, rho, U, phi) + fvc::ddtPhiCorr(rUA, rho, U, phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -52,7 +52,7 @@ else
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View file

@ -35,6 +35,7 @@ Description
#include "basicPsiThermo.H" #include "basicPsiThermo.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "OFstream.H" #include "OFstream.H"
#include "pisoControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,8 +45,12 @@ int main(int argc, char *argv[])
# include "createEngineTime.H" # include "createEngineTime.H"
# include "createEngineMesh.H" # include "createEngineMesh.H"
pisoControl piso(mesh);
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "createTimeControls.H"
# include "readEngineTimeControls.H" # include "readEngineTimeControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"
@ -57,7 +62,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
# include "readPISOControls.H"
# include "readEngineTimeControls.H" # include "readEngineTimeControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setDeltaT.H" # include "setDeltaT.H"
@ -74,7 +78,7 @@ int main(int argc, char *argv[])
# include "UEqn.H" # include "UEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) while (piso.correct())
{ {
# include "hEqn.H" # include "hEqn.H"
# include "pEqn.H" # include "pEqn.H"

View file

@ -57,3 +57,5 @@
Info<< "Creating field DpDt\n" << endl; Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt = volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -10,7 +10,7 @@
UEqn.relax(); UEqn.relax();
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
} }

View file

@ -107,3 +107,5 @@ DimensionedField<scalar, volMesh> chemistrySh
mesh, mesh,
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0) dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
); );
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -42,6 +42,7 @@ Description
#include "OFstream.H" #include "OFstream.H"
#include "volPointInterpolation.H" #include "volPointInterpolation.H"
#include "thermoPhysicsTypes.H" #include "thermoPhysicsTypes.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -50,11 +51,15 @@ int main(int argc, char *argv[])
# include "setRootCase.H" # include "setRootCase.H"
# include "createEngineTime.H" # include "createEngineTime.H"
# include "createEngineMesh.H" # include "createEngineMesh.H"
pimpleControl pimple(mesh);
# include "createFields.H" # include "createFields.H"
# include "readGravitationalAcceleration.H" # include "readGravitationalAcceleration.H"
# include "readCombustionProperties.H" # include "readCombustionProperties.H"
# include "createSpray.H" # include "createSpray.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "createTimeControls.H"
# include "readEngineTimeControls.H" # include "readEngineTimeControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"
@ -66,7 +71,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
# include "readPISOControls.H"
# include "readEngineTimeControls.H" # include "readEngineTimeControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setDeltaT.H" # include "setDeltaT.H"
@ -102,13 +106,13 @@ int main(int argc, char *argv[])
# include "rhoEqn.H" # include "rhoEqn.H"
# include "UEqn.H" # include "UEqn.H"
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) while (pimple.loop())
{ {
# include "YEqn.H" # include "YEqn.H"
# include "hsEqn.H" # include "hsEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) while (pimple.correct())
{ {
# include "pEqn.H" # include "pEqn.H"
} }

View file

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField A = UEqn.A(); volScalarField A = UEqn.A();
U = UEqn.H()/A; U = UEqn.H()/A;
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -12,7 +12,7 @@ if (transonic)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)) *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U))
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -25,7 +25,7 @@ if (transonic)
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -36,7 +36,7 @@ else
phi = fvc::interpolate(rho) phi = fvc::interpolate(rho)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)); *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -49,7 +49,7 @@ else
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View file

@ -40,6 +40,7 @@ Description
#include "IFstream.H" #include "IFstream.H"
#include "OFstream.H" #include "OFstream.H"
#include "Switch.H" #include "Switch.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,12 +49,15 @@ int main(int argc, char *argv[])
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
pimpleControl pimple(mesh);
# include "createFields.H" # include "createFields.H"
# include "readGravitationalAcceleration.H" # include "readGravitationalAcceleration.H"
# include "readCombustionProperties.H" # include "readCombustionProperties.H"
# include "createSpray.H" # include "createSpray.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "readTimeControls.H" # include "createTimeControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"
@ -63,7 +67,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
# include "readPISOControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setDeltaT.H" # include "setDeltaT.H"
@ -97,13 +100,13 @@ int main(int argc, char *argv[])
# include "rhoEqn.H" # include "rhoEqn.H"
# include "UEqn.H" # include "UEqn.H"
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) while (pimple.loop())
{ {
# include "YEqn.H" # include "YEqn.H"
# include "hsEqn.H" # include "hsEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) while (pimple.correct())
{ {
# include "pEqn.H" # include "pEqn.H"
} }

View file

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rUA = 1.0/UEqn.A(); volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H(); U = rUA*UEqn.H();
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -15,7 +15,7 @@ if (transonic)
) )
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -28,7 +28,7 @@ if (transonic)
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -43,7 +43,7 @@ else
+ fvc::ddtPhiCorr(rUA, rho, U, phi) + fvc::ddtPhiCorr(rUA, rho, U, phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -56,7 +56,7 @@ else
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View file

@ -5,7 +5,7 @@
+ turbulence->divDevRhoReff(U) + turbulence->divDevRhoReff(U)
); );
if (momentumPredictor) if (piso.momentumPredictor())
{ {
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
} }

View file

@ -57,6 +57,7 @@ Description
#include "ignition.H" #include "ignition.H"
#include "Switch.H" #include "Switch.H"
#include "OFstream.H" #include "OFstream.H"
#include "pisoControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -66,9 +67,13 @@ int main(int argc, char *argv[])
# include "createEngineTime.H" # include "createEngineTime.H"
# include "createEngineMesh.H" # include "createEngineMesh.H"
pisoControl piso(mesh);
# include "readCombustionProperties.H" # include "readCombustionProperties.H"
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "createTimeControls.H"
# include "readEngineTimeControls.H" # include "readEngineTimeControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"
@ -80,7 +85,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
# include "readPISOControls.H"
# include "readEngineTimeControls.H" # include "readEngineTimeControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setDeltaT.H" # include "setDeltaT.H"
@ -96,7 +100,7 @@ int main(int argc, char *argv[])
# include "UEqn.H" # include "UEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) while (piso.correct())
{ {
# include "ftEqn.H" # include "ftEqn.H"
# include "bEqn.H" # include "bEqn.H"

View file

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rUA = 1.0/UEqn.A(); volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H(); U = rUA*UEqn.H();
if (transonic) if (piso.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -12,7 +12,7 @@ if (transonic)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)) *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U))
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (piso.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -23,7 +23,7 @@ if (transonic)
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (piso.finalNonOrthogonalIter())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -34,7 +34,7 @@ else
phi = fvc::interpolate(rho) phi = fvc::interpolate(rho)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)); *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (piso.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -45,7 +45,7 @@ else
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (piso.finalNonOrthogonalIter())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View file

@ -7,8 +7,6 @@ fvVectorMatrix UEqn
UEqn.relax(); UEqn.relax();
if (oCorr == nOuterCorr - 1)
{
solve solve
( (
UEqn UEqn
@ -18,19 +16,5 @@ if (oCorr == nOuterCorr - 1)
fvc::interpolate(rho)*(g & mesh.Sf()) fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf() - fvc::snGrad(p)*mesh.magSf()
), ),
mesh.solutionDict().solver("UFinal") mesh.solutionDict().solver((U.select(pimple.finalIter())))
); );
}
else
{
solve
(
UEqn
==
fvc::reconstruct
(
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
)
);
}

View file

@ -128,3 +128,5 @@ if (composition.contains("fu"))
} }
fields.add(hs); fields.add(hs);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -33,6 +33,7 @@ Description
#include "hsCombustionThermo.H" #include "hsCombustionThermo.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "combustionModel.H" #include "combustionModel.H"
#include "pimpleControl.H"
#include "radiationModel.H" #include "radiationModel.H"
@ -43,11 +44,14 @@ int main(int argc, char *argv[])
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
pimpleControl pimple(mesh);
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "createFields.H" #include "createFields.H"
#include "createRadiationModel.H" #include "createRadiationModel.H"
#include "readTimeControls.H" #include "createTimeControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
@ -57,7 +61,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readPISOControls.H"
#include "readTimeControls.H" #include "readTimeControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -68,7 +71,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++) while (pimple.loop())
{ {
#include "UEqn.H" #include "UEqn.H"
@ -76,7 +79,7 @@ int main(int argc, char *argv[])
#include "fuhsEqn.H" #include "fuhsEqn.H"
// --- PISO loop // --- PISO loop
for (int corr = 0; corr < nCorr; corr++) while (pimple.correct())
{ {
#include "pEqn.H" #include "pEqn.H"
} }

View file

@ -17,7 +17,7 @@ surfaceScalarField phiU
phi = phiU + rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf()); phi = phiU + rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
surfaceScalarField rhorUAf = fvc::interpolate(rho*rUA); surfaceScalarField rhorUAf = fvc::interpolate(rho*rUA);
@ -30,16 +30,12 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
closedVolume = p.needReference(); closedVolume = p.needReference();
if (corr == nCorr-1 && nonOrth == nNonOrthCorr) pEqn.solve
{ (
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final")); mesh.solutionDict().solver(p.select(pimple.finalInnerIter()))
} );
else
{
pEqn.solve(mesh.solutionDict().solver(p.name()));
}
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View file

@ -9,7 +9,7 @@
UEqn.relax(); UEqn.relax();
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
} }

View file

@ -96,3 +96,5 @@ DimensionedField<scalar, volMesh> chemistrySh
mesh, mesh,
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0) dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
); );
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rUA = 1.0/UEqn.A(); volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H(); U = rUA*UEqn.H();
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -15,7 +15,7 @@ if (transonic)
) )
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -26,7 +26,7 @@ if (transonic)
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -41,7 +41,7 @@ else
+ fvc::ddtPhiCorr(rUA, rho, U, phi) + fvc::ddtPhiCorr(rUA, rho, U, phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -52,7 +52,7 @@ else
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View file

@ -35,6 +35,7 @@ Description
#include "psiChemistryModel.H" #include "psiChemistryModel.H"
#include "chemistrySolver.H" #include "chemistrySolver.H"
#include "multivariateScheme.H" #include "multivariateScheme.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,11 +44,14 @@ int main(int argc, char *argv[])
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
pimpleControl pimple(mesh);
# include "readChemistryProperties.H" # include "readChemistryProperties.H"
# include "readGravitationalAcceleration.H" # include "readGravitationalAcceleration.H"
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "readTimeControls.H" # include "createTimeControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"
@ -58,7 +62,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
# include "readTimeControls.H" # include "readTimeControls.H"
# include "readPISOControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setDeltaT.H" # include "setDeltaT.H"
@ -68,14 +71,14 @@ int main(int argc, char *argv[])
# include "chemistry.H" # include "chemistry.H"
# include "rhoEqn.H" # include "rhoEqn.H"
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) while (pimple.loop())
{ {
# include "UEqn.H" # include "UEqn.H"
# include "YEqn.H" # include "YEqn.H"
# include "hsEqn.H" # include "hsEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) while (pimple.correct())
{ {
# include "pEqn.H" # include "pEqn.H"
} }

View file

@ -48,7 +48,7 @@ int main(int argc, char *argv[])
# include "readGravitationalAcceleration.H" # include "readGravitationalAcceleration.H"
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "readTimeControls.H" # include "createTimeControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"

View file

@ -54,6 +54,7 @@ int main(int argc, char *argv[])
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
# include "createFields.H" # include "createFields.H"
# include "createTimeControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -55,6 +55,7 @@ int main(int argc, char *argv[])
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
# include "createFields.H" # include "createFields.H"
# include "createTimeControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -45,7 +45,7 @@ int main(int argc, char *argv[])
# include "createMesh.H" # include "createMesh.H"
# include "createFields.H" # include "createFields.H"
# include "readThermophysicalProperties.H" # include "readThermophysicalProperties.H"
# include "readTimeControls.H" # include "createTimeControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -7,34 +7,20 @@ tmp<fvVectorMatrix> UEqn
+ turbulence->divDevRhoReff(U) + turbulence->divDevRhoReff(U)
); );
if (oCorr == nOuterCorr - 1) UEqn().relax
{ (
if (mesh.solutionDict().relax("UFinal")) mesh.solutionDict().relaxationFactor(U.select(pimple.finalIter()))
{ );
UEqn().relax(mesh.solutionDict().relaxationFactor("UFinal"));
}
else
{
UEqn().relax(1);
}
}
else
{
UEqn().relax();
}
volScalarField rUA = 1.0/UEqn().A(); volScalarField rUA = 1.0/UEqn().A();
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
if (oCorr == nOuterCorr-1) solve
{ (
solve(UEqn() == -fvc::grad(p), mesh.solutionDict().solver("UFinal")); UEqn() == -fvc::grad(p),
} mesh.solutionDict().solver((U.select(pimple.finalIter())))
else );
{
solve(UEqn() == -fvc::grad(p));
}
} }
else else
{ {

View file

@ -62,3 +62,5 @@
Info<< "Creating field DpDt\n" << endl; Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt = volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -8,16 +8,11 @@
DpDt DpDt
); );
if (oCorr == nOuterCorr-1) hEqn.relax
{ (
hEqn.relax(); mesh.solutionDict().relaxationFactor(h.select(pimple.finalIter()))
hEqn.solve(mesh.solutionDict().solver("hFinal")); );
} hEqn.solve(mesh.solutionDict().solver((h.select(pimple.finalIter()))));
else
{
hEqn.relax();
hEqn.solve();
}
thermo.correct(); thermo.correct();
} }

View file

@ -3,12 +3,12 @@ rho = thermo.rho();
volScalarField rUA = 1.0/UEqn().A(); volScalarField rUA = 1.0/UEqn().A();
U = rUA*UEqn().H(); U = rUA*UEqn().H();
if (nCorr <= 1) if (pimple.nCorrPISO() <= 1)
{ {
UEqn.clear(); UEqn.clear();
} }
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -20,7 +20,7 @@ if (transonic)
) )
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -29,21 +29,12 @@ if (transonic)
- fvm::laplacian(rho*rUA, p) - fvm::laplacian(rho*rUA, p)
); );
if pEqn.solve
( (
oCorr == nOuterCorr-1 mesh.solutionDict().solver(p.select(pimple.finalInnerIter()))
&& corr == nCorr-1 );
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solutionDict().solver("pFinal"));
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -58,7 +49,7 @@ else
//+ fvc::ddtPhiCorr(rUA, rho, U, phi) //+ fvc::ddtPhiCorr(rUA, rho, U, phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
// Pressure corrector // Pressure corrector
fvScalarMatrix pEqn fvScalarMatrix pEqn
@ -68,21 +59,12 @@ else
- fvm::laplacian(rho*rUA, p) - fvm::laplacian(rho*rUA, p)
); );
if pEqn.solve
( (
oCorr == nOuterCorr-1 mesh.solutionDict().solver(p.select(pimple.finalInnerIter()))
&& corr == nCorr-1 );
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solutionDict().solver("pFinal"));
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View file

@ -37,6 +37,7 @@ Description
#include "basicPsiThermo.H" #include "basicPsiThermo.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "bound.H" #include "bound.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,8 +46,12 @@ int main(int argc, char *argv[])
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
pimpleControl pimple(mesh);
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "createTimeControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -55,7 +60,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -63,7 +67,7 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
if (nOuterCorr != 1) if (!pimple.firstIter())
{ {
p.storePrevIter(); p.storePrevIter();
rho.storePrevIter(); rho.storePrevIter();
@ -72,13 +76,13 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++) while (pimple.loop())
{ {
#include "UEqn.H" #include "UEqn.H"
#include "hEqn.H" #include "hEqn.H"
// --- PISO loop // --- PISO loop
for (int corr = 0; corr < nCorr; corr++) while (pimple.correct())
{ {
#include "pEqn.H" #include "pEqn.H"
} }

View file

@ -5,7 +5,7 @@
+ turbulence->divDevRhoReff(U) + turbulence->divDevRhoReff(U)
); );
if (momentumPredictor) if (piso.momentumPredictor())
{ {
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
} }

View file

@ -56,3 +56,5 @@
Info<< "Creating field DpDt\n" << endl; Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt = volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rUA = 1.0/UEqn.A(); volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H(); U = rUA*UEqn.H();
if (transonic) if (piso.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -15,7 +15,7 @@ if (transonic)
) )
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (piso.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -26,7 +26,7 @@ if (transonic)
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (piso.finalNonOrthogonalIter())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -41,7 +41,7 @@ else
+ fvc::ddtPhiCorr(rUA, rho, U, phi) + fvc::ddtPhiCorr(rUA, rho, U, phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (piso.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -52,7 +52,7 @@ else
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (piso.finalNonOrthogonalIter())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View file

@ -32,6 +32,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "basicPsiThermo.H" #include "basicPsiThermo.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "pisoControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -41,9 +42,12 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
pisoControl piso(mesh);
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "readTimeControls.H" #include "createTimeControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
@ -55,7 +59,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -67,7 +70,7 @@ int main(int argc, char *argv[])
#include "UEqn.H" #include "UEqn.H"
// --- PISO loop // --- PISO loop
for (int corr = 1; corr <= nCorr; corr++) while (piso.correct())
{ {
#include "hEqn.H" #include "hEqn.H"
#include "pEqn.H" #include "pEqn.H"

View file

@ -7,37 +7,23 @@ tmp<fvVectorMatrix> UEqn
+ turbulence->divDevRhoReff(U) + turbulence->divDevRhoReff(U)
); );
if (oCorr == nOuterCorr-1) UEqn().relax
{ (
if (mesh.solutionDict().relax("UFinal")) mesh.solutionDict().relaxationFactor(U.select(pimple.finalIter()))
{ );
UEqn().relax(mesh.solutionDict().relaxationFactor("UFinal"));
}
else
{
UEqn().relax(1);
}
}
else
{
UEqn().relax();
}
mrfZones.addCoriolis(rho, UEqn()); mrfZones.addCoriolis(rho, UEqn());
pZones.addResistance(UEqn()); pZones.addResistance(UEqn());
volScalarField rUA = 1.0/UEqn().A(); volScalarField rUA = 1.0/UEqn().A();
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
if (oCorr == nOuterCorr-1) solve
{ (
solve(UEqn() == -fvc::grad(p), mesh.solutionDict().solver("UFinal")); UEqn() == -fvc::grad(p),
} mesh.solutionDict().solver((U.select(pimple.finalIter())))
else );
{
solve(UEqn() == -fvc::grad(p));
}
} }
else else
{ {

View file

@ -3,12 +3,12 @@ rho = thermo.rho();
volScalarField rUA = 1.0/UEqn().A(); volScalarField rUA = 1.0/UEqn().A();
U = rUA*UEqn().H(); U = rUA*UEqn().H();
if (nCorr <= 1) if (pimple.nCorrPISO() <= 1)
{ {
UEqn.clear(); UEqn.clear();
} }
if (transonic) if (pimple.transonic())
{ {
surfaceScalarField phid surfaceScalarField phid
( (
@ -21,7 +21,7 @@ if (transonic)
); );
mrfZones.relativeFlux(fvc::interpolate(psi), phid); mrfZones.relativeFlux(fvc::interpolate(psi), phid);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -30,21 +30,12 @@ if (transonic)
- fvm::laplacian(rho*rUA, p) - fvm::laplacian(rho*rUA, p)
); );
if pEqn.solve
( (
oCorr == nOuterCorr-1 mesh.solutionDict().solver(p.select(pimple.finalInnerIter()))
&& corr == nCorr-1 );
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solutionDict().solver("pFinal"));
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi == pEqn.flux(); phi == pEqn.flux();
} }
@ -60,7 +51,7 @@ else
); );
mrfZones.relativeFlux(fvc::interpolate(rho), phi); mrfZones.relativeFlux(fvc::interpolate(rho), phi);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
// Pressure corrector // Pressure corrector
fvScalarMatrix pEqn fvScalarMatrix pEqn
@ -70,21 +61,12 @@ else
- fvm::laplacian(rho*rUA, p) - fvm::laplacian(rho*rUA, p)
); );
if pEqn.solve
( (
oCorr == nOuterCorr-1 mesh.solutionDict().solver(p.select(pimple.finalInnerIter()))
&& corr == nCorr-1 );
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solutionDict().solver("pFinal"));
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi += pEqn.flux(); phi += pEqn.flux();
} }

View file

@ -39,6 +39,7 @@ Description
#include "bound.H" #include "bound.H"
#include "MRFZones.H" #include "MRFZones.H"
#include "porousZones.H" #include "porousZones.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,8 +48,12 @@ int main(int argc, char *argv[])
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
pimpleControl pimple(mesh);
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "createTimeControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -57,7 +62,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -65,7 +69,7 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
if (nOuterCorr != 1) if (!pimple.firstIter())
{ {
p.storePrevIter(); p.storePrevIter();
rho.storePrevIter(); rho.storePrevIter();
@ -74,13 +78,13 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++) while (pimple.loop())
{ {
#include "UEqn.H" #include "UEqn.H"
#include "hEqn.H" #include "hEqn.H"
// --- PISO loop // --- PISO loop
for (int corr = 0; corr < nCorr; corr++) while (pimple.correct())
{ {
#include "pEqn.H" #include "pEqn.H"
} }

View file

@ -47,6 +47,7 @@ int main(int argc, char *argv[])
# include "createMesh.H" # include "createMesh.H"
# include "readThermodynamicProperties.H" # include "readThermodynamicProperties.H"
# include "createFields.H" # include "createFields.H"
# include "createTimeControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -1,4 +1,4 @@
# include "readTimeControls.H" # include "createTimeControls.H"
# include "readPIMPLEControls.H" # include "readPIMPLEControls.H"
bool correctPhi = false; bool correctPhi = false;

View file

@ -1,13 +1,13 @@
# include "readTimeControls.H" # include "readTimeControls.H"
# include "readPIMPLEControls.H" # include "readPIMPLEControls.H"
bool correctPhi = false; correctPhi = false;
if (pimple.found("correctPhi")) if (pimple.found("correctPhi"))
{ {
correctPhi = Switch(pimple.lookup("correctPhi")); correctPhi = Switch(pimple.lookup("correctPhi"));
} }
bool checkMeshCourantNo = false; checkMeshCourantNo = false;
if (pimple.found("checkMeshCourantNo")) if (pimple.found("checkMeshCourantNo"))
{ {
checkMeshCourantNo = Switch(pimple.lookup("checkMeshCourantNo")); checkMeshCourantNo = Switch(pimple.lookup("checkMeshCourantNo"));

View file

@ -58,6 +58,7 @@ int main(int argc, char *argv[])
# include "createDynamicFvMesh.H" # include "createDynamicFvMesh.H"
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "createControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -52,6 +52,7 @@ int main(int argc, char *argv[])
# include "createMesh.H" # include "createMesh.H"
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "createTimeControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -51,7 +51,7 @@ int main(int argc, char *argv[])
# include "createFields.H" # include "createFields.H"
# include "createSolidFields.H" # include "createSolidFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "readTimeControls.H" # include "createTimeControls.H"
# include "CourantNo.H" # include "CourantNo.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"

View file

@ -24,9 +24,11 @@
pcorrTypes pcorrTypes
); );
phi = (fvc::interpolate(U) & mesh.Sf()); phi = fvc::interpolate(U) & mesh.Sf();
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) mesh.schemesDict().setFluxRequired(pcorr.name());
while (piso.correctNonOrthogonal())
{ {
fvScalarMatrix pcorrEqn fvScalarMatrix pcorrEqn
( (
@ -36,7 +38,7 @@
pcorrEqn.setReference(pRefCell, pRefValue); pcorrEqn.setReference(pRefCell, pRefValue);
pcorrEqn.solve(); pcorrEqn.solve();
if (nonOrth == nNonOrthCorr) if (piso.finalNonOrthogonalIter())
{ {
phi -= pcorrEqn.flux(); phi -= pcorrEqn.flux();
} }

View file

@ -0,0 +1,6 @@
# include "createTimeControls.H"
bool checkMeshCourantNo
(
piso.dict().lookupOrDefault("checkMeshCourantNo", false)
);

View file

@ -53,6 +53,7 @@
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
mesh.schemesDict().setFluxRequired(p.name());
scalar totalVolume = sum(mesh.V()).value(); scalar totalVolume = sum(mesh.V()).value();
@ -69,16 +70,9 @@
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
bool momentumPredictor = piso.momentumPredictor();
{ {
const dictionary& piso = mesh.solutionDict().subDict("PISO");
bool momentumPredictor = true;
if (piso.found("momentumPredictor"))
{
momentumPredictor = Switch(piso.lookup("momentumPredictor"));
}
bool momentumPredictorSave = momentumPredictor; bool momentumPredictorSave = momentumPredictor;
momentumPredictor = false; momentumPredictor = false;
# include "UEqn.H" # include "UEqn.H"

View file

@ -36,6 +36,7 @@ Author
#include "fvCFD.H" #include "fvCFD.H"
#include "dynamicFvMesh.H" #include "dynamicFvMesh.H"
#include "engineTime.H" #include "engineTime.H"
#include "pisoControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,8 +46,12 @@ int main(int argc, char *argv[])
# include "setRootCase.H" # include "setRootCase.H"
# include "createEngineTime.H" # include "createEngineTime.H"
# include "createDynamicFvMesh.H" # include "createDynamicFvMesh.H"
pisoControl piso(mesh);
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "createFields.H" # include "createFields.H"
# include "createControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -89,7 +94,7 @@ int main(int argc, char *argv[])
// --- PISO loop // --- PISO loop
for (int corr = 0; corr < nCorr; corr++) while (piso.correct())
{ {
rUA = 1.0/UEqn.A(); rUA = 1.0/UEqn.A();
@ -99,7 +104,8 @@ int main(int argc, char *argv[])
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) // Non-orthogonal pressure corrector loop
while (piso.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -107,17 +113,12 @@ int main(int argc, char *argv[])
); );
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
pEqn.solve
(
mesh.solutionDict().solver(p.select(piso.finalInnerIter()))
);
if (corr == nCorr - 1 && nonOrth == nNonOrthCorr) if (piso.finalNonOrthogonalIter())
{
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solutionDict().solver(p.name()));
}
if (nonOrth == nNonOrthCorr)
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }

View file

@ -1,8 +1,4 @@
# include "readTimeControls.H" # include "readTimeControls.H"
# include "readPISOControls.H"
bool checkMeshCourantNo = false; checkMeshCourantNo =
if (piso.found("checkMeshCourantNo")) piso.dict().lookupOrDefault("checkMeshCourantNo", false);
{
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
}

View file

@ -52,6 +52,7 @@ int main(int argc, char *argv[])
# include "readPIMPLEControls.H" # include "readPIMPLEControls.H"
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "createTimeControls.H"
# include "readEngineTimeControls.H" # include "readEngineTimeControls.H"
# include "CourantNo.H" # include "CourantNo.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"

View file

@ -24,7 +24,9 @@
pcorrTypes pcorrTypes
); );
phi = (fvc::interpolate(U) & mesh.Sf()); phi = fvc::interpolate(U) & mesh.Sf();
mesh.schemesDict().setFluxRequired(pcorr.name());
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {

View file

@ -0,0 +1,8 @@
# include "createTimeControls.H"
# include "readPISOControls.H"
bool checkMeshCourantNo = false;
if (piso.found("checkMeshCourantNo"))
{
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
}

View file

@ -1,7 +1,7 @@
# include "readTimeControls.H" # include "readTimeControls.H"
# include "readPISOControls.H" # include "readPISOControls.H"
bool checkMeshCourantNo = false; checkMeshCourantNo = false;
if (piso.found("checkMeshCourantNo")) if (piso.found("checkMeshCourantNo"))
{ {
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo")); checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));

View file

@ -47,6 +47,7 @@ int main(int argc, char *argv[])
# include "createDynamicFvMesh.H" # include "createDynamicFvMesh.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "createFields.H" # include "createFields.H"
# include "createControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -49,6 +49,7 @@ int main(int argc, char *argv[])
# include "readTransportProperties.H" # include "readTransportProperties.H"
# include "createFaFields.H" # include "createFaFields.H"
# include "createFvFields.H" # include "createFvFields.H"
# include "createTimeControls.H"
Info << "\nStarting time loop\n" << endl; Info << "\nStarting time loop\n" << endl;

View file

@ -59,7 +59,7 @@ int main(int argc, char *argv[])
# include "readGravitationalAcceleration.H" # include "readGravitationalAcceleration.H"
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "readTimeControls.H" # include "createTimeControls.H"
# include "CourantNo.H" # include "CourantNo.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"

View file

@ -48,7 +48,7 @@ int main(int argc, char *argv[])
# include "readGravitationalAcceleration.H" # include "readGravitationalAcceleration.H"
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "readTimeControls.H" # include "createTimeControls.H"
# include "compressibleCourantNo.H" # include "compressibleCourantNo.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"

View file

@ -55,7 +55,7 @@ int main(int argc, char *argv[])
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "readTimeControls.H" #include "createTimeControls.H"
#include "readSolidTimeControls.H" #include "readSolidTimeControls.H"

View file

@ -17,6 +17,7 @@
transportProperties.lookup("nu") transportProperties.lookup("nu")
); );
Info<< "Reading field p\n" << endl; Info<< "Reading field p\n" << endl;
volScalarField p volScalarField p
( (
@ -31,6 +32,7 @@
mesh mesh
); );
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U
( (
@ -47,6 +49,8 @@
# include "createPhi.H" # include "createPhi.H"
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -38,6 +38,7 @@ Author
#include "dynamicFvMesh.H" #include "dynamicFvMesh.H"
#include "immersedBoundaryFvPatch.H" #include "immersedBoundaryFvPatch.H"
#include "immersedBoundaryAdjustPhi.H" #include "immersedBoundaryAdjustPhi.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -46,6 +47,9 @@ int main(int argc, char *argv[])
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
# include "createDynamicFvMesh.H" # include "createDynamicFvMesh.H"
pimpleControl pimple(mesh);
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
@ -68,12 +72,10 @@ int main(int argc, char *argv[])
// Make the fluxes relative to the mesh motion // Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U); fvc::makeRelative(phi, U);
# include "readPIMPLEControls.H"
# include "CourantNo.H" # include "CourantNo.H"
// Pressure-velocity corrector // Pressure-velocity corrector
int oCorr = 0; while (pimple.loop())
do
{ {
fvVectorMatrix UEqn fvVectorMatrix UEqn
( (
@ -82,10 +84,13 @@ int main(int argc, char *argv[])
- fvm::laplacian(nu, U) - fvm::laplacian(nu, U)
); );
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
}
// --- PISO loop // --- PISO loop
for (int corr = 0; corr < nCorr; corr++) while (pimple.correct())
{ {
volScalarField rUA = 1.0/UEqn.A(); volScalarField rUA = 1.0/UEqn.A();
@ -99,7 +104,8 @@ int main(int argc, char *argv[])
immersedBoundaryAdjustPhi(phi, U); immersedBoundaryAdjustPhi(phi, U);
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++) // Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -107,9 +113,15 @@ int main(int argc, char *argv[])
); );
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(); pEqn.solve
(
mesh.solutionDict().solver
(
p.select(pimple.finalInnerIter())
)
);
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }
@ -123,7 +135,7 @@ int main(int argc, char *argv[])
U -= rUA*fvc::grad(p); U -= rUA*fvc::grad(p);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
} }
} while (++oCorr < nOuterCorr); }
runTime.write(); runTime.write();

View file

@ -17,6 +17,7 @@
transportProperties.lookup("nu") transportProperties.lookup("nu")
); );
Info<< "Reading field p\n" << endl; Info<< "Reading field p\n" << endl;
volScalarField p volScalarField p
( (
@ -46,10 +47,10 @@
mesh mesh
); );
# include "createPhi.H" # include "createPhi.H"
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -36,6 +36,7 @@ Author
#include "fvCFD.H" #include "fvCFD.H"
#include "immersedBoundaryFvPatch.H" #include "immersedBoundaryFvPatch.H"
#include "immersedBoundaryAdjustPhi.H" #include "immersedBoundaryAdjustPhi.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,6 +46,9 @@ int main(int argc, char *argv[])
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
pimpleControl pimple(mesh);
# include "createIbMasks.H" # include "createIbMasks.H"
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
@ -57,12 +61,10 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readPIMPLEControls.H"
# include "CourantNo.H" # include "CourantNo.H"
// Pressure-velocity corrector // Pressure-velocity corrector
int oCorr = 0; while (pimple.loop())
do
{ {
fvVectorMatrix UEqn fvVectorMatrix UEqn
( (
@ -71,10 +73,13 @@ int main(int argc, char *argv[])
- fvm::laplacian(nu, U) - fvm::laplacian(nu, U)
); );
if (pimple.momentumPredictor())
{
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
}
// --- PISO loop // --- PISO loop
for (int corr = 0; corr < nCorr; corr++) while (pimple.correct())
{ {
volScalarField rUA = 1.0/UEqn.A(); volScalarField rUA = 1.0/UEqn.A();
@ -88,7 +93,8 @@ int main(int argc, char *argv[])
immersedBoundaryAdjustPhi(phi, U); immersedBoundaryAdjustPhi(phi, U);
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++) // Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -96,9 +102,15 @@ int main(int argc, char *argv[])
); );
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(); pEqn.solve
(
mesh.solutionDict().solver
(
p.select(pimple.finalInnerIter())
)
);
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }
@ -109,7 +121,7 @@ int main(int argc, char *argv[])
U -= rUA*fvc::grad(p); U -= rUA*fvc::grad(p);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
} }
} while (++oCorr < nOuterCorr); }
runTime.write(); runTime.write();

View file

@ -16,7 +16,7 @@
UEqn.relax(); UEqn.relax();
if (momentumPredictor) if (pimple.momentumPredictor())
{ {
solve solve
( (

View file

@ -36,7 +36,9 @@
immersedBoundaryAdjustPhi(phi, U); immersedBoundaryAdjustPhi(phi, U);
adjustPhi(phi, U, pcorr); adjustPhi(phi, U, pcorr);
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) mesh.schemesDict().setFluxRequired(pcorr.name());
while(pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pcorrEqn fvScalarMatrix pcorrEqn
( (
@ -46,7 +48,7 @@
pcorrEqn.setReference(pdRefCell, pdRefValue); pcorrEqn.setReference(pdRefCell, pdRefValue);
pcorrEqn.solve(); pcorrEqn.solve();
if (nonOrth == nNonOrthCorr) if (pimple.finalNonOrthogonalIter())
{ {
phi -= pcorrEqn.flux(); phi -= pcorrEqn.flux();
} }

View file

@ -128,6 +128,8 @@
); );
} }
mesh.schemesDict().setFluxRequired(pd.name());
// Construct interface from alpha1 distribution // Construct interface from alpha1 distribution
interfaceProperties interface(alpha1, U, twoPhaseProperties); interfaceProperties interface(alpha1, U, twoPhaseProperties);

View file

@ -45,6 +45,7 @@ Author
#include "interfaceProperties.H" #include "interfaceProperties.H"
#include "twoPhaseMixture.H" #include "twoPhaseMixture.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "pimpleControl.H"
#include "immersedBoundaryFvPatch.H" #include "immersedBoundaryFvPatch.H"
#include "immersedBoundaryAdjustPhi.H" #include "immersedBoundaryAdjustPhi.H"
@ -56,12 +57,14 @@ int main(int argc, char *argv[])
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
pimpleControl pimple(mesh);
# include "readGravitationalAcceleration.H" # include "readGravitationalAcceleration.H"
# include "readPIMPLEControls.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "createFields.H" # include "createFields.H"
# include "createIbMasks.H" # include "createIbMasks.H"
# include "readTimeControls.H" # include "createTimeControls.H"
# include "correctPhi.H" # include "correctPhi.H"
# include "CourantNo.H" # include "CourantNo.H"
# include "setInitialDeltaT.H" # include "setInitialDeltaT.H"
@ -72,7 +75,6 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
# include "readPIMPLEControls.H"
# include "readTimeControls.H" # include "readTimeControls.H"
# include "immersedBoundaryCourantNo.H" # include "immersedBoundaryCourantNo.H"
# include "setDeltaT.H" # include "setDeltaT.H"
@ -82,8 +84,7 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
// Pressure-velocity corrector // Pressure-velocity corrector
int oCorr = 0; while (pimple.loop())
do
{ {
twoPhaseProperties.correct(); twoPhaseProperties.correct();
@ -92,7 +93,7 @@ int main(int argc, char *argv[])
# include "UEqn.H" # include "UEqn.H"
// --- PISO loop // --- PISO loop
for (int corr = 0; corr < nCorr; corr++) while (pimple.correct())
{ {
# include "pEqn.H" # include "pEqn.H"
} }
@ -117,7 +118,7 @@ int main(int argc, char *argv[])
} }
turbulence->correct(); turbulence->correct();
} while (++oCorr < nOuterCorr); }
runTime.write(); runTime.write();

View file

@ -1,5 +1,6 @@
{ {
scalar limitMagU = readScalar(pimple.lookup("limitMagU")); scalar limitMagU =
readScalar(mesh.solutionDict().subDict("PIMPLE").lookup("limitMagU"));
volScalarField magU(mag(U)); volScalarField magU(mag(U));

View file

@ -1,5 +1,5 @@
{ {
if (nOuterCorr != 1) if (!pimple.firstIter())
{ {
pd.storePrevIter(); pd.storePrevIter();
} }
@ -29,7 +29,7 @@
)*rUAf*mesh.magSf(); )*rUAf*mesh.magSf();
for(int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pdEqn fvScalarMatrix pdEqn
( (
@ -38,23 +38,20 @@
pdEqn.setReference(pdRefCell, pdRefValue); pdEqn.setReference(pdRefCell, pdRefValue);
if (corr == nCorr - 1 && nonOrth == nNonOrthCorr) pdEqn.solve
{ (
pdEqn.solve(mesh.solutionDict().solver(pd.name() + "Final")); mesh.solutionDict().solver(pd.select(pimple.finalInnerIter()))
} );
else
{
pdEqn.solve(mesh.solutionDict().solver(pd.name()));
}
if (nonOrth == nNonOrthCorr)
if (pimple.finalNonOrthogonalIter())
{ {
phi -= pdEqn.flux(); phi -= pdEqn.flux();
} }
} }
// Explicitly relax pressure except for last corrector // Explicitly relax pressure except for last corrector
if (oCorr != nOuterCorr - 1) if (!pimple.finalIter())
{ {
pd.relax(); pd.relax();
} }

View file

@ -9,9 +9,4 @@
pZones.addResistance(UEqn()); pZones.addResistance(UEqn());
eqnResidual = solve solve(UEqn() == -fvc::grad(p));
(
UEqn() == -fvc::grad(p)
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);

View file

@ -1,9 +0,0 @@
// check convergence
if (maxResidual < convergenceCriterion)
{
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
runTime.writeAndEnd();
Info<< "latestTime = " << runTime.timeName() << endl;
}

View file

@ -32,7 +32,7 @@
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
mesh.schemesDict().setFluxRequired(p.name());
singlePhaseTransportModel laminarTransport(U, phi); singlePhaseTransportModel laminarTransport(U, phi);

View file

@ -1,7 +0,0 @@
// initialize values for convergence checks
scalar eqnResidual = 1, maxResidual = 0;
scalar convergenceCriterion = 0;
simple.readIfPresent("convergence", convergenceCriterion);

View file

@ -13,7 +13,7 @@
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop // Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (simple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -22,18 +22,9 @@
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
// Retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = pEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
}
else
{
pEqn.solve(); pEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (simple.finalNonOrthogonalIter())
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }

View file

@ -37,6 +37,7 @@ Author
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "RASModel.H" #include "RASModel.H"
#include "porousZones.H" #include "porousZones.H"
#include "simpleControl.H"
#include "immersedBoundaryFvPatch.H" #include "immersedBoundaryFvPatch.H"
#include "immersedBoundaryAdjustPhi.H" #include "immersedBoundaryAdjustPhi.H"
@ -48,6 +49,9 @@ int main(int argc, char *argv[])
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
simpleControl simple(mesh);
# include "createIbMasks.H" # include "createIbMasks.H"
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
@ -60,9 +64,6 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readSIMPLEControls.H"
# include "initConvergenceCheck.H"
p.storePrevIter(); p.storePrevIter();
// Pressure-velocity SIMPLE corrector // Pressure-velocity SIMPLE corrector
@ -78,8 +79,6 @@ int main(int argc, char *argv[])
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl; << nl << endl;
# include "convergenceCheck.H"
} }
Info<< "End\n" << endl; Info<< "End\n" << endl;

View file

@ -1,6 +1,8 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
-I$(LIB_SRC)/immersedBoundary/immersedBoundary/lnInclude -I$(LIB_SRC)/immersedBoundary/immersedBoundary/lnInclude
EXE_LIBS = \ EXE_LIBS = \
@ -9,5 +11,6 @@ EXE_LIBS = \
-lsurfMesh \ -lsurfMesh \
-lsampling \ -lsampling \
-ldynamicMesh \ -ldynamicMesh \
-ldynamicFvMesh \
-limmersedBoundary \ -limmersedBoundary \
-llduSolvers -llduSolvers

View file

@ -47,3 +47,4 @@
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
mesh.schemesDict().setFluxRequired(p.name());

View file

@ -32,6 +32,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "immersedBoundaryFvPatch.H" #include "immersedBoundaryFvPatch.H"
#include "immersedBoundaryAdjustPhi.H" #include "immersedBoundaryAdjustPhi.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,16 +44,18 @@ int main(int argc, char *argv[])
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
simpleControl simple(mesh);
# include "createIbMasks.H" # include "createIbMasks.H"
# include "createFields.H" # include "createFields.H"
# include "readSIMPLEControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< nl << "Calculating potential flow" << endl; Info<< nl << "Calculating potential flow" << endl;
// Do correctors over the complete set // Do correctors over the complete set
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (simple.correctNonOrthogonal())
{ {
phi = faceIbMask*(linearInterpolate(U) & mesh.Sf()); phi = faceIbMask*(linearInterpolate(U) & mesh.Sf());
@ -86,7 +89,7 @@ int main(int argc, char *argv[])
// Correct the flux // Correct the flux
phi -= pEqn.flux(); phi -= pEqn.flux();
if (nonOrth != nNonOrthCorr) if (!simple.finalNonOrthogonalIter())
{ {
p.relax(); p.relax();
} }

View file

@ -7,9 +7,4 @@
UEqn().relax(); UEqn().relax();
eqnResidual = solve solve(UEqn() == -fvc::grad(p));
(
UEqn() == -fvc::grad(p)
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);

View file

@ -1,9 +0,0 @@
// check convergence
if (maxResidual < convergenceCriterion)
{
Info<< "reached convergence criterion: " << convergenceCriterion << endl;
runTime.writeAndEnd();
Info<< "latestTime = " << runTime.timeName() << endl;
}

View file

@ -32,7 +32,7 @@
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
mesh.schemesDict().setFluxRequired(p.name());
singlePhaseTransportModel laminarTransport(U, phi); singlePhaseTransportModel laminarTransport(U, phi);

View file

@ -1,7 +0,0 @@
// initialize values for convergence checks
scalar eqnResidual = 1, maxResidual = 0;
scalar convergenceCriterion = 0;
simple.readIfPresent("convergence", convergenceCriterion);

View file

@ -13,7 +13,7 @@
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop // Non-orthogonal pressure corrector loop
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++) while (simple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -22,18 +22,9 @@
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
// Retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = pEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
}
else
{
pEqn.solve(); pEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (simple.finalNonOrthogonalIter())
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }

View file

@ -36,6 +36,7 @@ Author
#include "fvCFD.H" #include "fvCFD.H"
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "RASModel.H" #include "RASModel.H"
#include "simpleControl.H"
#include "immersedBoundaryFvPatch.H" #include "immersedBoundaryFvPatch.H"
#include "immersedBoundaryAdjustPhi.H" #include "immersedBoundaryAdjustPhi.H"
@ -47,6 +48,9 @@ int main(int argc, char *argv[])
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
simpleControl simple(mesh);
# include "createIbMasks.H" # include "createIbMasks.H"
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
@ -59,9 +63,6 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readSIMPLEControls.H"
# include "initConvergenceCheck.H"
p.storePrevIter(); p.storePrevIter();
// Pressure-velocity SIMPLE corrector // Pressure-velocity SIMPLE corrector
@ -77,8 +78,6 @@ int main(int argc, char *argv[])
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl; << nl << endl;
# include "convergenceCheck.H"
} }
Info<< "End\n" << endl; Info<< "End\n" << endl;

View file

@ -34,6 +34,7 @@ Description
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "incompressible/RAS/RASModel/RASModel.H" #include "incompressible/RAS/RASModel/RASModel.H"
#include "MRFZones.H" #include "MRFZones.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,6 +45,9 @@ int main(int argc, char *argv[])
# include "createTime.H" # include "createTime.H"
# include "createMesh.H" # include "createMesh.H"
simpleControl simple(mesh);
# include "createFields.H" # include "createFields.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
@ -55,8 +59,6 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readSIMPLEControls.H"
p.storePrevIter(); p.storePrevIter();
// Pressure-velocity SIMPLE corrector // Pressure-velocity SIMPLE corrector
@ -83,7 +85,7 @@ int main(int argc, char *argv[])
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop // Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) while (simple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -93,7 +95,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
pEqn.solve(); pEqn.solve();
if (nonOrth == nNonOrthCorr) if (simple.finalNonOrthogonalIter())
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }

View file

@ -32,7 +32,7 @@
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
mesh.schemesDict().setFluxRequired(p.name());
singlePhaseTransportModel laminarTransport(U, phi); singlePhaseTransportModel laminarTransport(U, phi);

View file

@ -39,6 +39,7 @@ Author
#include "IFstream.H" #include "IFstream.H"
#include "OFstream.H" #include "OFstream.H"
#include "Random.H" #include "Random.H"
#include "pisoControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,6 +48,9 @@ int main(int argc, char *argv[])
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
pisoControl piso(mesh);
#include "readTransportProperties.H" #include "readTransportProperties.H"
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
@ -58,8 +62,6 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readPISOControls.H"
#include "CourantNo.H" #include "CourantNo.H"
sgsModel->correct(); sgsModel->correct();
@ -76,7 +78,7 @@ int main(int argc, char *argv[])
// Time derivative matrix // Time derivative matrix
fvVectorMatrix ddtUEqn(fvm::ddt(U)); fvVectorMatrix ddtUEqn(fvm::ddt(U));
if (momentumPredictor) if (piso.momentumPredictor())
{ {
solve(ddtUEqn + HUEqn == -fvc::grad(p)); solve(ddtUEqn + HUEqn == -fvc::grad(p));
} }
@ -87,14 +89,14 @@ int main(int argc, char *argv[])
// --- PISO loop // --- PISO loop
for (int corr = 0; corr < nCorr; corr++) while (piso.correct())
{ {
U = HUEqn.H()/aU; U = HUEqn.H()/aU;
phi = (fvc::interpolate(U) & mesh.Sf()); phi = (fvc::interpolate(U) & mesh.Sf());
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++) while (piso.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
@ -102,17 +104,12 @@ int main(int argc, char *argv[])
); );
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
pEqn.solve
(
mesh.solutionDict().solver(p.select(piso.finalInnerIter()))
);
if (corr == nCorr-1 && nonOrth == nNonOrthCorr) if (piso.finalNonOrthogonalIter())
{
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solutionDict().solver(p.name()));
}
if (nonOrth == nNonOrthCorr)
{ {
phi -= pEqn.flux(); phi -= pEqn.flux();
} }

View file

@ -33,7 +33,7 @@
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
mesh.schemesDict().setFluxRequired(p.name());
singlePhaseTransportModel laminarTransport(U, phi); singlePhaseTransportModel laminarTransport(U, phi);

View file

@ -1,3 +0,0 @@
consistentIcoFoam.C
EXE = $(FOAM_APPBIN)/consistentIcoFoam

View file

@ -1,6 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-llduSolvers

View file

@ -1,125 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 3.2
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Application
consistentIcoFoam
Description
Transient solver for incompressible, laminar flow of Newtonian fluids.
Consistent formulation without time-step and relaxation dependence by Jasak
Author
Hrvoje Jasak, Wikki Ltd. All rights reserved
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
# include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readPISOControls.H"
# include "CourantNo.H"
// Convection-diffusion matrix
fvVectorMatrix HUEqn
(
fvm::div(phi, U)
- fvm::laplacian(nu, U)
);
// ddt matrix
fvVectorMatrix ddtUEqn(fvm::ddt(U));
solve(ddtUEqn + HUEqn == -fvc::grad(p));
// Prepare clean Ap without time derivative contribution
// HJ, 26/Oct/2015
volScalarField aU = HUEqn.A();
// --- PISO loop
for (int corr = 0; corr < nCorr; corr++)
{
U = HUEqn.H()/aU;
phi = (fvc::interpolate(U) & mesh.Sf());
adjustPhi(phi, U, p);
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(1/aU, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}
# include "continuityErrs.H"
// Note: cannot call H(U) here because the velocity is not complete
// HJ, 22/Jan/2016
U = 1.0/(aU + ddtUEqn.A())*
(
U*aU - fvc::grad(p) + ddtUEqn.H()
);
U.correctBoundaryConditions();
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show more