How to get the force on FSI body?

61 views
Skip to first unread message

Alex Lan

unread,
Mar 20, 2024, 11:40:02 PM3/20/24
to ProjectChrono
Hi, I want to get the force that SPH particles applied to a FSI body or mesh. How can I get it?
Regards.

Luning Bakke

unread,
Mar 21, 2024, 11:46:19 AM3/21/24
to ProjectChrono
Hello Alex,

PrintFsiInfoToFile() can output the position, pose and forces and torques applied to the FSI body to a file. See demo_FSI_CylinderDrop.cpp as an example where the outputs are written to the DEMO_OUTPUT/FSI_Cylinder_Drop/fsi/FSI_body0.csv file.  

Though FSI does not have an API that returns the body force and torque directly to the user yet, you can implement your own in ChSystemFSI.cpp . You can take a look at the implementation in Add_Rigid_ForceTorques_To_ChSystem(), or Add_Flex_Forces_To_ChSystem(), to see how the force/torque are extracted. 

For example, if you want the force from SPH particles applied to the i-th rigid FSI body, your implementation can be, 

ChVector<float> ChSystemFsi::GetFsiBodyForce(int i) const {
    thrust::host_vector<Real3> forcesH = m_sysFSI->fsiGeneralData->rigid_FSI_ForcesD;
    return utils::ToChVector(forcesH[i]);
}

Note that the force is expressed in global coordinate. 

Thank you,
Luning

Alex Lan

unread,
Mar 25, 2024, 3:15:40 AM3/25/24
to ProjectChrono
Hi Luning,

I want to give a fixed torque between the wheel and axle in the single wheel test demo. The wheel should be driven and then balance with the force from SPH terrain. I used ChLinkMotorRotationTorque to implement it, but the torque seem not right. The wheel kept accelerate all the time. Is there any problem here?

Best regards,
Alex

Reply all
Reply to author
Forward
0 new messages