db7fac3f24
git-svn-id: https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev@1731 e4e07f05-0c2f-0410-a05a-b8ba57e0c909
50 lines
1.1 KiB
C
50 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()));
|
|
|
|
phi = phiU +
|
|
(
|
|
fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
|
|
- ghf*fvc::snGrad(rho)
|
|
)*rAUf*mesh.magSf();
|
|
|
|
if (pd.needReference())
|
|
{
|
|
adjustPhi(phi, U, pd);
|
|
}
|
|
|
|
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.solver(pd.name() + "Final"));
|
|
}
|
|
else
|
|
{
|
|
pdEqn.solve(mesh.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);
|
|
}
|