35 lines
753 B
C
35 lines
753 B
C
p.boundaryField().updateCoeffs();
|
|
|
|
volScalarField AU = UEqn().A();
|
|
U = UEqn().H()/AU;
|
|
UEqn.clear();
|
|
phi = fvc::interpolate(U) & mesh.Sf();
|
|
adjustPhi(phi, U, p);
|
|
|
|
// Non-orthogonal pressure corrector loop
|
|
while (simple.correctNonOrthogonal())
|
|
{
|
|
fvScalarMatrix pEqn
|
|
(
|
|
fvm::laplacian(1.0/AU, 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
|
|
U -= fvc::grad(p)/AU;
|
|
U.correctBoundaryConditions();
|
|
|