43 lines
928 B
C++
43 lines
928 B
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)
|
|
);
|
|
|
|
phi = phiU +
|
|
(
|
|
mixture.surfaceTensionForce()
|
|
- ghf*fvc::snGrad(rho)
|
|
)*rUAf*mesh.magSf();
|
|
|
|
adjustPhi(phi, U, pd);
|
|
|
|
while (pimple.correctNonOrthogonal())
|
|
{
|
|
fvScalarMatrix pdEqn
|
|
(
|
|
fvm::laplacian(rUAf, pd) == fvc::div(phi)
|
|
);
|
|
|
|
pdEqn.setReference(pdRefCell, pdRefValue);
|
|
|
|
pdEqn.solve
|
|
(
|
|
mesh.solutionDict().solver(pd.select(pimple.finalInnerIter()))
|
|
);
|
|
|
|
if (pimple.finalNonOrthogonalIter())
|
|
{
|
|
phi -= pdEqn.flux();
|
|
}
|
|
}
|
|
|
|
U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
|
|
U.correctBoundaryConditions();
|
|
}
|