Skip to content

rigidBodyMeshMotion accesses CofG even if CofG object not specified

Summary

rigidBodyMeshMotion saves the CofG of even if not needed. This causes problems whilst checking for whether the body supplying the CofG is actually valid.

Steps to reproduce

multiphase/overInterDyMFoam/boatAndPropeller tutorial

What is the current bug behaviour?

Out-of-bounds access if bodyId of CofG is negative.

Environment information

  • OpenFOAM version : v2103

Possible fixes

do not access rigidBodyMeshMotion::bodyIdCofG_ unless needed.

@Sergio