🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

EDEM API Contact Model | Override particle velocity

User: "MQ"
Altair Community Member
Updated by MQ

Hello,

Is there any way/workaround to override particle velocity (and set to 0) in custom contact model API?

The idea is that when the two interacting particles (with initial attractive force) reach a certain overlap, they should abruptly stop (i.e. their velocities being instantaneously set to 'zero'), rather than applying decelerating/viscous force?

Simply setting contactResults.normalForce = zeroVector only removes acceleration between the particles, but they continue to move and further overlap with inertia (or last velocity).

Thank you.

Best regards,

MQ

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "RWood"
    Altair Employee
    Accepted Answer
    Updated by RWood

    Hi,

    You've probably realised that you can't set the particle velocity directly as it's part of the protected data. The way I've done this in the past is to apply a force in a particle body force plugin that takes the current particle velocity and applies a counteracting force based on that.

    results.force -= {
    particle.mass* particle.velocity.getX() / timeStepData.timeStep,
    particle.mass* particle.velocity.getY() / timeStepData.timeStep,
    particle.mass* particle.velocity.getZ() / timeStepData.timeStep};

    Simple, but it worked in my case (see attached). Ignore the random velocity directions, that was something unrelated.

    Cheers,

    Richard