ENH: reactingParcelFoam: moved hs out of PISO loop and added pFinal

This commit is contained in:
andy
2011-03-24 14:58:03 +00:00
parent 6f47073d34
commit 2c074892b0
2 changed files with 44 additions and 10 deletions

View File

@ -26,7 +26,18 @@ if (transonic)
parcels.Srho()
);
pEqn.solve();
pEqn.solve
(
mesh.solver
(
p.select
(
finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);
if (nonOrth == nNonOrthCorr)
{
@ -54,7 +65,18 @@ else
parcels.Srho()
);
pEqn.solve();
pEqn.solve
(
mesh.solver
(
p.select
(
finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);
if (nonOrth == nNonOrthCorr)
{
@ -66,7 +88,10 @@ else
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
rho = thermo.rho();
U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,23 +78,32 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- PIMPLE loop
for (int ocorr=1; ocorr<=nOuterCorr; ocorr++)
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
bool finalIter = oCorr == nOuterCorr-1;
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
#include "UEqn.H"
#include "YEqn.H"
#include "hsEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
for (int corr=0; corr<nCorr; corr++)
{
#include "hsEqn.H"
#include "pEqn.H"
}
turbulence->correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
turbulence->correct();
rho = thermo.rho();
if (runTime.write())
{
chemistry.dQ()().write();