Efficient Modeling of Particle Transport through Aerosols in GEANT4
EEfficient Modeling of Particle Transport throughAerosols in GEANT4
Nathaniel J.L. MacFadden a , Ara N. Knaian a, ∗ a NK Labs, Cambridge, MA 02139, USA
Abstract
We present a geometry class for efficiently simulating particle transportthrough aerosols in GEANT4. It is demonstrated that aerosol granularitycan strongly affect this transport and thus a generic aerosol model must re-spect this granularity, which the presented class achieves by modelling theaerosol as a collection of droplets. For large aerosols, this class is ordersof magnitude quicker and less memory intensive than standard granularity-respecting methods to model aerosols in GEANT4. These gains are allowedby simpler voxelization optimization, by only populating droplets relevant tothe transport, and by using droplet geometry to consider fewer droplets percalculation. The presented class allows differing aerosol bulk/droplet shape,droplets with structure, and spatially varying droplet position/rotation.
Keywords: aerosol; particle transport; GEANT4
1. Introduction
GEANT4 is a C++ based open-source toolkit for simulating the pas-sage of particles through matter[1]. Often used for high energy physics and ∗ Corresponding author.
E-mail address: [email protected]
Preprint submitted to Computer Physics Communications August 5, 2020 a r X i v : . [ phy s i c s . c o m p - ph ] A ug ccelerator design, GEANT4 also has a range of scientific/engineering appli-cations such as design of radiation shielding, medical equipment, and spacehardware[2, 3]. The transport of particles through aerosols is important bothin traditional application such as particle detectors[4, 5] and in many alter-nate applications such as environmental studies[6, 7, 8] and astronomicalstudies[9, 10, 11, 12], but this transport is complicated[13] since, for someaerosols, their granularity is important[9].The simplest aerosol model, a single-volume mixture of the backgroundand droplet materials in the correct mass fractions, is sufficient when thisgranularity is unimportant, but we experimentally find this only to be truewhen droplets are small. The failure of this approximation can be understoodbecause a single volume model implicitly posits equal interaction probabil-ity throughout the aerosol (uniform distribution of droplet material) but,when aerosols consist of large droplets, there is a heightened probability forinteractions in quick succession.The granularity is most directly respected by modelling the aerosol as acollection of (non-intersecting) droplets, which can be done with GEANT4’s‘parameterised solid’ geometry. A parameterised solid consists of one or moresub-objects that are repeatedly placed in the world according a parameter-isation function that allows differences in position, size, rotation, material,and more between copies[14]. While such solids are maximally flexible, theyexperience computational difficulties when the sub-object is populated mil-lions or billions of times, as in the case of many aerosols. To allow for suchaerosols with many large droplets to be simulated in GEANT4, we presentthe ‘fastAerosol’ geometry class which models the aerosol as a collection of2roplets but with three following differences from parameterised solids.First, while both fastAerosol and parameterised solids organize volumesin voxels, fastAerosol utilizes a simpler voxelization algorithm which onlyconsiders the average droplet number density and droplet bounding radiusin contrast to parameterised solids’ algorithm which utilizes the location ofthe sub-objects in voxelization.Second, fastAerosol differs from parameterised solids by not needing toload/generate the droplets at the start of the simulation: fastAerosol allowsdynamic population of droplets as particles travel through an aerosol (‘lazy’population). This allows speedups especially in aerosols where the effectivevolume (in which particles transport through) is significantly smaller thanthe total bulk volume or when the number of primaries is low.Third, the fastAerosol class utilizes the droplet geometry to speed upcalculations. The motivation is that, if the distance to the center of a dropletgives knowledge of the distance to the surface ± δ , then the closest dropletmust be in the spherical shell with radial width R ≤ R ≤ R + 2 δ for R thedistance to the closest droplet center.
2. fastAerosol Geometry
This report presents an aerosol model, ‘fastAerosol’, implemented inGEANT4 and representing an aerosol as a collection of uniformly shapeddroplets. Volumes in GEANT4 are described via a hierarchy[14]: at thelowest level, a volume is described by its shape in a ‘solid volume’. Next,the shape is given a material and physical properties in a ‘logical volume’.Finally, the shape is given a position and rotation in a ‘physical volume’.3ince the presented fastAerosol class is strictly geometrical, this class is onthe solid volume level of the hierarchy.The model consists of a helper class, ‘fastAerosol’, and a solid volumeclass, ‘fastAerosolSolid’. The fastAerosol helper class contains the droplet po-sitions, methods to find nearest droplets, and methods to populate droplets;the fastAerosolSolid class contains the GEANT4 requisite solid functions(e.g., DistanceToIn). We refer to the collection of the two classes as ‘fas-tAerosol’.
The fastAerosol class was designed to be usable with only knowledge ofthe aerosol’s macroscopic properties. While the aerosol’s microstate requiresdescription of each droplet’s position and rotation, this information may notbe available/relevant to the user. To allow the user to be unconcerned ofmicrostate properties, fastAerosol automatically generates droplets in theaerosol based off of an average droplet number density, a position distribu-tion, and a rotation distribution.By allowing fastAerosol to control the microstate, computational gainscan be achieved by lazily populating droplets. To achieve such population,the aerosol is voxelized and droplets are only generated/loaded in voxelswhich could contain the closest droplet for a given calculation. The vox-elization pitch, p grid , is fixed such that there are an average of N droplets/voxel droplets per voxel (default= 4; chosen from experimentation to minimizesimulation time): p grid = (cid:18) N droplets/voxel (cid:104) n d (cid:105) (cid:19) / (1)4or an aerosol with average droplet number density (cid:104) n d (cid:105) .These voxels are contained in a vector of length N tot = N x N y N z for N x , N y , and N z the number of voxels in the x , y , and z -directions respectively(appropriately aligned with the bounding box). A voxel with center ( x, y, z )is assigned an index I ( x, y, z ) in this vector given by I ( x, y, z ) = ( x − x ) + N x [( y − y ) + N y ( z − z )] p grid (2)for ( x , y , z ) the coordinates of the center of the ‘minimal’ voxel. That is,( x , y , z ) are defined so that x ≤ x and y ≤ y and z ≤ z for ( x, y, z ) thecoordinates of the center of any voxel in the bounding box’s voxelization. Wewill call ( x − x ) /p grid the voxel x -coordinate and similar for y and z .Two values must be determined for each voxel: a random seed, s ( x, y, z ),and the expected number of droplets per voxel, µ ( x, y, z ). First, s ( x, y, z ) ischosen to be: s ( x, y, z ) = I ( x, y, z ) + s global N tot , (3)for s global a random seed for the entire program. Multiplying s global by N tot guarantees completely new voxel seeds for different integer global seeds.Second, µ ( x, y, z ) is set based off of the spatial average, (cid:104) n d (cid:105) , and a dis-tribution, f . This is done by first calculating a value, µ , proportional to themean: µ ( x, y, z ) = (cid:104) n d (cid:105) max [0 , V ( x, y, z ) f ( x, y, z )] (4)where V ( x, y, z ) ∈ [0 ,
1] is the fraction of the volume in the voxel that allowsplacement of a droplet center (inside the aerosol bulk and at least r awayfrom the edge for droplet radius r ). If ( x, y, z ) is at least r + √ p grid / ( x, y, z ) = 1. Otherwise, this overlap fraction is manually calculated byplacing 100 points with uniform random distribution in the voxel and setting V ( x, y, z ) = N good /
100 where N good is the number of placed points whichallow droplet placement.Since no restrictions are placed on f , this µ ( x, y, z ) is not guaranteed togive the correct (cid:104) n d (cid:105) , so µ ( x, y, z ) must be scaled from µ ( x, y, z ): µ ( x, y, z ) = µ ( x, y, z ) (cid:104) n d (cid:105) V B (cid:80) voxels µ ( x (cid:48) , y (cid:48) , z (cid:48) ) (5)for V B the volume of the aerosol bulk. This guarantees that (cid:80) voxels µ ( x, y, z ) = (cid:104) n d (cid:105) V B , as desired.When performing distance calculations, voxels are lazily populated: if anunpopulated voxel at ( x, y, z ) could have the closest droplet, a Poisson ran-dom number of droplets (mean µ ( x, y, z ) and seed s ( x, y, z )) are placed withcenters uniform randomly distributed in the voxel. If a center is to be placedless than r from aerosol boundary or less than 2 r + minSpacing from anyother droplet center (for some user-specified buffer, minSpacing ), the posi-tion is regenerated. If a single center fails placement a user-specified amountof times (default is 100 attempts), the simulation skips that placement. In theevent that the number of skipped centers exceeds a user-specified maximum(default is 1% of the total droplets expected in the aerosol), the simulationends with an error. GEANT4 distance calculations are sensitive to the droplet with the closestsurface, so discussion is focused on determination of said droplet. The fas-tAerosol class finds the droplet with the closest surface by searching droplet6enters for a collection of droplets guaranteed to contain it and then iterat-ing over this collection to find the one with the closest surface. There aretwo definitions of distance relevant to GEANT4 calculations: absolute dis-tance and distance along a vector, both of which are covered in the followingsections.To generate this collection of candidates for either definition of distance,the relationship between the distance to a droplet’s center and the distanceto its surface is required. Define r in to be the radius of the largest sphere,centered at a droplet, that can be drawn fully inside the droplet; define r droplet to be the radius of the smallest sphere, centered at the same droplet,that contains the droplet (also called the ‘bounding radius’). Since dropletsare assumed to be uniform in shape/size, these r in and r droplet hold for alldroplets.For R the distance from a query point to the center of the droplet withthe closest center, it is then known that the droplet with the closest surfaceis centered in the shell (centered at the query point) with radius range R
25 + ( R + σ ) /p grid (cid:101) or when R exceeds a user defined maximum.The upper limit on R is chosen so that, at this limit, there are no points inthe voxelized shell at radius R + 1 that are closer than R + σ (upper limitcalculated in 2 D and used as approximation for 3 D ).The absolute closest droplet is then found by iterating over all dropletsin C that have centers closer than R + σ and returning the droplet with theclosest surface distance (return no droplet if C = {} ). To calculate the closest droplet to a particle at point (cid:126)p along normalizedvector (cid:126)v , first, define a voxel search width, w , as w = 2 (cid:24) r droplet p grid (cid:25) + 1 , (6)and a temporary position, (cid:126)p (cid:48) , beginning at (cid:126)p (cid:48) = (cid:126)p with distance R bulk fromthe aerosol bulk (let R bulk automatically update when (cid:126)p (cid:48) changes). Addi-tionally, let (cid:126)d be the closest droplet found so far and R the distance to thisdroplet’s center (treat R = ∞ at start). The search algorithm, then, is to1. if R bulk = ∞ , return (cid:126)d ; otherwise, if R bulk > p grid , update (cid:126)p (cid:48) → (cid:126)p (cid:48) +( R bulk − p grid ) (cid:126)v .2. If | (cid:126)p (cid:48) − (cid:126)p | is greater than a user defined maximum, return (cid:126)d ; otherwise,3. search a w × w × w grid of voxels centered at the voxel containing (cid:126)p (cid:48) ,calculate the vector distance to the surface of any droplets in this grid8nd update (cid:126)d and R appropriately.4. If | (cid:126)p (cid:48) − (cid:126)p | > R + σ , return (cid:126)d ; otherwise,5. Find the smallest n ∈ N such that (cid:126)p (cid:48) + n . p grid (cid:126)v lies in a new voxel,define (cid:126)δ = δ x ˆ x + δ y ˆ y + δ z ˆ z to be the difference in voxel positions betweenthe (cid:126)p (cid:48) + n . p grid (cid:126)v and (cid:126)p (cid:48) , and update (cid:126)p (cid:48) → (cid:126)p (cid:48) + n . p grid (cid:126)v .6. If R bulk > p grid , return step 1; otherwise,7. for each non-zero δ α for α ∈ { x, y, z } , search for droplets the ‘end caps’ (cid:126)p old (cid:48) + ( w + 1) δ α ˆ α + a ˆ β + b ˆ γ for ˆ β, ˆ γ ∈ { ˆ x, ˆ y, ˆ z } \ ˆ α with ˆ β (cid:54) = ˆ γ andwith a, b ∈ [ − w, w ] ∩ Z .8. If | (cid:126)δ | >
1, also search for droplets the edges/corners between the endcaps.9. Update (cid:126)d and R appropriately. Return to step 4.Since the surface distance needs to be calculated to know if a dropletis a candidate (the primary could travel through the droplet’s bounding ra-dius but not actually intersect the droplet), the explicit generation of thecollection C and then iteration through C is unnecessary. The fastAerosol class accepts any bulk shape in the form of a solid volumeobject, which is valuable since aerosols often have non-rectangular shapessuch as tori[9] and the shapes of atmospheric clouds. Similarly, fastAerosol-Solid accepts any droplet shape in form of a solid volume object, with thedisclaimer that, while distance calculations to droplets of any shape are ac-curate, these droplets will be placed as if they were spheres of their boundingradius. Thus fine packing of elongated objects (e.g., sticks) is currently notpossible with this package. 9y only containing the centers in the fastAerosol helper class, construc-tion of structured droplets is simple: associate multiple fastAerosolSolid ob-jects per fastAerosol helper class. Droplet rotation distributions are allowed.
The fastAerosol class achieves simpler user implementation by its relianceonly on macroscopic properties. While implementation of a parameterisedaerosol requires the user to provide droplet positions and rotations at con-struction, fastAerosol only needs distributions for position and rotation:f a s t A e r o s o l ∗ a e r o s o l = new f a s t A e r o s o l ( “ a e r o s o l ” , bulkShape , boundingR ,minSpacing , avgDropNumDens , sigma ,p o s i t i o n D i s t r i b u t i o n ) ;f a s t A e r o s o l S o l i d ∗ s o l i d A e r o s o l = new f a s t A e r o s o l S o l i d ( “ a e r o s o l S V ” , a e r o s o l ,d r o p l e t S h a p e ,r o t a t i o n D i s t r i b u t i o n ) ) ;where the first argument to each function is its name and the variables areself-explanatory. The distribution arguments (‘positionDistribution’ and ‘ro-tationDistribution’) and ‘sigma’ are optional, taking default values of uniformposition/rotation and σ = 0. More detailed implementation may be foundin the full source code, available as an advanced example in GEANT4 (as ofversion 10.7). 10 igure 1: Ellipsoidal aerosol geometry with 50 MeV protons shot through it from(0 , , − .
5) mm (with x and y spread σ = 16 . z -direction.
3. Experimental Methods
To test fastAerosol’s accuracy and computational efficiency, a fastAerosolaerosol is generated at the origin with a 150 × × z -axis from a Gaussian distribution centered at(0 , , − .
5) mm with standard deviation σ = 16 . x and y directions. The global seed is allowed to vary across s global ∈ [1 , ∩ N forstatistics.The following experiments were performed on GEANT4 10.04 (patch 02)running on an Amazon Web Services (AWS) ‘c5.24xlarge’ computer. Wehave provided the source code as an advanced example in GEANT4 (as of11ersion 10.7). The data reflects code compiled in release mode and ran inmulti-threaded mode. For the droplet distribution tests, droplets with bounding radius r = 1mm and number densities of n = 10 − k/ mm − for k ∈ Z ∩ [0 ,
20] werepopulated into a box-shaped aerosol. Droplet placement in the aerosol wasperformed by individually populating voxels in order of increasing o ( x i , y i , z i ),defined as o ( x i , y i , z i ) = z i + N z ( y i + N y x i ) (7)for voxel position ( x i , y i , z i ). This is effectively in order of voxel index (eq. (2))except with x and z swapped. The distribution of droplets is then saved andanalyzed to verify that droplets are roughly uniform in the clouds and thusactually modeling the aerosol of interest. Five particle transport experiments were performed to test the following:1. the dependence of particle transport on droplet size,2. the dependence of relative computational efficiency between fastAerosoland parameterised aerosols on droplet number density,3. the dependence of this relative computational efficiency on primarycount,4. the dependence on parameterised computational efficiency on its vox-elization fineness, and5. the dependence of particle transport on bulk/droplet shape.12our aerosol models are used for these tests: a parameterised model, a fas-tAerosol model, a fastAerosol model which has droplet positions generatedbefore shooting any primaries (‘pre-populated’ fastAerosol; as in section 3.1),and a single volume model (‘smooth’; density set as average aerosol den-sity). The parameterised aerosol loads droplet positions generated by thepre-populated fastAerosol.For droplet size investigations, 5000 protons are shot through parame-terised, fastAerosol, pre-populated fastAerosol, and smooth box-shaped aerosolsconsisting of n = 0 .
01 mm − spherical droplets with radius 0 . ≤ r ≤ . × × r = 1 mm and number density n = 10 − k/ mm − for k ∈ Z ∩ [0 , n = 10 − mm − spherical droplets with radius r = 1 mm. Thesimulation time draw was measured by ‘/usr/bin/time’.For parameterised solid voxelization tests, 5000 protons are shot througha box-shaped aerosol consisting of n = 10 − mm − spherical droplets with ra-dius r = 1 mm. The ‘smartless’ parameter, defined as the average number ofvoxels per geometry object in the parameterised solid, measures the finenessof parameterised solids’ voxelization (higher value implies finer voxelization)[14].13EANT4 automatically calculates an ‘optimal’ smartless value and then setsthe real smartless value as the minimum of the calculated and user-set values.To test how the voxelization fineness affects simulation time and memory, theuser-set smartless parameter is allowed to vary from 2 − to 2 and both sim-ulation time and memory draw were measured by ‘/usr/bin/time’.Finally, for droplet shape tests, 5000 protons are shot through a box-shaped fastAerosol aerosol with n = 0 .
01 mm − droplets shaped like cylin-ders, boxes, hemispheres, and spheres (all maximally sized to fit in a bound-ing radius of r = 1 mm; no rotations applied - aligned along z-axis) andthe energy deposited into the aforementioned detector/scoring grid recorded.Similarly, for bulk shape investigations, 5000 protons are shot through a fas-tAerosol aerosol containing n = 0 .
01 mm − spherical droplets with radius r = 1 mm inside a bulk shaped like1. a box (150 × × r = 75 mm, length = 5000 mm; aligned along z -axis),3. an ellipsoid ( r minor = 75 mm, r major = 2500 mm; major radius alignedalong z -axis), and4. a pipe ( r outer = 75 mm, r inner = 37 . z -axis).Again, the energy deposited into the detector/scoring grid was recorded.
4. Results
The uniformity of the droplet x -position distribution is verified usinga one-sample Kolmogorov-Smirnov test with the null hypothesis that the14roplet x -positions come from a uniform distribution. The distributions fromthe five seeds were concatenated for better statistics. Under a statisticalcutoff of α = 0 .
05, the n = 10 − mm − data fails to reject the null hypothesiswhile the n = 10 − mm − data succeeds in rejecting this hypothesis ( p ≈ p ≈
2% of drawing a distribution from the null hypothesis more extremethan measured for n = 10 − mm − and n = 10 − mm − respectively). Thissuggests that, while the n = 10 − mm − data is roughly uniform, the n =10 − mm − data is not.This failure of uniformity can be visualized in fig. 2, displaying in a solidblack line the observed cumulative distribution function (CDF) of droplet x -position (other directions similar) minus the expected uniform distribution.The 95% lower confidence bound (LCB) and upper confidence bound (UCB)are plotted in dotted blue lines, similarly minus the expected uniform distri-bution. The CDF for n = 10 − mm − data is displayed on top; the CDF for n = 0 .
01 mm − data is displayed on bottom.For truly uniform data, one would expect the predicted uniform CDFwould lay between the observed LCB and UCB, implying that, on fig. 2, theUCB-Uniform curve should be mostly positive while the LCB-Uniform curvemostly negative. This is observed in the n = 10 − mm − data, as expectedsince our statistical test failed to distinguish this data from a uniform dis-tribution. The n = 10 − mm − data, however, does not show this feature.Namely, the empirical data, LCB, and UCB are all consistently lower thana uniform distribution, except for periodic spikes in the CDF. This indicatesthat the observed droplet number density is, on average, low, with periodicbunching. The bunching period of ∼ . . EmpiricalLCBUCB -200 -150 -100 -50 0 50 100 150 200-0.00025-0.0002-0.00015-0.0001-0.0000500.000050.00010.00015
EmpiricalLCBUCB
Figure 2: Cumulative distribution plot of droplet x -position minus the expected CDF ofa uniform distribution. Top: the n = 10 − mm − x -position distribution is generallyuniform, with the UCB of the observed distribution consistently higher than the uniformexpectation and the LCB lower than the uniform expectation. Bottom: the n = 10 − mm − x -position distribution is observably non-uniform, with the UCB and LCB bothgenerally smaller than the uniform expectation and a periodic bunching at frequency ∼ . ∼ .
01% heightened probability of dropletplacement at voxel boundaries.
16m and, suggesting heightened droplet population at voxel boundaries.Despite this deviation, the overall distribution is still qualitatively uni-form: these spikes in probability correspond to an increased likelihood offinding a droplet with x -position near a voxel boundary of ∼ . The energy deposited into the detector after a parameterised, fastAerosol,pre-populated fast-Aerosol, and smooth aerosol is shown in fig. 3 (error barstoo small for visualization). The energy deposited after the smooth aerosoldrops off approaching r = 1 mm, a feature absent from all of the othersimulations. This most likely indicates that, for ‘large’ droplet radii, thegranularity is important for the particle transport, as expected since aerosolswith large droplets have a heightened probability for multiple interactions inquick succession, something absent from the single volume model.Above a droplet radius of r = 0 . .
05 (testedwith Welch’s t-test). Below r = 0 . σ (only strictly correct for absolute distance) and for the ap-proximation setting the upper limit in section 2.2.1 (limit calculated in 2 D .8 1 1.2 1.400.511.52 10 Figure 3: Plot of the energy deposited into the 150 × ×
50 mm aluminum block at(0 , , n = 0 .
01 mm − ). The smooth aerosol displays a drop off at r = 1 mm which is absentfrom the other simulations, indicating a difference in underlying simulations. but used for 3 D geometry). Total simulation time and maximum resident size for the parameterised,fastAerosol, and pre-populated fastAerosol simulations are shown in fig. 4for varying droplet number density. Note that, for both plots, error bars aretypically too small to be visible.
The fastAerosol simulations are significantly faster than (or comparableto) the parameterised simulations for all number densities, with a pronounced18 -6 -4 -2 Figure 4: Plots of computational efficiency in simulating the transport of 5000 protons(50 MeV) through a box-shaped aerosol with r = 1 mm spherical droplets. Top: thisplot of simulation time displays that, for all number densities, fastAerosol simulations arequicker than (or comparable to) parameterised simulations with significant speedup atlarge n . The kink in fastAerosol’s simulation time at n ≈ − . mm − is likely due toearly stopping of protons, reducing the number of generated droplets. Bottom: this plotof memory usage shows that fastAerosol simulations use less memory than (or comparableto) parameterised simulations for all number densities with a reduction of approximatelyone order of magnitude at large n . n = 10 − mm − . Since fastAerosolsimulation times include the generation of the droplet positions while theparameterised simulations do not, the pre-populated fastAerosol simulationminus this population time is also plotted (green solid line).Both the parameterised and pre-populated fastAerosol simulation timesincrease roughly polynomially with number density beyond n = 10 − mm − with roughly equal powers. The relatively constant y -gap of approximately1 order of magnitude indicates that parameterised simulations are roughly10 × slower than fastAerosol simulations.The dependence of fastAerosol’s simulation time on droplet number den-sity appears to largely be due to the population of droplets, as is seen inthe large decrease in the pre-populated fastAerosol simulation time when thepopulation time is subtracted. Despite this reduction, the simulation timeseems to have the same power dependence on droplet number density, indi-cating that droplet population is not the sole timing load that is dependenton number density.The drop-off in the dynamically populated fastAerosol’s simulation timeat n ≈ − . mm − is likely due to early termination of particles, reducingthe effective aerosol volume and thus reducing the effective droplet count.This both provides evidence that droplet population is a large factor in thesimulation load and it shows the value of the dynamically populated fas-tAerosol variant: it can be extremely quick compared to the pre-populatedsimulation models when the effective aerosol volume is significantly smallerthan the bulk volume or when few primaries are shot. Specifically, at thelargest number density, the dynamically populated fastAerosol’s simulation20ime is approximately two orders of magnitude less than the parameterisedsimulation time. For all number densities, the fastAerosol simulations use significantly lessmemory than (or comparable to) the parameterised simulations, peaking ata discrepancy of around one order of magnitude reductions at large numberdensities. With the current data, it is hard to determine the scaling offastAerosol (pre-populated and dynamically populated) simulations at largenumber densities and whether these match the parameterised memory scaling
Total simulation time for the parameterised, fastAerosol, and pre-populatedfastAerosol simulations is shown in fig. 5 for varying primary count (errorbars are too small to be visible).The pre-populated fastAerosol maintains a speedup of approximately afactor of 10 over parameterised simulations for all primary counts, indicatingcomputational gains due to the simpler voxelization optimization utilized inthe fastAerosol class (other speedups expected to change with particle count).While the pre-populated fastAerosol simulation times are roughly inde-pendent of primary count (minor upwards slope not visible in plot), the dy-namically populated fastAerosol simulation times are roughly polynomiallydependent on primary count. This dependence is most likely due to dropletpopulation since, at small primary counts, the dynamically populated fas-tAerosol can generate significantly fewer droplets than the pre-populatedvariant. Since these classes are otherwise identical, it is expected that both21 Figure 5: Plots of simulation time after shooting 50 MeV protons through a box-shapedaerosol ( n = 0 .
01 mm − ; r = 1 mm) for primary count ranging from 1 to 10000. Regard-less of this count, the fastAerosol simulations are around 10 × (or more) quicker. Both pa-rameterised and the pre-populated fastAerosol simulations appear relatively independentof the primary count while the dynamically populated fastAerosol seems approximatelypolynomially dependent on this count. Total simulation time and maximum resident set size for the parame-terised simulations is shown in fig. 6 for varying ‘smartless’ parameter, de-fined as the average number of voxels per contained geometry object (defaultis 2). The fastAerosol (dynamically populated and pre-populated) averagesimulation time and memory load are shown as horizontal lines (dashed blueand dotted red, respectively).Both the memory and simulation time appear dependent on the user-setsmartless value, implying that the user-set value is consistently smaller thanthe calculated value for this aerosol (since the real smartless value is set asthe minimum of these two; maximum user-set smartless is 32). This suggeststhat the tuning algorithm is overridden by the user-set smartless value forthis aerosol and thus an automatically tuned voxelization is not expected,contradicting the user manual’s recommendation that no manual tuning isneeded[14]. This need for additional manual tuning is potentially due tothe exotic nature of the simulated geometry: the aerosol contains 12,500,000droplets, significantly more sub-objects than parameterised typically takes.23 -4 -2 Figure 6: Plots of computational efficiency after shooting 50 MeV protons through a box-shaped aerosol (5000 primaries; n = 0 .
01 mm − ; r = 1 mm) for smartless parameterranging from 2 − to 2 . It is observed both that the default smartless value does not givea minimum in simulation time/memory and that, even at the true minimum simulationtime, fastAerosol is more efficient. − , both variants of fastAerosol (pre-populated and dynam-ically populated) maintain a simulation time reduction over the optimizedparameterised solids. Similarly, both variants of fastAerosol maintains theirmore memory reductions over parameterised solids even when tuning smart-less for minimum memory usage (even at smartless value 2 − , approximatelywhere a minimum in simulation time occurs).A more detailed investigation on tuning the smartless parameter shouldbe done to further verify the computational gains of fastAerosol over parame-terised solids for a variety of aerosols, since this test only verified fastAerosol’scomputational gains over parameterised aerosols for aerosols consisting of n = 0 .
01 mm − spherical droplets with r = 1 mm. It would be valuableto learn if serious computational gains are allowed for other parameterisedgeometries by tuning this smartless parameter. The energy deposited is recorded after particle transport through a box-shaped aerosol with cylindrical, box-shaped, hemispherical, and spherical25 roplet: cylinder -50 0 50-60-40-200204060 y - po s i t i on [ mm ] droplet: box -50 0 50-60-40-200204060 droplet: hemisphere -50 0 50-60-40-200204060 droplet: sphere -50 0 50-60-40-200204060 MeV bulk: ellipsoid -50 0 50 x-position [mm] -60-40-200204060 y - po s i t i on [ mm ] bulk: pipe -50 0 50 x-position [mm] -60-40-200204060 bulk: cylinder -50 0 50 x-position [mm] -60-40-200204060 bulk: box -50 0 50 x-position [mm] -60-40-200204060 MeV
Net=192200 500 Net=177700 400 Net=151000 500 Net=44000 500Net=60000 1000 Net=225400 200 Net=44000 1000 Net=44000 500
Figure 7: Plots of energy deposited into the 150 × ×
50 mm aluminum block at(0 , , r = 1 mm bound-ing radius and in the 150 × × droplets (top of fig. 7; chosen to maximally fit in bounding sphere; no rota-tions applied). Additionally, the energy deposited is recorded after particletransport through a ellipsoid, pipe, cylinder, box-shaped aerosol with spher-ical droplets (bottom of fig. 7). From left to right, the histograms are placedin order of increasing filling ratio in the bounding sphere/box respectively.With increasing filling ratio of the droplets in the bounding radius, thenet energy deposited is observed to decrease as expected. Similarly, withincreasing bulk filling ration in bounding box, the net energy deposited is26bserved to decrease except for the bulk pipe cloud. The exception of thepipe-shaped cloud is expected since the pipe-shaped cloud presents no barrierto the particles near ( x, y ) = (0 ,
5. Conclusion
Presented is a GEANT4 solid, fastAerosolSolid, and a helper class, fas-tAerosol, which enable accurate and efficient simulations of large aerosols.The fastAerosol classes represent aerosols as a collection of droplets, whichwe demonstrate is necessary when droplet size becomes large. When dropletnumber densities become large, the presented fastAerosol model is orders ofmagnitude more efficient in terms of timing and memory compared to themost efficient droplet-level method of building an aerosol currently includedin GEANT4, using parameterised solids, as is seen in fig. 4.The computational improvements in fastAerosol are achieved by fas-tAerosol’s simpler voxelization optimization and in the allowed dynamicalpopulation of droplets. Additionally, the distance calculations are compara-ble in time to those performed in parameterised solids as is seen in fig. 5: thepre-populated fastAerosol simulation times show a roughly 10 × speedup overparameterised simulations regardless of primary count and a higher primarycount implies a larger number of distance calculations.The reduction in memory usage is important for allowing simulations ofa wide variety of experiments. The peak observed memory load in simu-lating particle transport through a parameterised cloud, 18 . ± .
01 GB,is not small when compared to current computer hardware. Simulating thesame scenario with the (dynamically populated) fastAerosol class reduces the27emory load by a factor of ∼ × to 1 . ± .
002 GB. The parameter spaceof scenarios that can be simulated, then, is drastically larger when buildingaerosols with fastAerosol as compared to parameterised solids.As this will be featured as an advanced example in GEANT4 (availableas of version 10.7), it is our hope that the simplicity of implementation offastAerosol along with the large computational gains will make this classattractive whenever an aerosol needs to be simulated.
There are some areas for future study to be investigated. First, the pe-riodic droplet bunching apparently at voxel boundaries observed in fig. 2should be studied, maybe by modifying the the order (eq. (7)) in which vox-els are filled. Second, the study of the approximations (use of σ for vectorizeddistance and the upper limit on spherical voxel radius in section 2.2.1) shouldbe done in hopes of removing the discrepancy in energy deposited after parti-cles transport through aerosols containing droplets with radius r < . This work built on the GEANT4 source code and examples, so we thankthose developers and maintainers. In particular, Dr. Makoto Asai, Dr.Gabriele Cosmo, and Dr. Susanna Guatelli provided invaluable discussions,recommendations, testing, and assistance with integration with the GEANT4codebase.
References [1] S. Agostinelli, J. Allison, K. Amako, J. Apostolakis, H. Araujo, P. Arce,M. Asai, D. Axen, S. Banerjee, G. Barrand, F. Behner, L. Bellagamba,J. Boudreau, L. Broglia, A. Brunengo, H. Burkhardt, S. Chauvie,J. Chuma, R. Chytracek, G. Cooperman, G. Cosmo, P. Degtyarenko,A. Dell’Acqua, G. Depaola, D. Dietrich, R. Enami, A. Feliciello,C. Ferguson, H. Fesefeldt, G. Folger, F. Foppiano, A. Forti, S. Garelli,S. Giani, R. Giannitrapani, D. Gibin, J. G. Cadenas, I. Gonzlez,G. G. Abril, G. Greeniaus, W. Greiner, V. Grichine, A. Grossheim,S. Guatelli, P. Gumplinger, R. Hamatsu, K. Hashimoto, H. Hasui,A. Heikkinen, A. Howard, V. Ivanchenko, A. Johnson, F. Jones,J. Kallenbach, N. Kanaya, M. Kawabata, Y. Kawabata, M. Kawaguti,S. Kelner, P. Kent, A. Kimura, T. Kodama, R. Kokoulin, M. Kossov,29. Kurashige, E. Lamanna, T. Lampn, V. Lara, V. Lefebure, F. Lei,M. Liendl, W. Lockman, F. Longo, S. Magni, M. Maire, E. Meder-nach, K. Minamimoto, P. M. de Freitas, Y. Morita, K. Murakami,M. Nagamatu, R. Nartallo, P. Nieminen, T. Nishimura, K. Ohtsubo,M. Okamura, S. O’Neale, Y. Oohata, K. Paech, J. Perl, A. Pfeiffer,M. Pia, F. Ranjard, A. Rybin, S. Sadilov, E. D. Salvo, G. Santin,T. Sasaki, N. Savvas, Y. Sawada, S. Scherer, S. Sei, V. Sirotenko,D. Smith, N. Starkov, H. Stoecker, J. Sulkimo, M. Takahata, S. Tanaka,E. Tcherniaev, E. S. Tehrani, M. Tropeano, P. Truscott, H. Uno,L. Urban, P. Urban, M. Verderi, A. Walkden, W. Wander, H. We-ber, J. Wellisch, T. Wenaus, D. Williams, D. Wright, T. Yamada,H. Yoshida, D. Zschiesche, Geant4a simulation toolkit, Nuclear In-struments and Methods in Physics Research Section A: Accelerators,Spectrometers, Detectors and Associated Equipment 506 (3) (2003) 250– 303. doi:https://doi.org/10.1016/S0168-9002(03)01368-8 .URL [2] K. Amako, S. Guatelli, V. Ivanchencko, M. Maire, B. Mascialino,K. Murakami, L. Pandola, S. Parlati, M. Pia, M. Piergentili, T. Sasaki,L. Urban, Geant4 and its validation, Nuclear Physics B - Pro-ceedings Supplements 150 (2006) 44 – 49, proceedings of the 9thTopical Seminar on Innovative Particle and Radiation Detectors. doi:https://doi.org/10.1016/j.nuclphysbps.2004.10.083 .URL doi:https://doi.org/10.1016/j.nima.2016.06.125 .URL [4] F. D. Amaro, C. M. B. Monteiro, J. M. F. dos Santos, A. Antognini,Novel concept for neutron detection: proportional counter filled with310b nanoparticle aerosol, Scientific Reports 7 (2017) 41699 EP –, article. doi:10.1038/srep41699 .URL https://doi.org/10.1038/srep41699 [5] J. Irlinger, S. Trinkl, M. Wielunksi, J. Tschiersch, W. Ruhm, MonteCarlo simulation of semiconductor detector response to (222)Rn and(220)Rn environments, J Environ Radioact 158-159 (2016) 64–70.[6] J. Houghton, Y. Ding, D. Griggs, M. Noguer, P. van der Linden, X. Dai,K. Maskell, C. Johnson (Eds.), Climate Change 2001: The Scientific Ba-sis: Contribution of Working Group I to the Third Assessment Report ofthe Intergovernmental Panel on Climate Change, Cambridge UniversityPress, 2001.URL [7] G. A. Bazilevskaya, I. G. Usoskin, E. O. Fl¨uckiger, R. G. Harrison,L. Desorgher, R. B¨utikofer, M. B. Krainev, V. S. Makhmutov, Y. I.Stozhkov, A. K. Svirzhevskaya, N. S. Svirzhevsky, G. A. Kovaltsov, Cos-mic Ray Induced Ion Production in the Atmosphere, Springer New York,New York, NY, 2008, pp. 149–173. doi:10.1007/978-0-387-87664-1_10 .URL https://doi.org/10.1007/978-0-387-87664-1_10 [8] C. E. Chung, Aerosol direct radiative forcing: A review, in: H. Abdul-Razzak (Ed.), Atmospheric Aerosols, IntechOpen, Rijeka, 2012, Ch. 14. doi:10.5772/50248 .URL https://doi.org/10.5772/50248 doi:10.3847/0004-637x/818/2/164 .URL https://doi.org/10.3847/0004-637x/818/2/164 [10] T. Kawaguchi, M. Mori, Near-infrared reverberation by dusty clumpytori in active galactic nuclei, The Astrophysical Journal 737 (2) (2011)105. doi:10.1088/0004-637x/737/2/105 .URL http://dx.doi.org/10.1088/0004-637X/737/2/105 [11] M. Nenkova, M. M. Sirocky, Z. Ivezic, M. Elitzur, AGN Dusty Tori:I. Handling of Clumpy Media, Astrophys. J. 685 (2008) 147. arXiv:0806.0511 , doi:10.1086/590482 .[12] A. Tanimoto, Y. Ueda, H. Odaka, T. Kawaguchi, Y. Fukazawa, T. Kawa-muro, XCLUMPY: X-ray spectral model from clumpy torus and itsapplication to the circinus galaxy, The Astrophysical Journal 877 (2)(2019) 95. doi:10.3847/1538-4357/ab1b20 .URL https://doi.org/10.3847%2F1538-4357%2Fab1b20 [13] J. C. Kuniyal, R. P. Guleria, The current state of aerosol-radiationinteractions: A mini review, Journal of Aerosol Science 130 (2019) 45 –54. doi:https://doi.org/10.1016/j.jaerosci.2018.12.010 .URL doi:https://doi.org/10.1016/j.jcp.2013.01.035 .URL