52 lines
1.1 KiB
C++
52 lines
1.1 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)
|
|
);
|
|
|
|
phi = phiU - ghf*fvc::snGrad(rho)*rUAf*mesh.magSf();
|
|
|
|
while (pimple.correctNonOrthogonal())
|
|
{
|
|
fvScalarMatrix p_rghEqn
|
|
(
|
|
fvm::laplacian(rUAf, p_rgh) == fvc::div(phi)
|
|
);
|
|
|
|
p_rghEqn.setReference(p_rghRefCell, p_rghRefValue);
|
|
|
|
p_rghEqn.solve
|
|
(
|
|
mesh.solutionDict().solver(p_rgh.select(pimple.finalInnerIter()))
|
|
);
|
|
|
|
if (pimple.finalNonOrthogonalIter())
|
|
{
|
|
phi -= p_rghEqn.flux();
|
|
}
|
|
}
|
|
|
|
p == p_rgh + rho*gh;
|
|
|
|
if (p_rgh.needReference())
|
|
{
|
|
p += dimensionedScalar
|
|
(
|
|
"p",
|
|
p.dimensions(),
|
|
pRefValue - getRefCellValue(p, p_rghRefCell)
|
|
);
|
|
}
|
|
|
|
#include "continuityErrs.H"
|
|
|
|
U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
|
|
U.correctBoundaryConditions();
|
|
}
|