solvers::*:moveMesh: rationalised the application of correctPhi

Flux correction is now applied if either the topology changed or the mesh is
moving and correctPhi is true.  This strategy allows moving mesh cases without
topology change to be run without any change to the fluxes which is appropriate
for solid-body motion of the entire domain or a rotating sub-domain with NCC.
This commit is contained in:
Henry Weller
2023-03-25 15:36:09 +00:00
parent 92dacbfcf0
commit 7b4002fec2
6 changed files with 89 additions and 99 deletions

View File

@ -35,7 +35,7 @@ void Foam::solvers::VoFSolver::moveMesh()
{
if
(
correctPhi
(correctPhi || mesh.topoChanged())
&& divergent()
&& !divU.valid()
)
@ -65,34 +65,31 @@ void Foam::solvers::VoFSolver::moveMesh()
correctUphiBCs(U_, phi, true);
if (correctPhi)
if (divU.valid())
{
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
{
CorrectPhi
(
phi,
U,
p_rgh,
surfaceScalarField("rAUf", fvc::interpolate(rAU())),
geometricZeroField(),
pressureReference(),
pimple
);
}
// Make the fluxes relative to the mesh motion