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
997 B
C
Raw Normal View History

p.boundaryField().updateCoeffs();
2017-01-04 12:50:28 +00:00
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
(
2017-01-04 12:50:28 +00:00
fvm::laplacian
(
fvc::interpolate(rAU)/simple.aCoeff(),
p,
2017-01-09 15:28:44 +00:00
"laplacian(rAU," + p.name() + ')'
2017-01-04 12:50:28 +00:00
)
==
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();
2017-01-04 12:50:28 +00:00
// Reconstruct consistent velocity after pressure equation
simple.reconstructSteadyVelocity(U, rAU, p);