mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updated solvers to use simpleControl and pimpleControl
This commit is contained in:
@ -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"
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
if (momentumPredictor)
|
||||
if (pimple.momentumPredictor())
|
||||
{
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user