EDEM API Tutorial 1- Particle Replacement tutorial mechanism

Megan_21536
Megan_21536 Altair Community Member
edited July 2023 in Community Q&A

Hello,

I have recently completed the EDEM API tutorial on particle replacement and would like to understand the underlying mechanism on how EDEM decides if the particles are removed and replaced. I have read through the code and would like to understand if the criterion for deciding whether the particles are removed are the particle type and current EDEM simulation time? I have attached what I understand to be the main code for the removal criterion here.

image

Thank you

Regards,

Megan

Tagged:

Best Answer

  • RWood
    RWood
    Altair Employee
    edited July 2023 Answer ✓

    Hi Megan,

    The short version is if both those if conditions are met, the particle is marked as a 'particle of interest'. Further on in the code there is a processParticleOfInterest( ) function which dictates what is carried out for these particles of interest, one of which is to remove the particle (line 188 of CRemoval.cpp). At the end of the time-step, those particles marked for removal are removed.

    Cheers,

    Richard

Answers

  • RWood
    RWood
    Altair Employee
    edited July 2023 Answer ✓

    Hi Megan,

    The short version is if both those if conditions are met, the particle is marked as a 'particle of interest'. Further on in the code there is a processParticleOfInterest( ) function which dictates what is carried out for these particles of interest, one of which is to remove the particle (line 188 of CRemoval.cpp). At the end of the time-step, those particles marked for removal are removed.

    Cheers,

    Richard

  • Megan_21536
    Megan_21536 Altair Community Member
    edited July 2023

    Hi Megan,

    The short version is if both those if conditions are met, the particle is marked as a 'particle of interest'. Further on in the code there is a processParticleOfInterest( ) function which dictates what is carried out for these particles of interest, one of which is to remove the particle (line 188 of CRemoval.cpp). At the end of the time-step, those particles marked for removal are removed.

    Cheers,

    Richard

    Hi Richard, 

    Thank you for your response.

    May I find out if it is possible to implement the process ParticleOfInterest() within the contact model API rather than the body force API? Or if there is any way to determine the particle and geometry contact status and/or collision velocity using the body force API?

    Regards,

    Megan

  • RWood
    RWood
    Altair Employee
    edited July 2023

    Hi Richard, 

    Thank you for your response.

    May I find out if it is possible to implement the process ParticleOfInterest() within the contact model API rather than the body force API? Or if there is any way to determine the particle and geometry contact status and/or collision velocity using the body force API?

    Regards,

    Megan

    The markParticleOfInterest( ) function is coming from the particle manager, which will be defined elsewhere in the plugin [typically declared in the header then initialised in starting( ) ]. You can use the same manager in contact models.

    As for particle/geometry contact status in the body force, this isn't possible. Body force plug-ins have no concept of geometries. Anything contact/collision related will have to be done in the contact model. The best you could do is to store data from a contact model in a custom property (or global variable) and then do what you need in the body force plug-in.

    Richard