Skip to contents

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

Usage

generate_limnigraph(
  model,
  time = NULL,
  depth = NULL,
  duration = NULL,
  height = NULL,
  plateau = 0.5,
  symmetry = 0.5,
  exposition = "all",
  verbose = getOption("floodam_building_verbose")
)

Arguments

model

an object of class model

time

numeric, optional; time steps (in seconds) at which a specific floodwater depth is reached. Use together with depth for an explicit limnigraph.

depth

numeric, optional; depths (in meters) reached at time steps given by time. A matrix column represents one boundary series. Use together with time for an explicit limnigraph.

duration

numeric, optional; duration of an automatically generated event in seconds. Use together with height when time and depth are not supplied.

height

numeric, optional; maximum water height in meters for an automatically generated event.

plateau

numeric, optional; proportion of the generated event spent at maximum height, between 0 and 1. Defaults to 0.5.

symmetry

numeric, optional; position of the plateau within the generated event, between 0 and 1. A value of 0.5 gives a symmetric event.

exposition

list or character, exposure of the external walls. Use "all" to expose all external walls. For one limnigraph, provide a wall vector or a named list of wall vectors. For several limnigraphs, provide a list of exposures in the same order as the columns of depth.

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:

  • Explicit mode: time provides the time steps at which the floodwater depth is defined and depth provides the corresponding values. These inputs set 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).

  • Generated mode: when time and depth are omitted, duration and height generate a four-point event with an optional plateau controlled by plateau and symmetry.

  • exposition is a wall vector or list of wall vectors for a single limnigraph. For multiple limnigraphs, it is a list of exposures in the same order as the columns of depth.

Wall names may be supplied either as model wall names or as wall IDs. When wall names are repeated across external rooms, use a named wall list, such as list(external_basement = "wall_A"), to select the intended wall.

#' 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.

  • Incompatible series: depth and exposition must contain the same number of series.

  • 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


# Most simple case
flood = generate_limnigraph(
  model = adu_t,
  height = 1.5,
 plateau = 0.5,
  symmetry = 0.5,
  duration = 3600
)
#> generating limnigraph ...
#>  limnigraph successfully generated

# 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(
    list(external = c("wall_A", "wall_B", "wall_C", "wall_D")),
    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 = c(0, 2, 0),
  exposition = 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 1.70 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(
   list(
     external_groundfloor = c("wall_A"),
     external_basement = c("wall_A")
   ),
   list(external_groundfloor = c("wall_B", "wall_C"))
 )
)
#> generating limnigraph ...
#>  walls not exposed : wall_02 wall_03 wall_04 wall_20 wall_21 wall_22 wall_23 wall_24
#>  limnigraph successfully generated