Parking procedures and algorithms
In the simplest sense, the Anm geometrical model simply places or parks [4, 15, 16] particles in a matrix. The matrix is considered to be a continuum: mortar surrounding coarse aggregates or cement paste surrounding fine aggregates. An empty container is created to represent a specimen, and then particles are placed one after another into this container, from the larger ones to the smaller ones, following a particle size distribution that is given in terms of a sieve analysis, selecting particles from a particle shape database. A preliminary database, containing several sand and gravel types, has been created from previous data as part of the Anm model. This is not the equivalent of equilibrium packing, but when there is a wide particle size distribution, equilibrium packing and non-equilibrium placing produce similar arrangements of particles [30]. The sieve analysis is usually taken from experiment or some kind of standard for concrete materials. A pseudo-random number generator (the default function included in C++) is initialized with a seed value that is different for each run of the Anm model, thus guaranteeing different results for each run. The same pseudo-random number generator was used for all random numbers required for the functioning of the Anm model. Using a different random number generator will be considered for future versions of Anm, since such a large number of random numbers can be used for each Anm run.
The Anm model starts with the largest particles as it would be more difficult to place them if they were processed at a later stage. Each new particle that is placed must not overlap any other particles that have already been placed, since that would be unphysical. Particles are included in a sieve range according to their size, which is taken to be the particle width (previously computed). The widths within a sieve range are assumed to be distributed evenly, with equal probability for any width in the sieve range. A width within the sieve range being processed is picked randomly, using the same pseudo-random number generator that gives a random number between 0 and 1, with equal probability. The random number is scaled to the sieve range limits, determining a random width. A particle is chosen randomly from the appropriate particle shape database, which consists of a collection of sets of spherical harmonic coefficients representing a collection of particles. All particles in the database have equal probability and one is chosen randomly using the pseudo-random number generator in a way similar to how the width was chosen. If there are M particles, then the output of the pseudo-random number generator is scaled to pick an integer between 1 and M in order to choose a specific particle. Note that for the particle size ranges considered in the Anm model, particle shape does not appear to depend on particle size, so that any particle in the shape database can be randomly picked and scaled to fall into a given sieve size range [31].
When placing a particle, to simulate mixing we also need to randomly rotate each particle before attempting to place it at a random location. The operation of a rotation on the particle in the local coordinate system can be done by transforming the spherical harmonic expansion coefficients [22] according to an arbitrary orientation defined by the three Euler angles α, β, and γ [26]. Each Euler angle is assumed to be uniformly distributed in its range, and a selection is made of the three angles using three random numbers scaled to the appropriate angular range.
All points within the unit cell are equally probable, so the pseudo-random number generator is used again to choose values of x, y, and z that fall within the bounds of the unit cell. The chosen point is used for the origin of the particle being placed. This origin is always the center of mass of the particle [12]. The chosen particle is checked for overlap against the previously placed particles within a certain distance. This distance is controlled by a local bin structure. The unit cell is divided up into bins, typically 103 = 1,000, and the information about which bins are touched by a given particle is recorded. Only those particles lying in bins that have a possibility of overlap with the trial particle are checked. This saves considerable run time, especially once a significant number of particles have been placed. If periodic boundary conditions are being used, then the periodic ghost particles (see Sect. 3.3) are also checked for overlap with existing particles. If no overlap is detected, then the particle enters the simulation box successfully, otherwise the program will try to place it at a new randomly chosen location. The reassignment of the location is subject to a pre-defined maximum number of attempts. After the number of consecutive failures reaches the maximum limit, the particle will be resized to another randomly selected width within the current sieve range, and the program will try again to place the particle at a new random location. Rescaling of the particle size is also subject to a pre-defined maximum number of attempts. If the size scaling does not result in particle placement, then the particle will be rotated randomly to have a new orientation. If the particle still cannot be placed, then a new shape will be chosen from the particle shape database and the process restarts. If enough particles in that sieve range have been placed, satisfying the pre-determined volume fraction for that sieve, then the next smallest sieve class is processed. However, if after a number of such unsuccessful tries, again a predefined parameter, the next sieve range will be processed even if the volume placed is less than what the user desired for this sieve range.
Overlap algorithm
The key algorithm required in the particle placing procedures is to determine whether two particles overlap. This can be examined by formulating and solving contact equations. As shown in Fig. 2, the mass centers of two particles are O1(x
1
; y
1
; z
1
) and O2(x
2
; y
2
; z
2
), in a global coordinate system O(x; y; z). Two local coordinate systems are also defined and their origins are placed at O1 and O2, respectively. It is assumed that there is a contact point C(x
c
; y
c
; z
c
), and its local coordinates are (θ
c1
; ϕ
c1
) and (θ
c2
; ϕ
c2
) in the corresponding local coordinate system. In the particle database, the coordinates, relative to the center of a particle, of the corners of a box that just contains the particle are stored. These are updated when the particle is rescaled or rotated. If, for two particles, these boxes do not overlap, then there is no way that the particles themselves can overlap and no further checks are done. In this way, many of the potential particle overlaps can be handled simply.
The contact point C is located on the surface of particle O1, with coordinates defined using the spherical polar angles and origin associated with particle 1, so the following Eq. (3) should be satisfied, if the contact point C exists:
$$\begin{aligned} x_{c} &= \, x_{1} + \, r_{1} (\theta_{c1} ;\phi_{c1} ) \, \sin \theta_{c1} \cos \phi_{c1} \\ y_{c} &= \, y_{1} + \, r_{1} (\theta_{c1} ;\phi_{c1} ) \, \sin \theta_{c1} \sin \phi_{c1} \\ z_{c} &= \, z_{1} + \, r_{1} (\theta_{c1} ;\phi_{c1} ) \, \cos \theta_{c1} \\ \end{aligned}$$
(3)
The contact point C is also located on the surface of particle O2, with coordinates defined using the spherical polar angles and origin associated with particle 2, so Eq. (4) must also be valid,
$$\begin{aligned} x_{c} &= \, x_{2} + \, r_{2} (\theta_{c2} ;\phi_{c2} ) \, \sin \theta_{c2} \cos \phi_{c2} \\ y_{c} &= \, y_{2} + \, r_{2} (\theta_{c2} ;\phi_{c2} ) \, \sin \theta_{c2} \sin \phi_{c2} \\ z_{c} &= \, z_{2} + \, r_{2} (\theta_{c2} ;\phi_{c2} ) \, \cos \theta_{c2} \\ \end{aligned}$$
(4)
Equations (3) and (4) can be equated and rearranged, which yields Eqs. (5):
$$\begin{aligned} x_{2} - \, x_{1} + \, r_{2} (\theta_{c2} ;\phi_{c2} ) \, \sin \theta_{c2} \cos \phi_{c2} - \, r_{1} (\theta_{c1} ;\phi_{c1} ) \, \sin \theta_{c1} \cos \phi_{c1} &= \, 0 \\ y_{2} - \, y_{1} + \, r_{2} (\theta_{c2} ;\phi_{c2} ) \, \sin \theta_{c2} \sin \phi_{c2} - \, r_{1} (\theta_{c1} ;\phi_{c1} ) \, \sin \theta_{c1} \sin \phi_{c1} &= \, 0 \\ z_{2} - \, z_{1} + \, r_{2} (\theta_{c2} ;\phi_{c2} ) \, \cos \theta_{c2} - \, r_{1} (\theta_{c1} ;\phi_{c1} ) \, \cos \theta_{c1} &= \, 0 \\ \end{aligned}$$
(5)
Equations (5) have four unknowns θ
c1
; ϕ
c1
; θ
c2
; ϕ
c2
, which makes them unsolvable in principle. If these equations were expressed in terms of the three unknown Cartesian coordinates of the contact point, then there would of course be only three unknowns and three equations and therefore the contact equations would potentially be solvable if the contact point C existed. However, it is much easier to express the various derivatives needed for application of the Newton–Raphson method in terms of spherical polar coordinates, hence the four unknowns. The strategy to overcome this difficulty is to fix one of the four unknowns (e.g., ϕ
c2
) at pre-selected values in the range of [0; 2π), and then try to directly solve the three equations with the three unknowns θ
c1
; ϕ
c1
; θ
c2
using the Newton–Raphson method. If a solution is found, then it demonstrates that the contact point exists, and the two particles overlap. If no solution can be obtained for every selected value of ϕ
c2
, then it is assumed that the contact point does not exist, and the two particles do not overlap. It is recommended to take at least 20 different values of ϕ
c2
evenly distributed in the range [0; 2π). The number of such points is another user-selected parameter of the algorithm. This contact function has been tested against direct observation using VRML (virtual reality modeling language) images and has been found to be accurate for particle surfaces that approach to within a small fraction of either particle radius, approximately 1 %. For particle surfaces that approach closer than that distance, it is unknown how well the algorithm discriminates between overlap and non-overlap.
A more accurate and faster contact algorithm for star-shaped particles, which has been more rigorously tested, is described in Ref. [32]. This contact function will be introduced into the Anm model in its next version [33]. Another potential contact function, based on that described in Ref. [32] exists, but since it uses a numerical triangulation of particle surfaces, it can be applied also to non-star-shaped particles [34]. Since the Anm model for the foreseeable future will be restricted to star-shaped particles, the next version [33] will use the contact function of Ref. [32].
Periodic and non-periodic material boundaries
In mathematical models and computer simulations, the behavior of a small-volume model can often be dominated by surface effects, since the surface area to volume ratio increases as the volume decreases. Periodic boundary conditions are a set of boundary conditions that are often used to make a small model seem larger by removing the dominance of the surface since periodic boundary conditions eliminate the surface. In the Anm model, both periodic and non-periodic boundary conditions can be used. The periodic boundary permits a particle to pass through the surface of the simulation box and the part outside the simulation box is put on the opposite surface by placing a duplicate particle (ghost particle) with the same orientation, in the periodic position, while non-periodic boundary conditions do not allow a particle to pass through the surface of the simulation box, as shown in Fig. 3. In the specimen with periodic boundary conditions, if a particle passes through a surface but not an edge or corner, then it generates one ghost particle; if a particle goes through an edge but not a corner, then three ghost particles are created; if a particle passes through at a corner, then the number of its ghost particles is seven. In that way, every part of every particle appears inside the unit cell only once. A combination of periodic and non-periodic boundary conditions, applied to different faces of the unit cell, can also be employed.