Modified pisoFoam according to vanilla 3.0.1

This commit is contained in:
Vanja Skuric 2016-04-09 22:55:19 +02:00
parent 42c61d36a3
commit 9213922a18

View file

@ -34,15 +34,19 @@ Description
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulenceModel.H"
#include "pisoControl.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# 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,14 @@ 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 rUA = 1.0/UEqn.A();
@ -88,7 +91,7 @@ int main(int argc, char *argv[])
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
while (piso.correctNonOrthogonal())
{
// Pressure corrector
@ -99,11 +102,7 @@ int main(int argc, char *argv[])
pEqn.setReference(pRefCell, pRefValue);
if
(
corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
if (piso.finalInnerIter())
{
pEqn.solve(mesh.solutionDict().solver("pFinal"));
}
@ -112,7 +111,7 @@ int main(int argc, char *argv[])
pEqn.solve();
}
if (nonOrth == nNonOrthCorr)
if (piso.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
}