diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C index 47b15f0681..69b0c55959 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C @@ -52,7 +52,8 @@ sixDoFRigidBodyDisplacementPointPatchVectorField rhoInf_(1.0), rhoName_("rho"), lookupGravity_(-1), - g_(vector::zero) + g_(vector::zero), + relaxationFactor_(1) {} @@ -69,7 +70,8 @@ sixDoFRigidBodyDisplacementPointPatchVectorField rhoInf_(1.0), rhoName_(dict.lookupOrDefault("rhoName", "rho")), lookupGravity_(-1), - g_(vector::zero) + g_(vector::zero), + relaxationFactor_(dict.lookupOrDefault("relaxationFactor", 1)) { if (rhoName_ == "rhoInf") { @@ -112,7 +114,8 @@ sixDoFRigidBodyDisplacementPointPatchVectorField rhoInf_(ptf.rhoInf_), rhoName_(ptf.rhoName_), lookupGravity_(ptf.lookupGravity_), - g_(ptf.g_) + g_(ptf.g_), + relaxationFactor_(ptf.relaxationFactor_) {} @@ -129,7 +132,8 @@ sixDoFRigidBodyDisplacementPointPatchVectorField rhoInf_(ptf.rhoInf_), rhoName_(ptf.rhoName_), lookupGravity_(ptf.lookupGravity_), - g_(ptf.g_) + g_(ptf.g_), + relaxationFactor_(ptf.relaxationFactor_) {} @@ -235,7 +239,11 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs() Field::operator= ( - motion_.currentPosition(initialPoints_) - initialPoints_ + relaxationFactor_ + *( + motion_.currentPosition(initialPoints_) + - initialPoints_ + ) ); fixedValuePointPatchField::updateCoeffs(); @@ -258,6 +266,9 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::write(Ostream& os) const os.writeKeyword("g") << g_ << token::END_STATEMENT << nl; } + os.writeKeyword("relaxationFactor") + << relaxationFactor_ << token::END_STATEMENT << nl; + motion_.write(os); initialPoints_.writeEntry("initialPoints", os); diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.H b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.H index 697c60c88b..0124c96460 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.H +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.H @@ -84,6 +84,9 @@ class sixDoFRigidBodyDisplacementPointPatchVectorField //- Gravity vector to store when not available from the db vector g_; + //- Optional under-relaxation factor for the motion + scalar relaxationFactor_; + public: