
Perfom hydraulic analysis for a model
analyse_hydraulic.Rd
analyse_hydraulic()
perfoms hydraulic analysis for a model.
Usage
analyse_hydraulic(
model,
limnigraph,
flood_duration,
opening_scenario = c("combine", "close", "open"),
dt_max = 0.5,
Cd = 0.42,
clearance = getOption("floodam_building_hydraulic_close_opening_clearance"),
sim_id = NULL,
stage = "",
what = c("hmax", "damage"),
detail = TRUE,
verbose = getOption("floodam_building_verbose")
)
Arguments
- model
an object of class model
- limnigraph
numeric, matrix of floodwater depth heights by instant t for each exterior opening exposed to flooding
- flood_duration
numeric, duration of the flood event in seconds, optional; if not provided, calculated using limnigraph
- opening_scenario
character, one of the following options: "open", "close", "combine". See details.
- dt_max
numeric, optional; maxmimum timestep for simulation
- Cd
numeric, optional; discharge coefficient for each opening, default to getOption("floodam_building_hydraulic_discharge_coefficient")
- clearance
numeric, distance between the opening and its frame in centimeters. It represents water tightness for the opening
- sim_id
character, optional; id of simulation
- stage
character, what are the stages that should be done, default to nothing, can be "hydraulic", "damaging", "dangerosity", "graph", "save", "display"
- what
character, outputs to be saved in a temporary directory. Only works along with stage
save
. If detail is FALSE only "hmax" and "damage" can be saved- detail
boolean, if FALSE only returns hmax and damage, else returns all the outputs
- verbose
boolean, will floodam tells what it is doing, default to getOption("floodam_building_verbose")
Value
list of matrix:
h
: water depths in each rooms for each time stepeQ
: water exchanges through openings for each time stepv
: velocity of exchanges through openings for each time stepeS
: wet surface of exchanges through openings for each time stephmax
: peak water depths in each rooms and their peak timedangerosity
(optional) : dangerosity when opening a doordamage
(optional) : damage per room based on peak water depth
Details
stage
pilots what the function is doing:
"hydraulic" mandatory if you want something to be done, computes hydraulics for the model
"damaging" analyse damaging according to the hydraulics
"dangerosity" analyse dangerosity according to the hydraulics
"graph" saves visuals in a temporary directory
"save" saves data written en parameter
what
in a temporary directory"display" displays water level if paramater
detail
is TRUE
opening_scenario
controls the state of openings:
"open": scenario where all openings are open
"close": scenario where all openings are closed
"combine": scenario where all exterior openings are closed and all interior openings are open
If flood_duration
is missing, it is computed from limnigraph
(max time +
half an hour).
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) and *hydraulic*
model = analyse_model(
model = "adu_t",
type = "adu",
stage = c("load", "extract", "hydraulic"),
path = model_path
)
#> 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'
#> 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.35 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 = "hydraulic"
)
#> Simulating hydraulics for 'adu_t'...
#> ... hydraulics successfully modeled for 'adu_t'
#> End of analysis for 'adu_t'. Total elapsed time 0.24 secs