pimpleControl and pisoControl: Rationalize PISO and PIMPLE control

This commit is contained in:
Henry
2015-02-10 13:47:18 +00:00
parent 927498accb
commit 78f8e84d01
12 changed files with 203 additions and 60 deletions

View File

@ -52,4 +52,4 @@
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
setRefCell(p, piso.dict(), pRefCell, pRefValue);

View File

@ -36,4 +36,4 @@
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
setRefCell(p, piso.dict(), pRefCell, pRefValue);

View File

@ -31,7 +31,7 @@
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
setRefCell(p, piso.dict(), pRefCell, pRefValue);
singlePhaseTransportModel laminarTransport(U, phi);

View File

@ -34,6 +34,7 @@ Description
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "pisoControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,6 +44,9 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
pisoControl piso(mesh);
#include "createFields.H"
#include "initContinuityErrs.H"
@ -54,7 +58,6 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readPISOControls.H"
#include "CourantNo.H"
// Pressure-velocity PISO corrector
@ -70,14 +73,13 @@ int main(int argc, char *argv[])
UEqn.relax();
if (momentumPredictor)
if (piso.momentumPredictor())
{
solve(UEqn == -fvc::grad(p));
}
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
while (piso.correct())
{
volScalarField rAU(1.0/UEqn.A());
@ -93,7 +95,7 @@ int main(int argc, char *argv[])
adjustPhi(phiHbyA, U, p);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
while (piso.correctNonOrthogonal())
{
// Pressure corrector
@ -104,20 +106,9 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue);
if
(
corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver("pFinal"));
}
else
{
pEqn.solve();
}
pEqn.solve(mesh.solver(p.select(piso.finalInnerIter())));
if (nonOrth == nNonOrthCorr)
if (piso.finalNonOrthogonalIter())
{
phi = phiHbyA - pEqn.flux();
}