Particle Distribution Analysis

As a follow on to the Probability Density/Distribution Function for the continuous phase domain (link here), I have created a close cousin of this routine which works on Discrete Particles to determine a Particle Distribution of the Discrete Phase.

This routine was written with the intended use for Spray Distribution in an In-Cylinder model, and built according to the typical variables and techniques used for this modeling scheme. It is common to determine and understand what the distribution of the particular spray is within the domain over time (mass distribution vs. radius).  This routine asks the user for a variable to base the Distribution on (in this case droplet radius). The routine breaks this value down into N number of “bins” (in this case 20). For each bin, the routine calculates the total mass of the spray in that bin, and reports back out a distribution. The routine then walks the transient domain to collect this information over time, and generate extracted information vs. time.

In order to base the total in each bin on Mass, the user must prescribe three items : a) the droplet radius, b) the droplet density, and c) the number of droplet per parcel. In this instance, the actual Discrete/Particle data in EnSight represents one parcel of spray (all with the same physical properties).  Therefore, the mass is represented as (number_drop_parcel)*(particle_density)*(4/3*pi*r^3).

The GUI input for this routine is similar to the previous PDF macro for the continuous phase, with the addition of variable prescription needed for the mass calculation.

Based on this range, it then divides the volume into N number of IsoVolumes (number of bins) based on this variable range. The routine then determines the mass of the spray which is contained within each of these variable constrained ranges. The result is placed into a query register and automatically plotted on the screen.

The Tool presents the user with the simple Window to select the variable, and number of bins (or bars) for the distribution function, along with the three items needed to calculate the mass of the spray (radius, density, parcel count)

 

After executing, you will then get a graph of distribution of the variable within the parent part(s) selected.

The values on the graph should always sum to the total mass of spray in the domain.

Note: As users increase the number of bars( or bins) for the graph, the shape of the curve will increase in resolution, although values on the Y-axis of the graph will adjust.

This Tool can be downloaded from the link below. Please unzip the file and place both the Python Script and Icon PNG file into your UserDefinedTools area and restart EnSight. You should see a “PDF Particle Graph” icon available in your UDT area, and you can double click to execute.

 

 Video Tutorial:

Please view this video tutorial for a detailed walk through of using this tool for Spray Analysis.

Screencast Tutorial

Download:
Please use the following link to download the UserDefinedTool:

Click here to download Particle Distribution Tool

 

Spatial Probability Density Function (PDF) in EnSight

In analyzing the variable distribution within a solution, it is quite helpful to look at some type of Probability Density Function for the variable. There are a few interpretations of this function depending upon whether you are looking at the probability across time, space, or different datasets. In essence, the spatial probability density function indicates to the engineer how much of the domain (% of total volume in this case) which contains particular variable range. “How much of the domain has Species 1 near 0.01, or How much of the domain has Temperature near 900 degrees K”.

This particular tool I wrote is to analyze the distribution of a function spatially, sometimes referred to a volumetric probability density function, or a volumetric histogram. In a very basic interpretation, it is similar to the histogram display in the Color Palette Editor, normalized based on element volume.

This routine takes the parent part(s) that you have selected along with the variable that you’d to interrogate, and a user specified number of bins (or bars) in the histogram. The routine automatically finds the minimum and maximum variable range for the part(s). Based on this range, it then divides the volume into N number of IsoVolumes (number of bins) based on this variable range. The routine then determines the fraction of the total volume which is contained within each of these variable constrained ranges. The result is placed into a query register and automatically plotted on the screen.

The Tool presents the user with the simple Window to select the variable, and number of bins (or bars) for the distribution function.

 

After executing, you will then get a graph of distribution of the variable within the parent part(s) selected.

The values on the graph should always sum to 1.0, as it is presented as a fraction of the domain which contains that variable.

Note: As users increase the number of bars( or bins) for the graph, the shape of the curve will increase in resolution, although values on the Y-axis of the graph will adjust (as more bins used will still sum to 1.0).

This Tool can be downloaded from the link below. Please unzip the file and place both the Python Script and Icon PNG file into your UserDefinedTools area and restart EnSight. You should see a “PDF Graph” icon available in your UDT area, and you can double click to execute. Note, in EnSight 10, you can now place these UDT

Update 16-April-2012:

Based on User Requests, I’ve updated the routine to create a Stair-Stepped Graph rather than the smooth graph to represent the “binning” concept further in the graph.

Updated 22-April-2012:

Based on User Requests, I’ve updated the routine to handle transient models now. It does this by exporting out each timestep as a 1D bar part that is then automatically read back into EnSight at the end. This results in the PDF function correctly sitting in the time domain, and allows the user to normally control the timestep & all other features of EnSight while the PDF Graph correctly dove-tailed into the heirarchy of EnSight. This also allows the user to further interrogate and  and operate with the data as though it were normal Elemental Data (filtering, elevated surfaces, coloring, etc.)

I also updated the routine to correctly work with 2D parent parts (using the EleSize() and StatMoment() together rather than Vol().)

In addition, I also updated the routine to select the original Parent Parts for ease of repeat usage (rather than leaving the IsoVolume part selected).

Here is a example movie made from the Transient PDF function:

test_anim_out_sm

 

Update 05-Nov-2013: Updated routine for bug regarding the variable used for the IsoVolume. Previously, the variable selected in the GUI might not have been the variable used in the IsoVolume. Fixed in version 2.3

Update 03-Nov-2015 : Updated the explicit setting for the IsoVolume to “Band”, rather than default (not explicitly set). This would cause problems if previous IsoVolumes were not of type == Band.

Full Change log within header of Python File

Download:

Click here to Download PDF Tool v2.3 (pdf_graph_v2.3) Dated 05-Nov-2013

Click here to Download PDF Tool v 2.6 (pdf_graph_v2.6) Dated 03-Nov-2015