Norfolk, VA Case Study
System set up
Reproducing this script requires a Hydroshare username and password
The data will be saved to a path like
...Local\TRITON_SWMM_toolkit\...\contents.Data source: https://www.hydroshare.org/resource/a4aace329b8c401a93e94ce2a761fe1b/
[4]:
import TRITON_SWMM_toolkit.examples as examples
norfolk_irene = examples.GetTS_TestCases.retreive_norfolk_single_sim_test_case(download_if_exists=False)
norfolk_irene.system.analysis.print_all_yaml_defined_input_files()
/home/dcl3nd/
├── .local/
│ └── share/
│ └── TRITON_SWMM_toolkit/
│ └── examples/
│ └── norfolk_coastal_flooding/
│ └── data/
│ └── contents/
│ ├── norfolk_tests/
│ │ ├── weather_subset.nc
│ │ └── single_sim/
│ │ └── weather_indices.csv
│ ├── shp_watershed/
│ │ └── norfolk_wshed_epsg32147_state_plane_m.shp
│ ├── fullres_dem_m.tif
│ ├── landuse_lookup_tables.csv
│ ├── swmm/
│ │ ├── hague_hydraulics_model_template.inp
│ │ ├── hague_hydrology_model_template.inp
│ │ └── hague_full_model_template.inp
│ ├── landuse_clipped_to_triton_extent.tif
│ ├── software/
│ ├── b_sub_ids_and_mrms_rain_col.csv
│ ├── TRITON_SWMM_definition_template.cfg
│ ├── shp_boundary_condition/
│ │ └── variable_bc.shp
│ └── obs_event_summaries_from_yrs_with_complete_coverage.csv
└── dev/
└── TRITON-SWMM_toolkit/
└── src/
└── TRITON_SWMM_toolkit/
└── examples/
└── norfolk_coastal_flooding/
└── template_compile_triton_swmm.sh
Preparing TRITON-SWMM inputs (system set up)
Generating TRITON-ready manning’s and DEM files
Not that the DEM that is input to this process already has elevations of 9999 \(m\) assigned outside of the watershed aside from a corridor connecting the watershed to the variable water level boundary condition. Also, elevations of 80 \(m\) were assigned to grid cells overlapping with buildings.
[ ]:
# create system level inputs (DEM and mannings)
norfolk_irene.system.process_system_level_inputs(overwrite_if_exists=False, verbose = False)
norfolk_irene.system.plot.dem_and_mannings()
set up simulations
[3]:
# comile
norfolk_irene.system.analysis.compile_TRITON_SWMM(recompile_if_already_done_successfully=False)
# set up simulations
norfolk_irene.system.analysis.prepare_all_scenarios(overwrite_scenarios=False,
rerun_swmm_hydro_if_outputs_exist=False,
verbose=False)
# inspect simulation log
norfolk_irene.system.analysis.print_logfile_for_scenario(event_iloc=0)
{
"event_iloc": 0,
"event_idx": {
"year": 9,
"event_type": "compound",
"event_id": 1
},
"logfile": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/log.json",
"simulation_folder": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1",
"swmm_rainfall_dat_files": {
"156": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/dats/grid-ind156.dat",
"171": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/dats/grid-ind171.dat",
"170": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/dats/grid-ind170.dat",
"155": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/dats/grid-ind155.dat",
"140": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/dats/grid-ind140.dat",
"141": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/dats/grid-ind141.dat"
},
"storm_tide_for_swmm": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/dats/waterlevel.dat",
"scenario_creation_complete": true,
"inp_hydraulics_model_created_successfully": true,
"inp_full_model_created_successfully": true,
"inp_hydro_model_created_successfully": true,
"hydro_swmm_sim_completed": true,
"extbc_tseries_created": true,
"extbc_loc_created": true,
"hyg_timeseries_created": true,
"hyg_locs_created": true,
"inflow_nodes_in_hydraulic_inp_assigned": true,
"triton_swmm_cfg_created": true,
"sim_tritonswmm_executable_copied": true,
"TRITONSWMM_compiled_successfully_for_analysis": true,
"sim_log": {
"run_attempts": {
"2026-01-07T16:43:53-05:00": {
"sim_datetime": "2026-01-07T16:43:53-05:00",
"sim_start_reporting_tstep": 0,
"tritonswmm_logfile": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/tritonswmm_sim_logfiles/2026-01-07T164353-0500.log",
"time_elapsed_s": 0.0,
"status": "not started"
},
"2026-01-07T16:45:43-05:00": {
"sim_datetime": "2026-01-07T16:45:43-05:00",
"sim_start_reporting_tstep": 2,
"tritonswmm_logfile": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/tritonswmm_sim_logfiles/2026-01-07T164543-0500.log",
"time_elapsed_s": 0.0,
"status": "not started"
},
"2026-01-07T16:46:02-05:00": {
"sim_datetime": "2026-01-07T16:46:02-05:00",
"sim_start_reporting_tstep": 0,
"tritonswmm_logfile": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/tritonswmm_sim_logfiles/2026-01-07T164602-0500.log",
"time_elapsed_s": 0.0,
"status": "not started"
},
"2026-01-07T16:47:56-05:00": {
"sim_datetime": "2026-01-07T16:47:56-05:00",
"sim_start_reporting_tstep": 0,
"tritonswmm_logfile": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/tritonswmm_sim_logfiles/2026-01-07T164756-0500.log",
"time_elapsed_s": 0.0,
"status": "not started"
},
"2026-01-07T16:51:28-05:00": {
"sim_datetime": "2026-01-07T16:51:28-05:00",
"sim_start_reporting_tstep": 3,
"tritonswmm_logfile": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/tritonswmm_sim_logfiles/2026-01-07T165128-0500.log",
"time_elapsed_s": 0.0,
"status": "not started"
},
"2026-01-07T16:55:41-05:00": {
"sim_datetime": "2026-01-07T16:55:41-05:00",
"sim_start_reporting_tstep": 0,
"tritonswmm_logfile": "/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/tritonswmm_sim_logfiles/2026-01-07T165541-0500.log",
"time_elapsed_s": 9696.491301317,
"status": "simulation completed"
}
}
}
}
[4]:
# view all files and folders created for the system, analysis, and simulation
norfolk_irene.system.analysis.print_all_sim_files(event_iloc=0)
/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/
├── elevation.dem
├── mannings.dem
└── single_sim/
├── compiled_software/
│ ├── build/
│ ├── compile.sh
│ └── compilation.log
└── sims/
└── 0-year.9_event_type.compound_event_id.1/
├── log.json
├── dats/
├── swmm/
│ ├── hydro.inp
│ ├── hydraulics.inp
│ └── full.inp
├── extbc/
│ ├── tseries.txt
│ └── loc.extbc
├── strmflow/
│ ├── tseries.hyg
│ └── loc.txt
├── TRITONSWMM.cfg
├── build/
│ └── triton
└── tritonswmm_sim_logfiles/
Running a simulation
[ ]:
norfolk_irene.system.analysis.run_all_sims_in_series(mode="single_core", pickup_where_leftoff=True, verbose = False) # only runs 1 sim since there is only 1 event specified in this analysis
[6]:
norfolk_irene.system.analysis.scenarios[0].latest_simlog
[6]:
{'sim_datetime': '2026-01-07T16:55:41-05:00',
'sim_start_reporting_tstep': 0,
'tritonswmm_logfile': PosixPath('/home/dcl3nd/.local/share/TRITON_SWMM_toolkit/examples/norfolk_coastal_flooding/data/contents/system/single_sim/sims/0-year.9_event_type.compound_event_id.1/tritonswmm_sim_logfiles/2026-01-07T165541-0500.log'),
'time_elapsed_s': 9696.491301317,
'status': 'simulation completed'}