mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
sixDoFRigidBodyDisplacementPointPatchVectorField: Added optional under-relaxation
This commit is contained in:
@ -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<word>("rhoName", "rho")),
|
||||
lookupGravity_(-1),
|
||||
g_(vector::zero)
|
||||
g_(vector::zero),
|
||||
relaxationFactor_(dict.lookupOrDefault<scalar>("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<vector>::operator=
|
||||
(
|
||||
motion_.currentPosition(initialPoints_) - initialPoints_
|
||||
relaxationFactor_
|
||||
*(
|
||||
motion_.currentPosition(initialPoints_)
|
||||
- initialPoints_
|
||||
)
|
||||
);
|
||||
|
||||
fixedValuePointPatchField<vector>::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);
|
||||
|
||||
@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user