mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
56 lines
1.2 KiB
C
56 lines
1.2 KiB
C
{
|
|
volScalarField rAU(1.0/UEqn.A());
|
|
surfaceScalarField rAUf(fvc::interpolate(rAU));
|
|
|
|
U = rAU*UEqn.H();
|
|
surfaceScalarField phiU
|
|
(
|
|
"phiU",
|
|
(fvc::interpolate(U) & mesh.Sf())
|
|
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
|
);
|
|
|
|
adjustPhi(phiU, U, p_rgh);
|
|
|
|
phi = phiU +
|
|
(
|
|
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
|
- ghf*fvc::snGrad(rho)
|
|
)*rAUf*mesh.magSf();
|
|
|
|
while (pimple.correctNonOrthogonal())
|
|
{
|
|
fvScalarMatrix p_rghEqn
|
|
(
|
|
fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
|
|
);
|
|
|
|
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
|
|
|
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
|
|
|
if (pimple.finalNonOrthogonalIter())
|
|
{
|
|
phi -= p_rghEqn.flux();
|
|
}
|
|
}
|
|
|
|
U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
|
|
U.correctBoundaryConditions();
|
|
|
|
#include "continuityErrs.H"
|
|
|
|
p == p_rgh + rho*gh;
|
|
|
|
if (p_rgh.needReference())
|
|
{
|
|
p += dimensionedScalar
|
|
(
|
|
"p",
|
|
p.dimensions(),
|
|
pRefValue - getRefCellValue(p, pRefCell)
|
|
);
|
|
p_rgh = p - rho*gh;
|
|
}
|
|
}
|