ENH: Updated solvers to use simpleControl and pimpleControl

This commit is contained in:
andy
2011-04-14 17:45:20 +01:00
parent a1577b8aa8
commit 656bbf5308
117 changed files with 461 additions and 656 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -36,6 +36,7 @@ Description
#include "multiphaseMixture.H"
#include "turbulenceModel.H"
#include "MRFZones.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,7 +45,9 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readPISOControls.H"
pimpleControl pimple(mesh);
#include "initContinuityErrs.H"
#include "createFields.H"
#include "createMRFZones.H"
@ -59,7 +62,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readPISOControls.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "alphaCourantNo.H"
@ -73,12 +75,16 @@ int main(int argc, char *argv[])
rho = mixture.rho();
#include "zonePhaseVolumes.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "pEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
}
turbulence->correct();

View File

@ -17,7 +17,7 @@
UEqn.relax();
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve
(

View File

@ -20,7 +20,7 @@
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf();
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for(int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix p_rghEqn
(
@ -31,13 +31,10 @@
p_rghEqn.solve
(
mesh.solver
(
p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr)
)
mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi -= p_rghEqn.flux();
}

View File

@ -16,7 +16,7 @@
UEqn.relax();
if (momentumPredictor)
if (pimple.momentumPredictor())
{
solve
(

View File

@ -76,7 +76,7 @@
(
p,
p_rgh,
mesh.solutionDict().subDict("PISO"),
mesh.solutionDict().subDict("PIMPLE"),
pRefCell,
pRefValue
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,6 +35,7 @@ Description
#include "fvCFD.H"
#include "multiphaseMixture.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,10 +44,12 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "readTimeControls.H"
pimpleControl pimple(mesh);
#include "correctPhi.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
@ -57,7 +60,6 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readPISOControls.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "alphaCourantNo.H"
@ -70,12 +72,16 @@ int main(int argc, char *argv[])
mixture.solve();
rho = mixture.rho();
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
// --- Pressure-velocity PIMPLE corrector loop
for (pimple.start(); pimple.loop(); pimple++)
{
#include "pEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<pimple.nCorr(); corr++)
{
#include "pEqn.H"
}
}
turbulence->correct();

View File

@ -245,28 +245,15 @@ void Foam::multiphaseMixture::solve()
const Time& runTime = mesh_.time();
label nAlphaSubCycles
(
readLabel
(
mesh_.solutionDict().subDict("PISO").lookup("nAlphaSubCycles")
)
);
const dictionary& pimpleDict = mesh_.solutionDict().subDict("PIMPLE");
label nAlphaCorr
(
readLabel(mesh_.solutionDict().subDict("PISO").lookup("nAlphaCorr"))
);
label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles")));
bool cycleAlpha
(
Switch(mesh_.solutionDict().subDict("PISO").lookup("cycleAlpha"))
);
label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr")));
scalar cAlpha
(
readScalar(mesh_.solutionDict().subDict("PISO").lookup("cAlpha"))
);
bool cycleAlpha(Switch(pimpleDict.lookup("cycleAlpha")));
scalar cAlpha(readScalar(pimpleDict.lookup("cAlpha")));
volScalarField& alpha = phases_.first();

View File

@ -19,7 +19,7 @@
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf();
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
{
fvScalarMatrix p_rghEqn
(
@ -30,13 +30,10 @@
p_rghEqn.solve
(
mesh.solver
(
p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr)
)
mesh.solver(p_rgh.select(pimple.finalInnerIter(corr, nonOrth)))
);
if (nonOrth == nNonOrthCorr)
if (nonOrth == pimple.nNonOrthCorr())
{
phi -= p_rghEqn.flux();
}