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/simpleSRFFoam/pEqn.H

42 lines
1 KiB
C++
Raw Normal View History

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