Skip to content
Snippets Groups Projects
Commit e3b8fadc authored by Henry's avatar Henry
Browse files

uncoupledSixDoFRigidBodyDisplacement: Corrected for PMIPLE

parent a66979bd
Branches
Tags
No related merge requests found
......@@ -204,10 +204,10 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs()
const pointPatch& ptPatch = this->patch();
// Store the motion state at the beginning of the time-step
if (curTimeIndex_ != this->db().time().timeIndex())
if (curTimeIndex_ != t.timeIndex())
{
motion_.newTime();
curTimeIndex_ = this->db().time().timeIndex();
curTimeIndex_ = t.timeIndex();
}
// Patch force data is valid for the current positions, so
......@@ -238,7 +238,7 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs()
g_ = g.value();
}
// scalar ramp = min(max((this->db().time().value() - 5)/10, 0), 1);
// scalar ramp = min(max((t.value() - 5)/10, 0), 1);
scalar ramp = 1.0;
motion_.updateAcceleration
......
......@@ -47,7 +47,8 @@ uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField
:
fixedValuePointPatchField<vector>(p, iF),
motion_(),
initialPoints_(p.localPoints())
initialPoints_(p.localPoints()),
curTimeIndex_(-1)
{}
......@@ -60,7 +61,8 @@ uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField
)
:
fixedValuePointPatchField<vector>(p, iF, dict),
motion_(dict, dict)
motion_(dict, dict),
curTimeIndex_(-1)
{
if (!dict.found("value"))
{
......@@ -89,7 +91,8 @@ uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField
:
fixedValuePointPatchField<vector>(ptf, p, iF, mapper),
motion_(ptf.motion_),
initialPoints_(ptf.initialPoints_, mapper)
initialPoints_(ptf.initialPoints_, mapper),
curTimeIndex_(-1)
{}
......@@ -102,7 +105,8 @@ uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField
:
fixedValuePointPatchField<vector>(ptf, iF),
motion_(ptf.motion_),
initialPoints_(ptf.initialPoints_)
initialPoints_(ptf.initialPoints_),
curTimeIndex_(-1)
{}
......@@ -147,6 +151,13 @@ void uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs()
const polyMesh& mesh = this->dimensionedInternalField().mesh()();
const Time& t = mesh.time();
// Store the motion state at the beginning of the time-step
if (curTimeIndex_ != t.timeIndex())
{
motion_.newTime();
curTimeIndex_ = t.timeIndex();
}
motion_.updatePosition(t.deltaTValue(), t.deltaT0Value());
vector gravity = vector::zero;
......@@ -163,7 +174,8 @@ void uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs()
motion_.updateAcceleration
(
gravity*motion_.mass(),
vector::zero, t.deltaTValue()
vector::zero,
t.deltaTValue()
);
Field<vector>::operator=
......
......@@ -59,6 +59,9 @@ class uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField
//- Initial positions of points on the patch
pointField initialPoints_;
//- Current time index (used for updating)
label curTimeIndex_;
public:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment