db7fac3f24
git-svn-id: https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev@1731 e4e07f05-0c2f-0410-a05a-b8ba57e0c909
44 lines
1,015 B
C
44 lines
1,015 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
|
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
|
{
|
|
fvScalarMatrix pEqn
|
|
(
|
|
fvm::laplacian(1.0/AU, p) == fvc::div(phi)
|
|
);
|
|
|
|
pEqn.setReference(pRefCell, pRefValue);
|
|
|
|
// Retain the residual from the first iteration
|
|
if (nonOrth == 0)
|
|
{
|
|
eqnResidual = pEqn.solve().initialResidual();
|
|
maxResidual = max(eqnResidual, maxResidual);
|
|
}
|
|
else
|
|
{
|
|
pEqn.solve();
|
|
}
|
|
|
|
if (nonOrth == nNonOrthCorr)
|
|
{
|
|
phi -= pEqn.flux();
|
|
}
|
|
}
|
|
|
|
# include "continuityErrs.H"
|
|
|
|
// Explicitly relax pressure for momentum corrector
|
|
p.relax();
|
|
|
|
// Momentum corrector
|
|
U -= fvc::grad(p)/AU;
|
|
U.correctBoundaryConditions();
|
|
|