Skip to contents

generate_limnigraph() builds external limnigraphs that are used as boundary conditions for interior hydraulic simulation.

Usage

generate_limnigraph(
  model,
  time,
  depth,
  exposition,
  verbose = getOption("floodam_building_verbose")
)

Arguments

model

an object of class model

time

numeric, time steps (in seconds) at which a specific floodwater depth is reached

depth

numeric, depths (in meters) reached at time steps given by time. The vectors must be named after each facade exposed to the flood

exposition

list, contains list of facade exposed to the flood event. Each facade is a list of named vectors of the walls exposed in the same way. Vectors are named after the external they belong to in the model.

verbose

boolean, will floodam tells what it is doing, default to getOption("floodam_building_verbose")

Value

a list containing the generated limnigraph and the corresponding exposition data.

  • limnigraph: A matrix with time in the first column and floodwater depths along the building walls in the subsequent columns.

  • exposition: A list of the matching wall exposures.

Details

Data Structure:

  • time provides the time steps at which the floodwater depth is defined. This element sets the standard length for all limnigraph data.

  • depth Can be a numeric vector of the same length as time(for a single limnigraph) or a matrix whose number of rows is equal to the length of time (for multiple limnigraphs). Each column of the matrix represents a different limnigraph, corresponding to a specific facade.

  • exposition: A list defining the walls exposed to the flood. Each element of the list represents a facade, and contains a named list of walls exposed to that facade.

Naming Conventions:

  • When defining facades or external walls in your model, it's crucial to include the keywords "facade" and "external" in their names (e.g., "facade_west", "external_groundfloor").

  • Ensure that the names used in the exposition list match the names of the external walls in your model.

#' Error Handling:

  • Incompatible lengths: If time and depth have different lengths (number of rows), the function will throw an error. Ensure that both vectors have the same length.

  • Mismatched names: If the column names in depth do not match the names in exposition, the function will throw an error. Verify that the names are consistent.

  • Incorrect wall names: If the wall names in exposition do not exist in your building model, the function may produce unexpected results. Double-check the wall IDs.

Examples


# Limnigraph
limnigraph = generate_limnigraph(
  model = adu_t,
  time = c(0, 300, 900),
  depth = cbind(facade_1 = c(0, 2, 0),
                facade_2 = c(0, 0, 0)),
  exposition = list(
    facade_1 = list(external = c("wall_A", "wall_B", "wall_C", "wall_D")),
   facade_2 = list(external = c("wall_E", "wall_F", "wall_G", "wall_H"))
  )
)
#> generating limnigraph ...
#>  limnigraph successfully generated

# Limnigraph simplified
limnigraph = generate_limnigraph(
   model = adu_t,
  time = c(0, 300, 900),
  depth = cbind(facade_1 = c(0, 2, 0)),
  exposition = list(
    facade_1 = list(external =c("wall_A", "wall_B", "wall_C", "wall_D"))
  )
)
#> generating limnigraph ...
#>  walls not exposed : wall_05 wall_06 wall_07 wall_08
#>  limnigraph successfully generated

# declaring input and output paths

model_basement = analyse_model(
 model = adu_t_basement,
 stage = c("load", "extract", "damaging", "hydraulic")
)
#> Warning: model_name is already a model! Nothing new is loaded.
#> Extracting building information for 'adu_t_basement'...
#> 	- extracted:
#> 		- parameter
#> 		- storey
#> 		- room
#> 		- wall
#> 		- opening
#> 		- coating
#> 		- furniture
#> 	- missing (not found):
#> 	... Informations successfully extracted for 'adu_t_basement'
#> Computing some values for 'adu_t_basement'...
#> 	... Informations successfully extracted for 'adu_t_basement'
#> Computing damage for 'adu_t_basement'...
#> 	... Damaging successfully computed for 'adu_t_basement'
#> Extracting input data for hydraulic model for 'adu_t_basement'...
#> 	... converting hydraulic input data in 'adu_t_basement' to meters
#> 	... hydraulic input data in 'adu_t_basement' succesfully converted to meters
#> 	... hydraulic input data successfully extracted for 'adu_t_basement'
#> Computing damage by room and external wall segment for 'adu_t_basement'...
#> 	... Damaging by room and external wall successfully computed for 'adu_t_basement'
#> End of analysis for 'adu_t_basement'. Total elapsed time 2.00 secs
#> More information availabe at /tmp/R-test/model/adu/adu_t_basement/adu_t_basement.log

# create limnigraph for multi level building
flood = generate_limnigraph(
 model = model_basement,
 time = c(0, 450, 900),
 depth = cbind(facade_1 = c(0, 0.2, 0),
   facade_2 = c(0, 0.5, 0)),
 exposition = list(
   facade_1 = list(
     external_groundfloor = c("wall_A"),
     external_basement = c("wall_A")
   ),
   facade_2 = list(
     external_groundfloor = c("wall_B", "wall_C"))
 )
)
#> generating limnigraph ...
#>  walls not exposed : wall_02 wall_03 wall_04 wall_18 wall_19 wall_20 wall_21 wall_22
#>  limnigraph successfully generated