Skip to content

Compare MAM4xx and particle-resolved Brownian coagulation

View code · Download Python script · Download complete ZIP

Compare two descriptions of the same coagulating aerosol

Section titled “Compare two descriptions of the same coagulating aerosol”

Fast et al. ported a four-mode aerosol module to GPUs. Here two dry modes collide for one hour in a closed box. The source bundle includes the frozen output of their one-subarea coagulation routine. Particula tracks individual mergers on CUDA. The report describes the independently matched number and dry-volume moments and the assumptions about mode widths.

Python · section 1

import matplotlib.pyplot as plt
from scripts.mam4xx_coagulation.plots import curves, spectra
if "saved_data" in globals():
report = globals()["saved_data"]
else:
from scripts.mam4xx_coagulation.campaign import simulate
from scripts.mam4xx_coagulation.compare import attach_modal
report = attach_modal(simulate())
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:
     ~/.cache/warp/1.11.1
Module particula.gpu.kernels.environment e11375e load on device 'cuda:0' took 0.83 ms  (cached)
Module particula.gpu.kernels.coagulation 84ae354 load on device 'cuda:0' took 1.26 ms  (cached)
Module particula.gpu.kernels._coagulation_native f93a244 load on device 'cuda:0' took 1.53 ms  (cached)
Module particula.execution.prepared_guards 5366864 load on device 'cuda:0' took 1.46 ms  (cached)
Module particula.gpu.kernels._brownian_parallel 5433dfc load on device 'cuda:0' took 3.94 ms  (cached)
Module particula.gpu.kernels._brownian_parallel f84feee load on device 'cuda:0' took 5.28 ms  (cached)
Module particula.gpu.kernels._coagulation_subcycling 93efbd4 load on device 'cuda:0' took 0.87 ms  (cached)
Module particula.gpu.kernels._coagulation_budget b4a3978 load on device 'cuda:0' took 1.41 ms  (cached)
Module particula.gpu.kernels._brownian_parallel c0acfec load on device 'cuda:0' took 4.45 ms  (cached)
Module particula.gpu.kernels.coagulation fd5b5c9 load on device 'cuda:0' took 1.24 ms  (cached)
Module particula.gpu.kernels.coagulation 79e9aa8 load on device 'cuda:0' took 1.94 ms  (cached)
Module particula.gpu.kernels._coagulation_subcycling ca6b3ba load on device 'cuda:0' took 2.45 ms  (cached)
Module particula.gpu.kernels._coagulation_subcycling a49d377 load on device 'cuda:0' took 2.25 ms  (cached)
Finished 60 nm, Aitken/accumulation 0.25
Finished 60 nm, Aitken/accumulation 1
Finished 60 nm, Aitken/accumulation 4
Finished 110 nm, Aitken/accumulation 0.25
Finished 110 nm, Aitken/accumulation 1
Finished 110 nm, Aitken/accumulation 4
Finished 220 nm, Aitken/accumulation 0.25
Finished 220 nm, Aitken/accumulation 1
Finished 220 nm, Aitken/accumulation 4

Each panel names the starting accumulation-mode diameter and the Aitken-to-accumulation number ratio. Shading spans a 95% Student interval for the mean of the 12 independent high-resolution particle simulations.

Python · section 2
curves(report)
plt.show()
Compare MAM4xx and particle-resolved Brownian coagulation: saved scientific figure
Compare MAM4xx and particle-resolved Brownian coagulation · saved execution output

Compare the shapes retained after one hour

Section titled “Compare the shapes retained after one hour”

At equal starting mode counts, compare both final diameter distributions on identical logarithmic bins. The stored totals include underflow and overflow. The plot shows the interior bins where most particles remain.

Python · section 3
spectra(report)
plt.show()
Compare MAM4xx and particle-resolved Brownian coagulation: saved scientific figure
Compare MAM4xx and particle-resolved Brownian coagulation · saved execution output

Holding dry material and aerosol number fixed isolates predictions of the two coagulation implementations. Both the collision-rate treatment and the imposed modal shape can contribute to the observed difference.

Explore this topic: Brownian coagulation