Follow organic uptake onto seeds during imposed cooling
Follow organic uptake onto seeds during imposed cooling
Section titled “Follow organic uptake onto seeds during imposed cooling”How can cooling alter gas–particle partitioning while collisions change particle size? This example follows 24 organic species around a supplied seed population, applying condensation and Brownian coagulation under a prescribed temperature history. It connects volatility assumptions to mass and size diagnostics.
Despite the historical filename, this is not a soot-formation chemistry model. There is no nucleation, reaction network, carbonization, oxidation, or aggregate morphology. Fullerene-labeled seeds already exist at the start. Material tables and cooling are illustrative, not a calibrated flame or plume. Read organic partitioning and resolved coagulation for the separate mechanisms.
Python · section 1
# 🚧 Install Particula if you're running this in Google Colab# Remove the comment below to enable installation# Install from the repository root: `python -m pip install -e ".[extra]"`
# 📦 Import necessary librariesimport copy # to safely duplicate Python objectsfrom typing import Union
import matplotlib.pyplot as plt # for plottingimport numpy as np # numerical toolsimport particula as par # the main Particula packagefrom matplotlib.colors import LogNormfrom numpy.typing import NDArrayfrom particula.dynamics.condensation.species_mapping import ( CondensationSpeciesMap,)from tqdm import tqdm # optional: for progress bars during simulation
# 🎨 Set default plot styling using Tailwind-inspired colors from ParticulaTAILWIND = par.util.colors.TAILWINDbase_color = TAILWIND["gray"]["600"]
plt.rcParams.update( { "text.color": base_color, "axes.labelcolor": base_color, "figure.figsize": (5, 4), "font.size": 14, "axes.edgecolor": base_color, "xtick.color": base_color, "ytick.color": base_color, "pdf.fonttype": 42, "ps.fonttype": 42, })
# 🌌 Define the colors for the chemical species involved in the simulationcolor_list = ( # 1–2 ring aromatics (amber) [ TAILWIND["amber"][shade] for shade in ["400", "500", "600", "700", "800", "900"] ] + # 3–4 ring PAHs (sky) [ TAILWIND["sky"][shade] for shade in [ "300", "400", "500", "600", "700", "800", "900", "200", ] ] + # 5–7 ring PAHs (rose) [ TAILWIND["rose"][shade] for shade in [ "300", "400", "500", "600", "700", "800", "900", "200", ] ] + # Extra-large PAH surrogate (slate) [TAILWIND["slate"]["800"]] + # Fullerene (indigo) [TAILWIND["indigo"]["700"]])Define the species and audit the property lookup
Section titled “Define the species and audit the property lookup”The list spans small aromatics, PAHs, and a fullerene seed label. Supplied gas mass fractions are normalized to one; they are not tied here to a measured emission profile. The utility resolves names before retrieving properties. A returned numerical value does not establish a correct identity or validity at flame temperatures; inspect the resolved identifiers and property methods before using this as a material model.
Molar masses are kg/mol and densities kg/m³. The displayed standard-condition properties initialize part of the model; they do not mean all properties are updated consistently during cooling.
Python · section 2
# Define species list grouped by volatilitylist_of_chemicals = [ # 1–2-ring aromatics (gas-phase precursors, ~65%) "Benzene", "Toluene", "Ethylbenzene", "p-Xylene", "Styrene", "Indene", # 2–4-ring PAHs (semi-volatile, ~35%) "Naphthalene", "Acenaphthylene", "Acenaphthene", "Anthracene", "Fluoranthene", "Pyrene", "Chrysene", "Benzo[a]anthracene", # 5–7-ring PAHs (low volatility) "Benzo[b]fluoranthene", "Benzo[k]fluoranthene", "Benzo[a]pyrene", "Perylene", "Benzo[ghi]perylene", "Indeno[1,2,3-cd]pyrene", "Dibenzo[a,h]anthracene", "Coronene", # Optional ≥7-ring surrogate and soot seed "Ovalene", "Fullerene",]
# Initial mass fractions (normalized)initial_mass_fractions = np.array( [ # ------- 1–2-ring aromatics (~65%) 0.20, 0.15, 0.10, 0.10, 0.05, 0.05, # ------- 2–4-ring PAHs (~35%) 0.12068966, 0.01931034, 0.01448276, 0.01448276, 0.02896552, 0.02896552, 0.01448276, 0.00965517, # ------- 5–7-ring PAHs 0.01448276, 0.00965517, 0.00965517, 0.00724138, 0.00724138, 0.00482759, 0.00337931, 0.00241379, 0.00144828, 0.00072414, ], dtype=np.float64,)
# Normalize to sum to 1initial_mass_fractions /= np.sum(initial_mass_fractions)
# Initialize property arraysdensity_array = np.array([])molar_mass_array = np.array([])surface_tension_array = np.array([])cas_name = []chemical_dict = {}
# Retrieve and store propertiesfor chem in list_of_chemicals: cas = par.util.get_chemical_search(chem) print(f"{chem}: {cas}") chemical_dict[chem] = par.util.get_chemical_stp_properties(cas)
molar_mass_array = np.append( molar_mass_array, chemical_dict[chem]["molar_mass"] ) density_array = np.append(density_array, chemical_dict[chem]["density"]) surface_tension_array = np.append( surface_tension_array, chemical_dict[chem]["surface_tension"] ) cas_name.append(cas)
# Display property summaryfor chem, props in chemical_dict.items(): print(f"{chem}:") print(f" Molar Mass: {props['molar_mass']:.4f} kg/mol") print(f" Density: {props['density']:.2f} kg/m³") print(f" Surface Tension: {props['surface_tension']} N/m") print(f" Vapor Pressure: {props['pure_vapor_pressure']} Pa\n")Benzene: Benzene
Toluene: Toluene
Ethylbenzene: Ethylbenzene
p-Xylene: p-Xylene
Styrene: Styrene
Indene: Indene
Naphthalene: Naphthalene
Acenaphthylene: Acenaphthylene
Acenaphthene: Acenaphthene
Anthracene: Anthracene
Fluoranthene: Fluoranthene
Pyrene: Pyrene
Chrysene: Chrysene
Benzo[a]anthracene: Benzo[a]anthracene
Benzo[b]fluoranthene: Benzo[b]fluoranthene
Benzo[k]fluoranthene: Benzo[k]fluoranthene
Benzo[a]pyrene: Benzo[a]pyrene
Perylene: Perylene
Benzo[ghi]perylene: Benzo[ghi]perylene
Indeno[1,2,3-cd]pyrene: Indeno[1,2,3-cd]pyrene
Dibenzo[a,h]anthracene: Dibenzo[a,h]anthracene
Coronene: Coronene
Ovalene: Ovalene
Fullerene: Fullerene
Benzene:
Molar Mass: 0.0781 kg/mol
Density: 873.76 kg/m³
Surface Tension: 0.028206202466830844 N/m
Vapor Pressure: 12695.06760788906 Pa
Toluene:
Molar Mass: 0.0921 kg/mol
Density: 862.34 kg/m³
Surface Tension: 0.027906333880214882 N/m
Vapor Pressure: 3799.2916085833076 Pa
Ethylbenzene:
Molar Mass: 0.1062 kg/mol
Density: 862.64 kg/m³
Surface Tension: 0.028519673106300977 N/m
Vapor Pressure: 1278.8635512049998 Pa
p-Xylene:
Molar Mass: 0.1062 kg/mol
Density: 856.84 kg/m³
Surface Tension: 0.02780489434006062 N/m
Vapor Pressure: 1177.6548935579035 Pa
Styrene:
Molar Mass: 0.1041 kg/mol
Density: 900.52 kg/m³
Surface Tension: 0.030530851011226136 N/m
Vapor Pressure: 821.533882502462 Pa
Indene:
Molar Mass: 0.1162 kg/mol
Density: 957.15 kg/m³
Surface Tension: 0.019075436088789817 N/m
Vapor Pressure: 225.95221357669246 Pa
Naphthalene:
Molar Mass: 0.1282 kg/mol
Density: 1120.20 kg/m³
Surface Tension: 0.041817073351975 N/m
Vapor Pressure: 42.179417148049055 Pa
Acenaphthylene:
Molar Mass: 0.1522 kg/mol
Density: 1113.30 kg/m³
Surface Tension: 0.04143820989061258 N/m
Vapor Pressure: 2.83294928153961 Pa
Acenaphthene:
Molar Mass: 0.1542 kg/mol
Density: 972.47 kg/m³
Surface Tension: 0.0385194992687528 N/m
Vapor Pressure: 1.9222921879309003 Pa
Anthracene:
Molar Mass: 0.1782 kg/mol
Density: 1106.97 kg/m³
Surface Tension: 0.04831768955111898 N/m
Vapor Pressure: 0.362912065174679 Pa
Fluoranthene:
Molar Mass: 0.2023 kg/mol
Density: 1116.91 kg/m³
Surface Tension: 0.046639222539928284 N/m
Vapor Pressure: 0.0008003908764101553 Pa
Pyrene:
Molar Mass: 0.2023 kg/mol
Density: 1158.87 kg/m³
Surface Tension: 0.04893250644932069 N/m
Vapor Pressure: 5.1375589253832836e-05 Pa
Chrysene:
Molar Mass: 0.2283 kg/mol
Density: 1077.02 kg/m³
Surface Tension: 0.04985254377774797 N/m
Vapor Pressure: 2.6846652822105422e-05 Pa
Benzo[a]anthracene:
Molar Mass: 0.2283 kg/mol
Density: 1203.04 kg/m³
Surface Tension: 0.05157277097913564 N/m
Vapor Pressure: 5.569142923796036e-05 Pa
Benzo[b]fluoranthene:
Molar Mass: 0.2523 kg/mol
Density: 1150.91 kg/m³
Surface Tension: 0.050472914014624566 N/m
Vapor Pressure: 4.393050525936658e-06 Pa
Benzo[k]fluoranthene:
Molar Mass: 0.2523 kg/mol
Density: 1171.82 kg/m³
Surface Tension: 0.04582707666133075 N/m
Vapor Pressure: 0.0005678510119370869 Pa
Benzo[a]pyrene:
Molar Mass: 0.2523 kg/mol
Density: 1186.70 kg/m³
Surface Tension: 0.04608662360222815 N/m
Vapor Pressure: 0.0004701165050824623 Pa
Perylene:
Molar Mass: 0.2523 kg/mol
Density: 1145.59 kg/m³
Surface Tension: 0.0461198819597169 N/m
Vapor Pressure: 0.00045887128419603445 Pa
Benzo[ghi]perylene:
Molar Mass: 0.2763 kg/mol
Density: 1175.67 kg/m³
Surface Tension: 0.04702177589801932 N/m
Vapor Pressure: 7.126539938521257e-05 Pa
Indeno[1,2,3-cd]pyrene:
Molar Mass: 0.2763 kg/mol
Density: 1213.67 kg/m³
Surface Tension: 0.04679231808084244 N/m
Vapor Pressure: 8.535388889438557e-05 Pa
Dibenzo[a,h]anthracene:
Molar Mass: 0.2783 kg/mol
Density: 1172.69 kg/m³
Surface Tension: 0.04880049181278169 N/m
Vapor Pressure: 9.217001932898797e-06 Pa
Coronene:
Molar Mass: 0.3004 kg/mol
Density: 1116.06 kg/m³
Surface Tension: 0.04653055920308998 N/m
Vapor Pressure: 3.467366635539694e-05 Pa
Ovalene:
Molar Mass: 0.3985 kg/mol
Density: 1240.61 kg/m³
Surface Tension: 0.07585556520479782 N/m
Vapor Pressure: 7.325250517430775e-14 Pa
Fullerene:
Molar Mass: 0.7206 kg/mol
Density: 1441.72 kg/m³
Surface Tension: 0.040270320922924846 N/m
Vapor Pressure: 4.1068395355330673e-17 Pa
Build temperature-dependent tables and expose their limits
Section titled “Build temperature-dependent tables and expose their limits”There are 5000 sampled particles at 10⁷ cm⁻³, represented in 5×10⁻¹⁰ m³. The total initial organic gas concentration is 5×10⁻⁵ kg/m³. These chosen conditions are not qualified as a particular combustion source.
Vapor-pressure and surface-tension tables use 200 points from 200–1500 K. Surface tensions replace NaNs and impose a 0.02 N/m floor. Those numerical substitutions are model assumptions, not measurements at high temperature. The separately plotted vapor-pressure array is clipped after the strategies are constructed; that display operation should not be read as proof of the strategies’ underlying property validity. The charts help locate strong trends and questionable extrapolations; they do not establish chemical stability.
Python · section 3
# Reproducible initial sampling. Coagulation owns a separate random generator;# trajectories are stochastic and are not asserted equal across runs.np.random.seed(100)
# Simulation parametersnumber_of_samples = 5_000 # Simulated particlestotal_number_per_cm3 = 10_000_000 # #/cm³simulation_volume = number_of_samples / total_number_per_cm3 * 1e-6 # m³
# Initial gas phase loading and temperaturetotal_mass_gas_phase = 5e-5 # kg/m³temperature = 1200 # Initial gas temperature [K]
# Temperature range for property tablestemperature_range_table = np.linspace(200, 1500, 200)
# Preallocate property tablesvapor_pressure_strategy_list = []surface_tension_table = np.zeros( (len(temperature_range_table), len(list_of_chemicals)))vapor_pressure_table = np.zeros( (len(temperature_range_table), len(list_of_chemicals)))
# Loop through chemicals to build property tablesfor chem_i in list(chemical_dict.keys()): idx = list_of_chemicals.index(chem_i)
# Vapor pressure vs temperature vapor_pressure_temp = par.util.get_chemical_vapor_pressure( chemical_identifier=chem_i, temperature=temperature_range_table, ) vapor_pressure_table[:, idx] = vapor_pressure_temp
vapor_pressure_strategy = ( par.gas.TableVaporPressureBuilder() .set_temperature_table(temperature_range_table, "K") .set_vapor_pressure_table(vapor_pressure_temp, "Pa") .build() ) vapor_pressure_strategy_list.append(vapor_pressure_strategy)
# Surface tension vs temperature surface_tension_temp = par.util.get_chemical_surface_tension( chemical_identifier=chem_i, temperature=temperature_range_table, ) surface_tension_table[:, idx] = surface_tension_temp
# Clean up NaNs or extreme valuessurface_tension_table = np.nan_to_num(surface_tension_table, nan=2e-2)surface_tension_table = np.clip(surface_tension_table, a_min=2e-2, a_max=None)vapor_pressure_table = np.clip(vapor_pressure_table, a_min=1e-50, a_max=1e100)
# 🔍 Plot property tablesfig, ax = plt.subplots(2, 1, figsize=(10, 8), sharex=True)
for i, chem in enumerate(list_of_chemicals): ax[0].plot( temperature_range_table, surface_tension_table[:, i], label=chem, linewidth=2, color=color_list[i], ) ax[1].plot( temperature_range_table, vapor_pressure_table[:, i], label=chem, linewidth=2, color=color_list[i], )
ax[0].set_ylabel("Surface Tension (N/m)")ax[0].set_title("Surface Tension vs Temperature")ax[0].grid()
ax[1].set_yscale("log")ax[1].set_ylabel("Vapor Pressure (Pa)")ax[1].set_xlabel("Temperature (K)")ax[1].set_title("Vapor Pressure vs Temperature")ax[1].grid()
# Combined legendfig.legend( list_of_chemicals, loc="center left", bbox_to_anchor=(1.02, 0.5), title="Chemicals", fontsize="small",)plt.tight_layout(rect=(0, 0, 1, 1))plt.show()
Put the available material into a closed gas inventory
Section titled “Put the available material into a closed gas inventory”Each normalized fraction multiplies the total gas mass concentration. Native
GasData stores that ordered inventory, while EnvironmentData stores pressure
and temperature. The initial 1200 K value is replaced by the forcing below.
The parcel volume and pressure remain fixed: prescribed cooling here does not
also simulate expansion, entrainment, or dilution of material.
Python · section 4
# Compute gas-phase concentration [kg/m³]concentration_gas = initial_mass_fractions * total_mass_gas_phase
# Initialize gas-phase species with vapor pressure strategygas_species = par.gas.GasData( name=list_of_chemicals, molar_mass=molar_mass_array.copy(), partitioning=np.ones(len(list_of_chemicals), dtype=bool), concentration=concentration_gas[None, :].copy(),)environment = par.gas.EnvironmentData( temperature=np.array([float(temperature)]), pressure=np.array([101325.0]), saturation_ratio=np.zeros((1, len(list_of_chemicals))),)Supply the condensation sites rather than create them
Section titled “Supply the condensation sites rather than create them”Two lognormal seed-radius modes at 1 and 5 nm, both with geometric standard deviation 1.8, populate the resolved sample. All initial particle mass occupies the final, fullerene-labeled lane. The initial histogram counts particles per log-radius bin; it does not show a nucleation rate.
Ideal molar activity and a mass-weighted surface treatment are imposed. The seed has a separate phase label from the other organics. At the smallest sizes, continuum surface and transport assumptions themselves need scrutiny. The species-inventory helper includes gas mass times represented volume, so later closed material comparisons use kg per species.
Python · section 5
# Generate bi-modal seed particle distribution [m]radii_seeds = par.particles.get_lognormal_sample_distribution( mode=np.array([1e-9, 5e-9]), # 1 nm and 5 nm modes geometric_standard_deviation=np.array([1.8, 1.8]), number_of_particles=np.array([1, 0.5]), # relative mode strength number_of_samples=number_of_samples,)
# Calculate seed mass assuming all are pure fullerenemass_seeds = (4 / 3) * np.pi * (radii_seeds**3) * density_array[-1]
# Initialize mass speciation matrix: all mass in fullerene (last index)mass_speciation = np.zeros((number_of_samples, len(list_of_chemicals)))mass_speciation[:, -1] = mass_seeds
# Activity strategy (ideal molar)activity_strategy = ( par.particles.ActivityIdealMolarBuilder() .set_molar_mass(molar_mass_array, "kg/mol") .build())
# Phase indices: all condensed except the seedphases = np.ones_like(density_array)phases[-1] = 0 # last species (fullerene) is seed, not condensing
# Surface tension strategy (temperature-dependent)surface_strategy = ( par.particles.SurfaceStrategyMassBuilder() .set_surface_tension(surface_tension_array, "N/m") .set_density(density_array, "kg/m^3") .set_phase_index(phases) .set_surface_tension_table(surface_tension_table, "N/m") .set_temperature_table(temperature_range_table, "K") .build())
# Build the particle representationresolved_masses = par.particles.create_resolved_particle_data( masses=mass_speciation, density=density_array, volume=simulation_volume,)aerosol = par.Aerosol( particles=resolved_masses, gas=gas_species, environment=environment)
def species_inventory(aero): """Independent extensive species accounting including gas, kg.""" return np.sum( aero.particles.masses * aero.particles.concentration[..., None], axis=1 ) + (aero.gas.concentration * aero.particles.volume[:, None])
initial_inventory = species_inventory(aerosol)print(aerosol)
# 📊 Plot the initial size distributionfig, ax = plt.subplots()ax.hist(np.log10(resolved_masses.radii[0]), bins=50, alpha=0.5)ax.set_xlabel("log10(Radius [m])")ax.set_ylabel("Bin counts")ax.set_title("Initial Particle Size Distribution")plt.show()ParticleData(masses=array([[[0.00000000e+00, 0.00000000e+00, 0.00000000e+00, ...,
0.00000000e+00, 0.00000000e+00, 2.76038459e-25],
[0.00000000e+00, 0.00000000e+00, 0.00000000e+00, ...,
0.00000000e+00, 0.00000000e+00, 4.61302337e-23],
[0.00000000e+00, 0.00000000e+00, 0.00000000e+00, ...,
0.00000000e+00, 0.00000000e+00, 3.40787211e-23],
...,
[0.00000000e+00, 0.00000000e+00, 0.00000000e+00, ...,
0.00000000e+00, 0.00000000e+00, 2.41594302e-21],
[0.00000000e+00, 0.00000000e+00, 0.00000000e+00, ...,
0.00000000e+00, 0.00000000e+00, 2.75849762e-22],
[0.00000000e+00, 0.00000000e+00, 0.00000000e+00, ...,
0.00000000e+00, 0.00000000e+00, 4.70283383e-22]]],
shape=(1, 5000, 24)), concentration=array([[1., 1., 1., ..., 1., 1., 1.]], shape=(1, 5000)), charge=array([[0., 0., 0., ..., 0., 0., 0.]], shape=(1, 5000)), density=array([ 873.75728163, 862.3405711 , 862.64081188, 856.84076464,
900.52250717, 957.14688387, 1120.20362048, 1113.30161014,
972.4737836 , 1106.97030513, 1116.91442516, 1158.870467 ,
1077.0209774 , 1203.03774275, 1150.90754397, 1171.8180837 ,
1186.69738114, 1145.58749368, 1175.67352836, 1213.67033011,
1172.68838322, 1116.05748879, 1240.60653023, 1441.72368025]), volume=array([5.e-10]), distribution_type='particle_resolved', radius_grid=None)
GasData(name=['Benzene', 'Toluene', 'Ethylbenzene', 'p-Xylene', 'Styrene', 'Indene', 'Naphthalene', 'Acenaphthylene', 'Acenaphthene', 'Anthracene', 'Fluoranthene', 'Pyrene', 'Chrysene', 'Benzo[a]anthracene', 'Benzo[b]fluoranthene', 'Benzo[k]fluoranthene', 'Benzo[a]pyrene', 'Perylene', 'Benzo[ghi]perylene', 'Indeno[1,2,3-cd]pyrene', 'Dibenzo[a,h]anthracene', 'Coronene', 'Ovalene', 'Fullerene'], molar_mass=array([0.07811184, 0.09213842, 0.106165 , 0.106165 , 0.10414912,
0.11615982, 0.12817052, 0.15219192, 0.1542078 , 0.1782292 ,
0.2022506 , 0.2022506 , 0.22828788, 0.22828788, 0.25230928,
0.25230928, 0.25230928, 0.25230928, 0.27633068, 0.27633068,
0.27834656, 0.30035208, 0.39845356, 0.720642 ]), concentration=array([[1.03938926e-05, 7.79541942e-06, 5.19694628e-06, 5.19694628e-06,
2.59847314e-06, 2.59847314e-06, 6.27217680e-06, 1.00354800e-06,
7.52661257e-07, 7.52661257e-07, 1.50532251e-06, 1.50532251e-06,
7.52661257e-07, 5.01773998e-07, 7.52661257e-07, 5.01773998e-07,
5.01773998e-07, 3.76330629e-07, 3.76330629e-07, 2.50887259e-07,
1.75620925e-07, 1.25443370e-07, 7.52663336e-08, 3.76331668e-08]]), partitioning=array([ True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True, True, True, True,
True, True, True, True, True, True]))
EnvironmentData(temperature=array([1200.]), pressure=array([101325.]), saturation_ratio=array([[0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0.]]))

Apply mass transfer and collisions as separate operations
Section titled “Apply mass transfer and collisions as separate operations”Condensation uses a common diffusivity 2×10⁻⁵ m²/s and accommodation one. The fullerene lane (index 23) is excluded from partitioning, so its gas and particle inventories do not exchange through that process. Brownian coagulation can merge the existing resolved particles. Neither operation creates new chemical species or new seed particles.
Python · section 6
# 🌀 Condensation strategy setup (isothermal)condensation_strategy = par.dynamics.CondensationIsothermal( molar_mass=np.array(molar_mass_array), activity_strategy=activity_strategy, surface_strategy=surface_strategy, vapor_pressure_strategy=vapor_pressure_strategy_list, species_map=CondensationSpeciesMap( tuple(gas_species.name), tuple((i, i) for i in range(len(list_of_chemicals))), ), diffusion_coefficient=2e-5, # m²/s accommodation_coefficient=1.0, # perfect uptake skip_partitioning_indices=[23], # skip "Fullerene")
# Wrap into condensation process objectcondensation_process = par.dynamics.MassCondensation(condensation_strategy)
# ⚫ Coagulation strategy (Brownian motion)coagulation_strategy = ( par.dynamics.BrownianCoagulationBuilder() .set_distribution_type("particle_resolved") .build())
# Wrap into coagulation process objectcoagulation_process = par.dynamics.Coagulation(coagulation_strategy)Read the cooling equation before naming its temperatures
Section titled “Read the cooling equation before naming its temperatures”The two exponential contributions add: