solvers: Split moveMesh from motionCorrector
This is so that stitching is complete across all regions before any FV operations are attempted.
This commit is contained in:
@ -241,6 +241,9 @@ public:
|
||||
//- Called at the start of the PIMPLE loop to move the mesh
|
||||
virtual void moveMesh();
|
||||
|
||||
//- Corrections that follow mesh motion
|
||||
virtual void motionCorrector();
|
||||
|
||||
//- Called at the start of the PIMPLE loop
|
||||
virtual void prePredictor() = 0;
|
||||
|
||||
|
||||
@ -51,7 +51,14 @@ void Foam::solvers::VoFSolver::moveMesh()
|
||||
|
||||
// Move the mesh
|
||||
mesh_.move();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::solvers::VoFSolver::motionCorrector()
|
||||
{
|
||||
if (pimple.firstIter() || pimple.moveMeshOuterCorrectors())
|
||||
{
|
||||
if (mesh.changing())
|
||||
{
|
||||
buoyancy.moveMesh();
|
||||
|
||||
@ -225,6 +225,9 @@ public:
|
||||
//- Called at the start of the PIMPLE loop to move the mesh
|
||||
virtual void moveMesh();
|
||||
|
||||
//- Corrections that follow mesh motion
|
||||
virtual void motionCorrector();
|
||||
|
||||
//- Called at the start of the PIMPLE loop
|
||||
virtual void prePredictor();
|
||||
|
||||
|
||||
@ -36,7 +36,14 @@ void Foam::solvers::incompressibleDenseParticleFluid::moveMesh()
|
||||
{
|
||||
// Move the mesh
|
||||
mesh_.move();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::solvers::incompressibleDenseParticleFluid::motionCorrector()
|
||||
{
|
||||
if (pimple.firstIter() || pimple.moveMeshOuterCorrectors())
|
||||
{
|
||||
if (mesh.changing())
|
||||
{
|
||||
if (correctPhi || mesh.topoChanged())
|
||||
|
||||
@ -180,6 +180,9 @@ public:
|
||||
//- Called at the start of the PIMPLE loop to move the mesh
|
||||
virtual void moveMesh();
|
||||
|
||||
//- Corrections that follow mesh motion
|
||||
virtual void motionCorrector();
|
||||
|
||||
//- Called at the start of the PIMPLE loop
|
||||
virtual void prePredictor();
|
||||
|
||||
|
||||
@ -35,7 +35,14 @@ void Foam::solvers::incompressibleFluid::moveMesh()
|
||||
{
|
||||
// Move the mesh
|
||||
mesh_.move();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::solvers::incompressibleFluid::motionCorrector()
|
||||
{
|
||||
if (pimple.firstIter() || pimple.moveMeshOuterCorrectors())
|
||||
{
|
||||
if (mesh.changing())
|
||||
{
|
||||
MRF.update();
|
||||
|
||||
@ -466,6 +466,10 @@ void Foam::solvers::isothermalFilm::moveMesh()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::solvers::isothermalFilm::motionCorrector()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::solvers::isothermalFilm::thermophysicalPredictor()
|
||||
{
|
||||
thermo_.correct();
|
||||
|
||||
@ -338,6 +338,9 @@ public:
|
||||
//- Called at the start of the PIMPLE loop to move the mesh
|
||||
virtual void moveMesh();
|
||||
|
||||
//- Corrections that follow mesh motion
|
||||
virtual void motionCorrector();
|
||||
|
||||
//- Called at the start of the PIMPLE loop
|
||||
virtual void prePredictor();
|
||||
|
||||
|
||||
@ -255,6 +255,9 @@ public:
|
||||
//- Called at the start of the PIMPLE loop to move the mesh
|
||||
virtual void moveMesh();
|
||||
|
||||
//- Corrections that follow mesh motion
|
||||
virtual void motionCorrector();
|
||||
|
||||
//- Called at the start of the PIMPLE loop
|
||||
virtual void prePredictor();
|
||||
|
||||
|
||||
@ -35,9 +35,15 @@ void Foam::solvers::isothermalFluid::moveMesh()
|
||||
{
|
||||
// Move the mesh
|
||||
mesh_.move();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::solvers::isothermalFluid::motionCorrector()
|
||||
{
|
||||
if (pimple.firstIter() || pimple.moveMeshOuterCorrectors())
|
||||
{
|
||||
// The rhoU field can be cleared following mesh-motion
|
||||
// now the mesh has been re-stitched as necessary
|
||||
rhoU.clear();
|
||||
|
||||
if (mesh.changing())
|
||||
|
||||
@ -85,6 +85,10 @@ void Foam::solvers::movingMesh::moveMesh()
|
||||
}
|
||||
|
||||
|
||||
void Foam::solvers::movingMesh::motionCorrector()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::solvers::movingMesh::prePredictor()
|
||||
{}
|
||||
|
||||
|
||||
@ -91,6 +91,9 @@ public:
|
||||
//- Called at the start of the PIMPLE loop to move the mesh
|
||||
virtual void moveMesh();
|
||||
|
||||
//- Corrections that follow mesh motion
|
||||
virtual void motionCorrector();
|
||||
|
||||
//- Called at the beginning of the PIMPLE loop
|
||||
virtual void prePredictor();
|
||||
|
||||
|
||||
@ -57,7 +57,18 @@ void Foam::solvers::multiphaseEuler::moveMesh()
|
||||
|
||||
// Move the mesh
|
||||
mesh_.move();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::solvers::multiphaseEuler::motionCorrector()
|
||||
{
|
||||
if
|
||||
(
|
||||
pimple.flow()
|
||||
&& (pimple.firstIter() || pimple.moveMeshOuterCorrectors())
|
||||
)
|
||||
{
|
||||
if (mesh.changing())
|
||||
{
|
||||
buoyancy.moveMesh();
|
||||
|
||||
@ -239,6 +239,9 @@ public:
|
||||
//- Called at the start of the PIMPLE loop to move the mesh
|
||||
virtual void moveMesh();
|
||||
|
||||
//- Corrections that follow mesh motion
|
||||
virtual void motionCorrector();
|
||||
|
||||
//- Called at the start of the PIMPLE loop
|
||||
virtual void prePredictor();
|
||||
|
||||
|
||||
@ -33,11 +33,19 @@ void Foam::solvers::shockFluid::moveMesh()
|
||||
{
|
||||
// Move the mesh
|
||||
mesh_.move();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::solvers::shockFluid::motionCorrector()
|
||||
{
|
||||
if (pimple.firstIter() || pimple.moveMeshOuterCorrectors())
|
||||
{
|
||||
if (mesh.changing())
|
||||
{
|
||||
if (mesh.topoChanged())
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
meshCourantNo();
|
||||
|
||||
@ -244,6 +244,9 @@ public:
|
||||
//- Called at the start of the PIMPLE loop to move the mesh
|
||||
virtual void moveMesh();
|
||||
|
||||
//- Corrections that follow mesh motion
|
||||
virtual void motionCorrector();
|
||||
|
||||
//- Called at the start of the PIMPLE loop
|
||||
virtual void prePredictor();
|
||||
|
||||
|
||||
@ -201,6 +201,10 @@ void Foam::solvers::solid::moveMesh()
|
||||
}
|
||||
|
||||
|
||||
void Foam::solvers::solid::motionCorrector()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::solvers::solid::prePredictor()
|
||||
{
|
||||
if (pimple.predictTransport())
|
||||
|
||||
@ -144,6 +144,9 @@ public:
|
||||
//- Called at the start of the PIMPLE loop to move the mesh
|
||||
virtual void moveMesh();
|
||||
|
||||
//- Corrections that follow mesh motion
|
||||
virtual void motionCorrector();
|
||||
|
||||
//- Called at the beginning of the PIMPLE loop
|
||||
virtual void prePredictor();
|
||||
|
||||
|
||||
@ -134,6 +134,11 @@ int main(int argc, char *argv[])
|
||||
solvers[i].moveMesh();
|
||||
}
|
||||
|
||||
forAll(solvers, i)
|
||||
{
|
||||
solvers[i].motionCorrector();
|
||||
}
|
||||
|
||||
forAll(solvers, i)
|
||||
{
|
||||
solvers[i].fvModels().correct();
|
||||
|
||||
@ -139,6 +139,7 @@ int main(int argc, char *argv[])
|
||||
while (pimple.loop())
|
||||
{
|
||||
solver.moveMesh();
|
||||
solver.motionCorrector();
|
||||
solver.fvModels().correct();
|
||||
solver.prePredictor();
|
||||
solver.momentumPredictor();
|
||||
|
||||
@ -175,6 +175,9 @@ public:
|
||||
//- Called at the start of the PIMPLE loop to move the mesh
|
||||
virtual void moveMesh() = 0;
|
||||
|
||||
//- Corrections that follow mesh motion
|
||||
virtual void motionCorrector() = 0;
|
||||
|
||||
//- Called at the start of the PIMPLE loop
|
||||
virtual void prePredictor() = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user