DPM Statistics — Histograms, Residence Time, and Particle Size Validation
#+CATEGORY: cfd
#+TAGS: DPM statistics histograms residence-time size-distribution validation
#+MATURITY: growing
DPM Statistics :: Histograms, Residence Time Distributions, and Validation
This page covers the statistical analysis tools available for DPM results in ANSYS Fluent 2024 R1: particle size histograms at outlets, residence time distributions, mass balance verification, and validation against experimental particle size data. Target application: shisha PM2.5 simulation.
Overview — Statistical Quantities from DPM
After a DPM run, Fluent stores per-parcel data that enables several statistical analyses:
| Statistic | Source Data | Physical Meaning |
|---|---|---|
| Escape/trap counts | Particle status | Mass balance |
| Residence time distribution | Per-parcel time in domain | Mixing, exposure |
| Size distribution at outlet | Diameter of escaped parcels | Filtration or growth |
| Impact velocity distribution | Velocity at wall impact | Deposition likelihood |
| Impact angle distribution | Angle at wall impact | Deposition pattern |
| Temperature at exit | Temperature of escaped parcels | Thermal exposure |
Mass Balance — Escape vs. Trap vs. Incomplete
The first check on any DPM result is mass balance: does the total injected mass equal the sum of escaped, trapped, and incomplete?
Procedure: 1. Reports > Discrete Phase > Summary... 2. Fluent reports:
- Total injected mass (kg/s for steady, kg for transient)
- Escaped mass
- Trapped mass
- Incomplete mass
- Evaporated mass (if evaporation active)
Mass balance equation: $$\dot{m}_{\text{inject}} = \dot{m}_{\text{escape}} + \dot{m}_{\text{trap}} + \dot{m}_{\text{incomplete}} + \dot{m}_{\text{evap}}$$
Acceptable mass balance:
| Condition | Incomplete Fraction | Diagnosis |
|---|---|---|
| < 1% | Excellent | No action needed |
| 1-5% | Acceptable | Consider increasing max steps |
| 5-10% | Concerning | Increase max steps or refine mesh |
| > 10% | Poor | Re-examine setup (BCs, numerics) |
TUI: ``` report/dpm-summary ```
Residence Time Distribution (RTD)
The residence time distribution describes how long particles spend inside the domain. For shisha PM2.5, the RTD determines the exposure duration: how long smoke particles remain in the breathing zone before escaping.
Definition: $$E(t) = \text{fraction of escaped particles with residence time } t$$
The RTD is a probability density function: $$\int_0^{\infty} E(t) \, dt = 1$$
Mean residence time: $$\bar{t} = \int_0^{\infty} t \, E(t) \, dt$$
Variance: $$\sigma_t^2 = \int_0^{\infty} (t - \bar{t})^2 E(t) \, dt$$
Extracting RTD from Fluent:
Method 1 — Sample file + Python: 1. Sample particles at the outlet (see DPM Sample Files) 2. Read the sample file; the residence time column is the 9th column 3. In Python, compute the histogram:
```python import numpy as np import matplotlib.pyplot as plt
data = np.loadtxt('shisha-pm25-outlet.dat') residence_time = data[:, 8] # time column (seconds) mass_flow = data[:, 9]
E_t, bin_edges = np.histogram(residence_time, bins=50, weights=mass_flow, density=True) t_center = (bin_edges[:-1] + bin_edges[1:]) / 2
plt.semilogy(t_center, E_t) plt.xlabel('Residence time [s]') plt.ylabel('E(t) [1/s]') plt.title('Residence Time Distribution') plt.grid(True, alpha=0.3) plt.savefig('rtd.png', dpi=300) plt.show()
mean_t = np.average(residence_time, weights=mass_flow) print(f"Mean residence time: {mean_t:.3f} s") ```
Method 2 — Fluent's built-in histogram: 1. Reports > Discrete Phase > Histogram... 2. Variable: Residence Time 3. Injections: select your injection 4. Number of Bins: 50 5. Click Plot or /Write...=
Interpreting the RTD for shisha:
- A narrow RTD (small $\sigma_t / \bar{t}$) indicates plug-like flow (particles pass through quickly)
- A broad RTD (large $\sigma_t / \bar{t}$) indicates significant mixing or recirculation
- A long tail in $E(t)$ indicates dead zones where particles recirculate
TIP: If the RTD shows a secondary peak, it indicates a recirculation zone. Check the velocity field for vortices.
Particle Size Distribution at Outlet
The size distribution of particles that escape through the outlet reveals whether the device sorts particles by size (smaller particles escape faster, larger particles deposit).
Procedure: 1. Sample particles at the outlet surface 2. Read the diameter column from the sample file 3. Compute a size histogram:
```python # Load data data = np.loadtxt('shisha-pm25-outlet.dat') d = data[:, 6] # diameter (meters) mass_flow = data[:, 9]
d_um = d * 1e6
d_bins = np.linspace(0.1, 5.0, 50) d_center = (d_bins[:-1] + d_bins[1:]) / 2 m_dist, _ = np.histogram(d_um, bins=d_bins, weights=mass_flow, density=True)
plt.plot(d_center, m_dist) plt.xlabel('Particle diameter [um]') plt.ylabel('Mass distribution [1/um]') plt.title('Particle Size Distribution at Outlet') plt.grid(True, alpha=0.3) plt.savefig('size-distribution.png', dpi=300) plt.show()
d_mean = np.average(d_um, weights=mass_flow) print(f"Mass-weighted mean diameter at outlet: {d_mean:.2f} um") ```
Comparing injection vs. outlet distribution:
| Metric | Injection | Outlet | Interpretation |
|---|---|---|---|
| $d_{\text{mean}}$ | 1.0 um | ? | If outlet > injection: growth (coagulation). If outlet < injection: size-selective deposition |
| Geometric std dev | 1.5 | ? | Narrower outlet distribution = strong size-selective filtration |
For PM2.5 specifically: Particles < 2.5 um at the outlet are the health-relevant fraction. If the simulation shows most particles at the outlet are PM2.5, the device does not filter fine particles effectively.
Validation Against Experimental Data
Validation compares simulation results to experimental measurements. The primary validation metrics for shisha PM2.5 DPM are:
| Metric | Experimental Method | Simulation Output | Comparison |
|---|---|---|---|
| PM2.5 mass concentration | Gravimetric filter | Surface integral of $C_m$ at outlet | $C_m^{\text{sim}}$ vs. $C_m^{\text{exp}}$ |
| Particle size distribution | SMPS / cascade impactor | Outlet size histogram | $dN/d\log d$ comparison |
| Deposition fraction | Pre/post mass measurement | Trapped / Injected ratio | $f_{\text{dep}}^{\text{sim}}$ vs. $f_{\text{dep}}^{\text{exp}}$ |
| Velocity field | PIV / hot-wire | Continuous phase velocity | $U^{\text{sim}}$ vs. $U^{\text{exp}}$ |
Concentration validation: 1. Run experimental measurement: place a filter at the outlet, measure mass after time $T$ 2. $C_m^{\text{exp}} = \frac{m_{\text{filter}}}{Q \cdot T}$ where $Q$ is the volumetric flow rate 3. Run DPM simulation; sample concentration at the outlet plane 4. $C_m^{\text{sim}}$ = area-weighted average of DPM Concentration on outlet plane 5. Compute relative error: $\epsilon = \frac{|C_m^{\text{sim}} - C_m^{\text{exp}}|}{C_m^{\text{exp}}} \times 100\%$
Acceptable agreement: $\epsilon < 20\%$ for concentration; $< 30\%$ for deposition fraction (deposition is more sensitive to BC assumptions).
Size distribution validation: 1. Compare $dN/d\log d$ curves (experiment from SMPS, simulation from outlet sample file) 2. Compute the normalized root-mean-square error (NRMSE): $$\text{NRMSE} = \frac{\sqrt{\frac{1}{N}\sum_i (y_i^{\text{sim}} - y_i^{\text{exp}})^2}}{\max(y) - \min(y)}$$ 3. NRMSE < 15% is good agreement; 15-25% is acceptable; > 25% needs re-examination
Sensitivity Analysis — Key Parameters
Identify which input parameters most affect the output. For shisha PM2.5 DPM:
| Parameter | Expected Sensitivity | How to Test |
|---|---|---|
| Injection diameter | High (affects drag, deposition) | Run with $d_{\text{mean}} = 0.5, 1.0, 2.0$ um |
| Particle density | Medium (affects inertia) | Run with $\rho_p = 800, 1200, 1600$ kg/m^3 |
| Turbulence model | High (affects DRW dispersion) | Compare k-omega SST vs. k-epsilon RNG |
| Number of parcels | Low (convergence, not physics) | Run with 5K, 10K, 50K parcels |
| Wall BC (trap vs reflect) | High (affects deposition) | Run with trap and reflect on all walls |
| Stochastic tries | Medium (affects dispersion variance) | Run with 5, 10, 20 tries |
Procedure: 1. Run baseline case (locked parameters from Shisha PM2.5 DPM Case Study) 2. For each parameter, run 2-3 variations 3. Plot the output metric (e.g., outlet concentration) vs. the parameter 4. Identify the parameter with the steepest slope; that is the most sensitive input
TIP: The injection diameter is almost always the most sensitive parameter for PM2.5. If your experimental size distribution is uncertain, the simulation uncertainty is dominated by this input.
Journal File for Automated Statistics
Write a Fluent journal file to automate the statistics extraction:
``` ; --- DPM Statistics Journal --- ; Run after DPM calculation completes
; 1. Summary report report/dpm-summary > dpm-summary.txt
; 2. Sample outlet sample/particle-data outlet shisha-pm25-outlet.dat
; 3. Sample breathing-zone plane surface/plane-surface plane-mouth 0 0 0.15 0 0 1 sample/particle-data plane-mouth shisha-pm25-mouth.dat
; 4. Wall flux report report/dpm/wall-fluxes bowl-inner body-wall hose-wall > wall-fluxes.txt
; 5. Concentration on outlet report/surface-integrals area-weighted-avg outlet dpm-concentration > outlet-concentration.txt
; Exit exit ```
Run with: fluent 3d -i statistics.jou
See Also
- DPM Post-Processing Guide
- DPM Sample Files — Cutting Planes and Iso-Surfaces
- DPM Concentration Fields
- DPM Theory -- Governing Equations
- Shisha PM2.5 DPM Case Study