52 lines
1.2 KiB
C
52 lines
1.2 KiB
C
{
|
|
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)
|
|
);
|
|
|
|
adjustPhi(phiU, U, pd);
|
|
|
|
phi = phiU +
|
|
(
|
|
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]();
|
|
|
|
while (pimple.correctNonOrthogonal())
|
|
{
|
|
fvScalarMatrix pdEqn
|
|
(
|
|
fvc::div(phi) - fvm::laplacian(rUAf, pd)
|
|
+ (vDotvP - vDotcP)*(rho*gh - pSat) + fvm::Sp(vDotvP - vDotcP, pd)
|
|
);
|
|
|
|
pdEqn.setReference(pdRefCell, pdRefValue);
|
|
|
|
pdEqn.solve
|
|
(
|
|
mesh.solutionDict().solver(pd.select(pimple.finalInnerIter()))
|
|
);
|
|
|
|
if (pimple.finalNonOrthogonalIter())
|
|
{
|
|
phi += pdEqn.flux();
|
|
}
|
|
}
|
|
|
|
p = pd + rho*gh;
|
|
|
|
U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
|
|
U.correctBoundaryConditions();
|
|
}
|