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/incompressible/simpleFoam/pEqn.H
2017-01-04 13:50:28 +01:00

42 lines
997 B
C

p.boundaryField().updateCoeffs();
volScalarField rAU = 1.0/UEqn().A();
U = rAU*UEqn().H();
UEqn.clear();
// Calculate under-relaxation consistent flux
simple.calcSteadyConsistentFlux(phi, U);
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian
(
fvc::interpolate(rAU)/simple.aCoeff(),
p,
"laplacian(rAU" + p.name() + ')'
)
==
fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (simple.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
}
}
# include "continuityErrs.H"
// Explicitly relax pressure for momentum corrector
p.relax();
// Reconstruct consistent velocity after pressure equation
simple.reconstructSteadyVelocity(U, rAU, p);