access to the impact velocity

Submitted by gelinhan on Mon, 04/09/2018 - 15:51

Hi developers,

I am implementing a new normal contact model which needs the impact velocity (the velocity just before the collision) as an input parameter. A basic idea is to get the previous and current particle distance , and then extract the velocity just before there is an overlap. Is there any simple method to access the previous particle distance or any easier method to get the impact velocity?

Thank you.
Linhan

gelinhan | Thu, 04/12/2018 - 09:25

contact_history can be used to store the velocity just before the collision

Riccardo Maione's picture

Riccardo Maione | Wed, 04/25/2018 - 10:21

hello gelinhan,

have a look at "tangential_model_history.h", in this file there's the definition of
// shear history effects
if(cdata.touch) *cdata.touch |= TOUCH_TANGENTIAL_MODEL;
double * const shear = &cdata.contact_history[history_offset];

which is the element where all the information from the previous time step are stored, so you can store the "first" velocity there. you just need to define a condition for the first collision step.

Regards,
Riccardo

gelinhan | Thu, 04/26/2018 - 09:10

Hi Riccardo,

Thanks for the information. I implemented the impact velocity just like your idea.

Kind regards,
Linhan