| name | stormwater-management |
| description | Skill for integrated stormwater management and green infrastructure design with SWMM modeling, hydrologic analysis, BMP sizing, and MS4 permit compliance. |
| allowed-tools | Read, Grep, Write, Bash, Edit, Glob |
| category | Water and Wastewater Treatment |
| backlog-id | SK-004 |
| metadata | {"author":"babysitter-sdk","version":"1.0.0"} |
| graph | {"domains":["domain:environmental-engineering"],"skillAreas":["skill-area:data-analysis","skill-area:statistical-analysis","skill-area:geospatial-data-analysis"],"workflows":["workflow:experiment-design"],"roles":["role:research-engineer"]} |
Stormwater Management Skill
Integrated stormwater management and green infrastructure design for sustainable urban drainage.
Purpose
This skill provides comprehensive capabilities for stormwater management planning, including hydrologic analysis, green infrastructure design, BMP selection and sizing, SWMM modeling, and MS4 permit compliance analysis.
Capabilities
SWMM Modeling and Simulation
- EPA SWMM model setup and configuration
- Subcatchment delineation and parameterization
- Drainage network modeling
- Long-term continuous simulation
- Design storm analysis
- LID representation and modeling
Hydrologic Analysis
- TR-55 methodology implementation
- Rational method calculations
- SCS Curve Number determination
- Time of concentration estimation
- Unit hydrograph development
- Rainfall-runoff modeling
Green Infrastructure Sizing
- Bioretention facility design
- Permeable pavement sizing
- Rain garden design
- Green roof specifications
- Tree box filters
- Vegetated swales
Detention/Retention Pond Design
- Storage volume calculations
- Stage-storage-discharge relationships
- Outlet structure design
- Emergency spillway sizing
- Sediment forebay design
- Maintenance access planning
Water Quality BMP Selection
- Pollutant removal efficiency analysis
- BMP selection matrix
- Treatment train design
- Sizing for TSS removal
- Nutrient removal considerations
- Cost-effectiveness analysis
Pollutant Load Modeling
- Event Mean Concentration (EMC) analysis
- Annual pollutant load estimation
- Source area contribution analysis
- Loading rate calculations
- Reduction target setting
Low Impact Development Integration
- Site-level LID planning
- Watershed-scale LID analysis
- LID retrofit opportunities
- Performance monitoring design
- Adaptive management frameworks
MS4 Permit Compliance Analysis
- NPDES requirements interpretation
- MCM implementation tracking
- TMDL compliance assessment
- Monitoring program design
- Annual report preparation
Prerequisites
Installation
pip install numpy scipy pandas matplotlib
Optional Dependencies
pip install swmm-api pyswmm
pip install geopandas shapely
pip install plotly folium
Usage Patterns
Rational Method Calculations
import numpy as np
from dataclasses import dataclass
from typing import Dict, List, Tuple
@dataclass
class CatchmentData:
"""Catchment characteristics"""
area_acres: float
runoff_coefficient: float
time_of_concentration_min: float
description: str = ""
class RationalMethod:
"""Rational method for peak runoff calculation"""
def __init__(self):
self.idf_coefficients = {
2: {'a': 100, 'b': 10, 'c': 0.8},
5: {'a': 120, 'b': 10, 'c': 0.8},
10: {'a': 140, 'b': 10, 'c': 0.8},
25: {'a': 160, 'b': , : },
: {: , : , : },
: {: , : , : }
}
() -> :
coef = .idf_coefficients.get(return_period, .idf_coefficients[])
intensity = coef[] / (tc_min + coef[]) ** coef[]
intensity
() -> :
C = catchment.runoff_coefficient
I = .rainfall_intensity(catchment.time_of_concentration_min, return_period)
A = catchment.area_acres
Q = C * I * A
Q
() -> :
total_area = (a a, c subareas)
weighted_c = (a * c a, c subareas) / total_area
weighted_c
() -> :
tc = * (length_ft ** ) * (slope_pct ** -)
tc
RUNOFF_COEFFICIENTS = {
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
:
}
rational = RationalMethod()
subareas = [
(, RUNOFF_COEFFICIENTS[]),
(, RUNOFF_COEFFICIENTS[]),
(, RUNOFF_COEFFICIENTS[])
]
composite_c = rational.composite_runoff_coefficient(subareas)
catchment = CatchmentData(
area_acres=,
runoff_coefficient=composite_c,
time_of_concentration_min=,
description=
)
rp [, , , ]:
Q = rational.peak_runoff(catchment, rp)
()
SCS Curve Number Method
class SCSMethod:
"""SCS Curve Number method for runoff calculation"""
def __init__(self, curve_number: float):
self.cn = curve_number
self.S = (1000 / curve_number) - 10
self.Ia = 0.2 * self.S
def runoff_depth(self, rainfall_inches: float) -> float:
"""Calculate runoff depth (inches)"""
P = rainfall_inches
if P <= self.Ia:
return 0.0
Q = (P - self.Ia) ** 2 / (P - self.Ia + self.S)
return Q
def runoff_volume(self, rainfall_inches: float, area_acres: float) -> float:
"""Calculate runoff volume (acre-feet)"""
Q_inches = self.runoff_depth(rainfall_inches)
volume_ac_ft = Q_inches / 12 * area_acres
return volume_ac_ft
@staticmethod
def composite_cn(subareas: List[[, ]]) -> :
total_area = (a a, cn subareas)
weighted_cn = (a * cn a, cn subareas) / total_area
weighted_cn
() -> :
condition == :
cn = cn_ii / ( - * cn_ii)
condition == :
cn = cn_ii / ( + * cn_ii)
:
cn = cn_ii
cn
CURVE_NUMBERS = {
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
: ,
:
}
pre_cn = SCSMethod.composite_cn([
(, CURVE_NUMBERS[]),
(, CURVE_NUMBERS[])
])
pre_scs = SCSMethod(pre_cn)
post_cn = SCSMethod.composite_cn([
(, CURVE_NUMBERS[]),
(, CURVE_NUMBERS[]),
(, CURVE_NUMBERS[])
])
post_scs = SCSMethod(post_cn)
rainfall =
pre_runoff = pre_scs.runoff_volume(rainfall, area_acres=)
post_runoff = post_scs.runoff_volume(rainfall, area_acres=)
()
()
()
()
()
Bioretention Sizing
class BioretentionDesign:
"""Bioretention facility design"""
def __init__(self, infiltration_rate_in_hr: float = 1.0):
self.infiltration_rate = infiltration_rate_in_hr
def size_for_water_quality(self, drainage_area_sf: float,
impervious_fraction: float,
design_rainfall_in: float = 1.0) -> Dict:
"""Size bioretention for water quality treatment"""
Rv = 0.05 + 0.009 * (impervious_fraction * 100)
wqv_cf = Rv * design_rainfall_in / 12 * drainage_area_sf
ponding_depth_ft = 0.5
drain_time_hr = 24
storm_duration_hr = 2
infiltrated_depth = self.infiltration_rate * storm_duration_hr / 12
min_area_sf = wqv_cf / (ponding_depth_ft + infiltrated_depth)
recommended_area_sf = drainage_area_sf * impervious_fraction *
{
: wqv_cf,
: min_area_sf,
: (min_area_sf, recommended_area_sf),
: ,
: ,
: ponding_depth_ft * / .infiltration_rate
}
() -> :
{
: surface_area_sf,
: {
: ,
: ,
: .infiltration_rate
},
: {
: ,
: ,
: ,
:
},
: {
: ,
:
},
: {
: ,
: [, , ]
},
: {
: ,
: ,
:
}
}
bio = BioretentionDesign(infiltration_rate_in_hr=)
sizing = bio.size_for_water_quality(
drainage_area_sf=,
impervious_fraction=,
design_rainfall_in=
)
()
()
()
details = bio.design_details(sizing[])
()
Pollutant Load Analysis
class PollutantLoading:
"""Stormwater pollutant load estimation"""
EMC = {
'residential': {'TSS': 101, 'TP': 0.38, 'TN': 2.5, 'Zn': 0.14},
'commercial': {'TSS': 69, 'TP': 0.22, 'TN': 2.2, 'Zn': 0.22},
'industrial': {'TSS': 85, 'TP': 0.26, 'TN': 2.0, 'Zn': 0.32},
'highway': {'TSS': 142, 'TP': 0.34, 'TN': 3.2, 'Zn': 0.35},
'open_space': {'TSS': 40, 'TP': 0.10, 'TN': 1.0, 'Zn': 0.05}
}
BMP_REMOVAL = {
'bioretention': {'TSS': 85, 'TP': 60, : , : },
: {: , : , : , : },
: {: , : , : , : },
: {: , : , : , : },
: {: , : , : , : },
: {: , : , : , : }
}
() -> :
emc = .EMC.get(land_use, .EMC[]).get(pollutant, )
volume_l = annual_runoff_in * * area_acres * * *
load_mg = emc * volume_l
load_lbs = load_mg /
load_lbs
() -> :
efficiency = .BMP_REMOVAL.get(bmp_type, {}).get(pollutant, ) /
removed = load_lbs * efficiency
remaining = load_lbs - removed
{
: load_lbs,
: efficiency * ,
: removed,
: remaining
}
loading = PollutantLoading()
area =
annual_runoff =
land_use =
pollutant [, , ]:
load = loading.annual_load(area, land_use, annual_runoff, pollutant)
reduction = loading.load_reduction(load, , pollutant)
(
)
Usage Guidelines
When to Use This Skill
- Stormwater management plan development
- Green infrastructure design
- BMP selection and sizing
- MS4 permit compliance analysis
- Watershed planning and TMDL implementation
Best Practices
- Match design storm to local requirements
- Consider treatment train approaches for multiple benefits
- Plan for maintenance access in design
- Verify infiltration rates with field testing
- Include pre-treatment for high pollutant areas
- Monitor performance for adaptive management
Process Integration
- WW-004: Stormwater Management Planning (all phases)
Dependencies
- numpy, scipy: Numerical calculations
- pandas: Data analysis
- pyswmm: SWMM model interaction (optional)
References
- EPA SWMM Reference Manual
- ASCE Manual of Practice No. 77
- State-specific stormwater design manuals
- NCHRP Report 565 BMP Selection