vaws.model package¶
vaws.model.config module¶
Config module
This module defines basic parameter values for simulation.
-
vaws.model.config.
OUTPUT_DIR
¶ “output”
-
vaws.model.config.
INPUT_DIR
¶ “input”
-
vaws.model.config.
DEBRIS_DATA
¶ “input/debris”
-
vaws.model.config.
GUST_PROFILES_DATA
¶ “input/gust_envelope_profiles”
-
vaws.model.config.
HOUSE_DATA
¶ “input/house”
-
vaws.model.config.
FILE_HOUSE_DATA
¶ ‘house_data.csv’
-
vaws.model.config.
FILE_CONN_GROUPS
¶ ‘conn_groups.csv’
-
vaws.model.config.
FILE_CONN_TYPES
¶ ‘conn_types.csv’
-
vaws.model.config.
FILE_CONNECTIONS
¶ ‘connections.csv’
-
vaws.model.config.
FILE_ZONES
¶ ‘zones.csv’
-
vaws.model.config.
FILE_COVERAGE_TYPES
¶ ‘coverage_types.csv’
-
vaws.model.config.
FILE_COVERAGES
¶ ‘coverages.csv’
-
vaws.model.config.
FILE_COVERAGES_CPE
¶ ‘coverages_cpe.csv’
-
vaws.model.config.
FILE_INFLUENCES
¶ ‘influences.csv’
-
vaws.model.config.
FILE_INFLUENCE_PATCHES
¶ ‘influence_patches.csv’
-
vaws.model.config.
FILE_DAMAGE_COSTING_DATA
¶ ‘damage_costing_data.csv’
-
vaws.model.config.
FILE_DAMAGE_FACTORINGS
¶ ‘damage_factorings.csv’
-
vaws.model.config.
FILE_WATER_INGRESS_COSTING_DATA
¶ ‘water_ingress_costing_data.csv’
-
vaws.model.config.
FILE_FOOTPRINT
¶ ‘footprint.csv’
-
vaws.model.config.
FILE_FRONT_FACING_WALLS
¶ ‘front_facing_walls.csv’
-
# debris data
-
vaws.model.config.
FILE_DEBRIS
¶ ‘debris.csv’
-
# results
-
vaws.model.config.
FILE_RESULTS
¶ ‘results.h5’
Note
- regional shielding may be indirectly disabled by setting ‘regional_shielding_factor’ to 1.0
- differential shielding may be indirectly disabled by setting ‘building_spacing’ to 0
-
class
vaws.model.config.
Config
(file_cfg=None, logger=None)[source]¶ Bases:
object
Config class to set configuration for simulation
-
# model dependent attributes
-
house_bucket =
list
-
att_non_float =
list
-
house_bucket =
list
-
debris_bucket =
list
-
# model and wind dependent attributes
-
list_components =
list
-
group_bucket =
list
-
connection_bucket
¶ list
-
zone_bucket
¶ list
-
coverage_bucket
¶ list
-
dic_obj_for_fitting
¶ dict
-
att_time_invariant
¶ list
-
connection_bucket
= [('damaged', 1), ('capacity', 0), ('load', 1), ('strength', 0), ('dead_load', 0)]
-
coverage_bucket
= [('strength_negative', 0), ('strength_positive', 0), ('momentum_capacity', 0), ('capacity', 0), ('load', 1), ('breached', 1), ('breached_area', 1)]
-
debris_bucket
= [('mass', 1), ('frontal_area', 1), ('flight_time', 1), ('momentum', 1), ('flight_distance', 1), ('impact', 1)]¶
-
dic_obj_for_fitting
= {'lognorm': 'vulnerability_lognorm', 'weibull': 'vulnerability_weibull'}
-
group_bucket
= [('damaged_area', 1), ('prop_damaged', 1)]¶
-
header_for_cpe
= ['name', 0, 1, 2, 3, 4, 5, 6, 7]¶
-
house_bucket
= [('profile_index', 0), ('wind_dir_index', 0), ('terrain_height_multiplier', 0), ('shielding_multiplier', 0), ('qz', 1), ('cpi', 1), ('collapse', 0), ('di', 1), ('di_except_water', 1), ('repair_cost', 1), ('repair_cost_by_scenario', 1), ('water_ingress_cost', 1), ('window_breached', 1), ('no_debris_items', 1), ('no_debris_impacts', 1), ('breached_area', 1), ('mean_no_debris_items', 1)]¶
-
list_components
= ['group', 'connection', 'zone', 'coverage', 'debris']¶
-
static
read_damage_costing_data
(filename)[source]¶ Parameters: filename – Returns:
Note: damage costing data may contain
-
static
read_damage_factorings
(filename)[source]¶ Read damage factorings
Parameters: filename – damage_factorings.csv Returns: dict
-
static
read_influence_patches
(filename)[source]¶ Read influence patches
Parameters: filename – influence_patches.csv Returns: dict
-
static
read_influences
(filename)[source]¶ Read influence coefficients
Parameters: filename – influences.csv Returns: dict
-
read_wall_collapse
(conf, key)[source]¶ read roof to wall connections related parameters :param conf: :param key:
Returns:
-
read_water_ingress
(conf, key)[source]¶ read water ingress related parameters :param conf: :param key:
Returns:
TODO:
-
zone_bucket
= [('pressure_cpe', 1), ('pressure_cpe_str', 1), ('cpe', 0), ('cpe_str', 0), ('cpe_eave', 0), ('differential_shielding', 0)]
-
vaws.model.connection module¶
Connection module
This module contains Connection class, ConnectionTypeGroup class, and Influence class.
-
class
vaws.model.connection.
Connection
(name=None, logger=None, **kwargs)[source]¶ Bases:
object
-
dead_load
¶ Returns – sample of dead load following lognormal dist.
-
influence_patch
¶ return:
-
influences
¶ return:
-
strength
¶ return: a sampled strength from lognormal distribution
-
-
class
vaws.model.connection.
ConnectionTypeGroup
(name=None, logger=None, **kwargs)[source]¶ Bases:
object
-
connection_by_grid
¶
-
connections
¶
-
damage_grid
¶
-
damaged_area
¶ Returns – prop_damaged_group, prop_damaged_area
-
prop_damaged
¶ Returns – prop_damaged_group, prop_damaged_area
-
update_influence
(house_inst)[source]¶ Parameters: house_inst – instance of House class Returns:
Notes
influence_patch will be applied regardless of patch_dist influence coeff will be distributed only if patch_dist == 0 dist_dir == ‘col’: coeff will be distributed over the same char. dist_dir == ‘row’: coeff will be distributed over the same number row: chr, col: number
-
vaws.model.coverage module¶
Coverage Module
This module contains Coverage class.
-
class
vaws.model.coverage.
Coverage
(name=None, logger=None, **kwargs)[source]¶ Bases:
vaws.model.zone.Zone
-
breached_area
¶
-
check_damage
(qz, cpi, combination_factor, wind_speed)[source]¶ Parameters: - qz –
- cpi –
- combination_factor –
- wind_speed –
Returns:
-
momentum_capacity
¶
-
strength_negative
¶
-
strength_positive
¶
-
vaws.model.curve module¶
Curve module
This module contains functions related to fragility and vulnerability curves.
-
vaws.model.curve.
fit_fragility_curves
(cfg, dmg_idx)[source]¶ Parameters: - cfg –
- dmg_idx – numpy array
Returns: dict with keys of damage state
-
vaws.model.curve.
fit_fragility_curves_using_mle
(cfg, df_dmg_idx)[source]¶ Parameters: - cfg –
- df_dmg_idx –
Returns: dict with keys of damage state
-
vaws.model.curve.
fit_vulnerability_curve
(cfg, df_dmg_idx)[source]¶ Parameters: - cfg –
- df_dmg_idx –
Returns: dict of fitted_curve
-
vaws.model.curve.
likelihood
(param, data, idx)[source]¶ Parameters: - param – med, std
- data – pd.DataFrame with speed(index), pe1, pe2, pe3, pe4
- idx – index from 1 to 4
Returns:
-
vaws.model.curve.
vulnerability_lognorm
(x, med, std)[source]¶ Return vulnerability in lognormal CDF
Parameters: - x – 3sec gust wind speed at 10m height
- med – exp(mean of log x)
- std – standard deviation of log x
Returns: lognorm.cdf(x, std, loc=0, scale=med)
-
vaws.model.curve.
vulnerability_lognorm_pdf
(x, med, std)[source]¶ Return PDF of vulnerability curve in Lognormal
Parameters: - x – 3sec gust wind speed at 10m height
- med – exp(mean of log x)
- std – standard deviation of log x
Returns: lognorm.pdf(x, std, loc=0, scale=med)
-
vaws.model.curve.
vulnerability_weibull
(x, alpha, beta)[source]¶ Return vulnerability in Weibull CDF
Parameters: - x – 3sec gust wind speed at 10m height
- alpha – parameter value used in defining vulnerability curve
- beta – ditto
Returns: weibull_min.cdf(x, shape, loc=0, scale)
Note
- weibull_min.pdf = c/s * (x/s)**(c-1) * exp(-(x/s)**c)
- c: shape, s: scale, loc=0
weibull_min.cdf = 1 - exp(-(x/s)**c)
while Australian wind vulnerability is defined as
DI = 1 - exp(-(x/exp(beta))**(1/alpha))therefore:
s = exp(beta) c = 1/alpha
vaws.model.damage_costing module¶
- Damage Costing Module - costing profiles for a “type of damage”
- loaded from the database
- imported from house
- referenced by damage module to cost damages
-
class
vaws.model.damage_costing.
Costing
(name=None, **kwargs)[source]¶ Bases:
object
-
envelope_repair
¶
-
internal_repair
¶
-
vaws.model.debris module¶
- Debris Module - adapted from JDH Consulting and Martin’s work
- An instance of Debris class represents a debris item
- generate sources of debris.
- generate debris items from those sources.
- track items and sample target collisions.
- handle collisions (impact)
-
class
vaws.model.debris.
Debris
(debris_source, debris_type, debris_property, wind_speed, rnd_state, logger=None, flag_poly=2)[source]¶ Bases:
object
-
cdav
¶
-
compute_coeff_beta_dist
()[source]¶ Returns: parameters of beta distribution
Notes
The ratio of horizontal velocity of the windborne debris object to the wind gust velocity is related to the horizontal distance travelled, x as below
um/vs approx.= 1-exp(-b*sqrt(x))
- where um: horizontal velocity of the debris object
- vs: local gust wind speed x: horizontal distance travelled b: a parameter, sqrt(rho*CD*A/m)
The ratio is assumed to follow a beta distribution with mean, and
-
flight_distance
¶ Returns – flight distance based on the methodology in Appendix of Lin and Vanmarcke (2008)
Notes
The coefficients of fifth order polynomials are from
Lin and Vanmarcke (2008), while quadratic form are proposed by Martin.
-
flight_time
¶
-
frontal_area
¶
-
landing
¶
-
mass
¶
-
momentum
¶ Returns – momentum of debris object
Notes
The ratio of horizontal velocity of the windborne debris object to the wind gust velocity is related to the horizontal distance travelled, x as below
um/vs approx.= 1-exp(-b*sqrt(x))
- where um: horizontal velocity of the debris object
- vs: local gust wind speed x: horizontal distance travelled b: a parameter, sqrt(rho*CD*A/m)
The ratio is assumed to follow a beta distribution with mean, and
-
trajectory
¶
-
-
vaws.model.debris.
check_impact_by_debris
(debris_item, footprint, boundary)[source]¶ Parameters: - debris_item –
- footprint –
- boundary –
Returns:
-
vaws.model.debris.
create_sources
(radius, angle, bldg_spacing, flag_staggered, restrict_y_cord=False)[source]¶ define a debris generation region for a building :param radius: :param angle: (in degree) :param bldg_spacing: :param flag_staggered: :param restrict_y_cord:
# FIXME !! NO VALUE is assigned to restrict_yordReturns:
vaws.model.house module¶
-
class
vaws.model.house.
House
(cfg, seed, logger=None)[source]¶ Bases:
object
-
breached_area
¶
-
combination_factor
¶ AS/NZS 1170.2 action combination factor, Kc reduction when wind pressures from more than one building surface, e.g., walls and roof
-
compute_damage_index
(wind_speed)[source]¶ Parameters: wind_speed – Returns: repair cost / replacement cost Return type: damage_index Note
- compute sum of damaged area by group
- revised damage area by group by applying damage factoring
- calculate sum of revised damaged area by damage scenario
- apply costing modules
-
compute_qz
(wind_speed)[source]¶ calculate qz, velocity pressure given wind velocity qz = 1/2*rho_air*(V*Mz,cat*Ms)**2 * 1.0e-3 (kN) :param wind_speed: wind velocity (m/s)
Returns: qz
-
cpi
¶
-
damage_increment
¶
-
debris_coverages
¶
-
debris_coverages_area
¶
-
debris_coverages_area_ratio
¶
-
debris_momentums
¶ list of momentums of generated debris items
-
footprint
¶ create house footprint by wind direction Note that debris source model is generated assuming wind blows from East.
Returns: self.footprint
-
front_facing_walls
¶
-
leeward_walls
¶
-
mean_no_debris_items
¶ dN = f * dD where
dN: incr. number of debris items, dD: incr in vulnerability (or damage index) f : a constant factorif we use dD/dV (pdf of vulnerability), then dN = f * (dD/dV) * dV
Returns:
-
no_debris_impacts
¶ total number of impacted debris items
-
no_debris_items
¶ total number of generated debris items
-
profile_index
¶
-
run_debris_and_update_cpi
(wind_speed)[source]¶ Parameters: wind_speed – Returns: self.cpi self.cpi_wind_speed
-
shielding_multiplier
¶ AS4055 (Wind loads for housing) defines the shielding multiplier for full, partial and no shielding as 0.85, 0.95 and 1.0, respectively.
Based on the JDH report, the following percentages are recommended for the shielding of houses well inside Australian urban areas:
Full shielding: 63%, Partial shielding: 15%, No shielding: 22%.Note that regional shielding factor is less or equal to 0.85, then it model buildings are considered to be in Australian urban area.
-
side1_walls
¶
-
side2_walls
¶
-
terrain_height_multiplier
¶
-
total_area_by_group
¶
-
wind_dir_index
¶
-
window_breached
¶
-
windward_walls
¶
-
vaws.model.main module¶
-
vaws.model.main.
set_logger
(path_cfg, logging_level=None)[source]¶ debug, info, warning, error, critical
vaws.model.output module¶
output.py - output module, postprocess and plot display engine
-
vaws.model.output.
plot_heatmap
(grouped, values, vmin, vmax, vstep, xlim_max, ylim_max, file_name=None)[source]¶ Parameters: - grouped – pd.DataFrame (x_coord, y_coord, width, height)
- values – np.array(N,1)
- vmin – min. of scale in color bar
- vmax – max. of scale in color bar
- vstep – no. of scales in color bar
- file_name – file to save
Returns:
vaws.model.stats module¶
-
vaws.model.stats.
calc_big_a_b_values
(shape_k)[source]¶ Parameters: - shape_k – parameter k of GEV III (JHD)
- CDF –
- = u + a*A, s = a * B (m) –
- m (where) – mean, s: std, u: location factor, a:scale factor
- = (B) –
- = –
Returns: A, B
-
vaws.model.stats.
calc_parameters_gev
(mean_est, cov_est, big_a, big_b)[source]¶ Parameters: - mean_est – estimated mean (can be negative)
- cov_est – cov
- big_a – A value
- big_b – B value
- CDF –
- m = u+a*A, s = a*B, cov = s/m (where) –
- = m*cov/B, u = m-a*A (a) –
Returns:
-
vaws.model.stats.
compute_arithmetic_mean_stddev
(m, stddev)[source]¶ compute arithmetic mean and std of x
Parameters: - m – mean of log x
- stddev – std of log x
Returns: arithmetic mean, std of x
-
vaws.model.stats.
compute_logarithmic_mean_stddev
(m, stddev)[source]¶ compute mean of log x with mean and std. of x :param m: arithmetic mean of x :param stddev: arithmetic standard deviation of x :param mu = 2*log: :type mu = 2*log: m) - 0.5*log(v + m**2 :param std = sqrt: :type std = sqrt: log(V/m**2 +1) :param if m is zero, then return -999, 0.0:
Returns: mean and std of log x
-
vaws.model.stats.
sample_gev
(mean_est, cov_est, shape_k, big_a, big_b, rnd_state=None)[source]¶ JHD F(u) = exp{-[1-k(U-u)/a]**(1/k)} where a: scale factor, u: location factor k < 0: Type II (Frechet), k > 0: Type III (Weibull)
scipy.stats.genextreme.rvs(c, loc=0, scale=1, size=1, random_state=None) c: shape (or k)
Parameters: - mean_est –
- big_a –
- big_b –
- cov_est –
- shape_k –
- rnd_state – None, integer or np.random.RandomState
Returns: random sample from the extreme value distribution Type III
vaws.model.version module¶
Single point of truth for version information
vaws.model.zone module¶
- Zone Module - reference storage
- loaded from database.
- imported from ‘../data/houses/subfolder/zones.csv’
- holds zone area and CPE means.
- holds runtime sampled CPE per zone.
- calculates Cpe pressure load from wind pressure.
-
class
vaws.model.zone.
Zone
(name=None, **kwargs)[source]¶ Bases:
object
-
calc_zone_pressure
(cpi, qz, combination_factor)[source]¶ Determine wind pressure loads (Cpe) on each zone (to be distributed onto connections)
Parameters: - cpi – internal pressure coefficient
- qz – free stream wind pressure
- combination_factor – action combination factor
Returns: zone pressure
Return type: pressure
-
cpe
¶ Sample external Zone pressures for sheeting based on TypeIII General Extreme Value distribution
-
cpe_eave
¶ Sample external Zone Pressures for eaves Cpe, based on TypeIII General Extreme Value distribution
-
cpe_str
¶ Sample external Zone Pressures for structure based on TypeIII General Extreme Value distribution
-
differential_shielding
¶ The following recommendations for differential shielding for buildings deemed to be subject to full shielding are made:
- For outer suburban situations and country towns (building_spacing=40m):
- Neglect shielding effects (self.shielding_multiplier=1.0), except for the leading edges of upwind roofs. For the latter an implied pressure ratio of Ms^2 (equal to 0.85^2 for the full shielding cases (Ms=0.85), and 0.95^2 for partial shielding cases (Ms=0.95)) can be adopted.
- For inner suburban buildings (building_spacing=20m) with full shielding (Ms=0.85):
- Reduce the shielding multiplier to 0.7 for upwind roof areas, except adjacent to the ridge (implying a pressure reduction factor of 0.49). Retain a nominal value of Ms of 0.85 for all other surfaces.
- For inner suburban buildings (building_spacing=20m) deemed to have partial shielding (Ms=0.95):
- Reduce the shielding multiplier to 0.8 for upwind roof areas, except adjacent to the ridge (implying a pressure reduction factor of 0.64). Retain a nominal value of Ms of 0.95 for all other surfaces.
differential_shielding_factor = Ms,adj**2 / Ms ** 2
-
-
vaws.model.zone.
get_grid_from_zone_location
(_zone_name)[source]¶ Extract 0 based grid refs from string location (eg ‘A10’ to 0, 9)