2017-08-21 07:25 BST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002656OpenFOAMFeaturepublic2017-08-13 03:39
Reporterhandrake0724 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusnewResolutionopen 
Platformx86_64OSArchOS Version(please specify)
Product Version4.x 
Target VersionFixed in Version 
Summary0002656: request a functionObject for reporting motion state of sixDoFRigidBodyMotionsolver
DescriptionI am working on 6 DoF motion in two-phase flow.
sixDoFRigidBodyMotionSolver works fine, but what I am missing is a function to report motion state such as center of mass, rotation angle, etc.
Current sixDoFRigidBodyMotionSolver only print out to stdout.
So I made a functionObject for motion state. To do that, I have to access to motionPtr_ in dynamicMotionSolverFvMesh and motion_ in sixDoFRigidBodyMotionSolver.

So I added following code to two sources as follows:

  dynamicMotionSolverFvMesh.H
  public:
  const motionSolver& motionPtr() const { return motionPtr_(); }

  sixDoFRigidBodyMotionSolver.H
  public:
  const sixDoFRigidBodyMotion& motion() const { return motion_; }

based on these modification, I could make a functionObject as attached.

It would be good if a simular function reporting body motion is added to OpenFOAM.
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0008544

henry (manager)

in dynamicMotionSolverFvMesh.H

Why name the function motionPtr:

  const motionSolver& motionPtr() const { return motionPtr_(); }

it returns a reference to the motionSolver, not a pointer.

~0008545

handrake0724 (reporter)

I just name the function after the variable name.
just motion will be fine.

~0008547

henry (manager)

> I just name the function after the variable name.

But you de-reference the pointer with '()':

    return motionPtr_()

so it returns the reference rather than the pointer the variable is named after.

> just motion will be fine.

This would be more logical.

~0008548

handrake0724 (reporter)

Is there a way to write initial time and state to the stream?
current code starts writing from initial + timeStep instead of initial.

~0008549

henry (manager)

> Is there a way to write initial time and state to the stream?

Not in a standard way. This issue has been discussed before and a general solution would require some major work on the functionObject base classes and special handling for the functionObjects which do not have a logical initial state because they depend on values not available at the initial time.

~0008564

handrake0724 (reporter)

for now, it's find without writting the initial state.
+Notes

-Issue History
Date Modified Username Field Change
2017-08-09 05:04 handrake0724 New Issue
2017-08-09 05:04 handrake0724 File Added: rigidBodyState.tar.bz2
2017-08-09 18:41 henry Note Added: 0008544
2017-08-10 00:54 handrake0724 Note Added: 0008545
2017-08-10 08:49 henry Note Added: 0008547
2017-08-10 09:04 handrake0724 Note Added: 0008548
2017-08-10 09:45 henry Note Added: 0008549
2017-08-13 03:39 handrake0724 Note Added: 0008564
+Issue History