LEoPart - Extracting particle values at open boundaries (marked facets)

Dear all,

With the amazing functionality offered by the LEoPart library I am able to track “strain-history” of particles inside a complex domain.

image

In the picture above, one can distinguish the particles inside the red box that will leave through Outlet1 and the particles inside the blue box leaving through Outlet2. These particles will carry information of their own “strain-history”.

For my application I am interested in the cumulative strain-history of particles leaving a specific boundary. For example, I would like to know the average of strain-histories of particles leaving through outlet1 and compare the average strain-histories of particles leaving through outlet2. With the effect of the stenosis, I expect higher strain-histories carried by particles inside the red box.

LEoPart functionality enables specification of “open” boundaries, which means particles will be deleted if they “escaped” through a facet on an open boundary.
To compute the averages of the escaped particles, for every particle I would need to know whether they escaped through Outlet1 or Outlet2 and I need to collect their last recorded scalar value of strain-history.

I could extract a numpy array at every timestep that includes the last coordinate and value of every particle, and apply a filter on their final coordinates to learn whether they escaped through outlet1 or outlet2.

However, I was curious to know if there is a more convenient way to keep track of this. Perhaps, LEoPart is already keeping track of this and there is a way to access this, which would prevent unnecessary loops. If not, I will proceed with the above method.

With kind regards,

Currently, the way I made it work is with an additional particle property, that contains the “index” of the particle.
For every timestep:
I collect the indices of particles before advecting the particles in a np array
I collect the indices of particles after advection in a np array.
I compare the difference in indices, the missing indices represent the “escaped” particles.
With these indices, I am able to extract the information (coordinates, properties) from escaped particles in their “last timestep of existence”.

1 Like