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
Vuko Vukcevic 16ea621887 Consistency update in solution control class:
The rewrite enables multiple pressure/velocity systems to be treated in a time
and under-relaxation consistent way (useful for multiphase flows).
2017-04-20 08:24:25 +02:00

41 lines
1 KiB
C++

p.boundaryField().updateCoeffs();
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
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::laplacian
(
fvc::interpolate(rAUrel)/simple.aCoeff(Urel.name()),
p,
"laplacian(rAU," + p.name() + ')'
)
==
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();
// Reconstruct consistent velocity after pressure equation
simple.reconstructSteadyVelocity(Urel, rAUrel, p);