CorrectPhi: Change the divU argument to autoPtr<volScalarField>

If divU is valid the velocity divergence is included in the pcorr equation.
This simplifies the logic in multiphase moveMesh functions supporting
incompressible (with or without mass sources) and compressible fluids.
This commit is contained in:
Henry Weller
2023-03-31 08:53:59 +01:00
parent 0cfc03e14a
commit e33b53c7c7
15 changed files with 57 additions and 82 deletions

View File

@ -67,32 +67,16 @@ void Foam::solvers::VoFSolver::moveMesh()
if (incompressible())
{
if (divU.valid())
{
CorrectPhi
(
phi,
U,
p_rgh,
surfaceScalarField("rAUf", fvc::interpolate(rAU())),
divU(),
pressureReference(),
pimple
);
}
else
{
CorrectPhi
(
phi,
U,
p_rgh,
surfaceScalarField("rAUf", fvc::interpolate(rAU())),
geometricZeroField(),
pressureReference(),
pimple
);
}
CorrectPhi
(
phi,
U,
p_rgh,
surfaceScalarField("rAUf", fvc::interpolate(rAU())),
divU,
pressureReference(),
pimple
);
}
else
{