1. Introduction
Flood modeling and analysis has been a vital research area to reduce damages caused by flooding and to assess urban environment resilience against such occurrences [
1,
2,
3]. 2D and 3D hydrodynamic models have been used to provide insight to practitioners and city planners to determine patterns, risks, and anomalies in the environment through visualization of the phenomena. To accomplish a realistic simulation, the environment must be defined accurately, and local dynamics must be realized to analyze such events.
Historical information is a vital resource in flood modeling and analysis, and can contain valuable insight for the study area [
4]. Although the availability of such information might be problematic, if historical information about a region is found, then flood risk analysis can be performed [
5]. Geologic evidence and past stream gauge data left behind due to the occurrence of large floods enable researchers to collect and process information to analyze flood data [
4]. However, many floods are not included in the written history, and consequently it is challenging and expensive to search for historical evidence to assess flooding [
6]. Empirical methods have been investigated to model flooding and how the local dynamics direct or divert flooding [
7,
8]. These observations can be utilized in emergency management scenarios to support decision making [
9,
10]. As empirical flood modeling focuses on the formulation of certain properties of water, it is important to collect sufficient information regarding the study area to be able to provide values to the system. Maximum flood discharge, rainfall intensity, catchment area, and certain coefficients specific to the area being investigated are significant parameters for such formulas. Especially with the prominence of 1D and 2D hydrodynamic simulations to simulate flooding, empirical models can provide a level of correctness to other models [
11].
Hydrodynamic models utilize a mathematical approach to solve a variety of equations depending on the domain to represent the physical behavior of flooding or waters. 1D and 2D models have been used in analyzing and modeling flash floods [
12,
13], decision support systems [
9], and hydrodynamic modeling [
14]. 2D models have been used in the research community for their accuracy in solving full shallow water equations [
6]. By describing an additional dimension, these models are better in describing the flood progression and diffusion compared to 1D simulations. Through the advancement of modern graphics processing units (GPUs), 2D and 3D visualization have been utilized in flood modeling and analysis. Teng et al. [
6] introduce empirical, hydrodynamic, and simplified methods used in flood modeling and underline that hydrodynamic models utilizing 2D and 3D simulations may prove to be better in representing detailed flow dynamics. Furthermore, simplified models can be used best for probabilistic flood risk assessment. Leskens et al. [
15] present a system for analyzing flooding scenarios through 3D visualization. Upon representing the virtual environment, numerical methods that solve 2D hydraulic equations for water flow are used to simulate the flood. Note that 3D representation of the flood helps practitioners to better realize and estimate the impact of a flood. 2D and 3D models have been used for storm surge flood routing visualization [
16], risk estimation [
17], flood modeling and analysis [
15,
18,
19], rainfall forecasting [
20], landslide simulation [
21], and to visualize many other scenarios. Recent works show a move from static visualization to dynamic visualization [
22,
23,
24], to provide more interactive and accessible simulation tools to incorporate virtual environments and dynamic simulation parameters.
There are numerous software packages that offer a collection of models to represent a specialized aspect of flooding. The Hydrologic Engineering Center’s River Analysis System (HEC-RAS) is a numerical model featuring an integrated 1D model to represent flow, and provides an interactive environmental management scenario [
25]. It has commonly been used for evaluating and visualizing river dynamics through performing 1D steady and 2D unsteady river flow calculations to estimate flooding [
26], and has been utilized for the prediction of flood extent, simulation of overland flow, and examination of large floodplains [
27,
28,
29]. Similar to HEC-RAS, MIKE FLOOD is unique software providing a coupled 1D–2D hydrodynamic model [
30] suitable for modeling and accomplishing flood forecasting, flood management, flood risk analysis and hazard mapping, visualization, and evaluation of dam break scenarios and river and coastal flooding [
31,
32]. LISFLOOD-FP [
33] is a 2D hydrodynamic model which excels in visualizing and processing flood inundation efficiently for complex topographies, and it can be used for flood inundation prediction and flood risk assessment [
34,
35]. The existence and usability of these models show the importance of software tools and the need for alternative approaches and methods to investigate the phenomena.
Recently, with the improvements of modern GPUs and the availability of data, 3D simulations and especially particle-based Lagrangian simulations have been investigated in the literature [
6]. Furthermore, recent research has attempted to alleviate the performance issues of particle-based simulation methods, making them feasible for interactive simulations [
36,
37]. Among methods used to simulate flooding, many works utilize smoothed particle hydrodynamics (SPH) [
38,
39]. Furthermore, position-based fluids (PBF) is designed with real-time performance in mind [
40] and consequently, if it can describe the flood extent properly, then the method can be utilized in practical scenarios.
In this work, considering the state-of-the-art approaches discussed above, we built a Lagrangian flood simulation and visualization framework called
FloodSim for realistic and efficient representation of the flooding phenomena. PBF [
40] was utilized for simulating flood, which considers a Lagrangian description and provides benefits over traditional smoothed-particle hydrodynamics (SPH) [
38] methods by providing stability [
41] and alleviating the neighborhood requirement [
40] of traditional SPH, which has an expensive computation of determining a particle’s neighborhood [
36]. By utilizing an efficient flood simulation framework using position-based fluids, real-time performance is provided in a variety of scenarios. An urban environment reconstruction tool called City Maker [
42], which was developed to be utilized alongside
FloodSim, is used to generate 3D digital environment models. Through implementation of a local friction model, rainfall and cloud mechanics, and soil absorption mechanics, dynamic behavior to the environment is implemented, and an approximate description of the study area showing the extent of flooding is acquired.
2. Methodology
In this section, details about the flood simulation and visualization framework FloodSim are provided. Upon discussion of the overall system design, more details about the system are introduced in the following subsections. As the framework consists of multiple components to visualize the phenomena, subsections expand on these components and explain how these individual parts collaborate to provide an effective flood simulation.
2.1. System Overview
FloodSim, the simulation framework built for this study, contains several modules to accommodate various tasks. These modules are initialized to prepare the simulation engine for environmental parameter utilization, smooth fluid particle behavior, and animated rainfall.
Figure 1 shows these
FloodSim modules and required inputs for the system to be provided with critical information.
Position-based fluids [
40] is used as the simulation method. As mentioned earlier, among the computational methods available to render and visualize fluids, position-based fluids is a recent but well-established method that is well optimized for real-time soft interactive simulations. As it is not a common architecture within the flood modeling community, it is worth emphasizing that
FloodSim utilizes it to alleviate some common issues of SPH and to provide an engine which focuses on performance.
As indicated earlier, City Maker [
42] is used to provide the digital environment model for the simulation environment. By parsing OpenStreetMap (OSM) data and extracting significant features, City Maker is flexible enough to provide the required GIS layers to the environment. Furthermore, a particle-based fluids visualization tool [
43] is utilized to visualize the environment in 2D. Using this, clarity in otherwise complex-to-comprehend scenarios can be achieved.
Figure 2 shows an overview of the workflow and how
FloodSim is utilized alongside the tools discussed.
2.2. Global and Local Friction Model
Simulations require several important environmental parameters for the computations to be done accurately. Among these parameters, friction is vital. Objects are given a friction parameter that relates to the roughness of the surface, controlling how freely water flows over those surfaces. Additionally, friction between water particles is considered using viscous forces in the computations.
As part of the position-based fluids framework [
40], two global friction coefficients for static and dynamic friction are provided to account for different scenarios. A static friction coefficient is considered for stable entities in the environment, while dynamic friction coefficients are utilized to define the behavior of moving fluid particles. With static friction, the stability of water particles can be achieved as the coefficient defines the behavior of the particles when they are not in motion. On the other hand, dynamic friction defines the interaction between the surface and the fluid as the particles are moving. However, these coefficients are global friction coefficients and do not define the behavior of different materials in the environment.
Various works underline that some utility of local friction coefficients are used to simulate flood flow [
44,
45,
46], and consequently, our implementation is provided for the users to provide friction values for the features. As our domain is urban environments, differentiating between grasslands, farmlands, road networks, concrete, and any other significant material is imperative. Water flow and soil absorption works differently on different surfaces, and thus local friction coefficients are implemented to define this behavior. To enhance the global friction model with the local friction model, Manning coefficients [
47] are utilized. Utilizing these values with the surface information coming from the flood visualization framework, coefficients are provided. As we focused on extracting the environment from OpenStreetMap data using City Maker [
42], environmental information comes automatically. Nevertheless, if a user chooses to import a manually defined environment, then an appropriate file carrying contextual information must be provided. For this, our system reads environmental information alongside the Manning coefficients file to define areas in the environment with distinct friction parameters. By matching feature types with the values found in the coefficients file, roughness parameters are embedded into the digital model. This process is shown in
Figure 3. In this figure, darker reds show higher friction coefficients while lighter reds indicate lower coefficients.
2.3. Soil Absorption Mechanics
An important component embedded into the simulation framework is the mechanics that define how soil absorption works within the environment. Considering other frameworks developed to visualize water translation, this feature is either left out intentionally or implemented with certain approximations. Although empirical models may utilize the real values for the soil type of the environment after a thorough survey of the region, experimental models such as SPH-based 3D fluid mechanics utilize alternative ways to compensate slower performance due to particle interaction. As underlined earlier, another approach is to leave this feature out if the experiment is about surface runoff simulations and environmental effects over some period are not being tracked.
In the context of this framework, soil absorption does not only refer to the terrain, soil type, and soil saturation, but also refers to the overall absorption of water through citywide stormwater drains. Therefore, FloodSim incorporates a soil absorption engine and expects additional data to simulate the drains. The side inlets and grated inlets are modeled according to the specifications provided by the city, if available. Upon modeling these inlets and placing them properly around the 3D environment, the soil absorption works by removing a certain number of particles per simulation second to represent inlets carrying water away. Consequently, it is vital to find the drain information of the study area. Furthermore, features placed in the environment and the terrain may have different local soil absorption coefficients for realistic behavior of flood waters. Therefore, for each feature drawn on the environment, a local absorption coefficient is provided for further accounting for the different types of soils the environment might have. For example, a park may have a higher intrinsic absorption value than a road. Each soil type contains a saturation level, and when it reaches 100%, absorption stops as the water is considered to be running off the surface. Evaporation is taken into account through an evaporation rate, which can be set up according to the environmental properties of the study area. By utilizing storm sewer data only, this behavior cannot be provided, and therefore a feature level absorption coefficient can be used for representing this absorption mechanic.
As particle-based simulations focus on particles’ interactions with the surrounding environment, too much interaction may cause slow performance, simulation instability, and consequently, visual anomalies. To prevent this, our work proposes global and local soil absorption coefficients for the study area, and particle removal is handled according to these coefficients. Furthermore, storm drain information, if available, is incorporated into this model, and can be visualized in any resolution that the study area requires.
Figure 4 shows an overview of the soil absorption mechanics and how it places absorption coefficients across the virtual environment.
In this figure, reading the information from storm drain data and utilizing other global and local soil absorption coefficients, regions A, B, C and D are defined. These regions have different absorption values and thus water particles are removed at different rates. It is possible to provide a very high resolution by providing unique locations of every single side inlet, sacrificing performance in the process. Nevertheless, for real-time simulation, it might not be the most appropriate solution. An adaptive approach benefits both the demand of performance and detail in description. Consequently, our work provides an adaptive approach in which grid sizes may be altered on demand to provide both performance and detail.
The storm drain document is a vital part of this implementation, as it contains detailed representation of the environment and where the inlets are placed. This document provides longitudes, latitudes, and flow line elevation information for the absorption computation to run appropriately. As such information might be incomplete or unavailable, resolution can be decreased to represent an overall absorption for given areas instead of focusing on individual inlets. This is done through utilization of an adaptive grid [
43] as discussed earlier, by using a quadtree to divide the study area into grids. By predefining a proper level of depth as required for the study, absorption is computed through averaging the inlets’ properties in generated cells. This behavior is then visualized in 3D, through particle removal per simulation second, as part of the flood simulation framework. Overall, this process is efficient because predefined cells contain a fixed number of inlets and therefore computations of absorption coefficients are done prior to fluid simulation.
2.4. Cloud and Rainfall Mechanics
Rainfall must be described in a meaningful way such that its inherent behavior can be properly represented in 2D and 3D simulations. This behavior mostly comes from the observations that we can find for the given study area. Nevertheless, it might also be preferable to conduct experiments instead of following and engineering the existing data for the purpose of visualization. This module utilizes rainfall intensity data to generate instances of cloud objects over the study area to represent the rainfall in the 3D environment. Furthermore, custom clouds can be defined and placed around the map with differing rainfall intensities, sizes, and speeds. Hence, cloud and rainfall mechanics offers full customization of how the particles are added to the simulated environment. Together with soil absorption mechanics, they define the addition and removal of particles from the environment and thus are vital components of the simulation for the purpose of efficiency.
Cloud objects are formed using several parameters to describe the rainfall. These objects are read from a cloud configuration file, which holds references to the clouds with their identifiers, position, rainfall, and rainfall intensity. At this point, it is possible to activate the clouds to make the rainfall occur, but this is normally done dynamically using cloud animation objects to dictate cloud behavior in the simulation. A vector keeps track of the cloud references and the objects get processed at every time step. There is no limit to the maximum number of clouds that can be generated in the study area. Nonetheless, there is a hard particle number limit for real-time simulation purposes, which might stop clouds producing additional rainfall.
Figure 5 shows a representation of a cloud object.
Cloud position is derived from the geographic coordinates found in the cloud configuration file. In most cases, this information is implemented manually and therefore initial evaluation of the rainfall data may be required. Upon checking available rainfall data for the city, practitioners can divide the city into several subsections, define clouds, or areas where rainfall occurs, and then input the expected rainfall amount for the given area.
Cloud animation objects are extensions of cloud objects. Each cloud object comes with an additional cloud animation object associated with itself. These cloud animation objects carry keyframe information to specify important changes over time such as cloud movement and rainfall intensity changes. Moreover, an active cloud can be deactivated after a certain amount of time. The keyframes contain start and end timestamps to define an animation. When the cloud animation objects are loaded into the scene, the vectors containing these objects are passed to the visualization engine. At this stage, the visualization engine restructures the data and processes keyframe information as the time passes. Multiple timers are utilized to account for the CPU time, simulation time, and animation times and therefore it is possible to slow down or speed up these animations.
Available animations provided for cloud animation objects are the creation, translation, and deletion of clouds; altering rainfall intensity; changing the direction of rainfall; and altering the width of clouds. Some of these actions (e.g., altering rainfall intensity) can be initialized as gradually changing over time. If gradual change is not set up, then an immediate change occurs at a given timestamp. The timestamp feature utilizes 24-h notation to determine the time of events written in a cloud animation configuration file.
If rainfall data can be acquired, then cloud animation objects can be helpful in designing a real-world scenario and evaluating the results for calibrating the local dynamics of the system. Utilizing the acquired timestamps, the cloud configuration files can carry real-world precipitation information and visualize the event in the system through appropriate calibration of the local environment.
Figure 6 shows a representation of how cloud animation data files work and how they help the simulation engine to visualize cloud information over time.
An advantage of using the cloud animation objects is that the simulation environment becomes quite extensible and allows users to manipulate information in real time. Furthermore, such conditions can be recorded and logged into a data file for rebuilding the same environment. Although the randomization in the wind factor, rainfall splatter, and GPU processing would alter the visualization to some extent, it would be possible to recreate similar conditions and evaluate the environment parameters. Another advantage is provided through the provision of dynamic parameters for the cloud. Not only the position and rainfall intensity, but any other parameter can be given values and be animated over time. This allows for interpolation of the unknown data, as the user can define a command like “increase the intensity by 5 mm over an hour”. Therefore, rather than utilizing abrupt changes of environmental parameters, a smooth transition can occur, which would potentially help practitioners incorporate their data into the simulation environment.
2.5. Workflow
The simulation engine is prepared through reading scene descriptions. These data files contain information about the environment, such as terrain and object placement, simulation parameters, and several other pieces of environmental information. Initially the environment is loaded as the terrain for the scene. Terrain objects can be a singular unified entity or can consist of hundreds of separate pieces. The advantage of utilizing a unified body is that the simulation runs more efficiently. As the object does not contain subparts to be evaluated further once particle interaction occurs, the computation is handled in a straightforward fashion. The disadvantage is obviously the lack of feature differentiation, and therefore it might be detrimental if local friction coefficients are to be utilized. Conversely, the advantage of utilizing multi-part terrain is the inclusion of a local friction model with the cost of additional computation per feature placed in the terrain. This might come with a substantial loss of performance, especially for larger areas, considering that one of our main focuses is to provide an efficient flood simulation framework.
After the terrain and some simulation parameters (e.g., maximum number of particles) are initialized as defined by the user, environmental configuration files are read. By reading these files and initializing data structures to be utilized in the computation, the environment is organized for the simulation. After this, a digital elevation model (DEM) is generated from the terrain to be used for depth computation once the simulation begins. With the creation and storage of the height map, the simulation starts executing and producing results as requested.
Initially, the depth map and related storage, such as a regular grid and a quadtree with provided maximum depth, are created to support 2D tracking of depth. With this approach, the simulation can be visualized in a mini map placed at the bottom-right of the simulation environment alongside 3D information in the main simulation screen. This mini map provides depth information as the water traverses the environment. By providing a 2D view of the environment while getting the benefits of 3D simulation, as underlined in [
22], we provide better clarity of the depth information of flooding across the study area.
Upon initialization of the 2D mapping module [
43], the environment and relevant objects are updated per frame. The clouds are set to emit the water particles with given rainfall intensity and direction. Upon creation of these particles, the buffers are utilized to track different aspects of the particles (positions, velocities, densities, and several other parameters). These parameters are vital for the position-based fluids simulation environment to work properly.
Every simulation second, the engine sends an “absorb” message to the soil absorption module, which is responsible for checking environmental soil absorption coefficients and processing the requests coming from the simulation engine. If the module recognizes the particles touching the soil, it utilizes the absorption rates defined for the sections of the simulation environment to remove these particles from the environment. The cloud animation data file is read during scene initialization, and therefore the simulation engine has the knowledge of all future events at this stage. The engine considers the current simulation time and examines the timestamp information embedded into cloud animation objects to estimate if new events will occur at the current timestamp. Furthermore, if cloud parameters are currently being animated, the simulation engine calculates the parametric changes that will occur in the next frame and passes this information to the drawing component. In the next frame, the drawing component flushes the updated parameters.
These operations continue until the simulation is halted per user request. For the purpose of this work, we considered refreshing the parameters and processing the depth information every second, setting the required frame rate to 60 frames per second. If efficiency is not a concern, this parameter could possibly be initialized using milliseconds instead of seconds. A typical workflow in
FloodSim is represented in
Figure 7.
4. Conclusions and Future Work
The framework described in this work provides a workflow to demonstrate the usability of position-based fluids to simulate and visualize flooding events. As position-based fluids are more suited for real-time simulations than some traditional SPH models, the provision of this framework allows for real-time interaction through efficient particle representation. The addition of friction model, cloud and rainfall mechanics, along with the soil absorption provides dynamic representation of the study area. As the results show, by using environmental data through SRTM elevation with 30 m resolution, river flooding simulations can be performed with a realistic representation of the study area. As the purpose of the framework is to have an efficient position-based fluids framework for visualizing and simulating flooding, the results are appropriate.
FloodSim was designed with parameters such as rainfall, soil absorption, and water drainage to simulate a wide variety of flooding scenarios. This work presents a new flood visualization and simulation framework with position-based fluids by providing the benefits of position-based dynamics [
40] to contain particles and prevent usual neighborhood problems [
36] that occur in SPH [
38], contributing efficiency. To our knowledge, the position-based fluids approach has not been investigated in depth in the flood modeling community. Consequently, the provision of this framework yields an alternative approach for the visualization and simulation of flooding phenomena. Such a framework, with further calibration to incorporate a quantitative flood model, can be utilized to test different scenarios regarding flooding to visualize a city’s or an area’s resilience against flooding events. Considering that empirical and many hydrological models provide a grid-based approach to describe the fluid flow, our model utilizes a particle-based Lagrangian approach which has certain advantages over such models to provide more insight about the local fluid particle behavior. Although it can be underlined that Eulerian models visualize continuum properly, Lagrangian models with more advanced GPUs help experiment with the study area utilizing particle interaction. Consequently, this work can be used alongside other frameworks to provide a different perspective regarding the study area since it allows refinements in the hands of practitioners to describe the local dynamics of an environment more precisely.
As underlined earlier, many of the environmental parameters are loaded through the component reader. These parameters are not altered after the initial processing. Simulating a fully dynamic environment with shifting wind direction over time, intensifying the rain, and considering soil erosion and soil absorption could yield interesting results. Such scenarios should be implemented and experimented with in the future to provide a more precise simulation framework for utilization in real-world scenarios such as risk assessment and emergency management. Upon the description of a more detailed flood model for specialized purposes, recent flood models in the industry could be compared with FloodSim to recognize hte advantages and disadvantages of utilizing a position-based approach.
Further investigation must be done to clarify scalability issues of the flood simulation framework. Although the data can be parsed and large city models can be reconstructed with the current approach, SRTM data provides low-resolution elevation information that prevents us from proceeding with a higher-resolution simulation. City-wide or region-wide simulations will be incorporated in future work with the utility of higher-resolution elevation data.