How to change particle density during simulation run?

Clemenslischka
Clemenslischka Altair Community Member
edited November 2023 in Community Q&A

Hi all,

i have a simulation approach where i change the particle diameter using the scale function. It works as expected but i need to adjust also the particle density during simulation to conserve the overall mass in my system. The change in diameter is not huge, so i can maintain a usuable Rayleigh time step when changing the density a priori. I see now, that is not custom to change the density during simulation, since the properties are stored in .h5 files. Is there any work-around / tipp to change density according to particle scale?

Thank you!

Tagged:

Answers

  • Stefan Pantaleev_21979
    Stefan Pantaleev_21979
    Altair Employee
    edited November 2023

    Hi Clemens,

    The only way to change the particle density retroactively is to edit the particle template mass and moments of inertia in the .h5 files. You can do this manually in HDF5View or similar or in Python using the h5py library.

    Best regards,

    Stefan

  • Clemenslischka
    Clemenslischka Altair Community Member
    edited November 2023

    Hi Stefan,

    appreciate your help with this! How can i modify the .h5 file, i suspect it's in a special file format?

    Thanks!

  • Stefan Pantaleev_21979
    Stefan Pantaleev_21979
    Altair Employee
    edited November 2023

    Hi Clemens,

    As above you can use HDFView to manually open the files and change values or you can edit the file in Python using the h5py library.

    Best regards,

    Stefan

  • Clemenslischka
    Clemenslischka Altair Community Member
    edited November 2023

    Hi Stefan,

    HDFview works charmingly, thanks! However with modifying the .h5 file i can only change the density of all particle types, correct? Can i change the density of each individual particle also some how?

    TY

  • Stefan Pantaleev_21979
    Stefan Pantaleev_21979
    Altair Employee
    edited November 2023

    Hi Clemens,

    There is no good way to achieve this. An imperfect workaround in the EDEM API could be to store the scaling factor for the radius as a particle property and then use this to scale the total particle forces in a particle body force API. In this way you will get the particles to accelerate as if they were heavier or lighter although they have the wrong mass. The scaling will need to be done very carefully however and might be complex for certain things like damping.

    Best regards,

    Stefan

     

  • Clemenslischka
    Clemenslischka Altair Community Member
    edited November 2023

    Ok, that sounds rather complicated. I'll try to implement a solution by averaging over all scale factors and adjusting the density for all particles.

    Thank you!