2010-08-26 14:22:03 +00:00
|
|
|
rho = thermo.rho();
|
|
|
|
|
|
|
|
volScalarField rUA = 1.0/UEqn().A();
|
|
|
|
U = rUA*UEqn().H();
|
|
|
|
|
2016-05-26 07:42:51 +00:00
|
|
|
if (pimple.nCorrPISO() <= 1)
|
2010-08-26 14:22:03 +00:00
|
|
|
{
|
|
|
|
UEqn.clear();
|
|
|
|
}
|
|
|
|
|
2016-05-26 07:42:51 +00:00
|
|
|
if (pimple.transonic())
|
2010-08-26 14:22:03 +00:00
|
|
|
{
|
|
|
|
surfaceScalarField phid
|
|
|
|
(
|
|
|
|
"phid",
|
|
|
|
fvc::interpolate(psi)
|
|
|
|
*(
|
|
|
|
(fvc::interpolate(U) & mesh.Sf())
|
|
|
|
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
mrfZones.relativeFlux(fvc::interpolate(psi), phid);
|
|
|
|
|
2016-05-26 07:42:51 +00:00
|
|
|
while (pimple.correctNonOrthogonal())
|
2010-08-26 14:22:03 +00:00
|
|
|
{
|
|
|
|
fvScalarMatrix pEqn
|
|
|
|
(
|
|
|
|
fvm::ddt(psi, p)
|
|
|
|
+ fvm::div(phid, p)
|
|
|
|
- fvm::laplacian(rho*rUA, p)
|
|
|
|
);
|
|
|
|
|
2016-05-26 07:42:51 +00:00
|
|
|
pEqn.solve
|
2010-08-26 14:22:03 +00:00
|
|
|
(
|
2016-05-26 07:42:51 +00:00
|
|
|
mesh.solutionDict().solver(p.select(pimple.finalInnerIter()))
|
|
|
|
);
|
2010-08-26 14:22:03 +00:00
|
|
|
|
2016-05-26 07:42:51 +00:00
|
|
|
if (pimple.finalNonOrthogonalIter())
|
2010-08-26 14:22:03 +00:00
|
|
|
{
|
|
|
|
phi == pEqn.flux();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
phi =
|
|
|
|
fvc::interpolate(rho)*
|
|
|
|
(
|
|
|
|
(fvc::interpolate(U) & mesh.Sf())
|
|
|
|
//+ fvc::ddtPhiCorr(rUA, rho, U, phi)
|
|
|
|
);
|
|
|
|
mrfZones.relativeFlux(fvc::interpolate(rho), phi);
|
|
|
|
|
2016-05-26 07:42:51 +00:00
|
|
|
while (pimple.correctNonOrthogonal())
|
2010-08-26 14:22:03 +00:00
|
|
|
{
|
|
|
|
// Pressure corrector
|
|
|
|
fvScalarMatrix pEqn
|
|
|
|
(
|
|
|
|
fvm::ddt(psi, p)
|
|
|
|
+ fvc::div(phi)
|
|
|
|
- fvm::laplacian(rho*rUA, p)
|
|
|
|
);
|
|
|
|
|
2016-05-26 07:42:51 +00:00
|
|
|
pEqn.solve
|
2010-08-26 14:22:03 +00:00
|
|
|
(
|
2016-05-26 07:42:51 +00:00
|
|
|
mesh.solutionDict().solver(p.select(pimple.finalInnerIter()))
|
|
|
|
);
|
2010-08-26 14:22:03 +00:00
|
|
|
|
2016-05-26 07:42:51 +00:00
|
|
|
if (pimple.finalNonOrthogonalIter())
|
2010-08-26 14:22:03 +00:00
|
|
|
{
|
|
|
|
phi += pEqn.flux();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "rhoEqn.H"
|
|
|
|
#include "compressibleContinuityErrs.H"
|
|
|
|
|
|
|
|
//if (oCorr != nOuterCorr-1)
|
|
|
|
{
|
|
|
|
// Explicitly relax pressure for momentum corrector
|
|
|
|
p.relax();
|
|
|
|
|
|
|
|
rho = thermo.rho();
|
|
|
|
rho.relax();
|
|
|
|
Info<< "rho max/min : " << max(rho).value()
|
|
|
|
<< " " << min(rho).value() << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
U -= rUA*fvc::grad(p);
|
|
|
|
U.correctBoundaryConditions();
|
|
|
|
|
|
|
|
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
|
|
|
|
|
|
|
bound(p, pMin);
|
|
|
|
|
|
|
|
// For closed-volume cases adjust the pressure and density levels
|
|
|
|
// to obey overall mass continuity
|
|
|
|
/*
|
|
|
|
if (closedVolume)
|
|
|
|
{
|
|
|
|
p += (initialMass - fvc::domainIntegrate(psi*p))
|
|
|
|
/fvc::domainIntegrate(psi);
|
|
|
|
}
|
|
|
|
*/
|