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/pimpleDyMFoam/pEqn.H
2017-01-05 09:28:35 +01:00

56 lines
1.4 KiB
C

{
p.boundaryField().updateCoeffs();
// Prepare clean 1/a_p without time derivative and under-relaxation
// contribution
rAU = 1.0/HUEqn.A();
// Calculate U from convection-diffusion matrix
U = rAU*HUEqn.H();
// Consistently calculate flux
pimple.calcTransientConsistentFlux(phi, U, rAU, ddtUEqn);
// Global flux balance
adjustPhi(phi, U, p);
// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian
(
fvc::interpolate(rAU)/pimple.aCoeff(),
p,
"laplacian(rAU," + p.name() + ')'
)
==
fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve
(
mesh.solutionDict().solver(p.select(pimple.finalInnerIter()))
);
if (pimple.finalNonOrthogonalIter())
{
phi -= pEqn.flux();
}
}
// Explicitly relax pressure for momentum corrector except for last
// corrector
if (!pimple.finalIter())
{
p.relax();
}
# include "movingMeshContinuityErrs.H"
// Consistently reconstruct velocity after pressure equation. Note: flux is
// made relative inside the function
pimple.reconstructTransientVelocity(U, phi, ddtUEqn, rAU, p);
}