ENH: Updated solvers to use simpleControl and pimpleControl

This commit is contained in:
andy 2011-04-14 17:45:20 +01:00
parent a1577b8aa8
commit 656bbf5308
117 changed files with 461 additions and 656 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,6 +30,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -41,17 +42,17 @@ int main(int argc, char *argv[])
#include "createMesh.H"
#include "createFields.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nCalculating temperature distribution\n" << endl;
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
solve
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,32 +30,30 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
# include "setRootCase.H"
simpleControl simple(mesh);
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nCalculating scalar transport\n" << endl;
# include "CourantNo.H"
#include "CourantNo.H"
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readSIMPLEControls.H"
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
solve
(

View File

@ -59,11 +59,9 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readPIMPLEControls.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
@ -79,7 +77,7 @@ int main(int argc, char *argv[])
#include "fuhsEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -15,7 +15,7 @@ surfaceScalarField phiU
phi = phiU - rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf();
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
surfaceScalarField rhorAUf(fvc::interpolate(rho*rAU));
@ -28,18 +28,10 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
p_rghEqn.solve
(
mesh.solver
(
p_rgh.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += p_rghEqn.flux();
}

View File

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

View File

@ -8,7 +8,7 @@
volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H();
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phiv
(
@ -30,7 +30,7 @@
+ correction(fvm::ddt(psi, p) + fvm::div(phid, p))
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -40,18 +40,10 @@
pEqn.solve
(
mesh.solver
(
p.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}
@ -72,7 +64,7 @@
+ fvc::div(phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -82,18 +74,10 @@
pEqn.solve
(
mesh.solver
(
p.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}

View File

@ -62,10 +62,8 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
@ -81,7 +79,7 @@ int main(int argc, char *argv[])
#include "hsEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
for (int corr=1; corr<=pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -11,7 +11,7 @@ UEqn().relax();
volScalarField rAU(1.0/UEqn().A());
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
}

View File

@ -5,12 +5,12 @@ rho.relax();
U = rAU*UEqn().H();
if (nCorr <= 1)
if (pimple.nCorr() <= 1)
{
UEqn.clear();
}
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
@ -22,7 +22,7 @@ if (transonic)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -33,18 +33,10 @@ if (transonic)
pEqn.solve
(
mesh.solver
(
p.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi == pEqn.flux();
}
@ -59,7 +51,7 @@ else
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
// Pressure corrector
fvScalarMatrix pEqn
@ -71,18 +63,10 @@ else
pEqn.solve
(
mesh.solver
(
p.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}

View File

@ -56,10 +56,8 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
@ -70,7 +68,7 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
if (pimple.nOuterCorr() != 1)
{
p.storePrevIter();
rho.storePrevIter();
@ -80,7 +78,7 @@ int main(int argc, char *argv[])
#include "hEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -50,14 +50,14 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readPIMPLEControls.H"
pimpleControl pimple(mesh);
#include "setInitialrDeltaT.H"
#include "createFields.H"
#include "createZones.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -65,10 +65,8 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
@ -81,7 +79,7 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
if (pimple.nOuterCorr() != 1)
{
p.storePrevIter();
rho.storePrevIter();
@ -93,7 +91,7 @@ int main(int argc, char *argv[])
#include "hEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -1,6 +1,6 @@
scalar maxDeltaT
(
pimpleDict.lookupOrDefault<scalar>("maxDeltaT", GREAT)
pimple.dict().lookupOrDefault<scalar>("maxDeltaT", GREAT)
);
volScalarField rDeltaT

View File

@ -1,4 +1,6 @@
{
const dictionary& pimpleDict = pimple.dict();
scalar maxCo
(
pimpleDict.lookupOrDefault<scalar>("maxCo", 0.8)
@ -29,7 +31,7 @@
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField())
);
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(

View File

@ -15,7 +15,7 @@ pZones.addResistance(UEqn());
volScalarField rAU(1.0/UEqn().A());
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
}

View File

@ -6,12 +6,12 @@ rho.relax();
volScalarField rAU(1.0/UEqn().A());
U = rAU*UEqn().H();
if (nCorr <= 1)
if (pimple.nCorr() <= 1)
{
UEqn.clear();
}
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
@ -24,7 +24,7 @@ if (transonic)
);
mrfZones.relativeFlux(fvc::interpolate(psi), phid);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -35,18 +35,10 @@ if (transonic)
pEqn.solve
(
mesh.solver
(
p.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi == pEqn.flux();
}
@ -62,7 +54,7 @@ else
);
mrfZones.relativeFlux(fvc::interpolate(rho), phi);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
// Pressure corrector
fvScalarMatrix pEqn
@ -74,18 +66,10 @@ else
pEqn.solve
(
mesh.solver
(
p.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}

View File

@ -61,10 +61,8 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
@ -75,7 +73,7 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
if (pimple.nOuterCorr() != 1)
{
p.storePrevIter();
rho.storePrevIter();
@ -85,7 +83,7 @@ int main(int argc, char *argv[])
#include "hEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -9,7 +9,7 @@ UEqn.clear();
bool closedVolume = false;
if (transonic)
if (simple.transonic())
{
surfaceScalarField phid
(
@ -17,7 +17,7 @@ if (transonic)
fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf())
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -32,7 +32,7 @@ if (transonic)
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
phi == pEqn.flux();
}
@ -43,7 +43,7 @@ else
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
closedVolume = adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -54,7 +54,7 @@ else
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
phi -= pEqn.flux();
}

View File

@ -11,7 +11,7 @@ UEqn.clear();
bool closedVolume = false;
if (transonic)
if (simple.transonic())
{
surfaceScalarField phid
(
@ -20,7 +20,7 @@ if (transonic)
);
mrfZones.relativeFlux(fvc::interpolate(psi), phid);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
tmp<fvScalarMatrix> tpEqn;
@ -37,7 +37,7 @@ if (transonic)
tpEqn().solve();
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
phi == tpEqn().flux();
}
@ -50,7 +50,7 @@ else
closedVolume = adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
tmp<fvScalarMatrix> tpEqn;
@ -67,7 +67,7 @@ else
tpEqn().solve();
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
phi -= tpEqn().flux();
}

View File

@ -36,6 +36,7 @@ Description
#include "RASModel.H"
#include "MRFZones.H"
#include "thermalPorousZones.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,16 +49,16 @@ int main(int argc, char *argv[])
#include "createZones.H"
#include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p.storePrevIter();
rho.storePrevIter();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,6 +33,7 @@ Description
#include "fvCFD.H"
#include "basicPsiThermo.H"
#include "RASModel.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,16 +45,16 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p.storePrevIter();
rho.storePrevIter();

View File

@ -12,9 +12,9 @@ UEqn.clear();
bool closedVolume = false;
if (transonic)
if (simple.transonic())
{
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
surfaceScalarField phid
(
@ -54,7 +54,7 @@ if (transonic)
pEqn.solve();
}
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
phi == phic + pEqn.flux();
}
@ -62,7 +62,7 @@ if (transonic)
}
else
{
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
phi = fvc::interpolate(rho*U) & mesh.Sf();
closedVolume = adjustPhi(phi, U, p);
@ -88,7 +88,7 @@ else
}
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
phi += pEqn.flux();
}
@ -119,7 +119,7 @@ rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
if (!transonic)
if (!simple.transonic())
{
rho.relax();
}

View File

@ -35,6 +35,7 @@ Description
#include "RASModel.H"
#include "mixedFvPatchFields.H"
#include "bound.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -46,20 +47,20 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p.storePrevIter();
rho.storePrevIter();
if (!transonic)
if (!simple.transonic())
{
rho.storePrevIter();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,6 +38,7 @@ Description
#include "OSspecific.H"
#include "magnet.H"
#include "electromagneticConstants.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,7 +66,8 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "readSIMPLEControls.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -73,7 +75,7 @@ int main(int argc, char *argv[])
runTime++;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
solve(fvm::laplacian(murf, psi) + fvc::div(murf*Mrf));
}

View File

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

View File

@ -75,15 +75,13 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
pimple.read();
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
if (pimple.nOuterCorr() != 1)
{
p_rgh.storePrevIter();
}
@ -92,7 +90,7 @@ int main(int argc, char *argv[])
#include "TEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -10,7 +10,7 @@
surfaceScalarField buoyancyPhi(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());
phi -= buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix p_rghEqn
(
@ -21,18 +21,10 @@
p_rghEqn.solve
(
mesh.solver
(
p_rgh.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
// Calculate the conservative fluxes
phi -= p_rghEqn.flux();

View File

@ -8,7 +8,7 @@
UEqn().relax();
if (momentumPredictor)
if (simple.momentumPredictor())
{
solve
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -48,6 +48,7 @@ Description
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "RASModel.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,16 +61,16 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p_rgh.storePrevIter();
// Pressure-velocity SIMPLE corrector

View File

@ -11,7 +11,7 @@
surfaceScalarField buoyancyPhi(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());
phi -= buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix p_rghEqn
(
@ -22,7 +22,7 @@
p_rghEqn.solve();
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
// Calculate the conservative fluxes
phi -= p_rghEqn.flux();

View File

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

View File

@ -62,10 +62,8 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
@ -76,7 +74,7 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
if (pimple.nOuterCorr() != 1)
{
p_rgh.storePrevIter();
}
@ -85,7 +83,7 @@ int main(int argc, char *argv[])
#include "hEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -25,7 +25,7 @@
+ fvc::div(phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix p_rghEqn
(
@ -35,18 +35,10 @@
p_rghEqn.solve
(
mesh.solver
(
p_rgh.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
// Calculate the conservative fluxes
phi += p_rghEqn.flux();

View File

@ -8,7 +8,7 @@
UEqn().relax();
if (momentumPredictor)
if (simple.momentumPredictor())
{
solve
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,6 +33,7 @@ Description
#include "basicPsiThermo.H"
#include "RASModel.H"
#include "fixedGradientFvPatchFields.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,16 +46,16 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p_rgh.storePrevIter();
rho.storePrevIter();

View File

@ -14,7 +14,7 @@
surfaceScalarField buoyancyPhi(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
phi -= buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix p_rghEqn
(
@ -24,7 +24,7 @@
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve();
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
// Calculate the conservative fluxes
phi -= p_rghEqn.flux();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,6 +35,7 @@ Description
#include "RASModel.H"
#include "fixedGradientFvPatchFields.H"
#include "radiationModel.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,16 +49,16 @@ int main(int argc, char *argv[])
#include "createRadiationModel.H"
#include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p_rgh.storePrevIter();
rho.storePrevIter();

View File

@ -48,6 +48,7 @@ Description
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "RASModel.H"
#include "simpleControl.H"
template<class Type>
void zeroCells
@ -74,16 +75,16 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p.storePrevIter();
laminarTransport.lookup("lambda") >> lambda;
@ -121,7 +122,7 @@ int main(int argc, char *argv[])
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -131,7 +132,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
phi -= pEqn.flux();
}
@ -184,7 +185,7 @@ int main(int argc, char *argv[])
adjustPhi(phia, Ua, pa);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix paEqn
(
@ -194,7 +195,7 @@ int main(int argc, char *argv[])
paEqn.setReference(paRefCell, paRefValue);
paEqn.solve();
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
phia -= paEqn.flux();
}

View File

@ -11,7 +11,7 @@ UEqn().relax();
volScalarField rAU(1.0/UEqn().A());
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
}

View File

@ -1,6 +1,6 @@
U = rAU*UEqn().H();
if (nCorr <= 1)
if (pimple.nCorr() <= 1)
{
UEqn.clear();
}
@ -11,7 +11,7 @@ phi = (fvc::interpolate(U) & mesh.Sf())
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
// Pressure corrector
fvScalarMatrix pEqn
@ -23,18 +23,10 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
pEqn.solve
(
mesh.solver
(
p.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi -= pEqn.flux();
}

View File

@ -11,7 +11,7 @@ UEqn().relax();
rAU = 1.0/UEqn().A();
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
}

View File

@ -50,7 +50,7 @@
pcorrTypes
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pcorrEqn
(
@ -60,7 +60,7 @@
pcorrEqn.setReference(pRefCell, pRefValue);
pcorrEqn.solve();
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi -= pcorrEqn.flux();
}

View File

@ -1,6 +1,6 @@
U = rAU*UEqn().H();
if (nCorr <= 1)
if (pimple.nCorr() <= 1)
{
UEqn.clear();
}
@ -14,7 +14,7 @@ if (p.needReference())
fvc::makeAbsolute(phi, U);
}
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -25,18 +25,10 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
pEqn.solve
(
mesh.solver
(
p.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi -= pEqn.flux();
}

View File

@ -60,7 +60,6 @@ int main(int argc, char *argv[])
{
#include "readControls.H"
#include "CourantNo.H"
pimple.read();
// Make the fluxes absolute
fvc::makeAbsolute(phi, U);
@ -89,7 +88,7 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
if (pimple.nOuterCorr() != 1)
{
p.storePrevIter();
}
@ -97,7 +96,7 @@ int main(int argc, char *argv[])
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -1,5 +1,6 @@
#include "readTimeControls.H"
#include "readPIMPLEControls.H"
const dictionary& pimpleDict = pimple.dict();
const bool correctPhi =
pimpleDict.lookupOrDefault("correctPhi", false);

View File

@ -56,10 +56,8 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
@ -68,7 +66,7 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
if (pimple.nOuterCorr() != 1)
{
p.storePrevIter();
}
@ -76,7 +74,7 @@ int main(int argc, char *argv[])
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -26,14 +26,13 @@
mesh
);
# include "createPhi.H"
#include "createPhi.H"
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<incompressible::RASModel> turbulence

View File

@ -7,7 +7,7 @@
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -18,7 +18,7 @@
pEqn.solve();
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
phi -= pEqn.flux();
}

View File

@ -6,13 +6,7 @@
if (pZones.size())
{
// nUCorrectors for pressureImplicitPorosity
if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors"))
{
nUCorr = readInt
(
mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
);
}
nUCorr = simple.dict().lookupOrDefault<int>("nUCorrectors", 0);
if (nUCorr > 0)
{

View File

@ -11,7 +11,7 @@ UEqn.clear();
phi = fvc::interpolate(U) & mesh.Sf();
adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=simple.nNonOrthCorr(); nonOrth++)
{
tmp<fvScalarMatrix> tpEqn;
@ -35,7 +35,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
tpEqn().solve();
}
if (nonOrth == nNonOrthCorr)
if (nonOrth == simple.nNonOrthCorr())
{
phi -= tpEqn().flux();
}

View File

@ -34,6 +34,7 @@ Description
#include "singlePhaseTransportModel.H"
#include "RASModel.H"
#include "porousZones.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -42,6 +43,9 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
simpleControl simple(mesh);
#include "createFields.H"
#include "createPorousZones.H"
#include "initContinuityErrs.H"
@ -50,12 +54,10 @@ int main(int argc, char *argv[])
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p.storePrevIter();
// Pressure-velocity SIMPLE corrector

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,6 +32,7 @@ Description
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "RASModel.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,16 +44,16 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "initContinuityErrs.H"
simpleControl simple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
while (simple.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p.storePrevIter();
// Pressure-velocity SIMPLE corrector

View File

@ -74,11 +74,9 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readPIMPLEControls.H"
#include "readChemistryProperties.H"
#include "readAdditionalSolutionControls.H"
#include "readTimeControls.H"
pimple.read();
runTime++;
@ -94,7 +92,7 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
if (nOuterCorr != 1)
if (pimple.nOuterCorr() != 1)
{
p.storePrevIter();
}
@ -106,7 +104,7 @@ int main(int argc, char *argv[])
#include "hsEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

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

View File

@ -32,7 +32,7 @@
+ massSource.SuTot()
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -42,18 +42,10 @@
pEqn.solve
(
mesh.solver
(
p.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}

View File

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

View File

@ -74,10 +74,8 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
@ -101,7 +99,7 @@ int main(int argc, char *argv[])
#include "hsEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H();
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
@ -15,7 +15,7 @@ if (transonic)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -28,18 +28,10 @@ if (transonic)
pEqn.solve
(
mesh.solver
(
p.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi == pEqn.flux();
}
@ -54,7 +46,7 @@ else
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -67,18 +59,10 @@ else
pEqn.solve
(
mesh.solver
(
p.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}

View File

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

View File

@ -15,7 +15,7 @@ surfaceScalarField phiU
phi = phiU - rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf();
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix p_rghEqn
(
@ -30,18 +30,10 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
p_rghEqn.solve
(
mesh.solver
(
p_rgh.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += p_rghEqn.flux();
}

View File

@ -69,11 +69,9 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setMultiRegionDeltaT.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
@ -96,7 +94,7 @@ int main(int argc, char *argv[])
#include "hsEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
for (int corr=1; corr<=pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

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

View File

@ -3,7 +3,7 @@ rho = thermo.rho();
volScalarField rAU(1.0/UEqn.A());
U = rAU*UEqn.H();
if (transonic)
if (pimple.transonic())
{
surfaceScalarField phid
(
@ -15,7 +15,7 @@ if (transonic)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -28,18 +28,10 @@ if (transonic)
pEqn.solve
(
mesh.solver
(
p.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi == pEqn.flux();
}
@ -54,7 +46,7 @@ else
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -67,18 +59,10 @@ else
pEqn.solve
(
mesh.solver
(
p.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += pEqn.flux();
}

View File

@ -67,10 +67,8 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "readPIMPLEControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
@ -89,7 +87,7 @@ int main(int argc, char *argv[])
#include "hsEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

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

View File

@ -36,6 +36,7 @@ Description
#include "barotropicCompressibilityModel.H"
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,6 +53,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -65,13 +68,13 @@ int main(int argc, char *argv[])
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
for (int outerCorr=0; outerCorr<nOuterCorr; outerCorr++)
for (int outerCorr=0; outerCorr<pimple.nOuterCorr(); outerCorr++)
{
#include "rhoEqn.H"
#include "gammaPsi.H"
#include "UEqn.H"
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -1,5 +1,5 @@
{
if (nOuterCorr == 1)
if (pimple.nOuterCorr() == 1)
{
p =
(
@ -26,7 +26,7 @@
#include "resetPhivPatches.H"
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pEqn
(
@ -37,16 +37,12 @@
- fvm::laplacian(rAUf, p)
);
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
}
pEqn.solve
(
mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phiv += (phiGradp + pEqn.flux())/rhof;
}
@ -82,9 +78,9 @@
U = HbyA - rAU*fvc::grad(p);
// Remove the swirl component of velocity for "wedge" cases
if (piso.found("removeSwirl"))
if (pimple.dict().found("removeSwirl"))
{
label swirlCmpt(readLabel(piso.lookup("removeSwirl")));
label swirlCmpt(readLabel(pimple.dict().lookup("removeSwirl")));
Info<< "Removing swirl component-" << swirlCmpt << " of U" << endl;
U.field().replace(swirlCmpt, 0.0);

View File

@ -5,5 +5,3 @@ scalar maxAcousticCo
readScalar(runTime.controlDict().lookup("maxAcousticCo"))
);
#include "readPISOControls.H"

View File

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

View File

@ -44,6 +44,7 @@ Description
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,6 +61,8 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -113,7 +116,7 @@ int main(int argc, char *argv[])
turbulence->correct();
// --- Outer-corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
for (int oCorr=0; oCorr<pimple.nOuterCorr(); oCorr++)
{
#include "alphaEqnsSubCycle.H"
@ -122,7 +125,7 @@ int main(int argc, char *argv[])
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<oimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -4,7 +4,7 @@
tmp<fvScalarMatrix> p_rghEqnComp;
if (transonic)
if (pimple.transonic())
{
p_rghEqnComp =
(
@ -39,7 +39,7 @@
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf();
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix p_rghEqnIncomp
(
@ -55,18 +55,10 @@
)
*p_rghEqnComp()
+ p_rghEqnIncomp,
mesh.solver
(
p_rgh.select
(
oCorr == nOuterCorr-1
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
dgdt =
(pos(alpha2)*(psi2/rho2) - pos(alpha1)*(psi1/rho1))

View File

@ -1,15 +1,8 @@
#include "readPISOControls.H"
#include "readTimeControls.H"
#include "readTimeControls.H"
label nAlphaCorr
(
readLabel(piso.lookup("nAlphaCorr"))
);
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles
(
readLabel(piso.lookup("nAlphaSubCycles"))
);
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
if (nAlphaSubCycles > 1 && nOuterCorr != 1)
{
@ -19,14 +12,8 @@
<< exit(FatalError);
}
bool correctPhi = true;
if (piso.found("correctPhi"))
{
correctPhi = Switch(piso.lookup("correctPhi"));
}
bool correctPhi =
pimple.dict().lookupOrDefault<Switch>("correctPhi", true);
bool checkMeshCourantNo = false;
if (piso.found("checkMeshCourantNo"))
{
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
}
bool checkMeshCourantNo =
pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false);

View File

@ -41,6 +41,7 @@ Description
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -56,6 +57,8 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -71,7 +74,7 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Outer-corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
for (int oCorr=0; oCorr<pimple.nOuterCorr(); oCorr++)
{
#include "alphaEqnsSubCycle.H"
@ -80,7 +83,7 @@ int main(int argc, char *argv[])
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -39,7 +39,7 @@
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf();
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix p_rghEqnIncomp
(
@ -55,18 +55,10 @@
)
*p_rghEqnComp()
+ p_rghEqnIncomp,
mesh.solver
(
p_rgh.select
(
oCorr == nOuterCorr-1
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
dgdt =
(pos(alpha2)*(psi2/rho2) - pos(alpha1)*(psi1/rho1))

View File

@ -1,14 +1,13 @@
#include "readPISOControls.H"
#include "readTimeControls.H"
label nAlphaCorr
(
readLabel(piso.lookup("nAlphaCorr"))
readLabel(pimple.dict().lookup("nAlphaCorr"))
);
label nAlphaSubCycles
(
readLabel(piso.lookup("nAlphaSubCycles"))
readLabel(pimple.dict().lookup("nAlphaSubCycles"))
);
if (nAlphaSubCycles > 1 && nOuterCorr != 1)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,6 +44,7 @@ Description
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "fvcSmooth.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,9 +53,11 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
pimpleControl pimple(mesh);
#include "correctPhi.H"
#include "CourantNo.H"
#include "setInitialrDeltaT.H"
@ -65,8 +68,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readPISOControls.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
@ -76,13 +77,19 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H"
turbulence->correct();
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
turbulence->correct();
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "pEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
}
runTime.write();

View File

@ -1,6 +1,8 @@
label nAlphaCorr(readLabel(piso.lookup("nAlphaCorr")));
const dictionary& pimpleDict = pimple.dict();
label nAlphaSubCycles(readLabel(piso.lookup("nAlphaSubCycles")));
label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
if (nAlphaSubCycles > 1)
{

View File

@ -1,6 +1,6 @@
scalar maxDeltaT
(
piso.lookupOrDefault<scalar>("maxDeltaT", GREAT)
pimple.dict().lookupOrDefault<scalar>("maxDeltaT", GREAT)
);
volScalarField rDeltaT

View File

@ -1,52 +1,54 @@
{
const dictionary& pimpleDict = pimple.dict();
scalar maxCo
(
piso.lookupOrDefault<scalar>("maxCo", 0.9)
pimpleDict.lookupOrDefault<scalar>("maxCo", 0.9)
);
scalar maxAlphaCo
(
piso.lookupOrDefault<scalar>("maxAlphaCo", 0.2)
pimpleDict.lookupOrDefault<scalar>("maxAlphaCo", 0.2)
);
scalar rDeltaTSmoothingCoeff
(
piso.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.1)
pimpleDict.lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.1)
);
label nAlphaSpreadIter
(
piso.lookupOrDefault<label>("nAlphaSpreadIter", 1)
pimpleDict.lookupOrDefault<label>("nAlphaSpreadIter", 1)
);
scalar alphaSpreadDiff
(
piso.lookupOrDefault<scalar>("alphaSpreadDiff", 0.2)
pimpleDict.lookupOrDefault<scalar>("alphaSpreadDiff", 0.2)
);
scalar alphaSpreadMax
(
piso.lookupOrDefault<scalar>("alphaSpreadMax", 0.99)
pimpleDict.lookupOrDefault<scalar>("alphaSpreadMax", 0.99)
);
scalar alphaSpreadMin
(
piso.lookupOrDefault<scalar>("alphaSpreadMin", 0.01)
pimpleDict.lookupOrDefault<scalar>("alphaSpreadMin", 0.01)
);
label nAlphaSweepIter
(
piso.lookupOrDefault<label>("nAlphaSweepIter", 5)
pimpleDict.lookupOrDefault<label>("nAlphaSweepIter", 5)
);
scalar rDeltaTDampingCoeff
(
piso.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1.0)
pimpleDict.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1.0)
);
scalar maxDeltaT
(
piso.lookupOrDefault<scalar>("maxDeltaT", GREAT)
pimpleDict.lookupOrDefault<scalar>("maxDeltaT", GREAT)
);
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
@ -130,7 +132,7 @@
label nAlphaSubCycles
(
readLabel(piso.lookup("nAlphaSubCycles"))
readLabel(pimpleDict.lookup("nAlphaSubCycles"))
);
rSubDeltaT = rDeltaT*nAlphaSubCycles;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,6 +43,7 @@ Description
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "MRFZones.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -51,11 +52,13 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "createMRFZones.H"
#include "readTimeControls.H"
pimpleControl pimple(mesh);
#include "correctPhi.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
@ -66,7 +69,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readPISOControls.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "alphaCourantNo.H"
@ -81,12 +83,16 @@ int main(int argc, char *argv[])
#include "alphaEqnSubCycle.H"
#include "zonePhaseVolumes.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "pEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
}
turbulence->correct();

View File

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

View File

@ -19,7 +19,7 @@
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf();
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for(int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix p_rghEqn
(
@ -30,13 +30,10 @@
p_rghEqn.solve
(
mesh.solver
(
p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr)
)
mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi -= p_rghEqn.flux();
}

View File

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

View File

@ -1,12 +1,6 @@
label nAlphaCorr
(
readLabel(piso.lookup("nAlphaCorr"))
);
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles
(
readLabel(piso.lookup("nAlphaSubCycles"))
);
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
if (nAlphaSubCycles > 1)
{
@ -19,7 +13,7 @@ if (nAlphaSubCycles > 1)
!(++alphaSubCycle).end();
)
{
# include "alphaEqn.H"
#include "alphaEqn.H"
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
}
@ -27,7 +21,7 @@ if (nAlphaSubCycles > 1)
}
else
{
# include "alphaEqn.H"
#include "alphaEqn.H"
}
interface.correct();

View File

@ -34,7 +34,7 @@
adjustPhi(phi, U, pcorr);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix pcorrEqn
(
@ -44,7 +44,7 @@
pcorrEqn.setReference(pRefCell, pRefValue);
pcorrEqn.solve();
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi -= pcorrEqn.flux();
}

View File

@ -128,7 +128,7 @@
(
p,
p_rgh,
mesh.solutionDict().subDict("PISO"),
mesh.solutionDict().subDict("PIMPLE"),
pRefCell,
pRefValue
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,6 +39,7 @@ Description
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -47,10 +48,12 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "readTimeControls.H"
pimpleControl pimple(mesh);
#include "correctPhi.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
@ -105,12 +108,16 @@ int main(int argc, char *argv[])
#include "alphaEqnSubCycle.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "pEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
}
turbulence->correct();

View File

@ -18,7 +18,7 @@
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf();
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix p_rghEqn
(
@ -29,13 +29,10 @@
p_rghEqn.solve
(
mesh.solver
(
p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr)
)
mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi -= p_rghEqn.flux();
}

View File

@ -1,14 +1,6 @@
# include "readTimeControls.H"
# include "readPISOControls.H"
#include "readTimeControls.H"
bool correctPhi = true;
if (piso.found("correctPhi"))
{
correctPhi = Switch(piso.lookup("correctPhi"));
}
bool checkMeshCourantNo = false;
if (piso.found("checkMeshCourantNo"))
{
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
}
bool correctPhi =
pimple.dict().lookupOrDefault<Switch>("correctPhi", true);
bool checkMeshCourantNo =
pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,7 +31,7 @@ Description
The momentum and other fluid properties are of the "mixture" and a single
momentum equation is solved.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
For a two-fluid approach see twoPhaseEulerFoam.
@ -44,6 +44,7 @@ Description
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "interpolationTable.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,7 +53,9 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readPISOControls.H"
pimpleControl pimple(mesh);
#include "initContinuityErrs.H"
#include "createFields.H"
#include "readTimeControls.H"
@ -60,6 +63,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -80,12 +84,16 @@ int main(int argc, char *argv[])
#include "alphaEqnSubCycle.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "pEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
}
turbulence->correct();

View File

@ -18,7 +18,7 @@
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf();
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix p_rghEqn
(
@ -29,13 +29,10 @@
p_rghEqn.solve
(
mesh.solver
(
p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr)
)
mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi -= p_rghEqn.flux();
}

View File

@ -22,7 +22,7 @@
pZones.addResistance(UEqn);
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,6 +45,7 @@ Description
#include "twoPhaseMixture.H"
#include "turbulenceModel.H"
#include "porousZones.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -53,11 +54,13 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "createPorousZones.H"
#include "readTimeControls.H"
pimpleControl pimple(mesh);
#include "correctPhi.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
@ -68,7 +71,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readPISOControls.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "alphaCourantNo.H"
@ -82,12 +84,16 @@ int main(int argc, char *argv[])
#include "alphaEqnSubCycle.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "pEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
}
turbulence->correct();

View File

@ -1,12 +1,6 @@
label nAlphaCorr
(
readLabel(piso.lookup("nAlphaCorr"))
);
label nAlphaSubCycles
(
readLabel(piso.lookup("nAlphaSubCycles"))
);
const dictionary& pimpleDict = pimple.dict();
label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
if (nAlphaSubCycles > 1)
{
@ -19,7 +13,7 @@ if (nAlphaSubCycles > 1)
!(++alphaSubCycle).end();
)
{
# include "alphaEqns.H"
#include "alphaEqns.H"
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
}
@ -27,7 +21,7 @@ if (nAlphaSubCycles > 1)
}
else
{
# include "alphaEqns.H"
#include "alphaEqns.H"
}
interface.correct();

View File

@ -150,7 +150,7 @@
(
p,
p_rgh,
mesh.solutionDict().subDict("PISO"),
mesh.solutionDict().subDict("PIMPLE"),
pRefCell,
pRefValue
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -36,6 +36,7 @@ Description
#include "threePhaseMixture.H"
#include "threePhaseInterfaceProperties.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -45,12 +46,14 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
#include "correctPhi.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -59,7 +62,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readPISOControls.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "alphaCourantNo.H"
@ -74,12 +76,17 @@ int main(int argc, char *argv[])
#include "alphaEqnsSubCycle.H"
#define twoPhaseProperties threePhaseProperties
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "pEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
}
#include "continuityErrs.H"

View File

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

View File

@ -11,15 +11,11 @@ surfaceScalarField rhoPhi
);
{
label nAlphaCorr
(
readLabel(piso.lookup("nAlphaCorr"))
);
const dictionary& pimpleDict = pimple.dict();
label nAlphaSubCycles
(
readLabel(piso.lookup("nAlphaSubCycles"))
);
label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
surfaceScalarField phic(mag(phi/mesh.magSf()));
phic = min(interface.cAlpha()*phic, max(phic));
@ -44,7 +40,7 @@ surfaceScalarField rhoPhi
#include "alphaEqn.H"
}
if (nOuterCorr == 1)
if (pimple.nOuterCorr() == 1)
{
interface.correct();
}

View File

@ -98,7 +98,7 @@
(
p,
p_rgh,
mesh.solutionDict().subDict("PISO"),
mesh.solutionDict().subDict("PIMPLE"),
pRefCell,
pRefValue
);

View File

@ -56,27 +56,25 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "readTimeControls.H"
pimpleControl pimple(mesh);
#include "../interFoam/correctPhi.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readPIMPLEControls.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
pimple.read();
runTime++;
@ -92,7 +90,7 @@ int main(int argc, char *argv[])
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}

View File

@ -23,7 +23,7 @@
const volScalarField& vDotcP = vDotP[0]();
const volScalarField& vDotvP = vDotP[1]();
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix p_rghEqn
(
@ -35,18 +35,10 @@
p_rghEqn.solve
(
mesh.solver
(
p_rgh.select
(
pimple.finalIter()
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi += p_rghEqn.flux();
}

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