How do I find the time-varying center of gravity location of my deforming model using DPF in mechanical?
Published in
2 min readSep 16, 2022
Today’s script tip comes from Vishnu Venkataraman, Application Engineer at Ansys.
The COG of a body might vary with time as the body deforms and you might be interested in knowing how to compute the time varying COG.
This example also highlights on how you can create your own mesh with DPF.
Methodology followed:
- Get the time varying deformation vectors for all nodes using: dpf.operators.displacement
- Create a mesh region based on existing mesh using dpf.MeshedRegion
- Update the node locations of the created mesh based on the deformation vectors at each time point.
- Find the COG using dpf.operators.geo.center_of_gravity by feeding in the mesh regions at every time point .
Function to find the time varying COG of your model:
Use the below function like:
body_named_selection = ‘MYBODY’timepoint = 3find_COG_at_time (body_named_selection, timepoint)
Please remember to create a body named selection called ‘MYBODY’