Fire Emergency Evacuation from a School Building Using an Evolutionary Virtual Reality Platform

: In the last few years, modern technologies such as numerical simulations, virtual and augmented reality, and agent-based models represented effective tools to study phenomena, which may not be experimentally reproduced due to costs, inherent hazards, or other constraints (e.g., ﬁre or earthquake emergencies and evacuation from buildings). This paper shows how to integrate a virtual reality platform with numerical simulation tools to reproduce an evolutionary ﬁre emergency scenario. It is computed in real time based on the building information model and a ﬂuid dynamic software. A speciﬁc software was also used to simulate in real time the crowd dynamic in the virtual environment during the emergency evacuation process. To demonstrate the applicability of the proposed methodology, the emergency ﬁre evacuation process for an existing school building is presented. The results show that the proposed virtual reality-based system can be employed for reproducing ﬁre emergency scenarios. It can be used to help decision-makers to determine emergency plans and to help ﬁreﬁghters as a training tool to simulate emergency evacuation actions.


Introduction
Building emergency management can be defined as an integrated scientific methodology that concerns several aspects, such as emergency preplanning and psychological human behavior (Gao et al. 2011;Yan 2011) [1,2].It provides proper solutions for human safety in facing hazard events, such as earthquakes, floods, fire, etc. (Flynn 2010;Marasco et al. 2017) [3,4].Recent relevant studies have demonstrated that the high number of fire emergency casualties and injuries depends on the failure of timely evacuation of the occupants from the burning building (Fahy and Proulx 2001;Gershon et al. 2012) [5,6].The improper layout of the building structure and the psychological and physical responses of human beings may make the evacuation delayed.Indeed, human beings' behaviors in emergency conditions are usually quite complicated to be predicted by mathematical models.For instance, a panicked mental state or abnormal behaviors induced by the spreading of flames and smoke or by the unfamiliarity with the building may lead people to choose the wrong evacuation route.The quantification of risks and the analytical assessment of the optimal prevention measures are necessary to limit the consequences of fire, to face and to solve many fire prevention problems going beyond the traditional prescriptive methods provided by the technical rules.
Focusing on evacuation dynamics, some recent works from the literature can be found.Empirical methods in evacuation dynamics with studies using the field data collection methods of pedestrian are reviewed in (Haghani 2020a) [7].Haghani et al., (2020) [8] investigates the variation of the evacuation behavior of crowds with respect to perceived urgency.The study is developed by employing experiments and exploring different  [16,18,[29][30][31].
Particle systems can quickly model smoke and provide a satisfactory degree of realism to recreate the conditions of limited visibility, i.e., in indoor conditions when the division of space is not particularly complex.The particles used are colliders inside the software that collide against the walls, reproducing the smoke effect.
The previously mentioned studies on VR technologies for realistic simulations of fire emergency scenarios introduced significant advancements in this field of research.However, they do not provide much knowledge on the evolutionary conditions of the emergency scenario.On the contrary, this research work contribution focuses on these topics, and deepens the methodology to integrate different software in a VR platform in order to enrich in real time the evolution of fire and smoke reproduced in the virtual environment.In parallel, the evolutionary crowd dynamic in the virtual environment during the emergency evacuation process is also considered by a specific software.Therefore, the resulting system is enriched with information, being able to reproduce a progressing environment.Finally, the proposed system is applied for a case study of a school building, which represents an example of implementation that could however be extended to a different class of buildings.
The proposed VR platform allows one to experience evolutionary emergency scenarios in first person, and is targeted as a support tool to realistically reproduce fire emergency evacuation processes, supporting decision-makers in fire rescue and fire protection planning.Moreover, the proposed virtual reality-based system can be used by firefighters to perform repetitive emergency evacuation and rescue training, aiming at improving their abilities in a safe environment.

System Architecture
In this section, the system architecture is described briefly, introducing the software components that have been employed in the different modules.In the next sections, more details on the interoperability among the different software components is provided.
The proposed framework consists of three modules, as shown in Figure 1: (1) modeling input; (2) numerical simulation; (3) virtual reality platform.[16,31].Particle systems can quickly model smoke and provide a satisfactory degree o ism to recreate the conditions of limited visibility, i.e., in indoor conditions when t vision of space is not particularly complex.The particles used are colliders inside th ware that collide against the walls, reproducing the smoke effect.
The previously mentioned studies on VR technologies for realistic simulations emergency scenarios introduced significant advancements in this field of research.ever, they do not provide much knowledge on the evolutionary conditions of the gency scenario.On the contrary, this research work contribution focuses on these t and deepens the methodology to integrate different software in a VR platform in or enrich in real time the evolution of fire and smoke reproduced in the virtual environ In parallel, the evolutionary crowd dynamic in the virtual environment during the gency evacuation process is also considered by a specific software.Therefore, the res system is enriched with information, being able to reproduce a progressing environ Finally, the proposed system is applied for a case study of a school building, whic resents an example of implementation that could however be extended to a differen of buildings.
The proposed VR platform allows one to experience evolutionary emergency s ios in first person, and is targeted as a support tool to realistically reproduce fire gency evacuation processes, supporting decision-makers in fire rescue and fire prot planning.Moreover, the proposed virtual reality-based system can be used by firefi to perform repetitive emergency evacuation and rescue training, aiming at impr their abilities in a safe environment.

System Architecture
In this section, the system architecture is described briefly, introducing the sof components that have been employed in the different modules.In the next sections details on the interoperability among the different software components is provide The proposed framework consists of three modules, as shown in Figure 1: (1) eling input; (2) numerical simulation; (3) virtual reality platform.

Module 1: Modelling Input
The first module is the collection of all the input necessary to the subsequent analyses and simulations.Building information modeling (BIM) is a three-dimensional modelling where information on structure, materials and other features can be collected and analyzed.The model implemented in Unity3D software (Unity Technologies 2017) [32] is defined according to the BIM models to consider the actual geometry and to add texture, illumination, and other realistic features.The BIM model in parallel provides information for the preparation of both the FDS model for fire and smoke simulations, and the crowd dynamic model for evacuation simulations.

Module 2: Numerical Simulations
Fire and smoke simulation is one of the most important aspects in planning and analyzing escape routes.It is established through FDS software to reproduce the fire spread process and compute the motion of smoke particles.Besides, emergency evacuation is simulated with the use of specific software for crowd dynamics, such as MassMotion and Evac.MassMotion (Zarnke 2015) [33] is an agent-based microscopic model based on the social force model and is one of the advanced tools in the field of crowd simulation.Besides, Evac was developed at VTT Technical Research Centre of Finland to simulate human evacuation.It allows modelling high crowd density environments and the interactions among the evacuation and fire simulations (Korhonen and Hostikka 2009) [34].The main feature of Evac software is the ability to integrate the evacuation model within the fire and smoke model, considering the conditions posed by the fire hazard as a function of the simulation.Results from the numerical simulations are integrated with the Unity3D model.

Module 3: Virtual Reality Platform
The module consists in the preparation of the integrated fire rescue VR scenario that is built through Unity3D, which is software for the development of games written in C++ code.It is a powerful tool and is the more suitable to import and combine different output from simulation that, apparently, cannot communicate between each other.One of the biggest advantages of Unity3D software is the possibility to model the scenario in virtual reality, giving the possibility to create an immersive scenario for the final simulation (Unity Technologies 2017) [32].
Once the virtual environment has been established and developed, the VR platform with body sensors is used to make the simulation playable and interactive.There are many different gaming platforms, from less immersive as desktop, to very immersive ones.One of the latest tools in the field of gaming is the KATWalk: a VR multi-direction platform, also called VR treadmill, that allows a completely immersive experience where the user becomes the first player of the virtual scene controlling the body movements through VR sensors.

Modeling Development
Building information along with fire spread data are required to implement the fire rescue scenario.As mentioned before, the BIM model provides key information of the building, such as geometric dimensions, structural and non-structural parameters, and material.Geometric information can be used to define the indoor environment, while information on material is necessary, as it affects the combustion of building components.The FBX file is exported from BIM software Revit to generate the geometric model.Revit is used for building information modeling (BIM) providing a complete architectural design solution for a building project through detailed construction drawing and schedules (Revit 2013) [35].In this step, the pre-processing software of FDS, PyroSim, is used to convert the data from BIM to FDS (Eng 2011) [36].The computer program PyroSim is a graphical user interface for the Fire Dynamics Simulator (FDS).The geometric model exported from BIM contains the geometric information of the building; however, some features (e.g., texture, illumination, etc.) are not included in this model.Therefore, Unity3D software was adopted to construct a more realistic indoor scenario for the subsequent simulations.Specifically, the FBX file previously obtained was imported into Unity3D software to add texture and illumination to provide more realistic details.The completed model will be used in Unity3D to generate the VR scenario.

Fire and Smoke Spreading Simulation
Fire simulation is determined based on the FDS model established in Module 1.The FDS software is one of the main codes to compute fire simulations and smoke spreading.
It is an open-source software developed by the National Institute of Standards and Technologies (NIST) and is part of the models based on computational fluid dynamics (CFD) (McGrattan et al. 2013) [13].Particularly, FDS simulates the phenomenon of fire and smoke propagation through the resolution of Navier-Stokes equations optimized for low-speed flows.FDS simulation can be created using a text file that can be written manually or through graphical interfaces, such as Pyrosim (Eng 2011) [36], or through an extension for Blender 3D modeling software (Hess 2007) [37].The model works with a reference domain divided into cells, which define the resolution of the whole model.FDS can model different phenomena, such as heat transport and flame combustion products at low speed, radiative and convective heat exchange between gases and surfaces, flame propagation and fire development, fuel pyrolysis, heat, and smoke detector activations.This is done by employing four computational models: the hydrodynamic model, the combustion model, transmission by radiation, and sprinklers and detectors.In this work, hydrodynamic and combustion models were considered with standard boundary conditions (Temperature 20 • C, background pressure 101,325 Pa, relative humidity 40%, there is no wind).
The hydrodynamic model is based on the numerical resolution of the Navier-Stokes equations optimized for smoke and heat transport, while the combustion model uses a single chemical reaction for all burning materials.The FDS software allows one to compute the heat transfer by radiation using the finite volume method (FVM) for convective transport.It is possible to evaluate the action of sprinklers and detectors, water droplets and their capacity to absorb and spread heat radiation.The input parameters for the FDS model, such as numerical grid, environment, geometries, materials, and combustion, are described in a unique text file.Furthermore, four types of surfaces are used: supply, exhaust, layered, and burner.The supply surface indicates an introduction of air or gases in the model, while the exhaust surface works as a supply type area where the flows are discharged from the surface.The layered surface describes a material or layers of different materials.For example, a wall can be described as one surface with a different layer of material inside.When a layered surface is integrated in the model, thickness and physical parameters of the material must be specified.Finally, the burner surface represents the area from which fire is ignited.The main parameters required to characterize it are heat reaction rate per unit area (HRRPUA) and combustion reaction.Using this data, the reaction must be defined individually, specifying the chemical characteristics of the fuel described by the number of atoms of carbon, hydrogen, oxygen, and nitrogen.Smokeview is a software tool designed to visualize numerical predictions (fire and smoke) generated by FDS (Forney and McGrattan 2004) [38].However, the results of FDS are not directly applicable in the virtual environment but must be exported and processed first through other softwares (Paraview, Blender 3D) [36,39].This point has been discussed in detail within the application to the selected case study of the school building (Section 4.6).

Simulation of the Evacuation Process
Agent-based modeling (ABM) was implemented in this work as an evacuation process simulator within the MassMotion software.The ABM is a microscopic model where the behavior of the single agent is evaluated by highlighting the differences in the user profiles presented in the model.In ABM, the agents are assigned characteristics of size, motion, familiarity, and knowledge of the place, and each of them moves independently.The decisions of the agents may change over time depending on context factors.For example, in the case of an exit no longer usable, the agent may move to another available exit.
The decisions of the agents may change over time depending on context factors.For example, in the case of an exit no longer usable, the agent may move to another available exit.
The evacuation process can be divided in different phases, as shown in  The criteria applied in the evacuation process is that ASET > RSET, where ASET is the available safe escape time computed between the ignition of the fire and the moment in which the environmental conditions make the occupants unable to reach a safe place; RSET is the required safe escape time between the ignition of the fire and the time when the occupants reach a safe place.Accordingly, the time required for the evacuation is always larger than the actual time to evacuate the entire building.The evacuation process is divided into three phases: detection time (time required for fire detection), alarm time, and evacuation time.The detection time is determined by the type of detection system and the fire scenario.The alarm time is the time between the fire detection and dissemination of information to the occupants of the general alarm.Finally, the evacuation time is divided into pre-movement activity time and movement time.The pre-movement time is the time needed for the occupants to recognize the danger (recognition time) and to perform a series of activities before the movement to the safe place (Response time).The movement time, instead, is the time taken by the occupants to reach a safe place after the pre-movement activities; it is computed according to the occupants' distance from the exit, their speed, and the capacity of the escape routes due to geometry, size, height differences, and obstacles (Forssberg et al. 2019) [42].Therefore, the safe escape time (RSET) value is determined by several components, such as detection time, alarm time, pre-travel activity time, and the travel time (travel).Furthermore, ASET also considers the margin of safety, the difference between ASET and RSET.It is the amount of time left, after the evacuation is complete, before the condition of the building exceeds security thresholds, making the occupants unable to reach a safe place.The criteria applied in the evacuation process is that ASET > RSET, where ASET is the available safe escape time computed between the ignition of the fire and the moment in which the environmental conditions make the occupants unable to reach a safe place; RSET is the required safe escape time between the ignition of the fire and the time when the occupants reach a safe place.Accordingly, the time required for the evacuation is always larger than the actual time to evacuate the entire building.The evacuation process is divided into three phases: detection time (time required for fire detection), alarm time, and evacuation time.The detection time is determined by the type of detection system and the fire scenario.The alarm time is the time between the fire detection and dissemination of information to the occupants of the general alarm.Finally, the evacuation time is divided into pre-movement activity time and movement time.The pre-movement time is the time needed for the occupants to recognize the danger (recognition time) and to perform a series of activities before the movement to the safe place (Response time).The movement time, instead, is the time taken by the occupants to reach a safe place after the pre-movement activities; it is computed according to the occupants' distance from the exit, their speed, and the capacity of the escape routes due to geometry, size, height differences, and obstacles (Forssberg et al. 2019) [42].Therefore, the safe escape time (RSET) value is determined by several components, such as detection time, alarm time, pre-travel activity time, and the travel time (travel).Furthermore, ASET also considers the margin of safety, the difference between ASET and RSET.It is the amount of time left, after the evacuation is complete, before the condition of the building exceeds security thresholds, making the occupants unable to reach a safe place.
MassMotion is an advanced pedestrian simulation software (Zarnke 2015) [33].It is compatible with the BIM model and has been implemented in the proposed framework.MassMotion allows one to model all the objects in the space, classifying them according to their own function.The way objects are defined may influence the route choice, the speed, and the movement of the agents.Thus, it is important to assign the right type of object to each element.The elements to be considered in the simulation of the evacuation scene are floor, link, stair, ramp, escalator, path, elevator, portal, and barrier.Floor is the main object in the scene, since it represents the walkable area.Link, stair, ramp, escalator, paths, and elevator represent connections between floors.They have different feature and influence the speed and the movement of the agents.The portals represent entrances or exits where people can go to be safe.Finally, the barriers are solid obstacles in the model.The movement of the agents is influenced by social forces generated by the environment around the agents at each moment of the simulation, by the direction, the location, the obstacles around, and the movement of other agents.
The simulation of fire emergency evacuation is also done through Evac software, which is an extension of Fire Dynamic Simulator developed by the National Institute of Science and Technology (NIST) and the Technical Research Centre of Finland (VTT) [34].Evac software is based on the social force evacuation model and can integrate the fire and smoke model within the evacuation model, by considering the conditions posed by the fire as a function of the simulation.For instance, the agents may suffer a reduction of the visibility due to the concentration of the smoke.Moreover, the software accounts for the presence of carbon monoxide: agents may be unable to move according to FED (fractional effective dose) when the presence of carbon monoxide becomes higher than agents' tolerability.This value is calculated by FDS (McGrattan et al. 2013) [13] as: where FED CO is the incapacitating dose of CO, FED CN is the fraction of an incapacitating dose of CN, FED NOX is the fraction of an incapacitating dose of the sum of NO and NO 2 , FLD irr is the fractional lethal dose (FLS) of irritants, HV CO 2 is the hyperventilation factor induced by carbon dioxide, and FED O 2 is the fraction of an incapacitating dose of low O 2 hypoxia.
To simulate a realistic fire emergency evacuation, different physical factors that may occur in crowd dynamics are considered.Most of these factors are given by panic, such as friction forces between agents or between agents and geometries, social and psychological forces.
In addition, lethal threshold values for the agents are included in the definition of the disturbance conditions.If the agent encounters them on his way to the exit, the user remains stationary, i.e., his decision is diverted to an exit without preference.Exit without preference means that the agent cannot go towards it because he cannot go towards an exit that he does not see and does not know.
The types of agents that EVAC models can be based on four types of behavioral patterns: conservative, active, herding and follower.The active and conservative agents are more directly involved in the evacuation because they can remember and look for an exit; instead, herding and follower agents mainly wait to see where other agents go and then follow them.

Virtual Reality in Unity
The fire VR scenario is developed in Unity3D software, which is used for the development of videogames and written in C++ programming language.To take advantages of the immersive visuals and movements and, therefore, to make the proposed simulations playable and interactive, the connection among KAT VR platform and C++ programming scripts was employed, since the user can interact with the virtual environment and move in any direction, observing the fire spreading within the virtual scenario similar to a firstperson video game.That is possible by using a headset sensor that allows the user to be immersed inside the virtual scenario, while the navigation is controlled by sensors covering the shoes.KATVR sensors are connected to the Unity3D [32] model through plug-ins that consent the virtual model to receive the user's operations in real time.
The KATVR platform can simulate the movement of the player through the shoe sensors, making the virtual experience even more immersive and allowing a 360 • movement in the virtual environment.Much of the structure is built by the framework and movements are tracked by three sensors: one sensor on the torso for the direction of the movement and two on the shoes for the actual movement.The skating type movement is allowed.Furthermore, a computer is provided to control the KAT station.
It is worth paying attention to the platform calibration, because a prolonged mismatch between the player's movement and the actual body movement (the player turns in one direction and the movement within the game is opposite, or the player walks straight ahead and sees the movement slightly deviated to one side in the game) could lead to a feeling of nausea or dizziness.
The possibility to simulate all the movements, including walking, through the platform increases the immersive game sensation and helps to make the player feel more involved in the panic situation.Besides, with the real movement, the player can feel the physical effort of escaping.Moreover, the interaction between the user and the environment is also possible in the system by implementing the functionality of grabbing objects with the use of handset sensors.

Case Study 4.1. Case Study Summary
Public buildings, such as schools, are densely populated and generally includes complex facilities, which results in a high risk of hazards.In school buildings, fire safety requirements are often overlooked even though several firefighters' interventions are required in school buildings every year.In the latest data provided by the School Building Register (MIUR), it appears that schools with fire prevention certifications are only 9824 out of more than 40,000 buildings, while the annual statistics of firefighters report an average of more than 500 interventions per year in schools due to fires or explosions (Figure 3).
It is worth paying attention to the platform calibration, because a prolong match between the player's movement and the actual body movement (the play in one direction and the movement within the game is opposite, or the playe straight ahead and sees the movement slightly deviated to one side in the gam lead to a feeling of nausea or dizziness.
The possibility to simulate all the movements, including walking, through t form increases the immersive game sensation and helps to make the player feel m volved in the panic situation.Besides, with the real movement, the player can physical effort of escaping.Moreover, the interaction between the user and the e ment is also possible in the system by implementing the functionality of grabbing with the use of handset sensors.

Case Study Summary
Public buildings, such as schools, are densely populated and generally includ plex facilities, which results in a high risk of hazards.In school buildings, fire s quirements are often overlooked even though several firefighters' interventions quired in school buildings every year.In the latest data provided by the School B Register (MIUR), it appears that schools with fire prevention certifications are on out of more than 40,000 buildings, while the annual statistics of firefighters repor erage of more than 500 interventions per year in schools due to fires or explosions 3).A two-story secondary school was chosen as the case study for a fire resc school is a comprehensive institute in the Milan (Italy) surroundings, built in 19 3D BIM of the school building was developed in Revit [35], as shown in Figures A two-story secondary school was chosen as the case study for a fire rescue.The school is a comprehensive institute in the Milan (Italy) surroundings, built in 1976.The 3D BIM of the school building was developed in Revit [35], as shown in Figures 4 and 5.The building is a reinforced concrete (RC) structure and is divided into three blocks: classrooms, gym, and a third block with a canteen on the ground floor and an auditorium on the second floor.The block with classrooms is a two-story building where the ground level is dedicated to laboratories and offices while classrooms are located on the second level.
The building is a reinforced concrete (RC) structure and is divided into three blocks: classrooms, gym, and a third block with a canteen on the ground floor and an auditorium on the second floor.The block with classrooms is a two-story building where the ground level is dedicated to laboratories and offices while classrooms are located on the second level.To make the simulation simpler, only the main block with classrooms has been considered in the fire emergency simulation, since the remaining buildings (i.e., gym and auditorium/canteen) are not directly connected to the main block in case of fire emergency.
To simulate the fire emergency scenario, risk profiles introduced in the new fire prevention code were considered (DM2015, Section G3) [40].Risk profiles were indicators suggesting the appropriate performance of the materials and the necessary firefighting measures in the case of a fire emergency scenario for each area of activity.The risk profiles The building is a reinforced concrete (RC) structure and is divided into three blocks: classrooms, gym, and a third block with a canteen on the ground floor and an auditorium on the second floor.The block with classrooms is a two-story building where the ground level is dedicated to laboratories and offices while classrooms are located on the second level.To make the simulation simpler, only the main block with classrooms has been considered in the fire emergency simulation, since the remaining buildings (i.e., gym and auditorium/canteen) are not directly connected to the main block in case of fire emergency.
To simulate the fire emergency scenario, risk profiles introduced in the new fire prevention code were considered (DM2015, Section G3) [40].Risk profiles were indicators suggesting the appropriate performance of the materials and the necessary firefighting measures in the case of a fire emergency scenario for each area of activity.The risk profiles To make the simulation simpler, only the main block with classrooms has been considered in the fire emergency simulation, since the remaining buildings (i.e., gym and auditorium/canteen) are not directly connected to the main block in case of fire emergency.To simulate the fire emergency scenario, risk profiles introduced in the new fire prevention code were considered (DM2015, Section G3) [40].Risk profiles were indicators suggesting the appropriate performance of the materials and the necessary firefighting measures in the case of a fire emergency scenario for each area of activity.The risk profiles can be classified as: R life for the protection of people, R goods for the safeguard of goods, and R environment for the protection of the environment.R goods and R environment risk profiles were not considered in the simulation, since the considered school did not possess any historical or strategical relevance and did not contain any material dangerous for the environment.R life risk profile influences the exodus, as it defines the size of the corridor and the width of the exit routes; it is determined by δ occ that indicates some prevailing characteristics of the occupants inside the building, and δ a that indicates the prevalent fire growth characteristic speed.Two R life profiles were considered in the simulation, A2 and A3, which means that the occupants of the school were familiar with the environment of the building.

Building Simulation
The school building was first designed using Blender to generate the geometry, and then it was converted into a script file using a text editor.The geometric characteristics of the objects in the simulation must be adapted to the base grid of the model, since every cell presents uniform values and information.Therefore, the geometries were simplified into rectangle shapes and some rooms with complex shapes (i.e., bathrooms) were represented through solid cubes (voxelization), as illustrated in Figure 6.Afterward, the basic file with the simplified geometry was created and exported to Blender through the BlenderFDS extension [37].
can be classified as: Rlife for the protection of people, Rgoods for the safeguard of goods, and Renvironment for the protection of the environment.Rgoods and Renvironment risk profiles were not considered in the simulation, since the considered school did not possess any historical or strategical relevance and did not contain any material dangerous for the environment.Rlife risk profile influences the exodus, as it defines the size of the corridor and the width of the exit routes; it is determined by δocc that indicates some prevailing characteristics of the occupants inside the building, and δa that indicates the prevalent fire growth characteristic speed.Two Rlife profiles were considered in the simulation, A2 and A3, which means that the occupants of the school were familiar with the environment of the building.

Building Simulation
The school building was first designed using Blender to generate the geometry, and then it was converted into a script file using a text editor.The geometric characteristics of the objects in the simulation must be adapted to the base grid of the model, since every cell presents uniform values and information.Therefore, the geometries were simplified into rectangle shapes and some rooms with complex shapes (i.e., bathrooms) were represented through solid cubes (voxelization), as illustrated in Figure 6.Afterward, the basic file with the simplified geometry was created and exported to Blender through the BlenderFDS extension [37].

Fire Scenarios
Four fire scenarios with different ignition points were analyzed to verify the redundancy requested by the Fire Prevention Code (DM2015, Section S.4.8.4) [40] (see Figure 7

Fire Scenarios
Four fire scenarios with different ignition points were analyzed to verify the redundancy requested by the Fire Prevention Code (DM2015, Section S.4.8.4) [40] (see Figure 7 The redundancy check allows for verifying the minimum width of the exit ways in case one is interdicted due to the fire.Each available emergency exit is made unavailable one at a time; then whether the overall width of the remaining emergency exits is sufficient to allow the evacuation of the occupants is verified. Among the four proposed scenarios, Scenario A will be explained in detail, while the other 3 scenarios (Scenario B, C, and D) were developed in the same fashion.The smoke propagation within the building school for Scenario A is illustrated in Figure 8.The redundancy check allows for verifying the minimum width of the exit ways in case one is interdicted due to the fire.Each available emergency exit is made unavailable one at a time; then whether the overall width of the remaining emergency exits is sufficient to allow the evacuation of the occupants is verified.
Among the four proposed scenarios, Scenario A will be explained in detail, while the other 3 scenarios (Scenario B, C, and D) were developed in the same fashion.The smoke propagation within the building school for Scenario A is illustrated in Figure 8.The redundancy check allows for verifying the minimum width of the exit ways in case one is interdicted due to the fire.Each available emergency exit is made unavailable one at a time; then whether the overall width of the remaining emergency exits is sufficient to allow the evacuation of the occupants is verified.
Among the four proposed scenarios, Scenario A will be explained in detail, while the other 3 scenarios (Scenario B, C, and D) were developed in the same fashion.The smoke propagation within the building school for Scenario A is illustrated in Figure 8.

Simulation of the Evacuation Process
The first step for simulating the evacuation process is the definition of the number of occupants in the building.It can be evaluated as the theoretical crowding, according to the procedure indicated by fire regulations (DM2015, Section S.4.6) [40].The maximum crowding is determined by multiplying the crowding density by the area of the room.The parameters related to the building school crowding are listed in Table 1.Only the rooms that are assumed to be constantly full of people (e.g., students, teachers, and employees) were simulated.Thus, the number of occupants considered as the maximum crowding is set to 536 people.
To guarantee the evacuation even in the most severe situations, a certain number of independent exits (e.g., external, or protected exits) must be available.Thus, the possibility of independent exits to become simultaneously interdicted is minimized.To avoid the development of localized overcrowding, the number of exits must be at least three, according to the table S.4-15 from DM2015 [40].
A simultaneous exodus has been assumed (DM2015, Section S.4.1.3.a)[40], which is generally applied in building schools.Once the number of occupants has been defined, it is possible to model the evacuation process.Due to the damages caused by the seismic event, some exits are no longer available for the evacuation process.Three scenarios use only two exits for simulating this inconvenience in the evacuation, as follows: The evacuation process was simulated using different software: Evac and MassMotion [33,34].They are both used for simulating crowd movement and evacuation process and works as ABM.Evac is an extension of FDS and includes the fire simulation along with its consequences on the crowd movement (e.g., visibility, toxic gases, FED).On the other hand, MassMotion is easier to use to simulate the evacuation, as the solution of a path between the agent and the designed exit for that agent.Furthermore, MassMotion considers inputs about pre-movement time, speed, and more specific agent's profile.
In MassMotion software, the basic surfaces such as floor, obstacles, stairs, and portals have been assigned to the single object.The portals represent the point where agents are originated or the point where they must go for evacuating.In the model, twenty-four portals have been created for originating the agents, one portal for each class and three portals for the exits.The simulation is limited to the first floor, as it is the most subject to crowding effects.In the simulation, two different agents were implemented: the students and the teachers.According to school rules, teachers must wait for students to leave the classroom first to ensure that no one is left behind and then close the classroom door.Since it is not possible in the software to give such a specific indication to the agents defined as "teachers", a few seconds of delays in the departure have been set to recreate the simulation in a realistic way.The pre-movement activity time is represented by a log-normal distribution (min = 4 s, max = 166 s, average = 41 s, STD 35 s), which is based on a series of experiments conducted by (Cuesta and Gwynne 2016) [43].Generally, the log-normal distribution is used to best represent the impact of the social influence in its initial phase, and the response of people who decide to activate the exodus late.The speeds of the different types of agents have been proposed in the literature (Thompson and Marchant 1995) [44] and are based on log-normal distributions as show in Table 2. Evac software allows for setting a grid different from the one used in FDS to simulate the fire.After defining the grid, the space (mesh) where agents are randomly created must be set.A mesh for each classroom was set and the agent's profiles were chosen.The default agent profiles in Evac are five, as shown in Table 3, assuming a specific association to each profile.In the case scenario, the profile chosen for the simulation was child for the students and adult for the professors.To define the exit to which the agent will move, the software considered the solution of the choice as a case of optimization in which the occupant goes to the exit that makes its evacuation time lower.The choice of the exit was established based on three criteria (Korhonen and Hostikka 2009) [34]: (i) visibility, the agent can see the exit door from his position; (ii) familiarity, the agent is aware of the existence of the exit even if the agent cannot see it; and (iii) disturbing condition (e.g., the presence of smoke or CO; i.e., the agent is unable to move due to the scarce visibility).
Table 4 shows the preference order of the agents in choosing the best way for evacuation based on the three criteria explained before.Each class has been associated with the nearest exit, so the agents can consider the familiarity only to one exit.In case an exit is not available, the movement of the agents is based on the visibility of the other available exits or on the other agents.Among the three exits, two have a good visibility, as they are placed in the corridor (left and right exit), but the central one is hidden.Thus, if the agent does not know its location, the visibility criteria cannot be applied.Furthermore, the central exit can lead to congestion phenomena.
The Evac simulation also considers the interaction with toxic gases through the fractional effective dose (FED) model.Some agents could be unable to finish the evacuation due to the exposure to carbon monoxide and dioxide (e.g., disturbing conditions).

Analysis of Scenarios and Results
Results from the simulation of the four different scenarios through MassMotion software are presented in Figure 9.Each class has been associated with the nearest exit, so the agents can consider t familiarity only to one exit.In case an exit is not available, the movement of the agents based on the visibility of the other available exits or on the other agents.Among the th exits, two have a good visibility, as they are placed in the corridor (left and right exit), b the central one is hidden.Thus, if the agent does not know its location, the visibility cri ria cannot be applied.Furthermore, the central exit can lead to congestion phenomena The Evac simulation also considers the interaction with toxic gases through the fr tional effective dose (FED) model.Some agents could be unable to finish the evacuati due to the exposure to carbon monoxide and dioxide (e.g., disturbing conditions).

Analysis of Scenarios and Results
Results from the simulation of the four different scenarios through MassMotion so ware are presented in Figure 9.As shown, the agent count maps represent the number of agents that evacuate fro the available exits.The maps represent the situation in the school after the evacuation.T colors show the number of agents that cross every point of the school and help to und stand the crowding density during the evacuation process.Furthermore, Figure 9 hig lights the difference of the crowd movement in the four different scenarios.
It is evident that, in Scenario A, where all the emergency exits are available, the agen are well distributed during the evacuation process compared to the other scenarios.Scenario B and Scenario C, the agents are divided between the two available emergen exits in a functional way.Finally, the worst evacuation process is represented in Scena D, where an overcrowding of the agents occurs in the corridor of the building.The tim of evacuation in the different scenarios is illustrated in Figure 10.As shown, the agent count maps represent the number of agents that evacuate from the available exits.The maps represent the situation in the school after the evacuation.The colors show the number of agents that cross every point of the school and help to understand the crowding density during the evacuation process.Furthermore, Figure 9 highlights the difference of the crowd movement in the four different scenarios.
It is evident that, in Scenario A, where all the emergency exits are available, the agents are well distributed during the evacuation process compared to the other scenarios.In Scenario B and Scenario C, the agents are divided between the two available emergency exits in a functional way.Finally, the worst evacuation process is represented in Scenario D, where an overcrowding of the agents occurs in the corridor of the building.The time of evacuation in the different scenarios is illustrated in Figure 10.As shown, the agent count maps represent the number of agents that evacuate from the available exits.The maps represent the situation in the school after the evacuation.The colors show the number of agents that cross every point of the school and help to understand the crowding density during the evacuation process.Furthermore, Figure 9 highlights the difference of the crowd movement in the four different scenarios.
It is evident that, in Scenario A, where all the emergency exits are available, the agents are well distributed during the evacuation process compared to the other scenarios.In Scenario B and Scenario C, the agents are divided between the two available emergency exits in a functional way.Finally, the worst evacuation process is represented in Scenario D, where an overcrowding of the agents occurs in the corridor of the building.The time of evacuation in the different scenarios is illustrated in Figure 10.The evacuation time depends by the considered scenarios (Figure 10).Focusing on Scenario A, the evacuation time was less than the other scenarios, where the evacuation time increased due to the location of the available emergency exits.Table 5 lists the evacuation time obtained from the different scenarios using MassMotion and Evac software.The evacuation time depends by the considered scenarios (Figure 10).Focusing on Scenario A, the evacuation time was less than the other scenarios, where the evacuation time increased due to the location of the available emergency exits.Table 5 lists the evacuation time obtained from the different scenarios using MassMotion and Evac software.Results from the used software are quite similar.For instance, Scenario C shows the longest evacuation time due to the not availability of the left exit.Moreover, the shorter evacuation time is obtained from Scenario B, where only the central emergency exit is not available and, therefore, the agents can move more fluently towards the available exits.
The differences in the evacuation time from the two software are related to the consideration in Evac software of smoke and its influence on the agents' speed due to the reduced visibility, the toxic gases effects to the body, and the heat caused by the smoke.In Scenario A, the smoke made one of the emergencies exits no longer available.Thus, the occupants tried another escape route when they were aware of it.
The use of Evac software for simulating the evacuation process represents a proper solution, since it accounts for the effects of the fire and smoke.However, results from Evac software cannot be imported to Unity3D software to be included within the virtual reality model, because there is not an output that can be processed in a model compatible with Unity3D.Therefore, MassMotion results are implemented in the virtual environment because in this case is possible to export directly from MassMotion an animation of the simulation compatible with Unity3D.

Simulation of the Fire Emergency Scenario within the Virtual Reality
The last step of the methodology is the simulation of the fire emergency scenario through VR using the aforementioned methodology.The geometrical model, the FDS model, and the evacuation system described in the previous sections, are combined through Unity3D software.The geometric model was imported into Unity3D by using the Tridify plugin (https://www.tridify.com/accessed on 13 January 2022), which allowed for managing the texture, materials, and illumination.The FDS model was imported into Unity3D by using the Plot3D output, which is a format developed by NASA (National Aeronautics and Space Administration) designed to visualize fluid dynamics (CFD) datasets.A line &DUMP was then added to the code without any adjustment to the default settings, creating two files per second.Such files determine the number of "frames" that the software will create.
Although a higher number of files is necessary to make the animation much smoother, they could slow down the data processing.An XYZ file containing information on coordinates and orientation was created for further processing.The files were then imported into a fluid dynamics analysis software to be processed as 2D contours, vector plots, and iso-surfaces through Paraview (Ayachit 2015) [39].First, the XYZ file was imported as PLOT3D reader and all Plot3d files created by the Fire Dynamic Simulator were selected.The data are displayed as iso-surfaces using the density value as reference value for creating the contour.The animation was exported as a sequence of three-dimensional objects that correspond to static three-dimensional frames of the shape of the smoke at a given time of the simulation.These frames, exported in .objformat, were then combined in a single sequence on Blender software using the OBJsequence plug in.An alembic object (.abc) was created to reproduce the animation in Unity3D software.The animation was made with the help of the Sverchok plugin [45], which is a parametric tool that allows for managing the geometry with node tree functions.Therefore, a command tree was created to synthesize the sequence of objects in a single file as an alembic object that could be imported to Unity3D software in the scene previously created.The animation is activated when the program is started in the game mode.Figure 11 shows the VR smoke simulation in Unity3D software.
The last model to be imported in the VR environment was the evacuation process realized through MassMotion software.The simulation model was exported as an alembic file, keeping the geometry and the animation of the people evacuating.Moreover, the agents were represented as identical white standard figures and the dynamic movement of the walk can be perceived not only as a simple sliding of the static figure, but the agents reproduce the real movement of the steps and arms.Following the same procedure for the FDS model, a timeline to which the alembic object is associated was created.The fire emergency evacuation reproduced in the VR scenario is shown in Figure 12.
After importing the three different models in the VR scenario, a VR simulation to perform fire rescue training in first person was developed.To allow the player to move and interact within the VR environment, the single body KatWalk VR was used.This platform allows for 360 • movement in the VR scenario through a head-mounted display and the movements were tracked using sensors for the torso, feet, and hands.Figure 13 shows the KATVR platform at DISEG at the Politecnico di Torino used for the simulation.
when the program is started in the game mode.Figure 11 shows the VR smoke simulation in Unity3D software.The last model to be imported in the VR environment was the evacuation process realized through MassMotion software.The simulation model was exported as an alembic file, keeping the geometry and the animation of the people evacuating.Moreover, the agents were represented as identical white standard figures and the dynamic movement of the walk can be perceived not only as a simple sliding of the static figure, but the agents reproduce the real movement of the steps and arms.Following the same procedure for the FDS model, a timeline to which the alembic object is associated was created.The fire emergency evacuation reproduced in the VR scenario is shown in Figure 12.After importing the three different models in the VR scenario, a VR simulation to perform fire rescue training in first person was developed.To allow the player to move and interact within the VR environment, the single body KatWalk VR was used.This platform allows for 360° movement in the VR scenario through a head-mounted display and the movements were tracked using sensors for the torso, feet, and hands.Figure 13 shows the KATVR platform at DISEG at the Politecnico di Torino used for the simulation.The proposed VR platform can be used to verify the condition of existing buildings with respect to the emergency evacuation of occupants, to evaluate modifications in the building layout (e.g., walls and emergency exits), in the planning of dedicated evacuation routes, and in the design and placement of fire extinguishing and fire protection systems.In addition, the platform can be of essential significance for the training of emergency operators, and users, to know how to intervene and to visualize different scenarios.The system also lends itself to the simulation of multi-hazard scenarios where, for example, fire hazard and emergency evacuation overlap with the presence of debris from explosions or earthquakes.The critical advantage of the proposed VR platform consists in the reproduction of experiential learning environments, where users can be involved in and interact with complex emergency scenarios, including those conditions that cannot be reproduced in the real world through specific testing due to high cost or safety concerns (Xu et al. 2018;Sharma 2020;Corelli et al. 2020) [46][47][48].

Conclusions
Over the years, the importance of fire emergency simulation in fire safety engineering has gained great attention.In this work, a VR platform was proposed as a tool for simulating and experiencing, in first person, evolutionary fire emergency scenarios.The proposed platform integrated a fluid dynamic software to reproduce fire and smoke spreading in the virtual environment.Moreover, the occupants' dynamics was also simulated by a specific software and was implemented within the virtual environment.
The proposed VR system can be applied to a wide class of public buildings.In this work, adopting a school building as an example, the emergency fire scenario in the VR environment was established, and both the spread of indoor fire with smoke and the evacuation dynamics of occupants were integrated.Thus, the resulting VR system allows one to experience, in first person, evolutionary emergency fire scenarios for the selected school building.
Further research based on the proposed VR platform will focus on verifying emergency signals and determining how the smoke can influence their visibility, along with the human behavior in fire emergency conditions.Another research development will be focused on an emergency management study with managerial insights, e.g., to evaluate the fire safety or the effectiveness of existing evacuation paths.The use of immersive scenarios in virtual reality can provide different benefits to the development of training tools.Furthermore, the virtual reality environment created in Unity3D allows for combining different simulations from different software that otherwise cannot interact between each other.The simulations are also enriched by the realistic scenario that can be created only with graphic software.The combination of all these elements in an immersive experience is a powerful tool for analysing human behaviour and observing the choice of the player.
The proposed VR platform can be used to verify the condition of existing buildings with respect to the emergency evacuation of occupants, to evaluate modifications in the building layout (e.g., walls and emergency exits), in the planning of dedicated evacuation routes, and in the design and placement of fire extinguishing and fire protection systems.In addition, the platform can be of essential significance for the training of emergency operators, and users, to know how to intervene and to visualize different scenarios.The system also lends itself to the simulation of multi-hazard scenarios where, for example, fire hazard and emergency evacuation overlap with the presence of debris from explosions or earthquakes.The critical advantage of the proposed VR platform consists in the reproduction of experiential learning environments, where users can be involved in and interact with complex emergency scenarios, including those conditions that cannot be reproduced in the real world through specific testing due to high cost or safety concerns (Xu et

Conclusions
Over the years, the importance of fire emergency simulation in fire safety engineering has gained great attention.In this work, a VR platform was proposed as a tool for simulating and experiencing, in first person, evolutionary fire emergency scenarios.The proposed platform integrated a fluid dynamic software to reproduce fire and smoke spreading in the virtual environment.Moreover, the occupants' dynamics was also simulated by a specific software and was implemented within the virtual environment.
The proposed VR system can be applied to a wide class of public buildings.In this work, adopting a school building as an example, the emergency fire scenario in the VR environment was established, and both the spread of indoor fire with smoke and the evacuation dynamics of occupants were integrated.Thus, the resulting VR system allows one to experience, in first person, evolutionary emergency fire scenarios for the selected school building.
by the National Institute of Standards and Technology (NIST) of the United States; they include particle systems and volume rendering.Many researchers have applied particle systems to demonstrate the spread of smoke based on FDS simulation results (Shen et al. 2008; Cha et al. 2012; An et al. 2014; Glasa and Steckova 2015; Xu et al. 2020)

Buildings 2022 ,
12, x FOR PEER REVIEW Existing methods for fire and smoke visualization are based on computationa dynamics (CDF) computer software, such as the Fire Dynamics Simulator (FDS) oped by the National Institute of Standards and Technology (NIST) of the United S they include particle systems and volume rendering.Many researchers have applie ticle systems to demonstrate the spread of smoke based on FDS simulation results et al. 2008; Cha et al. 2012; An et al. 2014; Glasa and Steckova 2015; Xu et al. 2020)

Figure 1 .
Figure 1.Flowchart of the proposed methodology.

Figure 1 .
Figure 1.Flowchart of the proposed methodology.

Figure 2 .
Figure 2. Summary of the evacuation phases.

Figure 2 .
Figure 2. Summary of the evacuation phases.

Figure 3 .
Figure 3. Firefighter intervention in school buildings due to fire and explosion in Italy.

Figure 3 .
Figure 3. Firefighter intervention in school buildings due to fire and explosion in Italy.

Figure 4 .
Figure 4. Axonometric view of the school building.

Figure 5 .
Figure 5. Ground floor and first floor plan of the school building.

Figure 4 .
Figure 4. Axonometric view of the school building.

Figure 4 .
Figure 4. Axonometric view of the school building.

Figure 5 .
Figure 5. Ground floor and first floor plan of the school building.

Figure 5 .
Figure 5. Ground floor and first floor plan of the school building.
): -Scenario A: The fire starts in a classroom (first floor); all the emergency exits are available.-Scenario B: The fire starts near the central exit door.All the students must evacuate through the left door and the right door.-Scenario C: The fire starts near the left exit door.All the students must evacuate through the central door and the right door.-Scenario D: The fire starts near the right exit door.All the students must evacuate through the central door and the left door.
): -Scenario A: The fire starts in a classroom (first floor); all the emergency exits are available.-Scenario B: The fire starts near the central exit door.All the students must evacuate through the left door and the right door.-Scenario C: The fire starts near the left exit door.All the students must evacuate through the central door and the right door.-Scenario D: The fire starts near the right exit door.All the students must evacuate through the central door and the left door.

Figure 8 .
Figure 8. Simulation of smoke propagation vs time (Scenario A).

Figure 7 .
Figure 7. Fire scenarios and their ignition points (first floor, classrooms building).

Figure 7 .
Figure 7. Fire scenarios and their ignition points (first floor, classrooms building).

Figure 8 .
Figure 8. Simulation of smoke propagation vs time (Scenario A).Figure 8. Simulation of smoke propagation vs time (Scenario A).

Figure 8 .
Figure 8. Simulation of smoke propagation vs time (Scenario A).Figure 8. Simulation of smoke propagation vs time (Scenario A).

-
Scenario A: All the emergency exits are available.-Scenario B: All the student must evacuate through the left door and the right door.-Scenario C: All the student must evacuate through the central door and the right door.-Scenario D: All the student must evacuate through the central door and the left door.

Figure 9 .
Figure 9. Agent count maps for four scenarios.

Figure 9 .
Figure 9. Agent count maps for four scenarios.

Figure 11 .
Figure 11.External view of fire simulation in virtual reality model with smoke (top), real world (bottom).

Figure 11 .
Figure 11.External view of fire simulation in virtual reality model with smoke (top), real world (bottom).

Figure 12 .
Figure 12.Fire emergency evacuation scenario in virtual reality model (top), real world scenario (bottom).

Table 2 .
Speed of the agents introduced in MassMotion.The values are referred to log-normal distribution (Thompson and Marchant 1995) [44].

Table 5 .
Time of evacuation for different scenarios.