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

42 lines
1,006 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(U.name()),
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);