diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 8d6cc64947..8c3342d9f9 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -27,6 +27,7 @@ It is likely incomplete... - Bernhard Gschaider - Andrew Heather - David Hill +- Cristóbal Ibáñez - Yoshiaki Inoue - Mattijs Janssens - Andrew Jackson diff --git a/src/dynamicFvMesh/dynamicMotionSolverFvMeshAMI/dynamicMotionSolverFvMeshAMI.C b/src/dynamicFvMesh/dynamicMotionSolverFvMeshAMI/dynamicMotionSolverFvMeshAMI.C index bb94134e1f..bbad4c5bd3 100644 --- a/src/dynamicFvMesh/dynamicMotionSolverFvMeshAMI/dynamicMotionSolverFvMeshAMI.C +++ b/src/dynamicFvMesh/dynamicMotionSolverFvMeshAMI/dynamicMotionSolverFvMeshAMI.C @@ -31,6 +31,7 @@ License #include "volFields.H" #include "surfaceFields.H" #include "cyclicAMIPolyPatch.H" +#include "cyclicACMIPolyPatch.H" #include "polyTopoChange.H" #include "MeshObject.H" #include "lduMesh.H" @@ -83,6 +84,35 @@ bool Foam::dynamicMotionSolverFvMeshAMI::init(const bool doInit) } motionPtr_ = motionSolver::New(*this); + + // allow restarts during initialization to match patch field values if + // required + const auto& pbm = boundaryMesh(); + bool changeRequired = false; + for (label patchi = 0; patchi < pbm.nNonProcessor(); ++patchi) + { + const auto* cycAmiPtr = isA(pbm[patchi]); + + if (cycAmiPtr) + { + changeRequired = cycAmiPtr->createAMIFaces() || changeRequired; + } + else + { + const auto* cycAcmiPtr = isA(pbm[patchi]); + if (cycAcmiPtr) + { + changeRequired = + cycAcmiPtr->cyclicAMIPolyPatch::createAMIFaces() + || changeRequired; + } + } + } + if (returnReduceOr(changeRequired)) + { + update(); + } + return true; } diff --git a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/mixerVesselAMI2D-topologyChange/system/controlDict b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/mixerVesselAMI2D-topologyChange/system/controlDict index fee05d98df..67b8157234 100644 --- a/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/mixerVesselAMI2D-topologyChange/system/controlDict +++ b/tutorials/incompressible/pimpleFoam/laminar/mixerVesselAMI2D/mixerVesselAMI2D-topologyChange/system/controlDict @@ -32,7 +32,7 @@ writeInterval 0.1; purgeWrite 0; -writeFormat ascii; +writeFormat binary; //ascii; writePrecision 6;