grokkingstuff Home Blog Projects Wiki Calculators About

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:

StatisticSource DataPhysical Meaning
Escape/trap countsParticle statusMass balance
Residence time distributionPer-parcel time in domainMixing, exposure
Size distribution at outletDiameter of escaped parcelsFiltration or growth
Impact velocity distributionVelocity at wall impactDeposition likelihood
Impact angle distributionAngle at wall impactDeposition pattern
Temperature at exitTemperature of escaped parcelsThermal 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:

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:

ConditionIncomplete FractionDiagnosis
< 1%ExcellentNo action needed
1-5%AcceptableConsider increasing max steps
5-10%ConcerningIncrease max steps or refine mesh
> 10%PoorRe-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:

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:

MetricInjectionOutletInterpretation
$d_{\text{mean}}$1.0 um?If outlet > injection: growth (coagulation). If outlet < injection: size-selective deposition
Geometric std dev1.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:

MetricExperimental MethodSimulation OutputComparison
PM2.5 mass concentrationGravimetric filterSurface integral of $C_m$ at outlet$C_m^{\text{sim}}$ vs. $C_m^{\text{exp}}$
Particle size distributionSMPS / cascade impactorOutlet size histogram$dN/d\log d$ comparison
Deposition fractionPre/post mass measurementTrapped / Injected ratio$f_{\text{dep}}^{\text{sim}}$ vs. $f_{\text{dep}}^{\text{exp}}$
Velocity fieldPIV / hot-wireContinuous 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:

ParameterExpected SensitivityHow to Test
Injection diameterHigh (affects drag, deposition)Run with $d_{\text{mean}} = 0.5, 1.0, 2.0$ um
Particle densityMedium (affects inertia)Run with $\rho_p = 800, 1200, 1600$ kg/m^3
Turbulence modelHigh (affects DRW dispersion)Compare k-omega SST vs. k-epsilon RNG
Number of parcelsLow (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 triesMedium (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