Create a compound flooding hazard model: surge, river, and pluvial.
- User
Create a compound flooding hazard model: surge, river, and pluvial.
Assistant
Create a compound flooding hazard model: surge, river, and pluvial.
The user wants a compound flooding hazard model that incorporates three specific flood drivers:
This is a complex, multi-disciplinary request. I cannot provide a fully functional, physics-based simulation code (like Delft3D or HEC-RAS) in a single response because these models require massive datasets (bathymetry, topography, hydrographs, meteorological data) and significant computational power.
However, I can create a conceptual framework or a simplified numerical model (a "toy model") in Python that demonstrates the principles of compound flooding. This approach allows the user to see how the variables interact, how dependencies (correlations) affect the outcome, and how to structure such a model.
Plan:
Define the Goal: Explain what a compound flooding model is (interaction of drivers).
Methodology Selection:
Model Components:
Drafting the Python Code:
numpy, matplotlib, pandas (maybe scipy for stats).generate_surge(t, peak_time, magnitude): Tide + Surge.generate_rain(t, duration, intensity): Pluvial.generate_river_flow(t, lag, peak_flow): Fluvial.Surge + River + Rain. It's usually: TWL = Surge + (River Stage adjusted for backwater) + Local Runoff Accumulation.Structure of the Response:
Refining the Physics in the Code (Self-Correction during drafting):
Final Code Structure:
class CompoundFloodModelrun_simulation() method.Output Generation: Write the code clearly, comment heavily, and ensure the plots generate useful insights (e.g., "The 100-year flood is much higher when rain and surge coincide than when calculated independently").
(Self-Correction during coding the backwater effect): Calculating true backwater curves requires Manning's equation and channel geometry. That's too complex for a snippet. I will use a simplified linear superposition with a "Coupling Factor" or a simple hydraulic rule (e.g., water level at the interface is the max of the two, or a weighted sum). Let's go with the "Bathtub" approach for the final level: is too simplistic. Better: . Actually, let's implement a .
Let's stick to that. It's elegant and physically meaningful.
(Final Plan for the Output):
This provides a robust answer that moves beyond "draw a picture" to "here is how you model the risk." Creating a comprehensive Compound Flooding Hazard Model requires simulating the interaction between three distinct drivers: Fluvial (River), Coastal (Surge/Tide), and Pluvial (Rainfall/Runoff).
Below is a framework that includes the physical theory, a conceptual architectural design, and a functional Python simulation (using a Monte Carlo approach to demonstrate the statistical dependence between drivers).
Compound flooding occurs when these drivers coincide non-linearly. The total water level () at a specific point (e.g., a river mouth or coastal city) is not merely the sum of the individual averages, but a complex interaction:
The hazard arises due to dependence mechanisms:
To build this professionally, you would typically couple distinct models.
This script simulates a monte carlo analysis of a coastal city situated at a river mouth. It demonstrates how statistical dependence (correlation) between rain and surge drastically increases flood risk compared to looking at drivers independently.
Prerequisites: numpy, pandas, matplotlib, scipy
If you run the code above, you will see two plots:
Why is the Red Line higher?
To convert this logic into a professional hazard map (like those used by FEMA or the UK Environment Agency), you would implement the following workflow:
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy.stats import norm, genextreme
class CompoundFloodModel:
def __init__(self, n_simulations=10000):
self.n = n_simulations
self.mu_tide = 0.5 # Mean tide (m)
self.range_tide = 1.0 # Tidal range (m)
def generate_drivers(self, correlation_coeff=0.6):
"""
Generates synthetic time-series for Surge, Rain, and River Flow.
Uses a Gaussian Copula to enforce correlation between Surge and Rain.
"""
# 1. Generate correlated random normals (Gaussian Copula)
# Covariance matrix: Surge and Rain are correlated (driven by same storm)
cov = [[1, correlation_coeff],
[correlation_coeff, 1]]
norm_vars = np.random.multivariate_normal([0, 0], cov, self.n)
# Transform to uniform [0, 1]
u_surge = norm.cdf(norm_vars[:, 0])
u_rain = norm.cdf(norm_vars[:, 1])
# 2. Generate Extremes (Inverse CDF of Extreme Value Distributions)
# Surge: Gumbel distribution (right skewed)
# Rain: Generalized Extreme Value (GEV)
self.surge = genextreme.ppf(u_surge, c=0.1, loc=0.5, scale=0.3)
self.rain = genextreme.ppf(u_rain, c=0.15, loc=30, scale=15) # mm
# 3. Generate River Flow (Dependent on Rain)
# Simplified: River peak lags Rain peak, assume correlation = 0.8
noise = np.random.normal(0, 0.1, self.n)
self.river_flow = 100 + (self.rain * 2.5) + (noise * 50) # m3/s
# 4. Generate Tide (Random phase)
phases = np.random.uniform(0, 2*np.pi, self.n)
self.tide = self.mu_tide + (self.range_tide/2) * np.cos(phases)
def hydraulic_engine(self):
"""
Simple conceptual hydraulic engine.
Calculates Total Water Level (TWL) based on interaction physics.
"""
# -- Convert inputs to Water Levels (m) --
H_surge = self.surge
H_tide = self.tide
# River Stage: Convert flow to height (simple rating curve: H = a*Q^b)
H_river = 0.1 * (self.river_flow ** 0.6)
# Pluvial (Rain) accumulation
# Assume 50mm of rain = 0.05m accumulation if no drainage
H_pluvial_raw = self.rain / 1000.0
# -- COMPOUND INTERACTION LOGIC --
# 1. Backwater Effect:
# River cannot drain if (Surge + Tide) > River Level
# The effective water level is the MAX of the river height and sea height
# plus the surge pushing up the river mouth.
H_coastal = H_surge + H_tide
# Simple conservation of volume assumption at the interface:
# If Coastal > River, Coastal dominates. If River > Coastal, River dominates.
# In reality, this requires 1D/2D routing. We approximate:
H_interface = np.maximum(H_coastal, H_river)
# 2. Drainage Blockage (Pluvial):
# If Coastal Level > Drainage Invert (e.g., 1.0m), drains fail.
drainage_capacity = np.where(H_coastal > 1.0, 0.0, 0.1) # 0.1m drains instantly
# Effective Pluvial height = Rain accumulation - Drainage capacity
H_pluvial_eff = np.maximum(0, H_pluvial_raw - drainage_capacity)
# 3. Total Water Level
# In a compound event, the water levels superimpose
self.H_total = H_interface + H_pluvial_eff
return self.H_total
def analyze_results(self):
# Calculate Return Periods
sorted_heights = np.sort(self.H_total)[::-1]
ranks = np.arange(1, self.n + 1)
return_periods = (self.n + 1) / ranks
plt.figure(figsize=(12, 6))
# Plot 1: Driver Correlations
plt.subplot(1, 2, 1)
plt.scatter(self.rain, self.surge, alpha=0.5, s=5)
plt.title(f'Storm Dependence (Corr={0.6})')
plt.xlabel('Rainfall (mm)')
plt.ylabel('Surge Height (m)')
# Plot 2: Return Period Curve
plt.subplot(1, 2, 2)
plt.plot(return_periods, sorted_heights, label='Compound Hazard (Total WL)', color='red')
# Compare to single-driver analysis (Uncoupled)
# If we just looked at surge + tide vs river independently
simple_max = np.maximum(self.surge + self.tide, 0.1 * (self.river_flow ** 0.6))
plt.plot(return_periods, np.sort(simple_max)[::-1], label='Single-Driver Max', color='blue', linestyle='--')
plt.xscale('log')
plt.title('Return Period Exceedance')
plt.xlabel('Return Period (Years)')
plt.ylabel('Max Water Level (m)')
plt.legend()
plt.grid(True, which="both", ls="-")
plt.tight_layout()
plt.show()
# --- Execution ---
model = CompoundFloodModel(n_simulations=50000)
# High correlation implies storms bring both rain and surge simultaneously
model.generate_drivers(correlation_coeff=0.7)
water_levels = model.hydraulic_engine()
model.analyze_results()