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

51 lines
1.1 KiB
C
Raw Normal View History

2016-09-05 15:03:59 +00:00
{
p.boundaryField().updateCoeffs();
// Prepare clean 1/Ap without contribution from under-relaxation
// HJ, 26/Oct/2015
2017-01-11 11:57:28 +00:00
volScalarField rAU
(
"(1|A(U))",
1/HUEqn().A()
);
// Store velocity under-relaxation point before using U for
// the flux precursor
U.storePrevIter();
2017-01-11 11:57:28 +00:00
U = rAU*HUEqn().H();
HUEqn.clear();
2016-09-05 15:03:59 +00:00
phi = fvc::interpolate(U) & mesh.Sf();
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
2016-09-05 15:03:59 +00:00
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
2016-09-05 15:03:59 +00:00
U = UUrf*(U - rAU*fvc::grad(p)) + (1 - UUrf)*U.prevIter();
U.correctBoundaryConditions();
2016-09-05 15:03:59 +00:00
}