2010-08-26 14:22:03 +00:00
|
|
|
{
|
2016-04-05 13:08:06 +00:00
|
|
|
p.boundaryField().updateCoeffs();
|
2010-08-26 14:22:03 +00:00
|
|
|
|
2016-04-05 13:08:06 +00:00
|
|
|
// Prepare clean Ap without time derivative contribution and
|
|
|
|
// without contribution from under-relaxation
|
|
|
|
// HJ, 26/Oct/2015
|
|
|
|
aU = HUEqn.A();
|
2010-08-26 14:22:03 +00:00
|
|
|
|
2016-04-05 13:08:06 +00:00
|
|
|
// Store velocity under-relaxation point before using U for the flux
|
|
|
|
// precursor
|
|
|
|
U.storePrevIter();
|
2010-08-26 14:22:03 +00:00
|
|
|
|
2016-04-05 13:08:06 +00:00
|
|
|
U = HUEqn.H()/aU;
|
|
|
|
phi = (fvc::interpolate(U) & mesh.Sf());
|
|
|
|
|
|
|
|
// Global flux balance
|
|
|
|
adjustPhi(phi, U, p);
|
|
|
|
|
|
|
|
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
2010-08-26 14:22:03 +00:00
|
|
|
{
|
2016-04-05 13:08:06 +00:00
|
|
|
fvScalarMatrix pEqn
|
|
|
|
(
|
|
|
|
fvm::laplacian(1/aU, p) == fvc::div(phi)
|
|
|
|
);
|
|
|
|
|
|
|
|
pEqn.setReference(pRefCell, pRefValue);
|
|
|
|
|
|
|
|
if
|
|
|
|
(
|
|
|
|
corr == nCorr - 1
|
|
|
|
&& nonOrth == nNonOrthCorr
|
|
|
|
)
|
|
|
|
{
|
|
|
|
pEqn.solve
|
|
|
|
(
|
|
|
|
mesh.solutionDict().solver(p.name() + "Final")
|
|
|
|
);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pEqn.solve(mesh.solutionDict().solver(p.name()));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nonOrth == nNonOrthCorr)
|
|
|
|
{
|
|
|
|
phi -= pEqn.flux();
|
|
|
|
}
|
2010-08-26 14:22:03 +00:00
|
|
|
}
|
|
|
|
|
2016-04-05 13:08:06 +00:00
|
|
|
// Explicitly relax pressure for momentum corrector
|
|
|
|
if (oCorr != nOuterCorr - 1)
|
2010-08-26 14:22:03 +00:00
|
|
|
{
|
2016-04-05 13:08:06 +00:00
|
|
|
p.relax();
|
2010-08-26 14:22:03 +00:00
|
|
|
}
|
|
|
|
|
2016-04-05 13:08:06 +00:00
|
|
|
# include "movingMeshContinuityErrs.H"
|
2010-08-26 14:22:03 +00:00
|
|
|
|
2016-04-05 13:08:06 +00:00
|
|
|
U = UUrf*
|
|
|
|
(
|
|
|
|
1.0/(aU + ddtUEqn.A())*
|
|
|
|
(
|
|
|
|
U*aU - fvc::grad(p) + ddtUEqn.H()
|
|
|
|
)
|
|
|
|
)
|
|
|
|
+ (1 - UUrf)*U.prevIter();
|
|
|
|
U.correctBoundaryConditions();
|
2010-08-26 14:22:03 +00:00
|
|
|
}
|