A track file can be used to visualize the particle tracks of a Lagrangian phase. To gain a deeper understanding of the simulated flow field, you wish to visualize only those particles that leave the flow domain through a particular boundary.
Attachments: | LMPsegregation.sim (8 MB) |
A track file can be used to visualize the particle tracks of a Lagrangian phase. To gain a deeper understanding of the simulated flow field, you wish to visualize only those particles that leave the flow domain through a particular boundary.
This article demonstrates how to extract those particles with an example of a simple channel flow with one inlet and two outlets. The particles leaving the flow domain through the left outlet are highlighted.
All particles leaving the flow domain through the left outlet are identified using boundary sampling. Thus allowing you to create a xyz internal table of the Track: Parcel Index of all particles leaving the flow domain through this boundary.
The parcel index serves as a unique identifier for each parcel.
This data can be used in a field function to identify the relevant particles in a track file. Using the interpolateTable() function we can look-up if a parcel index is included in the xyz internal table. This field function can then be used to create a data focus of the particle tracks. The data focus can be applied to the scalar displayer to clip the tracks.
interpolateTable(@Table("PID @outlet1"), "Track: Parcel Index", STEP , "Track: Parcel Index", ${TrackParcelId}) == ${TrackParcelId}
We can take it one step further and map values from the boundary sampling onto the tracks.
(interpolateTable(@Table("ResTime @LMP"), "Parcel Index", STEP , "Parcel Index", ${TrackParcelId}) == ${TrackParcelId}) ? interpolateTable(@Table("ResTime @LMP"),"Parcel Index" , STEP , "Particle Residence Time", ${TrackParcelId}) : interpolateTable(@Table("BID @BS1&2"),"Track: Parcel Index" , STEP , "Track: Particle Residence Time", ${TrackParcelId})
In the picture below you can see the resulting particle tracks. The tracks are colored by the maximum residence time the particle had either when leaving the domain (boundary sampling in magenta-cyan) or when the calculation stopped (Lagrangian particles in black-white).