
Find the damage total of the model based on the hydraulic simulation
get_hydraulic_damage.Rd
Find the damage total of the model based on the hydraulic simulation
Examples
# declaring input and output paths
model_path = list(
data = system.file("extdata", package = "floodam.building"),
output = tempdir()
)
# analyzing model 'adu_t' of type 'adu' using the sequential steps *load*
# (load model data), *extract* (extract model data) *hydraulic*
# and *damaging*
model = analyse_model(
model = "adu_t",
type = "adu",
stage = c("load", "extract", "hydraulic", "damaging"),
path = model_path,
dam_by_room = TRUE
)
#> Loading model 'adu_t'...
#> - Structure of building.xml of 'adu_t' has been successfully checked
#> ... successful
#> Extracting building information for 'adu_t'...
#> - extracted:
#> - parameter
#> - storey
#> - room
#> - wall
#> - opening
#> - coating
#> - furniture
#> - missing (not found):
#> ... Informations successfully extracted for 'adu_t'
#> Computing some values for 'adu_t'...
#> ... Informations successfully extracted for 'adu_t'
#> Computing damage for 'adu_t'...
#> ... Damaging successfully computed for 'adu_t'
#> Extracting input data for hydraulic model for 'adu_t'...
#> ... converting hydraulic input data in 'adu_t' to meters
#> ... hydraulic input data in 'adu_t' succesfully converted to meters
#> ... hydraulic input data successfully extracted for 'adu_t'
#> End of analysis for 'adu_t'. Total elapsed time 0.97 secs
#> More information availabe at /tmp/RtmpRxWMul/model/adu/adu_t/adu_t.log
# generate limnigraph
flood = generate_limnigraph(
time = c(0, 300, 900),
depth = cbind(external_1 = c(0, 3, 0)),
external = list(
external_1 = c("wall_A", "wall_B", "wall_C", "wall_D", "wall_E",
"wall_F", "wall_G", "wall_H"))
)
#> generating limnigraph ...
#> limnigraph successfully generated
hydraulic = analyse_hydraulic(
model = model,
limnigraph = flood,
sim_id = "test",
stage = c("hydraulic", "damaging")
)
#> Simulating hydraulics for 'adu_t'...
#> ... hydraulics successfully modeled for 'adu_t'
#> ... damaging successfully computed for 'adu_t'
#> End of analysis for 'adu_t'. Total elapsed time 0.23 secs
hmax = c(room_1 = 0.38, room_2 = 0.4, room_3 = 0.38, room_4 = 0.38,
external_1 = 3)
get_hydraulic_damage(hmax, model, flood[["external"]])
#> room_1 room_2 room_3 room_4 external_1 total
#> damage 2663.12 1193.31 2863.12 6013.12 2649.54 15382.21