Modified pisoFoam according to vanilla 3.0.1
This commit is contained in:
parent
42c61d36a3
commit
9213922a18
1 changed files with 10 additions and 11 deletions
|
@ -34,15 +34,19 @@ Description
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "singlePhaseTransportModel.H"
|
#include "singlePhaseTransportModel.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
|
#include "pisoControl.H"
|
||||||
|
#include "fvOptions.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
|
pisoControl piso(mesh);
|
||||||
|
|
||||||
# include "createFields.H"
|
# include "createFields.H"
|
||||||
# include "initContinuityErrs.H"
|
# include "initContinuityErrs.H"
|
||||||
|
|
||||||
|
@ -54,7 +58,6 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
# include "readPISOControls.H"
|
|
||||||
# include "CourantNo.H"
|
# include "CourantNo.H"
|
||||||
|
|
||||||
// Pressure-velocity PISO corrector
|
// Pressure-velocity PISO corrector
|
||||||
|
@ -70,14 +73,14 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn.relax();
|
||||||
|
|
||||||
if (momentumPredictor)
|
if (piso.momentumPredictor())
|
||||||
{
|
{
|
||||||
solve(UEqn == -fvc::grad(p));
|
solve(UEqn == -fvc::grad(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- PISO loop
|
// --- PISO loop
|
||||||
|
|
||||||
for (int corr = 0; corr < nCorr; corr++)
|
while (piso.correct())
|
||||||
{
|
{
|
||||||
volScalarField rUA = 1.0/UEqn.A();
|
volScalarField rUA = 1.0/UEqn.A();
|
||||||
|
|
||||||
|
@ -88,7 +91,7 @@ int main(int argc, char *argv[])
|
||||||
adjustPhi(phi, U, p);
|
adjustPhi(phi, U, p);
|
||||||
|
|
||||||
// Non-orthogonal pressure corrector loop
|
// Non-orthogonal pressure corrector loop
|
||||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
while (piso.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
// Pressure corrector
|
// Pressure corrector
|
||||||
|
|
||||||
|
@ -99,11 +102,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
pEqn.setReference(pRefCell, pRefValue);
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
if
|
if (piso.finalInnerIter())
|
||||||
(
|
|
||||||
corr == nCorr-1
|
|
||||||
&& nonOrth == nNonOrthCorr
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
pEqn.solve(mesh.solutionDict().solver("pFinal"));
|
pEqn.solve(mesh.solutionDict().solver("pFinal"));
|
||||||
}
|
}
|
||||||
|
@ -112,7 +111,7 @@ int main(int argc, char *argv[])
|
||||||
pEqn.solve();
|
pEqn.solve();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nonOrth == nNonOrthCorr)
|
if (piso.finalNonOrthogonalIter())
|
||||||
{
|
{
|
||||||
phi -= pEqn.flux();
|
phi -= pEqn.flux();
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue