Hydraulic damage

The function get_hydraulic_damage() estimates the total flood damage in each room based on the maximum water levels obtained from the hydraulic simulation.

Input: h_max_by_room (hmax)

The function expects a named numeric vector of maximum water heights (in metres) by room/element (this is the same object typically passed as hydraulic$hmax["z", ]). The special name mean, if present, is ignored. Heights are converted to centimetres inside the function before interpolation. Here is a simple example:

room_1 room_2 facade_1
0.12 0.08 0.5

It compares these peak heights to damage functions defined in the building model. As damage functions have a set step of 10 cm and the peak water heights are numeric, we convert heights to centimetres and use linear interpolation to estimate damages for each room and exposed wall. Heights below a given threshold (threshold_height, in cm) are ignored; the shortest available duration curve under the specified limit (threshold_duration) is selected. If no damage-duration less than or equal to threshold_duration is available the function throws an error and asks the user to construct damage functions with a compatible hazard_range (see analyse_model()). The resulting damages are expressed as absolute values and a total damage value is also provided for the whole building.

Output structure

The function returns a numeric matrix with a single row named damage and one column per room (plus a final total column). Here is a simple example:

room_1 room_2 facade_1 total
1200 800 500 2500