Viral transmission in pedestrian crowds: Coupling an open-source code assessing the risks of airborne contagion with diverse pedestrian dynamics models

We study viral transmission in crowds via the short-ranged airborne pathway using a purely model-based approach. Our goal is two-pronged. Firstly, we illustrate with a concrete and pedagogical case study how to estimate the risks of new viral infections by coupling pedestrian simulations with the transmission algorithm that we recently released as open-source code. The algorithm hinges on pre-computed viral concentration maps derived from computational fluid dynamics (CFD) simulations. Secondly, we investigate to what extent the transmission risk predictions depend on the pedestrian dynamics model in use. For the simple bidirectional flow under consideration, the predictions are found to be surprisingly stable across initial conditions and models, despite the different microscopic arrangements of the simulated crowd, as long as the crowd evolves in a qualitatively similarly way. On the other hand, when major changes are observed in the crowd's behaviour, notably whenever a jam occurs at the centre of the channel, the estimated risks surge drastically.


Introduction
Designing robust tools to assess the risks of viral spread in pedestrian crowds and making them readily accessible to practitioners with limited computing capabilities is of manifest practical relevance for public safety, especially in the aftermath of the COVID-19 pandemic.For example, it would enable them to test variations of designs or flow rules for a given venue and determine which is the most suitable if an epidemic is lurking.While a number of such tools have been proposed, they generally either rely on a very coarse, and questionable, evaluation of transmission risks [1] or require considerable computing capabilities, even in their streamlined version [2].In a recent publication [3], we focused on the short-range airborne transmission route [4], i.e., the infection of a susceptible individual after the inhalation of virus-laden aerosols emitted by a contagious person who talks, shouts, eats, or just breathes in their immediate surrounding, and we showed how to overcome the foregoing limitations: this was achieved by computing spatio-temporal maps of viral concentration around a contagious person using high-fidelity microscopic simulations in a variety of micro-environments (in particular, diverse relative winds) and storing them in memory, so that at run time they are just loaded to assess the transmission risks between individuals in a macroscopic crowd [3].Since then, the associated Python scripts have been released as open-source code.
In this contribution, we explain how this code can be used in practice to integrate the output of crowd simulation software.Then, we investigate the sensitivity of the predictions to the pedestrian dynamics model in use.For that purpose we consider a simple bidirectional flow and simulate it with various popular models.

Principles of the model-based assessment of viral transmission risks in crowds
A chain of arguments is only as strong as its weakest link.Accordingly, one should not lend more credence to numerical tools designed to assess the risks of viral contagion than the underlying transmission model between individuals deserves.Consider two individuals, a contagious one (E) and a susceptible one (R); the instantaneous transmission rate due to aerosols emitted by E at t e and inhaled by R at t r > t e can be written as where the function ν accounts for the fluid dynamics of particle emission and transport, and will be obtained using CFD simulations.It depends on the geometric positions and head orientations of E at t E and R at t R , the delay t r − t e , the respiratory activity of the emitter (mouth-breathing, speaking, shouting, singing, etc.), and the ambient air flows.
On the other hand, all pathological and physiological uncertainties and unknowns about the emitter's viral load, the inhalation probability and the typical infectious dose (under an independent viral action hypothesis) are subsumed into the variable T 0 , which is the characteristic time for infection in a reference situation.(In our simulations, we systematically find that the estimated transmission rates, multiplied by T 0 , are hardly sensitive to the value of T 0 .)Thus, Eq. 1 splits the disease transmission rate into factors pertaining to the emission and propagation of virus-laden particles (integrated in ν) and biomedical factors specific to the virus (subsumed into T 0 ).Early risk assessment endeavours coarsely assumed that the transmission function ν only depends on the distance between E and R at emission time t E and, quite often, that ν is finite and constant below a threshold distance called contagion radius, and vanishes above [1].This is of course very questionable and we will see in Sec. 4 that this approach may be misguided.At the other extreme, detailed CFD simulations take into account all geometric considerations, the spatial layout, the air flow field and other environmental details; they are thus very accurate, but sensitive to small variations in the input conditions and, above all, computationally very demanding [2,5].
To reduce this computational cost, we adopted an intermediate stance in [3], by simulating inhalation and exhalation flows beforehand in a variety of micro-environmental conditions, notably for a gamut of relative winds, and injecting in the resulting flow aerosols and droplets with a size distribution similar to that found while either mouthbreathing or talking.From the simulated microscopic trajectories of these particles, we derived coarse-grained spatio-temporal maps of viral concentration around a contagious emitter taken in isolation and stored them in memory; the workflow is sketched in Fig. 1.Risks of new infections can then be obtained very efficiently by coupling these maps to pedestrian trajectory and head orientation data.
While these data were obtained from field observations in our previous works [3,6], here we explore the possibility of using numerical simulations of crowd dynamics as input to the risk assessment code.To gauge how likely the results are to be robust, we shall use widely different pedestrian models.In terms of scenario, particular simple flow settings are contemplated, namely, a well-balanced bidirectional flow in a 4-meter-wide corridor, which is located either outdoors or in a well ventilated space (so that risks mostly originate from direct exposure to emitted droplets and aerosols, rather than airborne contagion via long suspended aerosols).The layout and initial conditions are shown in Fig. 2: initially, the agents (of body radius 0.2 m) are randomly positioned in their respective waiting spaces, without overlap; their preferential speeds are randomly drawn from a uniform distribution between 1.0 and 1.5 m/s.Let us underline that this flow scenario is devoid of many complexities which would add to the modeller's burden in many practical situations, such as the uncertainty about people's destinations, their possible wish to halt temporarily, or the presence of social groups.

Our open-source code -a succinct tutorial
As one of our goals is to give a pedagogical introduction to our numerical method, we now present a synthetic tutorial of the tool we developed, which will connect theoretical assumptions, modeling choices, and practical implementation.Suppose that the pedestrian trajectories and head orientations are already known (this will be at the heart of the next section).To estimate the rate of new infections caused by an index patient, we use the open-source Python scripts available in the public GitHub repository https://github.com/an363/InfectiousRisksAcrossScales.After cloning the GitHub repository and unzipping the compressed folders (notably Diagrams.zip),we open the input file called "InputFile.txt" to adjust the paths and simulation conditions, viz., The algorithm will thus load the trajectories contained in text files within Trajectory-Folder.Each file should correspond to one agent and should be named [GROUP-ID] [PED-ID].csv,e.g., 1 3.csv, for pedestrian 3 belonging to social group 1; each line of this file refers to a successive timestamp and contains four floats, as follows: time (in seconds); x-position in meters; y-position in meters; head orientation in radian For instance, "10.1;1.2;2.3;0.1"means that at time t = 10.1 s the agents stands at x = 1.2 m, y = 2.3 m, with a head oriented along a direction 0.1 rad past the x-axis (counter-clockwise).Finally, we run the script main.py with Python 3 (for instance by typing $ python3 main.py in the terminal).
The characteristic infection time is the timescale T 0 appearing in Eq. 1; The Exhala-tionMode determines the number and size distribution of emitted droplets; the Booleans IsotropicInhalation and ContagionAmidGroups indicate if agents can inhale aerosols coming hitting the back of their heads (by default, we recommend to set it to False) and if a contagious person can infect other members of their social group (i.e., if these members are still susceptible despite probable previous contacts with the index patient).
Note that semi-colons can be used to separate multiple input conditions if the user wants to launch multiple runs sequentially with a single input file, for instance (vx,vy)=(0.0,0.0);(-0.2,0.5) or ExhalationMode=speaking;breathing.Comments after a hash symbol at the end of each line are discarded.
The risk assessment outcome is saved in OutputFolder, with a distinct folder for each set of conditions.The folder contains a summary of the parameters (parameters.txt),a file detailing how many new cases each distinct agent would cause per hour, should they be contagious (Risks by person output...dat), and one file containing the mean number of new cases per hour (Risks mean output...dat).In these two files, for every line, a lower bound Clow and an upper bound Cbar on the number of new cases are given: the upper bound is the value if everybody (but the index patient) is susceptible at the beginning of the simulation, whereas the lower bound refers to the possibility that agents have already been infected by the index patient, outside the observed field of view.In practice, these two bounds are extremely close to one another, so we shall not elaborate more in this regard.

Impact of the chosen pedestrian model on the risk assessment
To determine to what extent the risks of new infections in a given setup can be determined by a fully model-based approach, we now couple the foregoing algorithm with the output of pedestrian simulation software.To this end, we consider the simple bidirectional-flow settings introduced in Sec. 2 and compare the trajectory predictions of various crowd dynamics algorithms, using the UMANS software developed at INRIA [7] to simulate them all.
More precisely, we put to the probe five different models.Two come from the field of robotics, RVO [8] and ORCA [9], and are based on the idea of velocity obstacles: roughly speaking, each agent selects the velocity closest to its desire, but outside the 'cone' of velocities leading to an imminent collision.Instead, SocialForces posits that pedestrians maintain their distance to their neighbours because of binary repulsive pseudo-forces at play in a Newton-like equation [10] (these forces are sensitive to the relative velocities of the agents in the UMANS implementation).Karamouzas et al.'s PowerLaw model [11] substitutes these mostly distance-dependent pseudo-forces with pseudo-forces that are inversely related to the anticipated time to collision (i.e., the delay after which a collision is expected if all velocities are conserved).Finally, Moussaid resorts to simple heuristics to select a direction of motion (which should bring the agent closest to the goal before any collision) and a speed [12].Note that the recent and versatile ANDA model [13] is not considered here, because it has not been implemented in the UMANS software.In all simulations, pedestrians are described as disks of radius 0.2 m and preferential speeds are uniformly distributed between 1 and 1.5 m/s.The predictions of the models at a random time in the scenario are shown in Fig. 3 Importantly, we do not optimise the parameters of the models, but use the default ones natively coded in the UMANS software.Furthermore, we adopt a constant numerical time step dt = 0.01 s for all models.Clearly, should one wish to make the simulation as realistic as possible, then the parameters and time step would need to be adjusted.In particular, dt = 0.01 s is definitely too large for some simulations, which leads to occasional spurious effects (such as a reduced ability to form lanes in Moussaid and PowerLaw).Last but not least, the corridor walls are not properly handled in the UMANS implementation of the PowerLaw and ORCA models, so that a couple of agents cross them now and them (but most agents remain confined in the corridor width).While these artifacts are undesirable for practical applications, here they will actually turn out to be quite enlightening, as we shall see, because they give rise to a different phenomenology whose impact on our risk assessments we can explore.For the sake of simplicity, simulations are referred to with the name of the model employed in the figures.However, bear in mind that we do not intend to compare models, but to investigate the influence of pedestrian dynamics on transmission risks prediction, the use of different models allowing one to explore different dynamics.
Let us now couple the simulated pedestrian trajectories with the viral transmission code.To do so, we consider environmental conditions with very little wind (actually, an almost undetectable draught), (v x , v y ) = (0, 0.2 m/s), T 0 = 900 s and we assume that people are constantly talking in the scenario, with their heads oriented in the instantaneous walking direction and an emission point at the centre of the head.
In these conditions, Fig. 4 presents the estimated transmission rates for at least a dozen simulations of each model for 18 seconds each (each realisation is represented by a dot).We start by focusing on the three leftmost columns, corresponding to RVO, ORCA, and Social Forces.What strikes us is the strong homogeneity (low dispersion) within each model, i.e., across all realisations of initial positions and preferential speeds.These variations visibly affect the dynamics, but they hardly impact the estimated transmission rates, apart from one outlier in the ORCA model (to which we shall come back later).Even more arresting is the consistency of the predictions across the three models.This is partly unexpected because the arrangement of the crowd, notably in terms of spacings, differs markedly between the models, as illustrated in Fig. 3.In particular, ORCA agents tend to come very close to each other, almost within contact, which is consistent with the fact that velocity obstacles prohibit the selection of a velocity that leads to a collision, but do not penalise close proximity.By contrast, SocialForces agents, repelled by their mutual social forces, keep a significant distance to each other.This discrepancy would have led to drastic variations in the estimates if we had used a naive transmission model based on the instantaneous spacing between agents, or on a distance-based contagion radius.Instead, here, because pedestrians are moving, the virus-rich exhalation cloud dragged in their wake may affect people following them; the external wind and the walking-induced relative wind also undermine any naive assumption of an isotropic decay of the transmission risks with distance.
Bearing in mind this strong homogeneity in the risk estimates despite the observed differences in the dynamics, how can one explain the much larger estimates obtained with the PowerLaw and, even more so, Moussaid models, as well as for one ORCA outlier?Direct visualisation of the numerical output gives the answer: In these simulations (including the ORCA outlier), the two counter-flows fail to intertwine so as to pass each other and, instead, form a jam at the centre of the channel; these jams are pretty systematic, but may be temporary (as with PowerLaw) or much longer-lived (Moussaid).In that situation, agents in the jam stand close to each other, at almost zero speed.In the absence of significant external wind to disperse the exhaled puffs, this configuration is quite favorable for airborne transmission, which explains the high transmission rates.

Conclusion
In summary, we have explored the possibility of a purely model-based assessment of the risks of airborne viral transmission (by direct exposure), in actual and hypothetical scenarios.Using a practical example, we have explained how to make use of our recently released Python scripts designed for that purpose.The method hinges on the assumption that an agent's puff is only marginally influenced by the other pedestrians in the neighbourhood and relies on pre-computed dynamic viral concentration maps, which are computed with detailed CFD simulations in a variety of micro-environmental conditions and stored in memory.This leads to robust model-based risk assessments that are several orders of magnitude faster than CFD-based ones and can be run on a personal laptop.
Then, enquiring into the role of the pedestrian model in use to simulate pedestrian trajectories, we have compared the output of diverse models implemented in the UMANS software [7], in a non-specifically tailored version.This has led to interesting, partly unexpected findings.In the very simple dynamic settings under study, the fine-grained organisation of the crowd flow has little incidence on the global transmission rate.In particular, the estimated rates are remarkably stable with respect to the initial positions and preferential speeds of the agents, and even to how much social distance they maintain around themselves (e.g., very little in simulations using ORCA, much more in those using SocialForces).This is quite at odds with what would be predicted by models premised on the idea of a contagion radius; it can be rationalised by the aerosols left and dragged in pedestrians' wakes (noting the absence of any prolonged tight contact in the present scenario).On the other hand, substantial variations in transmission risks do occur if major phenomenological changes take place in the crowd.For instance, a drastic increase in transmission rates is observed whenever the counter-walking groups fail to form intercalating lanes that fluidise the flow, but end up forming a high-density, halted jam at the centre.More broadly speaking, we expect that, for an identical scenario with moving people, moderate variations in the trajectories predicted by distinct models will have limited incidence on viral spread estimates, whereas structural differences (such as the formation of groups of halted people, possibly talking to each other) will substantially alter the results; these expectations may not hold for static scenarios in windless conditions, where the transmission risks may sensitively depend on the distances between people.

Figure 1
Figure 1 Principle of the algorithm to assess transmission risks: Exhalations and aerosol emission are reproduced with high-fidelity CFD methods (middle) and then coarse-grained into dynamic viral concentration maps (right).For computational acceleration, transmission risks beyond 4 m may be discarded.

Figure 2
Figure 2 Sketch of the geometry and initial conditions of the considered bidirectional corridor flow configuration.45 blue agents head for the blue star to the left, whereas their 45 red counterparts head right.

Figure 3
Figure 3 Snapshots of the simulations, approximately halfway through the run, simulated and visualised with the UMANS software, using the native parameters for every model and a constant integration time step dt = 0.01 s (which departs from the continuous limit at least for PowerLaw and Moussaid, marked with a star).Quotation marks have been used around the models' names, because we have made no endeavour to specifically adjust the model parameters to the present scenario.

Figure 4
Figure4 Mean number of new cases per hour caused by a contagious agent, estimated using diverse pedestrian simulation models and varying the initial conditions.