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