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
40 lines
803 B
C
40 lines
803 B
C
volScalarField rUA = 1.0/UEqn.A();
|
|
|
|
surfaceScalarField rUAf
|
|
(
|
|
"(rho*(1|A(U)))",
|
|
fvc::interpolate(rho)*fvc::interpolate(rUA)
|
|
);
|
|
|
|
U = rUA*UEqn.H();
|
|
phi =
|
|
fvc::interpolate(rho)
|
|
*(
|
|
(fvc::interpolate(U) & mesh.Sf())
|
|
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
|
|
);
|
|
|
|
surfaceScalarField phiU("phiU", phi);
|
|
phi -= ghf*fvc::snGrad(rho)*rUAf*mesh.magSf();
|
|
|
|
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
|
{
|
|
fvScalarMatrix pEqn
|
|
(
|
|
fvm::laplacian(rUAf, p) == fvc::ddt(rho) + fvc::div(phi)
|
|
);
|
|
|
|
pEqn.setReference(pRefCell, pRefValue);
|
|
pEqn.solve();
|
|
|
|
if (nonOrth == nNonOrthCorr)
|
|
{
|
|
phi -= pEqn.flux();
|
|
}
|
|
}
|
|
|
|
#include "rhoEqn.H"
|
|
#include "compressibleContinuityErrs.H"
|
|
|
|
U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
|
|
U.correctBoundaryConditions();
|