Support rigidBodyMotionState object in writeObjects
Functionality to add/problem to solve
To reduce the number of fields files written by openFoam, the normal writes can be disabled with a very large write interval and a custom "writeObjects" can be used instead. This makes it possible to specify exactly which field(s) need to be written to disk. For users interested in the rigidBodyMotionState this does not work because it is not an "Available objects in database".
Target audience
Anyone wanting more control over which fields are written to disk, and needing the rigidBodyMotionState. Note that re-staring a case from a saved data point requires the rigidBodyMotionState file. It can also be used for transformations in paraFoam, to invert or match the object motion. (as workaround, a user could try to recreate the missing rigidBodyMotionState files from the orientation information in the log.interFoam file. And maybe there are other workarounds.)
Proposal
If it is a database object but it is not listed for some reason, make sure rigidBodyMotionState is listed when available. If rigidBodyMotionState is not a "real" database object, it may be possible to add an option to "writeObjects" to enable writing of non-real-databse-objects, similar to how the normal write writes these files, and probably similar to how the "time" file is not listed but is written automatically.
I don't know how complex this is to add. During a normal write they are written and in the rigidBodyMotionState files header claim to be a database object.
What does success look like, and how can we measure that?
The rigidBodyMotionState(.gz) file appearing in the processor0/0.1/uniform folders.
example case
Using the normal write:
- start with the multiphase/interFoam/RAS/DTCHullMoving example
- change endTime to 0.2 and writeInterval to 0.1 (to speed up the test)
- Allrun
- there now is a processor0/0.1/uniform/rigidBodyMotionState file.
Using a custom write with just "U" and "points":
- copy the attached controlDict in the multiphase/interFoam/RAS/DTCHullMoving example
- Allrun
- processor0/0.1 folder now only contains the selected (U) file.
Including "rigidBodyMotionState" results in warning and no file:
- copy the attached controlDict in the multiphase/interFoam/RAS/DTCHullMoving example
- uncomment the rigidBodyMotionState line in controlDict
- Allrun
- log.interFoam contains a warning for rigidBodyMotionState, and lists the 56 objects available in the database.
Links / references
example controlDict
resulting warning: log.interFoam_snippet
typical result object file: rigidBodyMotionState