51 lines
1.1 KiB
C
51 lines
1.1 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()));
|
|
|
|
if (pd.needReference())
|
|
{
|
|
adjustPhi(phi, U, pd);
|
|
}
|
|
|
|
phi = phiU +
|
|
(
|
|
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
|
- ghf*fvc::snGrad(rho)
|
|
)*rAUf*mesh.magSf();
|
|
|
|
|
|
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
|
{
|
|
fvScalarMatrix pdEqn
|
|
(
|
|
fvm::laplacian(rAUf, pd) == fvc::div(phi)
|
|
);
|
|
|
|
pdEqn.setReference(pdRefCell, pdRefValue);
|
|
|
|
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();
|
|
}
|
|
}
|
|
|
|
U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
|
|
U.correctBoundaryConditions();
|
|
|
|
#include "continuityErrs.H"
|
|
|
|
// Make the fluxes relative to the mesh motion
|
|
fvc::makeRelative(phi, U);
|
|
}
|