Further rationalisation of the handling of "Final" solver settings
The selection of the "Final" solver settings is now handled automatically within the "<equation>.solve()" call and there is no longer any need no provide a bool argument for specific cases. This simplifies the solution algorithm loop structures and ensures consistency in behaviour across all solvers. All tutorials have been updated to correspond to the now consistent rules.
This commit is contained in:
@ -101,7 +101,7 @@ int main(int argc, char *argv[])
|
||||
fvm::laplacian(rAUf, p) == fvc::div(phiHbyA)
|
||||
);
|
||||
|
||||
pEqn.solve(piso.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
phi = phiHbyA - pEqn.flux();
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ if (pimple.transonic())
|
||||
betav*fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
@ -57,7 +57,7 @@ else
|
||||
betav*fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -35,7 +35,7 @@ if (pimple.transonic())
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
@ -71,7 +71,7 @@ else
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -29,7 +29,7 @@ if (pimple.transonic())
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
@ -64,7 +64,7 @@ else
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -36,7 +36,7 @@ while (pimple.correctNonOrthogonal())
|
||||
+ fvOptions(psi, p_rgh, rho.name())
|
||||
);
|
||||
|
||||
p_rghEqn.solve(pimple.finalInnerIter());
|
||||
p_rghEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -37,7 +37,7 @@ if (pimple.transonic())
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
@ -72,7 +72,7 @@ else
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -49,7 +49,7 @@ if (pimple.transonic())
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
@ -89,7 +89,7 @@ else
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -41,7 +41,7 @@ while (pimple.correctNonOrthogonal())
|
||||
- fvm::laplacian(rhorAUf, p_rgh)
|
||||
);
|
||||
|
||||
p_rghEqn.solve(pimple.finalInnerIter());
|
||||
p_rghEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
nonOrthogonalSolutionControl pcorrControl(mesh, pimple.algorithmName());
|
||||
|
||||
CorrectPhi
|
||||
(
|
||||
U,
|
||||
@ -7,5 +9,5 @@ CorrectPhi
|
||||
psi,
|
||||
dimensionedScalar("rAUf", dimTime, 1),
|
||||
divrhoU(),
|
||||
pimple
|
||||
pcorrControl
|
||||
);
|
||||
|
||||
@ -54,7 +54,7 @@ if (pimple.transonic())
|
||||
// Relax the pressure equation to ensure diagonal-dominance
|
||||
pEqn.relax();
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
@ -76,7 +76,7 @@ else
|
||||
{
|
||||
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -65,7 +65,7 @@ if (pimple.transonic())
|
||||
// Relax the pressure equation to ensure diagonal-dominance
|
||||
pEqn.relax();
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
@ -90,7 +90,7 @@ else
|
||||
{
|
||||
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAtU, p));
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -114,7 +114,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
pEqn.solve(piso.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (piso.finalNonOrthogonalIter())
|
||||
{
|
||||
@ -154,7 +154,7 @@ int main(int argc, char *argv[])
|
||||
fvm::laplacian(rABf, pB) == fvc::div(phiB)
|
||||
);
|
||||
|
||||
pBEqn.solve(bpiso.finalInnerIter());
|
||||
pBEqn.solve();
|
||||
|
||||
if (bpiso.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
|
||||
p_rghEqn.solve(pimple.finalInnerIter());
|
||||
p_rghEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -46,7 +46,7 @@ while (pimple.correctNonOrthogonal())
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
}
|
||||
|
||||
p_rghEqn.solve(pimple.finalInnerIter());
|
||||
p_rghEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -69,7 +69,7 @@ constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
pressureControl.refValue()
|
||||
);
|
||||
|
||||
p_rghEqn.solve(pimple.finalInnerIter());
|
||||
p_rghEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
fvOptions.constrain(hEqn);
|
||||
|
||||
hEqn.solve(pimples.finalIter());
|
||||
hEqn.solve();
|
||||
|
||||
fvOptions.correct(h);
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
pEqn.solve(piso.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (piso.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -102,7 +102,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
pEqn.solve(piso.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (piso.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -40,7 +40,7 @@ while (pimple.correctNonOrthogonal())
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
nonOrthogonalSolutionControl pcorrControl(mesh, pimple.algorithmName());
|
||||
|
||||
CorrectPhi
|
||||
(
|
||||
U,
|
||||
@ -5,7 +7,7 @@ CorrectPhi
|
||||
p,
|
||||
dimensionedScalar("rAUf", dimTime, 1),
|
||||
geometricZeroField(),
|
||||
pimple
|
||||
pcorrControl
|
||||
);
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
@ -44,7 +44,7 @@ while (pimple.correctNonOrthogonal())
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -26,7 +26,7 @@ while (piso.correctNonOrthogonal())
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
pEqn.solve(piso.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (piso.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -124,7 +124,7 @@ int main(int argc, char *argv[])
|
||||
- fvm::laplacian(ghrAUf, h)
|
||||
);
|
||||
|
||||
hEqn.solve(pimple.finalInnerIter());
|
||||
hEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
nonOrthogonalSolutionControl pcorrControl(mesh, pimple.algorithmName());
|
||||
|
||||
CorrectPhi
|
||||
(
|
||||
Uc,
|
||||
@ -5,7 +7,7 @@ CorrectPhi
|
||||
p,
|
||||
dimensionedScalar("rAUf", dimTime, 1),
|
||||
geometricZeroField(),
|
||||
pimple
|
||||
pcorrControl
|
||||
);
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -33,7 +33,7 @@ if (pimple.transonic())
|
||||
+ fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
@ -69,7 +69,7 @@ else
|
||||
+ fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -46,7 +46,7 @@ while (pimple.correctNonOrthogonal())
|
||||
- fvm::laplacian(rhorAUf, p_rgh)
|
||||
);
|
||||
|
||||
p_rghEqn.solve(pimple.finalInnerIter());
|
||||
p_rghEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -42,7 +42,7 @@ if (pimple.transonic())
|
||||
+ fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
@ -77,7 +77,7 @@ else
|
||||
+ fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
- fvm::laplacian(rhorAUf, p)
|
||||
);
|
||||
|
||||
pEqn.solve(pimple.finalInnerIter());
|
||||
pEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -107,8 +107,7 @@
|
||||
|
||||
solve
|
||||
(
|
||||
p_rghEqnComp1() + p_rghEqnComp2() + p_rghEqnIncomp,
|
||||
pimple.finalInnerIter()
|
||||
p_rghEqnComp1() + p_rghEqnComp2() + p_rghEqnIncomp
|
||||
);
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
nonOrthogonalSolutionControl pcorrControl(mesh, pimple.algorithmName());
|
||||
|
||||
CorrectPhi
|
||||
(
|
||||
U,
|
||||
@ -5,7 +7,7 @@ CorrectPhi
|
||||
p,
|
||||
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1),
|
||||
divU,
|
||||
pimple
|
||||
pcorrControl
|
||||
);
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
@ -121,8 +121,7 @@
|
||||
|
||||
solve
|
||||
(
|
||||
p_rghEqnComp1() + p_rghEqnComp2() + p_rghEqnIncomp,
|
||||
pimple.finalInnerIter()
|
||||
p_rghEqnComp1() + p_rghEqnComp2() + p_rghEqnIncomp
|
||||
);
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
|
||||
@ -86,12 +86,7 @@
|
||||
phasei++;
|
||||
}
|
||||
|
||||
solve
|
||||
(
|
||||
p_rghEqnComp
|
||||
+ p_rghEqnIncomp,
|
||||
pimple.finalInnerIter()
|
||||
);
|
||||
solve(p_rghEqnComp + p_rghEqnIncomp);
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
|
||||
p_rghEqn.solve(pimple.finalInnerIter());
|
||||
p_rghEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
nonOrthogonalSolutionControl pcorrControl(mesh, pimple.algorithmName());
|
||||
|
||||
CorrectPhi
|
||||
(
|
||||
U,
|
||||
@ -5,7 +7,7 @@ CorrectPhi
|
||||
p_rgh,
|
||||
surfaceScalarField("rAUf", fvc::interpolate(rAU())),
|
||||
geometricZeroField(),
|
||||
pimple
|
||||
pcorrControl
|
||||
);
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
@ -20,6 +20,8 @@ if (correctPhi)
|
||||
}
|
||||
else
|
||||
{
|
||||
nonOrthogonalSolutionControl pcorrControl(mesh, pimple.algorithmName());
|
||||
|
||||
CorrectPhi
|
||||
(
|
||||
U,
|
||||
@ -27,7 +29,7 @@ else
|
||||
p_rgh,
|
||||
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1),
|
||||
geometricZeroField(),
|
||||
pimple
|
||||
pcorrControl
|
||||
);
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
|
||||
p_rghEqn.solve(pimple.finalInnerIter());
|
||||
p_rghEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
nonOrthogonalSolutionControl pcorrControl(mesh, pimple.algorithmName());
|
||||
|
||||
CorrectPhi
|
||||
(
|
||||
U,
|
||||
@ -5,7 +7,7 @@ CorrectPhi
|
||||
p_rgh,
|
||||
surfaceScalarField("rAUf", fvc::interpolate(rAU())),
|
||||
divU,
|
||||
pimple
|
||||
pcorrControl
|
||||
);
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
@ -22,6 +22,8 @@ if (correctPhi)
|
||||
}
|
||||
else
|
||||
{
|
||||
nonOrthogonalSolutionControl pcorrControl(mesh, pimple.algorithmName());
|
||||
|
||||
CorrectPhi
|
||||
(
|
||||
U,
|
||||
@ -29,7 +31,7 @@ else
|
||||
p_rgh,
|
||||
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1),
|
||||
geometricZeroField(),
|
||||
pimple
|
||||
pcorrControl
|
||||
);
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
|
||||
p_rghEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
p_rghEqn.solve(pimple.finalInnerIter());
|
||||
p_rghEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
nonOrthogonalSolutionControl pcorrControl(mesh, pimple.algorithmName());
|
||||
|
||||
CorrectPhi
|
||||
(
|
||||
U,
|
||||
@ -5,7 +7,7 @@ CorrectPhi
|
||||
p_rgh,
|
||||
dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1),
|
||||
geometricZeroField(),
|
||||
pimple
|
||||
pcorrControl
|
||||
);
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
@ -229,8 +229,7 @@
|
||||
// (alpha1/rho1)*pEqnComp1()
|
||||
// + (alpha2/rho2)*pEqnComp2()
|
||||
// ) +
|
||||
pEqnIncomp,
|
||||
pimple.finalInnerIter()
|
||||
pEqnIncomp
|
||||
);
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
nonOrthogonalSolutionControl pcorrControl(mesh, pimple.algorithmName());
|
||||
|
||||
CorrectPhi
|
||||
(
|
||||
U,
|
||||
@ -5,7 +7,7 @@ CorrectPhi
|
||||
p_gh,
|
||||
surfaceScalarField("rAUf", fvc::interpolate(rAU)),
|
||||
geometricZeroField(),
|
||||
pimple
|
||||
pcorrControl
|
||||
);
|
||||
|
||||
#include "continuityErrs.H"
|
||||
|
||||
@ -36,7 +36,7 @@ while (pimple.correctNonOrthogonal())
|
||||
|
||||
p_ghEqn.setReference(p_ghRefCell, p_ghRefValue);
|
||||
|
||||
p_ghEqn.solve(pimple.finalInnerIter());
|
||||
p_ghEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -370,11 +370,7 @@ while (pimple.correct())
|
||||
}
|
||||
}
|
||||
|
||||
solve
|
||||
(
|
||||
pEqn,
|
||||
pimple.finalInnerIter()
|
||||
);
|
||||
pEqn.solve();
|
||||
}
|
||||
|
||||
// Correct fluxes and velocities on last non-orthogonal iteration
|
||||
|
||||
@ -358,11 +358,7 @@ while (pimple.correct())
|
||||
}
|
||||
}
|
||||
|
||||
solve
|
||||
(
|
||||
pEqn,
|
||||
pimple.finalInnerIter()
|
||||
);
|
||||
pEqn.solve();
|
||||
}
|
||||
|
||||
// Correct fluxes and velocities on last non-orthogonal iteration
|
||||
|
||||
@ -326,11 +326,7 @@ while (pimple.correct())
|
||||
pEqn += pEqnComp2();
|
||||
}
|
||||
|
||||
solve
|
||||
(
|
||||
pEqn,
|
||||
pimple.finalInnerIter()
|
||||
);
|
||||
pEqn.solve();
|
||||
}
|
||||
|
||||
// Correct fluxes and velocities on last non-orthogonal iteration
|
||||
|
||||
@ -336,11 +336,7 @@ while (pimple.correct())
|
||||
pEqn += pEqnComp2();
|
||||
}
|
||||
|
||||
solve
|
||||
(
|
||||
pEqn,
|
||||
pimple.finalInnerIter()
|
||||
);
|
||||
pEqn.solve();
|
||||
}
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
||||
|
||||
p_rghEqn.solve(pimple.finalInnerIter());
|
||||
p_rghEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
|
||||
@ -311,8 +311,7 @@ while (pimple.correct())
|
||||
|
||||
solve
|
||||
(
|
||||
pEqnComp1() + pEqnComp2() + pEqnIncomp,
|
||||
pimple.finalInnerIter()
|
||||
pEqnComp1() + pEqnComp2() + pEqnIncomp
|
||||
);
|
||||
|
||||
// Correct fluxes and velocities on last non-orthogonal iteration
|
||||
|
||||
@ -290,8 +290,7 @@ while (pimple.correct())
|
||||
|
||||
solve
|
||||
(
|
||||
pEqnComp1() + pEqnComp2() + pEqnIncomp,
|
||||
pimple.finalInnerIter()
|
||||
pEqnComp1() + pEqnComp2() + pEqnIncomp
|
||||
);
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
|
||||
@ -34,7 +34,7 @@ License
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "adjustPhi.H"
|
||||
#include "fvcMeshPhi.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "nonOrthogonalSolutionControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -46,7 +46,7 @@ void Foam::CorrectPhi
|
||||
const volScalarField& p,
|
||||
const RAUfType& rAUf,
|
||||
const DivUType& divU,
|
||||
pimpleControl& pimple
|
||||
nonOrthogonalSolutionControl& pcorrControl
|
||||
)
|
||||
{
|
||||
const fvMesh& mesh = U.mesh();
|
||||
@ -92,7 +92,7 @@ void Foam::CorrectPhi
|
||||
|
||||
mesh.setFluxRequired(pcorr.name());
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
while (pcorrControl.correctNonOrthogonal())
|
||||
{
|
||||
// Solve for pcorr such that the divergence of the corrected flux
|
||||
// matches the divU provided (from previous iteration, time-step...)
|
||||
@ -103,9 +103,9 @@ void Foam::CorrectPhi
|
||||
|
||||
pcorrEqn.setReference(0, 0);
|
||||
|
||||
pcorrEqn.solve(pimple.finalNonOrthogonalIter());
|
||||
pcorrEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
if (pcorrControl.finalNonOrthogonalIter())
|
||||
{
|
||||
phi -= pcorrEqn.flux();
|
||||
}
|
||||
@ -123,7 +123,7 @@ void Foam::CorrectPhi
|
||||
const volScalarField& psi,
|
||||
const RAUfType& rAUf,
|
||||
const DivRhoUType& divRhoU,
|
||||
pimpleControl& pimple
|
||||
nonOrthogonalSolutionControl& pcorrControl
|
||||
)
|
||||
{
|
||||
const fvMesh& mesh = U.mesh();
|
||||
@ -162,7 +162,7 @@ void Foam::CorrectPhi
|
||||
|
||||
mesh.setFluxRequired(pcorr.name());
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
while (pcorrControl.correctNonOrthogonal())
|
||||
{
|
||||
// Solve for pcorr such that the divergence of the corrected flux
|
||||
// matches the divRhoU provided (from previous iteration, time-step...)
|
||||
@ -175,9 +175,9 @@ void Foam::CorrectPhi
|
||||
divRhoU
|
||||
);
|
||||
|
||||
pcorrEqn.solve(pimple.finalNonOrthogonalIter());
|
||||
pcorrEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
if (pcorrControl.finalNonOrthogonalIter())
|
||||
{
|
||||
phi += pcorrEqn.flux();
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ SourceFiles
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
class pimpleControl;
|
||||
class nonOrthogonalSolutionControl;
|
||||
|
||||
//- If the mesh is moving correct the velocity BCs on the moving walls to
|
||||
// ensure the corrected fluxes and velocity are consistent
|
||||
@ -75,7 +75,7 @@ namespace Foam
|
||||
const volScalarField& p,
|
||||
const RAUfType& rAUf,
|
||||
const DivUType& divU,
|
||||
pimpleControl& pimple
|
||||
nonOrthogonalSolutionControl& pcorrControl
|
||||
);
|
||||
|
||||
template<class RAUfType, class DivRhoUType>
|
||||
@ -88,7 +88,7 @@ namespace Foam
|
||||
const volScalarField& psi,
|
||||
const RAUfType& rAUf,
|
||||
const DivRhoUType& divRhoU,
|
||||
pimpleControl& pimple
|
||||
nonOrthogonalSolutionControl& pcorrControl
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -68,17 +68,51 @@ bool Foam::pisoControl::read()
|
||||
}
|
||||
|
||||
|
||||
bool Foam::pisoControl::nonOrthSubLoop() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::pisoControl::correct()
|
||||
{
|
||||
static bool finalIteration = false;
|
||||
|
||||
read();
|
||||
|
||||
if (corrPISO_ == 0)
|
||||
{
|
||||
finalIteration =
|
||||
mesh().data::lookupOrDefault<bool>("finalIteration", false);
|
||||
|
||||
if (finalIteration)
|
||||
{
|
||||
mesh().data::remove("finalIteration");
|
||||
}
|
||||
}
|
||||
|
||||
if (finalPISOIter())
|
||||
{
|
||||
corrPISO_ = 0;
|
||||
|
||||
if
|
||||
(
|
||||
!finalIteration
|
||||
&& mesh().data::lookupOrDefault<bool>("finalIteration", false)
|
||||
)
|
||||
{
|
||||
mesh().data::remove("finalIteration");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
++ corrPISO_;
|
||||
corrPISO_++;
|
||||
|
||||
if (finalPISOIter())
|
||||
{
|
||||
mesh().data::add("finalIteration", true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -90,6 +90,7 @@ public:
|
||||
//- Read controls
|
||||
virtual bool read();
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Maximum number of PISO correctors
|
||||
@ -105,6 +106,9 @@ public:
|
||||
// non-orthogonal)
|
||||
inline bool finalInnerIter() const;
|
||||
|
||||
//- Return true as the non-orthogonality loop is subsidiary
|
||||
virtual bool nonOrthSubLoop() const;
|
||||
|
||||
|
||||
// Evolution
|
||||
|
||||
|
||||
@ -62,6 +62,12 @@ bool Foam::simpleControl::read()
|
||||
}
|
||||
|
||||
|
||||
bool Foam::simpleControl::nonOrthSubLoop() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::simpleControl::run(Time& time)
|
||||
{
|
||||
read();
|
||||
|
||||
@ -91,6 +91,13 @@ public:
|
||||
//- Read controls
|
||||
virtual bool read();
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Return true as the non-orthogonality loop is subsidiary
|
||||
virtual bool nonOrthSubLoop() const;
|
||||
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Time run loop
|
||||
|
||||
@ -73,17 +73,51 @@ bool Foam::nonOrthogonalSolutionControl::read()
|
||||
}
|
||||
|
||||
|
||||
bool Foam::nonOrthogonalSolutionControl::nonOrthSubLoop() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::nonOrthogonalSolutionControl::correctNonOrthogonal()
|
||||
{
|
||||
static bool finalIteration = false;
|
||||
|
||||
read();
|
||||
|
||||
if (nonOrthCorr_ == 0)
|
||||
{
|
||||
finalIteration =
|
||||
mesh().data::lookupOrDefault<bool>("finalIteration", false);
|
||||
|
||||
if (finalIteration)
|
||||
{
|
||||
mesh().data::remove("finalIteration");
|
||||
}
|
||||
}
|
||||
|
||||
if (finalNonOrthogonalIter())
|
||||
{
|
||||
nonOrthCorr_ = 0;
|
||||
|
||||
if
|
||||
(
|
||||
!finalIteration
|
||||
&& mesh().data::lookupOrDefault<bool>("finalIteration", false)
|
||||
)
|
||||
{
|
||||
mesh().data::remove("finalIteration");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
++ nonOrthCorr_;
|
||||
nonOrthCorr_++;
|
||||
|
||||
if (finalNonOrthogonalIter() && (finalIteration || !nonOrthSubLoop()))
|
||||
{
|
||||
mesh().data::add("finalIteration", true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -88,6 +88,7 @@ public:
|
||||
//- Read controls
|
||||
virtual bool read();
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Maximum number of non-orthogonal correctors
|
||||
@ -99,8 +100,13 @@ public:
|
||||
//- Flag to indicate the last non-orthogonal iteration
|
||||
inline bool finalNonOrthogonalIter() const;
|
||||
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Return true if the non-orthogonality loop is a subsidiary
|
||||
// i.e. a sub-loop of the PISO or PIMPLE algorithms
|
||||
virtual bool nonOrthSubLoop() const;
|
||||
|
||||
//- Non-orthogonal corrector loop
|
||||
bool correctNonOrthogonal();
|
||||
};
|
||||
|
||||
@ -406,15 +406,6 @@ public:
|
||||
// Solver controls read from fvSolution
|
||||
SolverPerformance<Type> solve(const word& name);
|
||||
|
||||
//- Solve segregated or coupled returning the solution statistics.
|
||||
// Solver controls read from fvSolution
|
||||
// Required to avoid ambiguity from char* -> bool conversion
|
||||
SolverPerformance<Type> solve(const char* name);
|
||||
|
||||
//- Solve returning the solution statistics.
|
||||
// Solver controls read from fvSolution
|
||||
SolverPerformance<Type> solve(const bool final);
|
||||
|
||||
//- Solve returning the solution statistics.
|
||||
// Solver controls read from fvSolution
|
||||
SolverPerformance<Type> solve();
|
||||
@ -567,12 +558,6 @@ void checkMethod
|
||||
template<class Type>
|
||||
SolverPerformance<Type> solve(fvMatrix<Type>&, const word&);
|
||||
|
||||
//- Solve returning the solution statistics given convergence tolerance
|
||||
// Use the given solver controls
|
||||
// Required to avoid ambiguity from char* -> bool conversion
|
||||
template<class Type>
|
||||
SolverPerformance<Type> solve(fvMatrix<Type>&, const char*);
|
||||
|
||||
//- Solve returning the solution statistics given convergence tolerance,
|
||||
// deleting temporary matrix after solution.
|
||||
// Use the given solver controls
|
||||
@ -583,28 +568,6 @@ SolverPerformance<Type> solve
|
||||
const word&
|
||||
);
|
||||
|
||||
//- Solve returning the solution statistics given convergence tolerance,
|
||||
// deleting temporary matrix after solution.
|
||||
// Use the given solver controls
|
||||
// Required to avoid ambiguity from char* -> bool conversion
|
||||
template<class Type>
|
||||
SolverPerformance<Type> solve
|
||||
(
|
||||
const tmp<fvMatrix<Type>>&,
|
||||
const char*
|
||||
);
|
||||
|
||||
//- Solve returning the solution statistics given convergence tolerance
|
||||
// Solver controls read fvSolution
|
||||
template<class Type>
|
||||
SolverPerformance<Type> solve(fvMatrix<Type>&, const bool final);
|
||||
|
||||
//- Solve returning the solution statistics given convergence tolerance,
|
||||
// deleting temporary matrix after solution.
|
||||
// Solver controls read fvSolution
|
||||
template<class Type>
|
||||
SolverPerformance<Type> solve(const tmp<fvMatrix<Type>>&, const bool final);
|
||||
|
||||
//- Solve returning the solution statistics given convergence tolerance
|
||||
// Solver controls read fvSolution
|
||||
template<class Type>
|
||||
|
||||
@ -326,29 +326,21 @@ Foam::SolverPerformance<Type> Foam::fvMatrix<Type>::solve(const word& name)
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::SolverPerformance<Type> Foam::fvMatrix<Type>::solve(const char* name)
|
||||
{
|
||||
return solve(word(name));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::SolverPerformance<Type> Foam::fvMatrix<Type>::solve(const bool final)
|
||||
{
|
||||
return solve(psi_.mesh().solverDict(psi_.select(final)));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::SolverPerformance<Type> Foam::fvMatrix<Type>::solve()
|
||||
{
|
||||
return solve
|
||||
(
|
||||
psi_.mesh().data::template lookupOrDefault<bool>
|
||||
psi_.mesh().solverDict
|
||||
(
|
||||
"finalIteration",
|
||||
false
|
||||
psi_.select
|
||||
(
|
||||
psi_.mesh().data::template lookupOrDefault<bool>
|
||||
(
|
||||
"finalIteration",
|
||||
false
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -406,17 +398,6 @@ Foam::SolverPerformance<Type> Foam::solve
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::SolverPerformance<Type> Foam::solve
|
||||
(
|
||||
fvMatrix<Type>& fvm,
|
||||
const char* name
|
||||
)
|
||||
{
|
||||
return fvm.solve(name);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::SolverPerformance<Type> Foam::solve
|
||||
(
|
||||
@ -433,44 +414,6 @@ Foam::SolverPerformance<Type> Foam::solve
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::SolverPerformance<Type> Foam::solve
|
||||
(
|
||||
const tmp<fvMatrix<Type>>& tfvm,
|
||||
const char* name
|
||||
)
|
||||
{
|
||||
SolverPerformance<Type> solverPerf =
|
||||
const_cast<fvMatrix<Type>&>(tfvm()).solve(name);
|
||||
|
||||
tfvm.clear();
|
||||
|
||||
return solverPerf;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::SolverPerformance<Type> Foam::solve(fvMatrix<Type>& fvm, const bool final)
|
||||
{
|
||||
return fvm.solve(final);
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
Foam::SolverPerformance<Type> Foam::solve
|
||||
(
|
||||
const tmp<fvMatrix<Type>>& tfvm,
|
||||
const bool final
|
||||
)
|
||||
{
|
||||
SolverPerformance<Type> solverPerf =
|
||||
const_cast<fvMatrix<Type>&>(tfvm()).solve(final);
|
||||
|
||||
tfvm.clear();
|
||||
|
||||
return solverPerf;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::SolverPerformance<Type> Foam::solve(fvMatrix<Type>& fvm)
|
||||
{
|
||||
|
||||
@ -17,7 +17,7 @@ FoamFile
|
||||
|
||||
solvers
|
||||
{
|
||||
p
|
||||
"p.*"
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
|
||||
@ -44,7 +44,7 @@ solvers
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
"(U|B)"
|
||||
"(U|B).*"
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother symGaussSeidel;
|
||||
|
||||
Reference in New Issue
Block a user