How did a particle reach 5 nm?
View code · Download Python script
How did a particle reach 5 nm?
Section titled “How did a particle reach 5 nm?”One sphere takes up vapor until its diameter reaches 5 nm. In a second box, two initially 4 nm spheres merge into a particle of almost the same size. A final size count gives one particle above 5 nm in each box. How can we tell which process brought it there?
The examples use the fixed-step prepared runner with Warp on CPU. Each active slot represents one particle. A small air volume of 10⁻¹⁵ m³ lets us observe a Brownian collision in a short illustrative run. Both boxes start at 298.15 K and 101,325 Pa. The particles are neutral spheres of density 1,000 kg/m³. Each example admits one physical process so its expected crossing channel can be checked independently.
Prepare the same starting diameter in each box
Section titled “Prepare the same starting diameter in each box”Convert a 4 nm diameter to the mass of a solid sphere. The growth box receives one particle and 40 µg/m³ of an idealized condensable vapor. The collision box receives two particles and no vapor. The example uses kg, metres and seconds throughout the simulation.
Python · section 1
import matplotlib.pyplot as pltimport numpy as npfrom particula import Aerosol, plottingfrom particula.dynamics import ( BrownianCoagulationStrategy, Coagulation, MassCondensation,)from particula.dynamics.condensation.condensation_strategies import ( CondensationIsothermal,)from particula.dynamics.condensation.species_mapping import ( CondensationSpeciesMap,)from particula.execution.crossings import DiameterCrossingsfrom particula.gas import EnvironmentData, GasDatafrom particula.gas.vapor_pressure_strategies import ( ConstantVaporPressureStrategy,)from particula.particles import ParticleDatafrom particula.particles.activity_strategies import ActivityIdealMassfrom particula.particles.surface_strategies import SurfaceStrategyVolume
def make_box(diameters_nm, vapor_kg_m3): """Build one resolved box from particle diameters and vapor concentration.""" density = 1000.0 diameters_m = np.asarray(diameters_nm) * 1e-9 masses = density * np.pi / 6 * diameters_m**3 return Aerosol( particles=ParticleData( masses=masses[None, :, None], population=np.ones((1, masses.size)), charge=np.zeros((1, masses.size)), density=np.array([density]), volume=np.array([1e-15]), distribution_type="particle_resolved", ), gas=GasData( ["vapor"], np.array([0.098]), np.array([[vapor_kg_m3]]), np.array([True]), ), environment=EnvironmentData([298.15], [101325.0], [[1.0]]), )Grow one sphere by vapor uptake
Section titled “Grow one sphere by vapor uptake”The vapor and particle phase share one material with molar mass 0.098 kg/mol. A saturation vapor pressure of 10⁻¹² Pa favors uptake throughout this example. The finite gas reservoir depletes, so growth slows. The species map directs the vapor mass lost from the gas to that same material in the particle.
Python · section 2
def condensation(aerosol): """Configure isothermal uptake from the box's single gas lane.""" return MassCondensation( CondensationIsothermal( molar_mass=aerosol.gas.molar_mass, diffusion_coefficient=1e-5, activity_strategy=ActivityIdealMass(), surface_strategy=SurfaceStrategyVolume( surface_tension=0.03, density=1000.0 ), vapor_pressure_strategy=ConstantVaporPressureStrategy(1e-12), species_map=CondensationSpeciesMap(("vapor",), ((0, 0),)), ) )Compare a merger with the growing sphere
Section titled “Compare a merger with the growing sphere”Two equal-density 4 nm spheres merge at conserved material volume. Their
expected product diameter is
Take an observation before each 0.05 s step and another after it. The two columns in the interval result count growth and mergers in that order. Dividing each count by its box’s air volume and the elapsed time gives the corresponding rate in m⁻³ s⁻¹. Also record the largest surviving diameter so we can compare the event counts with the particle sizes.
Python · section 3
def observe(aerosol, process): """Return diameters, interval counts and interval rates for one box.""" processes = process | DiameterCrossings(5e-9) time_s = [0.0] largest_nm = [float(2e9 * aerosol.particles.radii.max())] counts, rates = [], [] with processes.prepare( aerosol, device="cpu", time_step=0.05, root_seed=17 ) as simulation: previous = simulation.crossing_observation() for _ in range(4): simulation.step() current = simulation.crossing_observation() interval = current.interval_since(previous) counts.append(interval.counts[0].tolist()) rates.append(interval.rates[0].tolist()) time_s.append(simulation.simulated_time) largest_nm.append( float(2e9 * simulation.snapshot().particles.radii.max()) ) previous = current return dict( time_s=time_s, largest_nm=largest_nm, counts=counts, rates=rates )
def run_example(): """Compare independent growth and merger histories at 5 nm.""" growth_box = make_box([4.0], 4e-8) merger_box = make_box([4.0, 4.0], 0.0) return { "growth": observe(growth_box, condensation(growth_box)), "merger": observe( merger_box, Coagulation(BrownianCoagulationStrategy("particle_resolved")), ), }Locate the crossing in each history
Section titled “Locate the crossing in each history”The diameter panel shows the starting size and each step endpoint. The merger is drawn as a jump at the end of its observation interval. In the count panel each marker belongs to the interval ending at that time. The circle and square count different processes in separate boxes. Each inactive channel stays at zero throughout its run.
Python · section 4
def plot_results(report): """Plot the largest diameter and its observed pathway in each box.""" with plt.style.context("particula.default"): fig, (size, events) = plotting.subplots(2, 1, sharex=True, size="wide") size.axhline(5, color="0.45", linestyle=":", label="5 nm threshold") for channel, (key, label, style) in enumerate( (("growth", "Condensation", "o-"), ("merger", "Coagulation", "s--")) ): data = report[key] size.plot( data["time_s"], data["largest_nm"], style, label=label, drawstyle="steps-post" if channel == 1 else "default", ) events.plot( data["time_s"][1:], np.asarray(data["counts"])[:, channel], marker="o" if channel == 0 else "s", linestyle="none", markerfacecolor="none" if channel == 0 else None, markersize=9 if channel == 0 else 4, ) size.set(ylabel="Largest diameter (nm)", yticks=[4.0, 4.5, 5.0]) size.legend(loc="lower right") events.set( xlabel="Elapsed time (s)", ylabel="Crossings per interval", xticks=report["growth"]["time_s"], yticks=[0, 1], ylim=(-0.15, 1.2), ) plotting.fit(fig) return fig
if __name__ == "__main__": plot_results(run_example()) plt.show()Explicit cpu invocation
report = run_example()plot_results(report)plt.show()Warp 1.11.1 initialized:
CUDA Toolkit 12.9, Driver 13.4
Devices:
"cpu" : "CPU"
"cuda:0" : "NVIDIA GeForce RTX 5060" (8 GiB, sm_120, mempool enabled)
Kernel cache:
/tmp/crossing-wp
Module particula.gpu.kernels.condensation 2735326 load on device 'cpu' took 1.03 ms (cached)
Module particula.gpu.kernels.environment 0749c5a load on device 'cpu' took 0.13 ms (cached)
Module particula.gpu.kernels._condensation_native 4bb83eb load on device 'cpu' took 0.13 ms (cached)
Module particula.gpu.kernels.thermodynamics 48ddd42 load on device 'cpu' took 0.18 ms (cached)
Module particula.execution.prepared_guards 9442bd4 load on device 'cpu' took 0.12 ms (cached)
Module particula.gpu.kernels.crossings 7eeac75 load on device 'cpu' took 0.19 ms (cached)
Module particula.gpu.kernels.condensation 8837791 load on device 'cpu' took 0.13 ms (cached)
Module particula.gpu.kernels.condensation 2ef5c50 load on device 'cpu' took 0.12 ms (cached)
Module particula.gpu.kernels.condensation 738cb3b load on device 'cpu' took 0.19 ms (cached)
Module particula.gpu.kernels._condensation_native dadea1f load on device 'cpu' took 0.13 ms (cached)
Module particula.gpu.kernels.condensation c71949e load on device 'cpu' took 0.16 ms (cached)
Module particula.gpu.kernels._condensation_native 03a4549 load on device 'cpu' took 0.18 ms (cached)
Module particula.gpu.kernels.condensation ede8a9e load on device 'cpu' took 0.30 ms (cached)
Module particula.gpu.kernels._condensation_native eaa1bbf load on device 'cpu' took 0.21 ms (cached)
Module particula.gpu.kernels._condensation_native 071056c load on device 'cpu' took 0.21 ms (cached)
Module particula.gpu.kernels.condensation 67d6284 load on device 'cpu' took 0.29 ms (cached)
Module particula.gpu.kernels.condensation 28e2786 load on device 'cpu' took 0.33 ms (cached)
Module particula.gpu.kernels.condensation 2cf1f0b load on device 'cpu' took 0.36 ms (cached)
Module particula.gpu.kernels._condensation_native a09be9d load on device 'cpu' took 0.20 ms (cached)
Module particula.gpu.kernels.coagulation ac676ea load on device 'cpu' took 0.24 ms (cached)
Module particula.gpu.kernels._coagulation_native c1df7de load on device 'cpu' took 0.14 ms (cached)
Module particula.gpu.kernels._brownian_parallel 1e32053 load on device 'cpu' took 0.35 ms (cached)
Module particula.gpu.kernels._brownian_parallel 9a1a29e load on device 'cpu' took 0.30 ms (cached)
Module particula.gpu.kernels._coagulation_budget 45a9ea0 load on device 'cpu' took 0.15 ms (cached)
Module particula.gpu.kernels._brownian_parallel 0b09bee load on device 'cpu' took 0.31 ms (cached)
Module particula.gpu.kernels.coagulation 42589f5 load on device 'cpu' took 0.17 ms (cached)
Module particula.gpu.kernels.coagulation 27f6890 load on device 'cpu' took 0.14 ms (cached)

With seed 17 the merger creates a single 5.04 nm particle during 0–0.05 s. The growing sphere reaches 5 nm during 0.10–0.15 s. Each event gives one count in 0.05 s and 10⁻¹⁵ m³, or 2 × 10¹⁶ m⁻³ s⁻¹ in its own channel. Averaged over the entire 0.20 s observation, the rate is 5 × 10¹⁵ m⁻³ s⁻¹ for either case. The common rate and similar final diameters conceal the difference between the pathways.
The collision time belongs to one random realization. To estimate a formation rate in a larger sample, repeat the same physical case across independent boxes and divide the summed event counts by their summed volume-time exposure. To examine the threshold dependence, try 5.1 nm. The 4 nm pair has too little combined material to reach that diameter in a merger. See prepared simulations for observer scope and CLOUD run 1833 for the chamber study that motivated counting the two pathways.
Study resources
Section titled “Study resources”- Prepare the crossing observer · Prepared GPU simulations
- CLOUD chamber comparison · How sulfuric acid capture shapes particle growth in CLOUD run 1833
Explore this topic: Particle-resolved populations · Condensation and evaporation