This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/pEqn.H

34 lines
772 B
C++

{
volScalarField rUA("rUA", 1.0/UEqn.A());
surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA));
U = rUA*UEqn.H();
surfaceScalarField phiU
(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi)
);
phi = phiU + rUAf*fvc::interpolate(rhok)*(g & mesh.Sf());
while (piso.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian(rUAf, p) == fvc::div(phi)
);
pEqn.solve(mesh.solutionDict().solver(p.select(piso.finalInnerIter())));
if (piso.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
}
}
U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
U.correctBoundaryConditions();
#include "continuityErrs.H"
}