David Nortes Martínez
hydraulic_model.Rmd
This vignette is going to help you simulate the hydraulic behavior of
the interior of a building using floodam.building
. To do so
you need 3 key inputs:
The library floodam.building
provides methods to
calculate each of these elements. Let us see how.
To determine the two first key inputs, the function
analyse_model()
provides you with the stage
hydraulic. We are using one of the models shipped with with
floodam.building
to make this example:
# set up model to use example shipped with floodam
model_path = list(
data = system.file("extdata", package = "floodam.building"),
output = tempdir()
)
We are going to use the model called adu_t. This model
proposes a 4-room house where three of them are organized around a
central living room. As stages of analysis we are going to specify
c("load", "extract", "hydraulic")
. If you check the object
model
, you can see that inside the slot called
hydraulic there are four different slots containing three
data.frames:
The data.frame rooms corresponds to the first key inputs, while the data.frames exchanges open, exchanges_close and exchanges_combined are variants of the second key input: all openings open, all openings closed but not waterproof, and all exterior openings closed and all interior openings open.
library(floodam.building)
model = analyse_model(
"adu_t",
stage = c("load", "extract", "hydraulic"),
path = model_path
)
To simulate the third key input, floodam.building
provides the function generate_limnigraph()
. This function
generates a limnigraph, i.e. the evolution of floodwater depth against
time. You need to manually provide different parameters to this
function:
The function returns a data.frame with time steps as rows and openings as columns.
flood = generate_limnigraph(
model = model,
time = c(0, 5400, 10800),
depth = c(0,3,0),
exposed_openings = c("door1", "window1", "window2")
)
Once the three key parameters are determined, the simulation of the
hydraulic behavior of the building for the flood event designed can be
simulate. To do so, floodam.building
provides the function
analyse_hydraulics()
. This function takes three mandatory
parameters:
analyse_model()
(see above)generate_limnigraph()
(see above)Additionally, the function can be provided with the parameter sim_id, in order to properly identify the simulation when working within an experimental design.
output_hydrau = analyse_hydraulics(
model = model,
limnigraph = flood,
opening_scenario = "open",
sim_id = "integrated_model"
)
The function returns a list with four slots for four data.frames: