get particle's volume

Asked by DuMin

Is there a funtion to get particle's volume?

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Dion Weatherley
Solved:
Last query:
Last reply:
Revision history for this message
Best Dion Weatherley (d-weatherley) said :
#1

Hi DuMin,

There is no function to directly get the volume of a particle. However there is a function to get the Radius of a particle. Since all particles are spherical in ESyS-Particle, it is trivial to compute a particle's volume once its Radius is known.

To get the radius of particles, you must first request a particle list from the simulation LsmMpi object, then request the radius of the desired sphere in the list. The following code fragment will compute the volume of the first particle in the list:

from math import pi

[...]

particles = sim.getParticleList()
R1 = particles[0].getRadius()
Volume = 4.*pi*R1**3./3.

I hope this helps.

Cheers,

Dion

Revision history for this message
DuMin (592451185-r) said :
#2

Thanks Dion Weatherley, that solved my question.