View Issue Details

IDProjectCategoryView StatusLast Update
0003345OpenFOAMFeaturepublic2019-09-11 11:46
Reporterhandrake0724Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Product Versiondev 
Fixed in Version 
Summary0003345: suggestion of including time information in restraint class in sixDoFRigidBodyMotion and rigidBodyDynamics
DescriptionIn simulating 6 DoF motion, sometimes it comes in handy when time varying external forces to the body are available.
for example, step function-like external force will be useful in towing simulation.

external forces acting on a body can be implemented with restraint class in sixDoFRigidBodyMotion and rigidBodyDynamics.
but in current implementation of restraint class, it is not possible to have a reference to time object.

It might be easy to add time support by passing objectRegistry object to restraint class constructor.

please check this feature implementation.
TagsNo tags attached.

Activities

henry

2019-09-10 10:33

manager   ~0010715

The rigidBodyDynamics classes are designed without the need for an objectRegistry so that they can be used in other contexts, e.g. robotics for which an OpenFOAM objectRegistry would not be required. If the current time is needed in the forces and restraint classes it would be better to pass that specifically rather than the high-level objectRegistry which may not exist for all applications of rigidBodyDynamics.

handrake0724

2019-09-10 12:27

reporter   ~0010717

tracing from rigidBodyMeshMotion class, time information is passed into RBD::rigidBodyMotion::solve.
in RBD::rigidBodyMotion::solve, time info is stored in motionState and only internal joint force and external force are passed into rigidBodySolver::solve member function.
in the rigidBodySolver::solve, those forces are passed into rigidBodyModel's member function applyRestraints.
and in the applyRestraints, restraints associated to a body are calculated by restrain member function.
So, time parameter will be added in rigidBodySolver::solve, rigidBodyModel::applyRestraints and restraints::restrain in order to pass current time information to restrain class.

henry

2019-09-10 13:44

manager   ~0010718

Do you mean that the time parameter would need to be added to the rigidBodySolver::solve call or that rigidBodySolver::solve would pass it to rigidBodyModel::applyRestraints?
Given that rigidBodySolver::solve already has access to the current time from the rigidBodyModelState() protected member function I would suggest the latter.

will

2019-09-10 15:11

manager   ~0010720

A little while ago we added a reference to the rigidBodyModelState to the jcalc method of the joints for a
 very similar reason (we needed more state information that we previously had). We could do the same for the restraints. This would allow the restraints to access the time, but also potentially any other aspect of the rigid body state.

Foam::RBD::restraint::restrain would need the new argument, as would all of it's derivations. Foam::RBD::rigidBodyModel::applyRestraints would also need it. The Foam::RBD::rigidBodySolvers then call applyRestraints with the same set of arguments as they use to call forwardDynamics.

Does that make sense? I don't know if the same is possible for sixDoF.

handrake0724

2019-09-10 23:21

reporter   ~0010724

yes, I think that make sense. for the sixDoF, I will study further.

handrake0724

2019-09-11 05:45

reporter   ~0010725

studying sixDoFRigidBodyMotion, sixDoFRigidBodyMotionState has not any information time.
access to restraints::restrain member function is maded in sixDoFRigidBodyMotion::applyRestraints() which is called in sixDoFRigidBodyMotion::updateAcceleration(fGlobal, tauGlobal).
sixDoFRigidBodyMotion::updateAcceleration is called in sixDoFSolver::updateAcceleration(fGlobal, tauGlobal)
sixDoFSolver::updateAcceleration is called in sixDoFSolver::solve(firstIter, fGlobal, tauGlobal, deltaT, deltaT0)

so sixDoF is using only time step and it doesn't look like an easy work to hand over time information up to restraint class unless chaning design of sixDoF classes or sixDoFRigidbodyMotionState. maybe best bet is to add time information to sixDoFRigidBodyMotioState and make it accessable.

henry

2019-09-11 08:05

manager   ~0010729

The longer term plan is to replace sixDoF with the more general and extensible rigidBody system, the only reason why this has not yet been done is that sixDoF supports implicit handling of restraints whereas they are currently handled explicitly in rigidBody and it is non-trivial to change this to an implicit implementation but this will get done eventually, particularly if we can secure funding for it. If your cases are not critically dependent on the implicit treatment of restraints I would recommend using the rigidBody system and update that to provide the time information to the restraints.

handrake0724

2019-09-11 08:49

reporter   ~0010730

I got the feeling rigidBody would replace sixDoF before. in that sense, I agree with Henry. Thank you for letting me know the plan.

Issue History

Date Modified Username Field Change
2019-09-10 10:24 handrake0724 New Issue
2019-09-10 10:33 henry Note Added: 0010715
2019-09-10 12:27 handrake0724 Note Added: 0010717
2019-09-10 13:44 henry Note Added: 0010718
2019-09-10 15:11 will Note Added: 0010720
2019-09-10 23:21 handrake0724 Note Added: 0010724
2019-09-11 05:45 handrake0724 Note Added: 0010725
2019-09-11 08:05 henry Note Added: 0010729
2019-09-11 08:49 handrake0724 Note Added: 0010730