diff --git a/src/ODE/sixDOF/sixDOFODE/sixDOFODE.H b/src/ODE/sixDOF/sixDOFODE/sixDOFODE.H index adb7e93e8..f73c0a6bf 100644 --- a/src/ODE/sixDOF/sixDOFODE/sixDOFODE.H +++ b/src/ODE/sixDOF/sixDOFODE/sixDOFODE.H @@ -316,6 +316,13 @@ public: const dimensionedVector& externalMoment ); + //- Initialize force and moment for the first time step + inline void initExternalForceAndMoment + ( + const dimensionedVector& externalForce, + const dimensionedVector& externalMoment + ); + // Access to motion constraints diff --git a/src/ODE/sixDOF/sixDOFODE/sixDOFODEI.H b/src/ODE/sixDOF/sixDOFODE/sixDOFODEI.H index aa5e68ee0..b358c2892 100644 --- a/src/ODE/sixDOF/sixDOFODE/sixDOFODEI.H +++ b/src/ODE/sixDOF/sixDOFODE/sixDOFODEI.H @@ -114,6 +114,21 @@ void Foam::sixDOFODE::setExternalForceAndMoment } +void Foam::sixDOFODE::initExternalForceAndMoment +( + const dimensionedVector& externalForce, + const dimensionedVector& externalMoment +) +{ + // Initialise force and moment only for the first time step + if (curTimeIndex_ == -1) + { + force_ = externalForce; + moment_ = externalMoment; + } +} + + const Foam::PtrList& Foam::sixDOFODE::translationalConstraints() const {