2010-05-12 13:27:55 +00:00
|
|
|
{
|
|
|
|
if (nOuterCorr == 1)
|
|
|
|
{
|
2010-09-22 18:13:13 +00:00
|
|
|
p =
|
2010-05-12 13:27:55 +00:00
|
|
|
(
|
|
|
|
rho
|
|
|
|
- (1.0 - gamma)*rhol0
|
|
|
|
- ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat
|
|
|
|
)/psi;
|
|
|
|
}
|
|
|
|
|
|
|
|
surfaceScalarField rhof = fvc::interpolate(rho, "rhof");
|
|
|
|
|
|
|
|
volScalarField rUA = 1.0/UEqn.A();
|
|
|
|
surfaceScalarField rUAf("rUAf", rhof*fvc::interpolate(rUA));
|
|
|
|
volVectorField HbyA = rUA*UEqn.H();
|
|
|
|
|
|
|
|
phiv = (fvc::interpolate(HbyA) & mesh.Sf())
|
|
|
|
+ fvc::ddtPhiCorr(rUA, rho, U, phiv);
|
|
|
|
|
|
|
|
p.boundaryField().updateCoeffs();
|
|
|
|
|
|
|
|
surfaceScalarField phiGradp = rUAf*mesh.magSf()*fvc::snGrad(p);
|
|
|
|
|
|
|
|
phiv -= phiGradp/rhof;
|
|
|
|
|
2010-10-01 09:33:00 +00:00
|
|
|
# include "resetPhivPatches.H"
|
2010-05-12 13:27:55 +00:00
|
|
|
|
|
|
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
|
|
|
{
|
|
|
|
fvScalarMatrix pEqn
|
|
|
|
(
|
|
|
|
fvm::ddt(psi, p)
|
|
|
|
- (rhol0 + (psil - psiv)*pSat)*fvc::ddt(gamma) - pSat*fvc::ddt(psi)
|
|
|
|
+ fvc::div(phiv, rho)
|
|
|
|
+ fvc::div(phiGradp)
|
|
|
|
- fvm::laplacian(rUAf, p)
|
|
|
|
);
|
|
|
|
|
2010-10-12 07:51:26 +00:00
|
|
|
if (corr == nCorr - 1 && nonOrth == nNonOrthCorr)
|
2010-09-22 18:13:13 +00:00
|
|
|
{
|
|
|
|
pEqn.solve(mesh.solver(p.name() + "Final"));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pEqn.solve(mesh.solver(p.name()));
|
|
|
|
}
|
2010-05-12 13:27:55 +00:00
|
|
|
|
|
|
|
if (nonOrth == nNonOrthCorr)
|
|
|
|
{
|
|
|
|
phiv += (phiGradp + pEqn.flux())/rhof;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-22 18:13:13 +00:00
|
|
|
Info<< "Predicted p max-min : " << max(p).value()
|
2010-05-12 13:27:55 +00:00
|
|
|
<< " " << min(p).value() << endl;
|
|
|
|
|
2010-09-22 18:13:13 +00:00
|
|
|
rho == max
|
|
|
|
(
|
|
|
|
psi*p
|
|
|
|
+ (1.0 - gamma)*rhol0
|
|
|
|
+ ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat,
|
|
|
|
rhoMin
|
|
|
|
);
|
|
|
|
|
2010-10-01 09:33:00 +00:00
|
|
|
# include "gammaPsi.H"
|
2010-09-22 18:13:13 +00:00
|
|
|
|
|
|
|
p =
|
|
|
|
(
|
|
|
|
rho
|
|
|
|
- (1.0 - gamma)*rhol0
|
|
|
|
- ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat
|
|
|
|
)/psi;
|
|
|
|
|
|
|
|
p.correctBoundaryConditions();
|
|
|
|
|
|
|
|
Info<< "Phase-change corrected p max-min : " << max(p).value()
|
|
|
|
<< " " << min(p).value() << endl;
|
|
|
|
|
|
|
|
// Correct velocity
|
2010-05-12 13:27:55 +00:00
|
|
|
|
|
|
|
U = HbyA - rUA*fvc::grad(p);
|
|
|
|
|
|
|
|
// Remove the swirl component of velocity for "wedge" cases
|
|
|
|
if (piso.found("removeSwirl"))
|
|
|
|
{
|
|
|
|
label swirlCmpt(readLabel(piso.lookup("removeSwirl")));
|
|
|
|
|
|
|
|
Info<< "Removing swirl component-" << swirlCmpt << " of U" << endl;
|
|
|
|
U.field().replace(swirlCmpt, 0.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
U.correctBoundaryConditions();
|
|
|
|
|
|
|
|
Info<< "max(U) " << max(mag(U)).value() << endl;
|
|
|
|
}
|