diff --git a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.C b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.C index b0cbbbc3a99bb0615c65651aa78f1fffa53ebe15..7562cad50fa7f32312b84abb6f1bfbaa275966b5 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.C +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.C @@ -41,20 +41,33 @@ namespace Foam void Foam::dynamicFvMesh::readDict() { - IOdictionary dict + IOobject dictHeader ( - IOobject - ( - "dynamicMeshDict", - thisDb().time().constant(), - thisDb(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false // Do not register - ) + "dynamicMeshDict", + thisDb().time().constant(), + thisDb(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false // Do not register ); - timeControl_.read(dict); + if (dictHeader.typeHeaderOk<IOdictionary>(false, false)) + { + IOdictionary dict(dictHeader); + timeControl_.read(dict); + + if (!timeControl_.always()) + { + // Feedback about the trigger mechanism + Info<< "Controlled mesh update triggered on " + << timeControl_.type() << nl; + } + } + else + { + // Ensure it is pass-through + timeControl_.clear(); + } } @@ -138,7 +151,8 @@ bool Foam::dynamicFvMesh::controlledUpdate() if (!timeControl_.always()) { // Feedback that update has been triggered - Info<< "Mesh update triggered based on " << timeControl_.name() << nl; + Info<< "Mesh update triggered based on " + << timeControl_.type() << nl; } return this->update(); diff --git a/tutorials/incompressible/pimpleFoam/RAS/wingMotion/wingMotion2D_pimpleFoam/constant/dynamicMeshDict b/tutorials/incompressible/pimpleFoam/RAS/wingMotion/wingMotion2D_pimpleFoam/constant/dynamicMeshDict index ff9dc98dacb5426c8f880a6d1354158816747d23..6b64457ce3a42ba92aa5f18b33918e06993f23cc 100644 --- a/tutorials/incompressible/pimpleFoam/RAS/wingMotion/wingMotion2D_pimpleFoam/constant/dynamicMeshDict +++ b/tutorials/incompressible/pimpleFoam/RAS/wingMotion/wingMotion2D_pimpleFoam/constant/dynamicMeshDict @@ -20,6 +20,11 @@ motionSolverLibs (sixDoFRigidBodyMotion); motionSolver sixDoFRigidBodyMotion; +// Not necessarily useful here, but can have different motion updates types +updateControl timeStep; +updateInterval 1; + + patches (wing); innerDistance 0.3; outerDistance 1;