A Ship Firefighting Training Simulator with Physics-Based Smoke

<jats:p>Under the current background of navigation education, students generally lack a comprehensive grasp of ship firefighting equipment’s operation. Therefore, we develop a novel ship firefighting training simulator with a multi-sensory human–computer interaction function for teaching and training marine students. In the simulator, we consider a container ship of 1.8w containers as the prototype ship, and the entire ship models are built using three-dimensional modeling technology. We design various interactive modes and realize a full-process operation simulation of several standard ship firefighting equipment. Furthermore, we propose a purely Lagrangian vortex dynamics framework to simulate smoke and flame in fire scenarios. In this framework, we model fluids using velocity and vorticity fields discretized on discrete vortex segments. The main components of the framework include a stable geometric stretching solution and particle strength exchange method for solving the diffusion term. The simulation results show that the simulator has good behavioral realism and scene immersion and can be applied to ship firefighting training. To the best of our knowledge, this is the first study on real-time smoke simulation using a physics-based method in a firefighting training simulator.</jats:p>

section_content: As the primary means to undertake worldwide goods transportation, the shipping industry has carried out about 90% of world trading [1]. Since various accidents such as ship collisions and ship fires often result in significant economic loss, death, and environmental contamination, maritime safety is a crucial factor in the process of shipping [2]. The causes of these accidents may be deliberate actions or incidental. In order to reduce the probability of accidents and resist these accidents, research institutions have performed various studies on safety systems, alarm mechanisms, and emergency strategies [3]. 

Ship fires are the leading cause of harm to people and property on board and are one of the most dangerous events threatening the safety of ship operations. Due to the particular structure and function of the ship, ship fire has the characteristics of high risk, difficult to put out, and easy to spread. Even a tiny mistake or accident in the firefighting process can cause significant damage due to the instantaneous nature of ship fire [4]. Therefore, we need to take effective control after the fire. To improve the crew's fire safety skills, and test their ability to respond to fires in various parts of the ship and the coordination between the crew during the emergency process, it is necessary to conduct fire drills. However, ship fire drills are primarily carried out in real environments, which are expensive and dangerous. In addition, training in real environments is limited by time, money, and environmental factors. 

Simulation training on computers is an effective alternative to dangerous or high-cost training. First, computer-based simulation training reduces costs and eliminates accidents that may occur during training in real environments. Second, simulation training builds a highly immersive training environment and can reproduce the training scene realistically. By interacting with the virtual three-dimensional (3D) world, students find it exciting and challenging, motivating them to complete tasks. Moreover, developers can add appropriate instructional designs, clear learning objectives, and standard operating guidelines that conform to the training process to the training content. Owing to the above characteristics, computer-based simulation training in all walks of life has become very common, such as aviation [5], navigation [6, 7], medical [8], entertainment [9], manufacturing technology [10, 11], and firefighting [12, 13]. 

The application of virtual reality (VR) in the firefighting field can be viewed as a natural evolution of computer-based simulation training, which is primarily used for professional education purposes and can provide high-level interactivity and participation. Currently, many firefighting simulation applications focus mainly on the following areas: systematic search or fire suppression in buildings filled with smoke [14, 15], communication and leadership in fire scenarios [5, 16], and fire safety education [17, 18]. 

Relatively few VR applications exist in the field of ship firefighting. Tate et al. 

[19] constructed a virtual environment for ship firefighting training using a texture-based approach to simulate fire and smoke. Firefighters can use this environment to practice firefighting tactics and procedures. Liu et al. [20] developed a head-mounted display-based firefighting simulation system for LNG ships. The system can present the scenario of fire spreading without interactivity and evaluate students' perception and decision-making ability in combination with human factors. In summary, although some progress has been made in ship firefighting simulation training, it has not been fully explored. 

Realism in virtual environments plays a vital role in user training and assessing user awareness of hazardous situations. During a major fire, smoke occupies a large area of view of firefighters. Hence, the degree of reality of the simulated smoke significantly affects the realism of the virtual environment. The smoke simulation methods in firefighting simulation software can be roughly divided into two categories. The first category uses non-physical methods to calculate the motion of smoke directly in the software, such as the particle system [21] and texture synthesis [22]. This type of method has high computational efficiency with poor realism and is especially suitable for real-time software. Obtaining realistic smoke details and coherent structures that are much larger than a single particle is challenging. 

The second category uses professional computation platforms to predict the fire behavior [23, 24] based on computational fluid dynamics, such as CFAST, FDS, etc. Then, the fire data are visualized in the simulation software to present the fire scene realistically. This type of method is suitable for applications that need to assess the fire hazard and firefighting performance of a building. However, it is complicated to implement and has poor computational efficiency. To improve the realism of smoke simulation and ensure real-time computation simultaneously, developing a fast and physics-based method for smoke simulation in simulation software is useful. 

Researchers in computer graphics and computational physics have been devoted to using limited computing resources and time to improve the realism of smoke movement as much as possible. Various numerical methods have been proposed to solve the physical model of smoke. Stam's stable fluids is the most famous method and is known for its simple implementation and unconditional stability [25]. It allows researchers to ignore the restriction of the Courant-Friedrichs-Lewy condition on the time-step but leads to significant numerical dissipation. To solve the problem of numerical dissipation, various structure-preserving schemes have been proposed, such as the BFECC scheme [26], the Mac-Cormack scheme [27], the advection-reaction scheme [28], the "BiMocq2" method [29], the Clebsch method [30] [31] [32], and the impluse method [33]. These methods must be based on a predivided grid, also called the Eulerian grid method. 

Another type of method for solving the physical smoke model are the Lagrangian methods. These methods represent the motion state of fluid using discrete particles that carry the fluid's physical information. The representative Lagrangian methods include smoothed particle hydrodynamics (SPH) [34] and vortex particle methods [35]. Since the SPH method relies on the uniform distribution of particles to ensure computational accuracy, it is not suitable for large-scale smoke simulation. The vortex particle method is an effective numerical tool for solving turbulence and smoke evolution and has the natural advantage of maintaining the vortex structure. Compared with the grid-based method, the Lagrangian methods have better flexibility and are more suitable for parallelization than the Eulerian methods. The most crucial point is that the Lagrangian methods do not require a grid and can work in an unbounded space. This feature is particularly useful in large-scale smoke simulations. 

In recent years, the share of professional ships and advanced fast large vessels is growing, and the goods volume of the container ship has significantly increased. Taking the container ship as the prototype ship, we develop a ship firefighting training simulator with a multi-sensory human-computer interaction function. Since engine and container fire are common in ship fire and can easily lead to major accidents, we use the engine and container fire as the training background and construct realistic virtual ship fire scenarios. In the simulator, we use 3D modeling technology to restore the entire ship and realize the full-process operation simulation of several standard ship firefighting equipment. Users can operate the virtual ship firefighting equipment for firefighting training. 

To improve the environmental realism of virtual scenes, we propose a novel physicsbased real-time smoke simulation framework. In this framework, we model smoke and fire using vorticity and velocity fields discretized on a set of discrete vortex segments. We devise a stable geometric approach for solving the vortex stretching term that can capture fine fluid details while maintaining good numerical stability. Moreover, we employ the particle strength exchange approach to solve the diffusion term. As examples, we construct container and engine room fire scenarios with different initial configurations. Our technical contributions are summarized as follows:

(1) A ship firefighting training simulator with a multi-sensory human-computer interaction function. The simulator includes high-fidelity 3D models and several standard ship firefighting equipment that can realize full-process operation simulation. We design a variety of interaction modes and provide some external interactive devices for users. (2) A novel physics-based real-time smoke and fire simulation framework. In the framework, we design a novel weighted stretching approach to capture the fluid details with long-time stability. The fluid simulation based on the vortex segment can achieve real-time through parallel computation.
section_name: Introduction

section_content: The ship firefighting training simulator is a teaching and training system with a realtime human-computer interaction function and a highly immersive virtual scene. First, ship firefighting equipment is distributed throughout the ship, such as the bridge, cargo hold, deck, and engine room. To familiarize students with the distribution of firefighting equipment on board, the simulator should have a 3D model of the entire ship and provide a roaming function. 

Second, as a ship firefighting teaching and training system, it should provide equipment interaction and multi-person collaborative training functions. The interactive operation function allows students to interactively control the equipment for firefighting training. Moreover, we design a multi-sensory interaction pattern to improve the behavioral realism of the system. The interactive devices include a mouse, keyboard, touch screen, and VR helmet. Multi-person collaborative training allows students to conduct emergency fire drills in teams, improving their mutual support and coordination abilities during the entire drill process. In addition, to enhance the environmental realism of the system, we realize the dynamic evolution of complex smoke scenes by solving the physical model of the incompressible fluid in real time.
section_name: System Design

section_content: Figure 1 shows the ship firefighting training simulator's overall architecture, including the scene, function, and user interface (UI) modules. According to the display part, the scene module is subdivided into a 3D whole ship submodule and a smoke simulation submodule. The function module is divided into three submodules: scene roaming, equipment interaction, and multi-person collaboration. The 3D whole-ship submodule is an important support for the visual output of the system, which contains all the 3D models in the system. The smoke simulation submodule is responsible for computing the motion of smoke and smoke visualization, significantly improving the environmental realism of the system environment. Using the scene roaming submodule, students can browse the ship environment and firefighting equipment through different patterns and conduct fire drills from a first-person perspective. The equipment interaction submodule provides several pieces of ship firefighting equipment for firefighting training. The multi-person collaboration submodule realizes network communication between terminal systems and synchronizes changes in equipment and scenes. The UI module is used as an interface for the system to set fires, select roles, and switch interaction patterns.
section_name: System Structure

section_content: Firefighting equipment simulation training and fire drills are the primary functions of the simulator. Based on the operation instructions of the equipment and the correct operation steps, we simulate the entire operation process of several standard firefighting equipment involved in the fire drill. For training purposes, when the operation steps of the students are wrong, the simulator provides a prompt and informs them of the correct operation steps. A detailed introduction to the three firefighting equipment is as follows. 

Fixed-carbon-dioxide fire-extinguishing system: The system consists of the carbon dioxide (CO 2 ) cylinder group, control system, fire-extinguishing pipeline, injection device, etc. The opening of the CO 2 cylinder could be controlled manually or automatically and the release of CO 2 is controlled by manipulating the release valve. In practice, the misoperation of a fixed-CO 2 fire-extinguishing system may lead to serious safety incidents. Therefore, the correct operation steps are the training focus of the fixed-CO 2 fire-extinguishing system. 

Fixed-water fire-extinguishing system: This system is one of the most basic and effective fire-extinguishing systems, which is also a fire-extinguishing system that all ships must be equipped with. In the training for this equipment, students' familiarity with the equipment and their collaboration abilities are the key training points. Training requires the cooperation of 2-4 people. According to the actual operation needs and division of labor, students log in to the simulator with different roles to start the training.
section_name: Firefighting Equipment Training

section_content: The portable fire extinguisher has a simple structure and is light and flexible, consisting of a cylinder, release valve, and injection system. It is mainly used for small-scale fires. According to relevant regulations, it is necessary to set up a sufficient number of fire extinguishers in critical places on ships. In the training process, students should focus on mastering the spray direction and appropriate distance of fire extinguishing.
section_name: Portable fire extinguisher:

section_content: As a real-time application, the ship firefighting training simulator has high real-time requirements for smoke simulation. Moreover, realistic smoke animation is of great help in enhancing the environmental realism of the simulator. Therefore, real-time and high realism are two critical aspects that must be considered in smoke simulation. From the perspective of solving variables, smoke solvers based on physical models can be divided into two categories: solvers based on velocity-pressure and solvers based on velocity-vorticity. Because the vorticity space contains more structural fluid features than the velocity space, this paper models the motion of smoke based on the vorticity form of the Navier-Stokes equation to meet realistic requirements for smoke simulation. 

In this paper, we discretize the vorticity field on a set of discrete vortex elements to track the evolution of the vorticity field. Regarding realism, the Lagrangian vortex method inherits the advantages of the Lagrangian method, such as being free of numerical dissipation. Moreover, tracer particles are used to visualize smoke, which follows the velocity field and does not affect the evolution of the vorticity field. 

In the fluid solver based on the vorticity equation, the most computationally expensive part is constructing the velocity field from the vorticity field. To simulate smoke in real time, the velocity field needs to be calculated efficiently. The velocity field can be calculated in two ways. The first is solving the Poisson equation for the stream function. It is difficult to converge the solution in real time, especially for large-scale simulation. The other method is to use the Biot-Savart formula to calculate the velocity by summation. The two methods are mathematically equivalent. In contrast, the direct summation operation in the BS formula is easy to implement and is suitable for parallelization.
section_name: Smoke Scenes Simulation

section_content: In this section, we first give the mathematical description of the physical model of smoke. Then we introduce the vortex dynamics framework used for numerical computation. In the framework, the vorticity field is discretized on the vortex segments. The vortex segments are updated under the influence of the advection, the stretching, and the diffusion terms. For further mathematical details of the vortex method, we refer the readers to the book by Cottet [36].
section_name: Smoke Simulation

section_content: In the computer graphics and computational physics community, the physical laws of fluids are the same: the famous Navier-Stokes equations. As a typical fluid phenomenon, the smoke movement can be explained by the equations. The Navier-Stokes equations describe the rate of change of fluid momentum under pressure and viscous force, and are usually written as follows:

where u is the velocity, t is the time, p is the pressure, ρ is the density, and υ is the kinematic viscosity. Assuming that ρ is constant, we can obtain that the curl of Equation ( 1 ) yields the vorticity form of Navier-Stokes equations:

where ω is the vorticity and ν∇ 2 ω denotes the diffusion term. The pressure term disappears. u • ∇u becomes the vorticity advection u • ∇ω and the vortex stretching (∇u) • ω. 

The advection term describes the transportation of vorticity as the velocity field moves, and the stretching term causes local intensification and reorientation of the vorticity. 

In this paper, we use the Lagrangian viewpoint to discretize the fluid. The vorticity field is discretized on a set of discrete vortex elements:

where N v is the total number of vortex elements, Γ i and x i are the vorticity strength and position of the ith vortex element, respectively. f δ i is the distribution function around the ith vortex element that satisfies Ω f δ i (x)dx = 1. Ω is the computation domain of fluid.
section_name: Physical Model

section_content: This paper proposes a purely Lagrangian vortex dynamic framework based on Equation (2). The core components of the framework include a discrete structure of the vortex segment, a stable approach for solving the stretching term, and an approach for solving the diffusion term. The core components are as follows. 

Vortex segment: The vortex segment is a new discrete representation of the vorticity field proposed by Xiong et al. in 2021 [37]. It combines the flexibility of the vortex particle method with the accuracy of the vortex filament method. Xiong et al. [37] successfully simulated various smoke phenomena and incompressible fluid exhibiting robust anisotropic vortical features. In addition to the vortex segment, the geometric representation of the vorticity field can be discrete points, lines, or triangular mesh. Each discrete form has characteristics that are not introduced here. We refer the reader to related works in the literature [37]. 

We discretize the vorticity field on the vortex segments. The vortex segment can be considered as a small cylinder with two ends x l i, x r i and the magnitude of the vorticity strength Γ i. The vorticity strength of the vortex segment is

According to the literature [37], given a vortex segment S i, the induced velocity of the vortex segment at any position x is

where R is the regularization term used to avoid the singularity problem in the Biot-Savart formula. The velocity field of the fluid can be obtained by summing the induced velocities of all the vortex segments:

where N v is the total number of vortex segments. Advection and Stretching: It is unconditionally unstable to use finite differences for explicitly solving the advection and stretching terms [38]. A common strategy for solving the advection term is to integrate the velocity over the Lagrangian elements directly. The stretching of the vortex elements can be captured by calculating the geometric struc-ture's deformation; however, the geometric method is prone to diverge with large time steps and requires special processing to stabilize the simulation [39]. 

In this paper, we design a stable geometric method to update the vortex segment with advection and stretching. We calculate the vortex stretching by capturing the geometric deformation of the vortex segment. Then, the stretched and original vortex segments are weighted to stabilize the simulation. We describe our vortex stretching approach in detail, as follows. 

First, we update the positions of the ends of the vortex segment according to the current velocity field:

where xl i and xr i are the positions of the ends after the stretching. According to Kelvin's circulation theorem, the vorticity strength of a vortex segment is conserved during advection and stretching. 

In the experiment of the jet, we found that if we directly set the position of the ends of the vortex segment with xl i and xr i, the flow diverges quickly. The experiment is almost identical to the experiment in Figure 5, with the only difference in updating the vortex segments' ends. To stabilize the simulation, we add some special post-processing, i. e., weighting the position of the stretched and original vortex segments. Finally, the end positions of the vortex segments are updated as follows:

where α ∈ (0, 1). We remark that our geometric method is more intuitive and stable than explicit calculation using finite differences. Weighted processing makes the long-time simulation possible. Diffusion: In Equation (2), ν∇ 2 ω is the diffusion term describing vorticity diffusion due to friction of flow. We consider two aspects when solving the diffusion term. On the one hand, the Laplacian operator in the diffusion term is a second partial derivative. The common and effective way to compute the second partial derivative is the finite difference, which is not straightforward in our Lagrangian framework. On the other hand, the Lagrangian method is suitable for solving discretization problems with integral operators. Therefore, the key point is to replace the Laplacian operator in an equivalent integral manner. 

The particle strength exchange (PSE) [40] method is used to solve the diffusion term in this paper. The Laplacian operator in the diffusion term behaves similar to a fuzzy operator. Based on this fact, the PSE method performs an integral operation over the vorticity exchange between vortex segments, and the vorticity strength of the vortex segment is updated as

where N i n is the number of neighboring vortex segments of i th vortex segment, ν is the viscosity coefficient, and ψ is a second-order diffusion kernel. The PSE method can gradually reduce the total kinetic energy and make the simulation robust while maintaining circulation conservation [41].
section_name: Lagrangian Vortex Dynamics Framework

section_content: We use the Unity 3D virtual reality engine to develop the ship firefighting training simulator. The version of Unity is 2017. 4. 20. The script is written by the C# programming language. We use the ComputeShader of Unity3D to parallelize most smoke simulation steps. Our simulator is developed on a laptop with a 6-core 2. 20 GHz CPU and an NVIDIA GeForce GTX 1060 graphics card. In addition to the desktop display, the simulator is equipped with an HTC VIVE Pro virtual reality helmet and Philips touch screen as the medium of multi-sensory interaction. Table 1 lists the timing statistics of various smoke examples, including the number of vortex segments N v, the number of flame tracer particles N f, the number of smoke tracer particles N s, the timing for fire and smoke velocity computation T t, and the timing for vortex segment velocity computation T v. The implementation process of each module is described below. The 3D model of the entire ship and firefighting equipment is the important support for the visual output of the system, which is also the basis of this study. This paper uses the container ship "Atlantic" as the prototype ship. The ship "Atlantic" has a maximum capacity of 1. 8 w containers. Its total length is 399. 9 m, and its width is 61. 3 m. We build the 3D model for the primary areas of the ship and the key firefighting equipment. Moreover, we use occlusion culling and levels of detail technologies to optimize the model and improve the system's performance. The modeling process is described as follows. 

This paper uses 3D Studio Max as the modeling software. First, the ship data must be organized, including the size and appearance of the main equipment and ship. We import the design drawings in DWG format to obtain the size information. Appearance information can be obtained by photographing the real ship. To facilitate subsequent management, we write planning documents and formulate the rules for making and naming models. Finally, we create the white model and texture map, and obtain the complete model resource after rendering. The modeling process is illustrated in Figure 2, and the model in Unity is shown in Figure 3. We divide the model into static and dynamic models to improve the efficiency and performance of the simulator. The state and size of the dynamic models are driven by the script. In contrast, the state and size of static models do not change during the process of interactive operation. This division can reduce the time required to traverse the model for the system, thereby reducing the drawing time and improving the scene drawing efficiency.
section_name: System Implementation

section_content: Smoke simulation can be divided into two parts: visualization and computation. Because smoke consists of small solid particles and gases, we use tracer particles to visualize smoke, which is a small disc with transparency. Moreover, we use bulletin board technology, which makes all tracer particles always face students. From the student's viewpoint, smoke seems to be composed of a large number of translucent microspheres. This visually matches reality and adds little additional computational overhead. The moving tracer particles form highly realistic smoke in an accurate velocity field constructed from the vorticity field. 

Next, we introduce, in detail, the computational part of the smoke simulation. We generate and initialize vortex segments and tracer particles at each time step. Subsequently, we advect the vortex segments and tracer particles under the current velocity field. Subsequently, the diffusion term is solved, and the velocity field is calculated. Finally, we update the lifetimes of the vortex segments and tracer particles. Figure 4 shows the overview of our method. Figure 5 shows a jet smoke. Considering the jet smoke as an example, we update the flow according to the following steps. 

(1) Generate the vortex segments and tracer particles. On the CPU, emit a vortex ring consisting of 10 vortex segments every ten steps, with normal faces up. We set a certain lifetime for vortex elements and tracer particles. Elements with a negative lifetime are dynamically deleted. In addition, 200 tracer particles are generated near the vortex ring at each time step. Then, the data of the vortex segments and tracer particles on the CPU are transferred to the GPU for subsequent calculations. (2) Advect tracer particles. Based on the current velocity field, advect tracer particles. 

(3) Advect and stretch the vortex segments. Based on the current velocity field, advect vortex segments to obtain xl i and xr i. Then, weight the ends of segments according to Equation (7) to complete the advection and stretching. (4) Diffusion. Use the PSE method to solve the diffusion term as follows:

(5) Velocity computation. Because the time complexity of calculating the vortex segments' velocity is O(n 2 ), we use the forward Euler scheme to calculate the velocity of the vortex segment. The velocity of tracer particles x p is calculated by the third-order Runge-Kutta scheme as follows: (1) Walking mode: The walking mode is similar to how the characters move in the game. Students can use the external device to move at a fixed distance. The external device includes the mouse, keyboard, touch screen, and VR device. Table 2 shows the compatibility of roaming mode with external devices. (2) Flying mode: The difference between flying and walking modes is that students can roam in the sky. The implementation of the walking and flying modes is simple and is not described here. (3) Automatic navigation: In automatic navigation mode, we use the A* algorithm [42] to calculate the shortest path according to the distribution of stairs and obstacles. (4) Fast teleportation: This mode is used only for the VR device. When interacting with the VR device, the walking mode makes users feel a certain degree of vertigo. This is why most VR applications use fast teleportation as the main roaming mode. The basic idea of fast teleportation is to emit a Bezier curve from the handle, and the intersection between the ray and the deck or stairs is the teleportation position. ( 5 ) Fast navigation: Students can move directly to the target position by selecting a specific ship equipment or location by UI. 

Table 2. The compatibility of roaming mode with external devices.
section_name: Smoke Simulation Submodule

section_content: Flying Mode
section_name: External Device Walking Mode

section_name: Automatic Navigation Fast Teleportation

section_name: Fast Navigation

section_content: Touch screen VR device
section_name: Mouse and keyboard

section_content: The simulator provides several standard firefighting equipment for firefighting training. Students can operate firefighting equipment from a first-person perspective by controlling external devices. The camera in the scene is regarded as the student's eye. The interaction patterns of the external devices are listed in Table 3. Each external device has three interaction patterns, which serve the same purpose. For example, the left single click of the mouse corresponds to a single click on the touch screen and pulls the trigger of the VR handle. Trigger; touchPad; grip A flowchart of equipment interaction is shown in Figure 6. We set the maximum interactable distance L for each firefighting equipment. When the student begins interacting, the simulator determines whether the distance D between the equipment and camera is less than L. If D < L, the equipment can be operated, and its status changes. Otherwise, the simulator prompts that the operating distance is too far. In addition, if the student operates the equipment in the wrong steps, the simulator provides the corresponding correct steps.
section_name: Equipment Interaction Submodule

section_content: In practice, fire drills are performed by the group. Hence, the simulator provides a collaborative working mechanism. Students can choose different roles to log into the simulator, such as captains, third officers, fire detective, and firefighters. The simulators are interconnected by a local area network or the Internet. During training, the changes in equipment and scenes are synchronized with the other simulators using this submodule. Students perceive each other's existence, behavior, and work status by observing the behavior of the virtual avatars of other students. Moreover, students can communicate and complete drills collaboratively through voice and text messages. 

This paper adopts a client-server network mode to ensure that each terminal simulator shares the same virtual scene. A simulator creates a room as a server, and other simulators are connected to the server as clients. When the student in the client operates the device, the simulator sends the device status and operational data to the server. Then, the server sends the data to each client for synchronization. If a client disconnects and then reconnects during training, the server synchronizes the data of the current scene to the client to ensure that the scene of the reconnected client is consistent with that of the other simulators.
section_name: Multi-Person Collaboration Submodule

section_name: Results and Discussion

section_content: We test our method on two benchmarks, as follows, to validate the correctness of our method. Furthermore, we present the flame simulation method based on the conclusions drawn from the benchmark at the end of this subsection. 

In Figure 7, we compare the jets with different regularization term R. In this example, we emit a vortex ring consisting of 200 vortex segments every five time steps, whose normal faces up. We observe that a big R produces fewer vortices, but the vortex structure is clearer. A small R can capture more fluid details, making the fluid represent a turbulent state. In addition, we give the induced velocity profiles of a vortex segment with different R. It can be seen from Figure 8a that the induced velocity first rises with the increase of distance r and then rapidly decreases after reaching the peak. The smaller the R, the higher the peak. This also leads to a larger velocity gradient around the vortex segment with a smaller R. The simulation results are consistent with this property. Furthermore, to evaluate the turbulent details induced by different R, we employ the Q-criterion widely used in CFD for vortex core measurements [43]. The regions of positive Q-criterion correspond to the strong vortical structures [44]. The Q-criterion is formulated as follows:

where X 2 F represents the square of the norm of the matrix X, B = 0. 5(J + J T ), A = 0. 5(J -J T ), and J is the Jacobi matrix of velocity. We calculate the Q-criteria of the tracer particles' positions at each time step for the three cases in Figure 7. Figure 8b gives the number of tracer particles with positive Q-criterion Q+. We observe that Q+ grows faster in the case with smaller R, which indicates that the case with small R has more vortex structures and details. This is consistent with the results shown in Figure 7. The second benchmark is an example of jets with different viscosity coefficients ν. The motivation for performing this benchmark is to demonstrate that the parameter ν has a physical meaning and can control the fluid's viscosity. In the jet, the normal of the vortex ring is slightly distorted to break the symmetry. We observe that the larger the ν, the more viscous the fluid. In contrast, a small ν makes the fluid flow faster. By modifying the viscosity coefficient, animators can reproduce specific flow features. 

Based on the characteristics of R, we introduce the method of flame simulation here. Since we are mainly interested in lower-speed combustion, the incompressible equations are sufficient. We use our smoke simulation framework to simulate the flame. Flames produce more complex turbulent and vortex behaviors than smoke due to the larger temperature gradients inside the flame [45]. Therefore, we use a smaller R for the flames to simulate the high-detail and fast-moving flames. In this way, the flames are visually plausible. Some examples of fire simulation are given in this paper later.
section_name: Validations

section_content: The engine room is the most common place where fires occur on board [4]. Severe engine room fires can cause explosion accidents and impair the ship's maneuverability. The cause of engine fire may be human factor, electrical short circuit, or mechanical failure. We consider an engine room fire as an example to introduce the training process of the portable fire extinguisher and fixed-CO 2 fire-extinguishing system. The interactive device is the mouse and keyboard. 

We first give the response plan for the engine fire. In the event of an engine fire, the smoke detection panel in the bridge alarms when it detects the smoke. The duty officer must confirm the alarm and contact the engine room crew to verify the fire. The duty officer then issues a ship-wide warning and notifies the firefighter to put out the fire. The firefighter attempts to extinguish the fire using a portable CO 2 fire extinguisher according to the size and type of fire. If the portable fire extinguisher cannot put out the fire, the firefighter uses the fixed-CO 2 fire-extinguishing system. 

When using the simulator for training, the training process is precisely the same as the response plan. We initialize the smoke and flame in the pipeline, as shown in Figure 10. The students choose different roles to log into the simulator: duty officer A, crew B, and firefighter C. After the smoke detection panel alarm sounds (see Figure 11a ), duty officer A roams to the smoke detection panel and finds that the alarm location is the engine room. Then, A single-clicks the green "reset" button on the panel with the left mouse button and confirms the fire situation. After the firefighter C is notified, C first single-clicks the bottle of the fire extinguisher with the left mouse button to take it out from the wall. Then, C pulls the safety pin out by single clicking the pin. The fire extinguisher can be lifted by single-clicking the operating levers with the left mouse button. At a distance of 1-2 m from the fire, C holds the spray nozzle and presses the operating lever to spray CO 2 (see Figure 11b ). Based on the spatial positions of the flame particles, we calculate the bounding box to detect collisions between the flame and CO 2. We count the number of CO 2 particles entering the bounding box of flame and gradually adjust the emission frequency of the flame particle source to control the flame size. 

If the portable fire extinguisher cannot put out the fire, the fire spreads further (see Figure 12 ), and the firefighter C uses the fixed-CO 2 fire-extinguishing system. The firefighter C first roams in the CO 2 room and opens the cabin valve of the CO 2 pipeline, and then opens the lever and valve of the gas cylinder (see Figure 11c ). After 20 s, CO 2 is released into the engine through the pipeline (see Figure 11d ). Once a fixed-CO 2 fire-extinguishing system is used, a fire can usually be extinguished. After awhile, the firefighter C performs a second fire detection to determine whether the fire has the possibility of reignition. If the flame is completely extinguished, the firefighter C resets the firefighting equipment used in training. For the other special effects of fluid, such as CO 2 and water spray, involved in the equipment operation simulation, we use particle system technology to simulate these phenomena. We build a unified particle system and define the basic properties of the particles, such as color, size, speed, and life-cycle. In addition, texture maps are created for each fluid. Texture maps mainly determine the local appearance of fluid effects, and the overall structure of the fluid is controlled by adjusting the properties such as particle speed and life-cycle. The fire hose in the fixed-water fire-extinguishing system is a flexible object, simulated by the position-based dynamics (PBD) method. We refer readers interested in the PBD method to the literature [46].
section_name: Engine Room Fire

section_content: We introduce a training process for a fixed-water fire-extinguishing system using a container fire. A simulation of a container fire is shown in Figure 13d. A fixed-water fire-extinguishing system requires 2-4 firefighters to operate cooperatively. The simulator sets three roles for training: Sailors 1, 2, and 3. Sailor 1 is responsible for turning the fire pump on. The fire pump sucks the seawater outside the ship to spray water into the container fire through the fire hose. Sailor 2 removes the fire hose (see Figure 13a ) and lays it on the deck, then connects it to the fire hydrant (see Figure 13b ). Sailor 3 removes the fire hose nozzle and attaches it to the hose. After the connection, Sailor 2 opens the fire hydrant valve. Sailor 3 sprays water with a fire-hose nozzle. It is laborious to control the fire hose owing to the high velocity of the water jet. Therefore, Sailor 2 quickly runs to the side of Sailor 3 to assist him in spraying water. If the fixed-water extinguishing system does not extinguish the fire, the fire spreads further to the other container, producing thick smoke (see Figure 14 ). The captain issues an alert to abandon the ship, and the fire drill ends. 

For the convenience of readers to reproduce our method, the implementation details of the thick smoke example are described here. In the initialization step, we first need to sample the containers with fire to determine the position of tracer particles. The sampling numbers of tracer particles for smoke and flame are 400 and 160, respectively. We emit three vortex rings with the normal faces to the ship's port side at the sampling position. The three vortex rings are arranged in sequence along the direction of the bow. In addition, a constant background flow with velocity facing the direction of the ship's port side is added to simulate the effect of wind.
section_name: Container Fire

section_content: We develop a ship firefighting training simulator with a multi-sensory human-computer interaction function. Based on the actual operation process of ship firefighting equipment, we realize a full-process operation simulation of several standard firefighting equipment, including a fixed-CO 2 fire-extinguishing system, fixed-water fire-extinguishing system, and portable fire extinguisher. Students can use firefighting equipment for simulation training in several ways. We propose a physics-based Lagrangian vortex dynamics framework to simulate smoke and fire, which can enhance the environmental realism of virtual ship fire scenes. Through parallel computation, the smoke simulated by our framework can achieve real time. We devise a stable geometric method to solve the stretching term, which can produce rich fluid detail with long-time stability. We employ the PSE method to solve the diffusion term, which can control the fluid's viscosity. The simulator has good behavioral and environmental realism and can be applied to ship firefighting teaching and training of sailing students. Our simulator is the first ship firefighting training simulator that achieves real-time smoke simulation by solving the computational fluid dynamics equation. 

We only simulate the smoke and flame in the open space without considering the interaction between fluid and solid. The boundary handling step in fluid-solid coupling is necessary to simulate fire spread between cabin rooms. However, the boundary treatment method of the vortex method usually requires solving a linear system, which is challenging to apply in real-time applications. We could look at exploring a fast and reasonable boundary treatment method. In addition, the time complexity of calculating the velocity field is O(N 2 ), which makes the system unable to realize the real-time simulation of ultra-large-scale fluid. In the future, we will consider employing the relevant acceleration algorithms, such as the fast multipole method [47] and the octree-based algorithms [48], to improve the computational efficiency of the velocity field. Finally, we could also look at providing more ship firefighting equipment, such as fixed-foam fire-extinguishing systems and automatic sprinkler systems.
section_name: Conclusions

section_content: Funding: This work was supported by the National Natural Science Foundation of China (No. 52071312 and 51939001 ), the Liaoning Province Natural Science Foundation Shipping Joint Fund Project (No. 2020-HYLH-29 ), and Dalian City Science and Technology Innovation Fund Project (No. 2021JJ12GX031 ). Institutional Review Board Statement: Not applicable. Informed Consent Statement: Not applicable.

section_name: Conflicts of Interest:

section_content: Data Availability Statement: Not applicable.

section_content: The authors declare no conflicts of interest.
section_name: Conflicts of Interest: