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/MRFSimpleFoam/pEqn.H
2017-01-11 11:57:48 +00:00

54 lines
1.3 KiB
C

{
p.boundaryField().updateCoeffs();
// Prepare clean 1/Ap without contribution from under-relaxation
// HJ, 26/Oct/2015
volScalarField rAU
(
"(1|A(U))",
1/HUEqn().A()
);
// Update boundary velocity for consistency with the flux
// This is needed for a ramped MRF
mrfZones.correctBoundaryVelocity(U);
// Store velocity under-relaxation point before using U for
// the flux precursor
U.storePrevIter();
U = rAU*HUEqn().H();
HUEqn.clear();
phi = fvc::interpolate(U) & mesh.Sf();
mrfZones.relativeFlux(phi);
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian(rAU, p) == 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();
// Momentum corrector
// Note: since under-relaxation does not change aU, H/a in U can be
// re-used. HJ, 22/Jan/2016
U = UUrf*(U - rAU*fvc::grad(p)) + (1 - UUrf)*U.prevIter();
U.correctBoundaryConditions();
}