solvers: Cache rAU and/or divU fields for CorrectPhi if mesh.topoChanging()
This commit is contained in:
@ -102,7 +102,7 @@ Foam::solvers::compressibleMultiphaseVoF::compressibleMultiphaseVoF
|
||||
// Read the controls
|
||||
readControls();
|
||||
|
||||
if (correctPhi)
|
||||
if (correctPhi || mesh.topoChanging())
|
||||
{
|
||||
rAU = new volScalarField
|
||||
(
|
||||
|
||||
@ -119,7 +119,7 @@ Foam::solvers::compressibleVoF::compressibleVoF(fvMesh& mesh)
|
||||
// Read the controls
|
||||
readControls();
|
||||
|
||||
if (correctPhi)
|
||||
if (correctPhi || mesh.topoChanging())
|
||||
{
|
||||
rAU = new volScalarField
|
||||
(
|
||||
|
||||
@ -102,9 +102,7 @@ Foam::solvers::incompressibleMultiphaseVoF::incompressibleMultiphaseVoF
|
||||
// Read the controls
|
||||
readControls();
|
||||
|
||||
if (!runTime.restart() || !divergent())
|
||||
{
|
||||
if (correctPhi)
|
||||
if (correctPhi || mesh.topoChanging())
|
||||
{
|
||||
rAU = new volScalarField
|
||||
(
|
||||
@ -119,9 +117,14 @@ Foam::solvers::incompressibleMultiphaseVoF::incompressibleMultiphaseVoF
|
||||
mesh,
|
||||
dimensionedScalar(dimTime/dimDensity, 1)
|
||||
);
|
||||
}
|
||||
|
||||
if (!runTime.restart() || !divergent())
|
||||
{
|
||||
correctUphiBCs(U_, phi, true);
|
||||
|
||||
if (correctPhi)
|
||||
{
|
||||
CorrectPhi
|
||||
(
|
||||
phi,
|
||||
@ -135,8 +138,6 @@ Foam::solvers::incompressibleMultiphaseVoF::incompressibleMultiphaseVoF
|
||||
}
|
||||
else
|
||||
{
|
||||
correctUphiBCs(U_, phi, true);
|
||||
|
||||
CorrectPhi
|
||||
(
|
||||
phi,
|
||||
|
||||
@ -87,9 +87,7 @@ Foam::solvers::incompressibleVoF::incompressibleVoF(fvMesh& mesh)
|
||||
// Read the controls
|
||||
readControls();
|
||||
|
||||
if (!runTime.restart() || !divergent())
|
||||
{
|
||||
if (correctPhi)
|
||||
if (correctPhi || mesh.topoChanging())
|
||||
{
|
||||
rAU = new volScalarField
|
||||
(
|
||||
@ -104,9 +102,14 @@ Foam::solvers::incompressibleVoF::incompressibleVoF(fvMesh& mesh)
|
||||
mesh,
|
||||
dimensionedScalar(dimTime/dimDensity, 1)
|
||||
);
|
||||
}
|
||||
|
||||
if (!runTime.restart() || !divergent())
|
||||
{
|
||||
correctUphiBCs(U_, phi, true);
|
||||
|
||||
if (correctPhi)
|
||||
{
|
||||
CorrectPhi
|
||||
(
|
||||
phi,
|
||||
@ -120,8 +123,6 @@ Foam::solvers::incompressibleVoF::incompressibleVoF(fvMesh& mesh)
|
||||
}
|
||||
else
|
||||
{
|
||||
correctUphiBCs(U_, phi, true);
|
||||
|
||||
CorrectPhi
|
||||
(
|
||||
phi,
|
||||
|
||||
@ -298,7 +298,7 @@ void Foam::solvers::isothermalFluid::preSolve()
|
||||
// Store divrhoU from the previous mesh so that it can be mapped
|
||||
// and used in correctPhi to ensure the corrected phi has the
|
||||
// same divergence
|
||||
if (correctPhi)
|
||||
if (correctPhi || mesh.topoChanging())
|
||||
{
|
||||
divrhoU = new volScalarField
|
||||
(
|
||||
|
||||
@ -215,7 +215,7 @@ void Foam::solvers::multiphaseEuler::preSolve()
|
||||
// Store divU from the previous mesh so that it can be
|
||||
// mapped and used in correctPhi to ensure the corrected phi
|
||||
// has the same divergence
|
||||
if (correctPhi)
|
||||
if (correctPhi || mesh.topoChanging())
|
||||
{
|
||||
// Construct and register divU for mapping
|
||||
divU = new volScalarField
|
||||
|
||||
Reference in New Issue
Block a user