This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H

57 lines
1.3 KiB
C
Raw Normal View History

{
volScalarField rUA = 1.0/UEqn.A();
surfaceScalarField rUAf = fvc::interpolate(rUA);
U = rUA*UEqn.H();
surfaceScalarField phiU
(
"phiU",
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
2010-09-22 18:13:13 +00:00
adjustPhi(phiU, U, p);
phi = phiU +
(
2010-09-22 18:13:13 +00:00
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
)*rUAf*mesh.magSf();
Pair<tmp<volScalarField> > vDotP = twoPhaseProperties->vDotP();
const volScalarField& vDotcP = vDotP[0]();
const volScalarField& vDotvP = vDotP[1]();
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pdEqn
(
fvc::div(phi) - fvm::laplacian(rUAf, pd)
+ (vDotvP - vDotcP)*(rho*gh - pSat) + fvm::Sp(vDotvP - vDotcP, pd)
);
pdEqn.setReference(pdRefCell, pdRefValue);
2011-10-12 09:32:38 +00:00
if (corr == nCorr - 1 && nonOrth == nNonOrthCorr)
{
pdEqn.solve(mesh.solutionDict().solver(pd.name() + "Final"));
}
else
{
pdEqn.solve(mesh.solutionDict().solver(pd.name()));
}
if (nonOrth == nNonOrthCorr)
{
phi += pdEqn.flux();
}
}
p = pd + rho*gh;
U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
U.correctBoundaryConditions();
}