2010-05-12 13:27:55 +00:00
|
|
|
{
|
2010-08-26 14:22:03 +00:00
|
|
|
bool closedVolume = p.needReference();
|
2010-05-12 13:27:55 +00:00
|
|
|
|
2010-08-26 14:22:03 +00:00
|
|
|
rho = thermo.rho();
|
2010-05-12 13:27:55 +00:00
|
|
|
|
|
|
|
volScalarField rUA = 1.0/UEqn().A();
|
2010-08-26 14:22:03 +00:00
|
|
|
surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
|
2010-05-12 13:27:55 +00:00
|
|
|
|
2010-08-26 14:22:03 +00:00
|
|
|
U = rUA*UEqn().H();
|
|
|
|
|
|
|
|
surfaceScalarField phiU
|
|
|
|
(
|
|
|
|
fvc::interpolate(rho)
|
2010-05-12 13:27:55 +00:00
|
|
|
*(
|
2010-08-26 14:22:03 +00:00
|
|
|
(fvc::interpolate(U) & mesh.Sf())
|
|
|
|
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
|
2010-05-12 13:27:55 +00:00
|
|
|
)
|
2010-08-26 14:22:03 +00:00
|
|
|
);
|
2010-05-12 13:27:55 +00:00
|
|
|
|
2010-08-26 14:22:03 +00:00
|
|
|
phi = phiU + fvc::interpolate(rho)*(g & mesh.Sf())*rhorUAf;
|
2010-05-12 13:27:55 +00:00
|
|
|
|
2010-08-26 14:22:03 +00:00
|
|
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
|
|
|
{
|
|
|
|
fvScalarMatrix pEqn
|
|
|
|
(
|
|
|
|
fvm::ddt(psi, p)
|
|
|
|
+ fvc::div(phi)
|
|
|
|
- fvm::laplacian(rhorUAf, p)
|
|
|
|
);
|
2010-05-12 13:27:55 +00:00
|
|
|
|
2010-08-26 14:22:03 +00:00
|
|
|
if
|
|
|
|
(
|
|
|
|
oCorr == nOuterCorr-1
|
2011-10-12 09:33:03 +00:00
|
|
|
&& corr == nCorr - 1
|
2010-08-26 14:22:03 +00:00
|
|
|
&& nonOrth == nNonOrthCorr
|
|
|
|
)
|
|
|
|
{
|
2011-08-14 16:39:59 +00:00
|
|
|
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
|
2010-08-26 14:22:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-08-14 16:39:59 +00:00
|
|
|
pEqn.solve(mesh.solutionDict().solver(p.name()));
|
2010-08-26 14:22:03 +00:00
|
|
|
}
|
2010-05-12 13:27:55 +00:00
|
|
|
|
2010-08-26 14:22:03 +00:00
|
|
|
if (nonOrth == nNonOrthCorr)
|
|
|
|
{
|
|
|
|
phi += pEqn.flux();
|
|
|
|
}
|
|
|
|
}
|
2010-05-12 13:27:55 +00:00
|
|
|
|
|
|
|
// Correct velocity field
|
2010-08-26 14:22:03 +00:00
|
|
|
U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf);
|
|
|
|
U.correctBoundaryConditions();
|
|
|
|
|
|
|
|
// Update pressure substantive derivative
|
|
|
|
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
|
|
|
|
|
|
|
// Solve continuity
|
|
|
|
#include "rhoEqn.H"
|
|
|
|
|
|
|
|
// Update continuity errors
|
|
|
|
#include "compressibleContinuityErrors.H"
|
2010-05-12 13:27:55 +00:00
|
|
|
|
|
|
|
// For closed-volume cases adjust the pressure and density levels
|
|
|
|
// to obey overall mass continuity
|
|
|
|
if (closedVolume)
|
|
|
|
{
|
2010-08-26 14:22:03 +00:00
|
|
|
p += (massIni - fvc::domainIntegrate(psi*p))
|
|
|
|
/fvc::domainIntegrate(psi);
|
|
|
|
rho = thermo.rho();
|
2010-05-12 13:27:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Update thermal conductivity
|
2015-08-05 11:34:57 +00:00
|
|
|
Kappa = thermoFluid[i].Cp()*turb.alphaEff();
|
2010-05-12 13:27:55 +00:00
|
|
|
}
|