interFoam solvers update: PIMPLE
This commit is contained in:
parent
83ffa19dbc
commit
c9d2fdcb2d
13 changed files with 142 additions and 93 deletions
|
@ -49,7 +49,7 @@ int main(int argc, char *argv[])
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createDynamicFvMesh.H"
|
# include "createDynamicFvMesh.H"
|
||||||
# include "readGravitationalAcceleration.H"
|
# include "readGravitationalAcceleration.H"
|
||||||
# include "readPISOControls.H"
|
# include "readPIMPLEControls.H"
|
||||||
# include "initContinuityErrs.H"
|
# include "initContinuityErrs.H"
|
||||||
# include "createFields.H"
|
# include "createFields.H"
|
||||||
# include "readTimeControls.H"
|
# include "readTimeControls.H"
|
||||||
|
@ -96,31 +96,36 @@ int main(int argc, char *argv[])
|
||||||
# include "meshCourantNo.H"
|
# include "meshCourantNo.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
twoPhaseProperties.correct();
|
// Pressure-velocity corrector
|
||||||
|
int oCorr = 0;
|
||||||
# include "alphaEqnSubCycle.H"
|
do
|
||||||
|
|
||||||
# include "UEqn.H"
|
|
||||||
|
|
||||||
// --- PISO loop
|
|
||||||
for (int corr = 0; corr < nCorr; corr++)
|
|
||||||
{
|
{
|
||||||
# include "pEqn.H"
|
twoPhaseProperties.correct();
|
||||||
}
|
|
||||||
|
|
||||||
p = pd + rho*gh;
|
# include "alphaEqnSubCycle.H"
|
||||||
|
|
||||||
if (pd.needReference())
|
# include "UEqn.H"
|
||||||
{
|
|
||||||
p += dimensionedScalar
|
|
||||||
(
|
|
||||||
"p",
|
|
||||||
p.dimensions(),
|
|
||||||
pRefValue - getRefCellValue(p, pdRefCell)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
turbulence->correct();
|
// --- PISO loop
|
||||||
|
for (int corr = 0; corr < nCorr; corr++)
|
||||||
|
{
|
||||||
|
# include "pEqn.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
p = pd + rho*gh;
|
||||||
|
|
||||||
|
if (pd.needReference())
|
||||||
|
{
|
||||||
|
p += dimensionedScalar
|
||||||
|
(
|
||||||
|
"p",
|
||||||
|
p.dimensions(),
|
||||||
|
pRefValue - getRefCellValue(p, pdRefCell)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
turbulence->correct();
|
||||||
|
} while (++oCorr < nOuterCorr);
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
# include "readTimeControls.H"
|
# include "readTimeControls.H"
|
||||||
# include "readPISOControls.H"
|
# include "readPIMPLEControls.H"
|
||||||
|
|
||||||
bool correctPhi = true;
|
bool correctPhi = true;
|
||||||
if (piso.found("correctPhi"))
|
if (pimple.found("correctPhi"))
|
||||||
{
|
{
|
||||||
correctPhi = Switch(piso.lookup("correctPhi"));
|
correctPhi = Switch(pimple.lookup("correctPhi"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool checkMeshCourantNo = false;
|
bool checkMeshCourantNo = false;
|
||||||
if (piso.found("checkMeshCourantNo"))
|
if (pimple.found("checkMeshCourantNo"))
|
||||||
{
|
{
|
||||||
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
|
checkMeshCourantNo = Switch(pimple.lookup("checkMeshCourantNo"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
label nAlphaCorr
|
label nAlphaCorr
|
||||||
(
|
(
|
||||||
readLabel(piso.lookup("nAlphaCorr"))
|
readLabel(pimple.lookup("nAlphaCorr"))
|
||||||
);
|
);
|
||||||
|
|
||||||
label nAlphaSubCycles
|
label nAlphaSubCycles
|
||||||
(
|
(
|
||||||
readLabel(piso.lookup("nAlphaSubCycles"))
|
readLabel(pimple.lookup("nAlphaSubCycles"))
|
||||||
);
|
);
|
||||||
|
|
||||||
if (nAlphaSubCycles > 1)
|
if (nAlphaSubCycles > 1)
|
||||||
|
|
|
@ -49,17 +49,17 @@ Description
|
||||||
|
|
||||||
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"
|
||||||
#include "readGravitationalAcceleration.H"
|
# include "readGravitationalAcceleration.H"
|
||||||
#include "readPISOControls.H"
|
# include "readPIMPLEControls.H"
|
||||||
#include "initContinuityErrs.H"
|
# include "initContinuityErrs.H"
|
||||||
#include "createFields.H"
|
# include "createFields.H"
|
||||||
#include "readTimeControls.H"
|
# include "readTimeControls.H"
|
||||||
#include "correctPhi.H"
|
# include "correctPhi.H"
|
||||||
#include "CourantNo.H"
|
# include "CourantNo.H"
|
||||||
#include "setInitialDeltaT.H"
|
# include "setInitialDeltaT.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -67,42 +67,47 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
while (runTime.run())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
#include "readPISOControls.H"
|
# include "readPIMPLEControls.H"
|
||||||
#include "readTimeControls.H"
|
# include "readTimeControls.H"
|
||||||
#include "CourantNo.H"
|
# include "CourantNo.H"
|
||||||
#include "setDeltaT.H"
|
# include "setDeltaT.H"
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
twoPhaseProperties.correct();
|
// Pressure-velocity corrector
|
||||||
|
int oCorr = 0;
|
||||||
#include "alphaEqnSubCycle.H"
|
do
|
||||||
|
|
||||||
#include "UEqn.H"
|
|
||||||
|
|
||||||
// --- PISO loop
|
|
||||||
for (int corr = 0; corr < nCorr; corr++)
|
|
||||||
{
|
{
|
||||||
#include "pEqn.H"
|
twoPhaseProperties.correct();
|
||||||
}
|
|
||||||
|
|
||||||
#include "continuityErrs.H"
|
# include "alphaEqnSubCycle.H"
|
||||||
|
|
||||||
p = pd + rho*gh;
|
# include "UEqn.H"
|
||||||
|
|
||||||
if (pd.needReference())
|
// --- PISO loop
|
||||||
{
|
for (int corr = 0; corr < nCorr; corr++)
|
||||||
p += dimensionedScalar
|
{
|
||||||
(
|
# include "pEqn.H"
|
||||||
"p",
|
}
|
||||||
p.dimensions(),
|
|
||||||
pRefValue - getRefCellValue(p, pdRefCell)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
turbulence->correct();
|
# include "continuityErrs.H"
|
||||||
|
|
||||||
|
p = pd + rho*gh;
|
||||||
|
|
||||||
|
if (pd.needReference())
|
||||||
|
{
|
||||||
|
p += dimensionedScalar
|
||||||
|
(
|
||||||
|
"p",
|
||||||
|
p.dimensions(),
|
||||||
|
pRefValue - getRefCellValue(p, pdRefCell)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
turbulence->correct();
|
||||||
|
} while (++oCorr < nOuterCorr);
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|
||||||
|
|
|
@ -115,8 +115,13 @@ solvers
|
||||||
|
|
||||||
PISO
|
PISO
|
||||||
{
|
{
|
||||||
momentumPredictor no;
|
cAlpha 1;
|
||||||
nCorrectors 3;
|
}
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
momentumPredictor yes;
|
||||||
|
nOuterCorrectors 1;
|
||||||
|
nCorrectors 4;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 3;
|
nAlphaSubCycles 3;
|
||||||
|
|
|
@ -107,12 +107,16 @@ solvers
|
||||||
|
|
||||||
PISO
|
PISO
|
||||||
{
|
{
|
||||||
momentumPredictor no;
|
cAlpha 1;
|
||||||
nCorrectors 3;
|
}
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
momentumPredictor yes;
|
||||||
|
nOuterCorrectors 1;
|
||||||
|
nCorrectors 4;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 3;
|
nAlphaSubCycles 3;
|
||||||
cAlpha 1;
|
|
||||||
pRefPoint ( 0.51 0.51 0.51 );
|
pRefPoint ( 0.51 0.51 0.51 );
|
||||||
pRefValue 0;
|
pRefValue 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,8 +111,13 @@ solvers
|
||||||
|
|
||||||
PISO
|
PISO
|
||||||
{
|
{
|
||||||
momentumPredictor no;
|
cAlpha 1;
|
||||||
nCorrectors 2;
|
}
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
momentumPredictor yes;
|
||||||
|
nOuterCorrectors 1;
|
||||||
|
nCorrectors 4;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 3;
|
nAlphaSubCycles 3;
|
||||||
|
|
|
@ -91,12 +91,16 @@ solvers
|
||||||
|
|
||||||
PISO
|
PISO
|
||||||
{
|
{
|
||||||
momentumPredictor no;
|
cAlpha 1;
|
||||||
nCorrectors 2;
|
}
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
momentumPredictor yes;
|
||||||
|
nOuterCorrectors 1;
|
||||||
|
nCorrectors 4;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 3;
|
nAlphaSubCycles 3;
|
||||||
cAlpha 1.5;
|
|
||||||
correctPhi no;
|
correctPhi no;
|
||||||
|
|
||||||
pdRefPoint (0 0 0.15);
|
pdRefPoint (0 0 0.15);
|
||||||
|
|
|
@ -91,12 +91,16 @@ solvers
|
||||||
|
|
||||||
PISO
|
PISO
|
||||||
{
|
{
|
||||||
momentumPredictor no;
|
cAlpha 1;
|
||||||
nCorrectors 2;
|
}
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
momentumPredictor yes;
|
||||||
|
nOuterCorrectors 1;
|
||||||
|
nCorrectors 4;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 3;
|
nAlphaSubCycles 3;
|
||||||
cAlpha 1.5;
|
|
||||||
correctPhi no;
|
correctPhi no;
|
||||||
|
|
||||||
pdRefPoint (0 0 0.15);
|
pdRefPoint (0 0 0.15);
|
||||||
|
|
|
@ -91,12 +91,17 @@ solvers
|
||||||
|
|
||||||
PISO
|
PISO
|
||||||
{
|
{
|
||||||
momentumPredictor no;
|
cAlpha 1;
|
||||||
nCorrectors 2;
|
}
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
momentumPredictor yes;
|
||||||
|
|
||||||
|
nOuterCorrectors 1;
|
||||||
|
nCorrectors 4;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 3;
|
nAlphaSubCycles 3;
|
||||||
cAlpha 1.5;
|
|
||||||
correctPhi no;
|
correctPhi no;
|
||||||
|
|
||||||
pdRefPoint (0 0 0.15);
|
pdRefPoint (0 0 0.15);
|
||||||
|
|
|
@ -91,12 +91,16 @@ solvers
|
||||||
|
|
||||||
PISO
|
PISO
|
||||||
{
|
{
|
||||||
momentumPredictor no;
|
cAlpha 1;
|
||||||
nCorrectors 2;
|
}
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
momentumPredictor yes;
|
||||||
|
nOuterCorrectors 1;
|
||||||
|
nCorrectors 4;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 3;
|
nAlphaSubCycles 3;
|
||||||
cAlpha 1.5;
|
|
||||||
correctPhi no;
|
correctPhi no;
|
||||||
|
|
||||||
pdRefPoint (0 0 0.15);
|
pdRefPoint (0 0 0.15);
|
||||||
|
|
|
@ -49,15 +49,19 @@ solvers
|
||||||
relTol 0;
|
relTol 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PISO
|
PISO
|
||||||
|
{
|
||||||
|
cAlpha 1;
|
||||||
|
}
|
||||||
|
PIMPLE
|
||||||
{
|
{
|
||||||
momentumPredictor yes;
|
momentumPredictor yes;
|
||||||
nCorrectors 3;
|
nOuterCorrectors 1;
|
||||||
|
nCorrectors 4;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 2;
|
nAlphaSubCycles 2;
|
||||||
cAlpha 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
|
@ -115,12 +115,16 @@ solvers
|
||||||
|
|
||||||
PISO
|
PISO
|
||||||
{
|
{
|
||||||
momentumPredictor no;
|
cAlpha 1;
|
||||||
nCorrectors 2;
|
}
|
||||||
nNonOrthogonalCorrectors 1;
|
PIMPLE
|
||||||
|
{
|
||||||
|
momentumPredictor yes;
|
||||||
|
nOuterCorrectors 1;
|
||||||
|
nCorrectors 4;
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 4;
|
nAlphaSubCycles 1;
|
||||||
cAlpha 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
Reference in a new issue