7.1.2.1.3. infrarisk.src.physical.water package
7.1.2.1.3.1. infrarisk.src.physical.water.water_network_model module
Functions to implement water network simulations.
- infrarisk.src.physical.water.water_network_model.add_control_system(wn, list_of_tanks, list_of_pumps, controller_id=None)
Adds a controller system to the water network.
- Parameters:
wn (wntr water network object) – Water network model object.
list_of_tanks (list) – List of tanks controlled by the controller system.
list_of_pumps (list) – List of pumps controlled by the controller system.
id (integer) – The ID of the controller to be added.
- infrarisk.src.physical.water.water_network_model.add_discharge_pipe(wn, tank_id, elevation)
Adds a discharge pipe to the tank of interest.
- Parameters:
wn (wntr water network object) – Water network model object.
tank_id (string) – The ID of the tank to which the discharge pipe is to be added.
elevation (float) – The elevation of the discharge pipe.
- infrarisk.src.physical.water.water_network_model.add_discharge_pipe_actuator_system(wn, controller_id, list_of_tanks)
Adds a discharge pipe actuator system to the water network.
- Parameters:
wn (wntr water network object) – Water network model object.
- infrarisk.src.physical.water.water_network_model.add_pump_actuator_system(wn, controller_id, list_of_pumps)
Adds a pump actuator system to the water network.
- Parameters:
wn (wntr water network object) – Water network model object.
- infrarisk.src.physical.water.water_network_model.add_tank_level_sensor_system(wn, controller_id, list_of_tanks)
Adds a sensor system to the water network.
- Parameters:
wn (wntr water network object) – Water network model object.
controller_id (string) – The ID of the controller to which the sensor system is to be added.
list_of_tanks (list) – List of tank IDs for which tank level sensors are to be assigned.
- infrarisk.src.physical.water.water_network_model.add_universal_control_system(wn, controller_id=None)
Adds single control system to the water network.
- Parameters:
wn (wntr water network object) – Water network model object.
- infrarisk.src.physical.water.water_network_model.generate_base_supply(wn_original, directory)
Runs demand driven simulation (DDA) simulation under normal network conditions and stores the node demands.
- Parameters:
wn (wntr water network object) – Water network model object.
directory (string) – The directory to which the node demands are to be saved.
- infrarisk.src.physical.water.water_network_model.generate_base_supply_pda(wn_original, dir)
Runs pressure-dependent demand simulation (PDA) simulation under normal network conditions and stores the node demands.
- Parameters:
wn (wntr water network object) – Water network model object.
dir (string) – The directory to which the node demands are to be saved.
- infrarisk.src.physical.water.water_network_model.generate_pattern_interval_dict(wn)
_summary_
- Parameters:
wn (_type_) – _description_
- infrarisk.src.physical.water.water_network_model.get_valves_to_isolate_water_node(integrated_network, node)
- infrarisk.src.physical.water.water_network_model.get_water_control_dict()
Creates a dictionary of major water distribution system contol components.
- Returns:
Mapping of control component abbreviations to names.
- Return type:
dictionary of string: string
- infrarisk.src.physical.water.water_network_model.get_water_dict()
Creates a dictionary of major water distribution system components.
- Returns:
Mapping of infrastructure component abbreviations to names.
- Return type:
dictionary of string: string
- infrarisk.src.physical.water.water_network_model.load_water_network(network_inp, water_sim_type, initial_sim_step, cyber_layer=False)
Loads the water network model from an inp file.
- Parameters:
network_inp (string) – Location of the inp water network file.
water_sim_type – The type of water simulation in wntr. Available options are pressure-dependent demand analysis (‘PDA’) and demand driven analysis (‘DDA’).
initial_sim_step (integer) – The initial iteration step size in seconds.
- Returns:
The loaded water wntr network object.
- Return type:
wntr network object
- infrarisk.src.physical.water.water_network_model.run_water_simulation(wn)
Runs the simulation for one time step.
- Parameters:
wn (wntr water network object) – Water network model object.
- Returns:
Simulation results in pandas tables.
- Return type:
ordered dictionary of string: pandas table
- infrarisk.src.physical.water.water_network_model.set_initial_control_system_status(wn, actuator_status=1, sensor_status=1, controller_status=1)
Sets the initial status of the control system components (sensors, actuators, and sensors).
- Parameters:
wn (wntr water network object) – Water network model object.
actuator_status (int, optional) – Initial status of the actuators, defaults to 1
sensor_status (int, optional) – Initial status of the sensors, defaults to 1
controller_status (int, optional) – Initial status of the controller, defaults to 1
- infrarisk.src.physical.water.water_network_model.set_tank_levels(wn, tank_id, tolerance, print_levels=False)
Sets the maximum and allowable range of water levels for the tank.
- Parameters:
wn (wntr water network object) – water network model object.
tank_id (string) – Name of the tank (id).
tolerance (float) – The difference between maximum and allowable tank levels in meters.
- infrarisk.src.physical.water.water_network_model.set_tl_sensor_ef(wn, tank_id, error_factor)
Sets the error factor for the tank level sensor. A value of 1 means no error.
- Parameters:
wn (wntr water network object) – Water network model object.
tank_id (str) – Tank ID.
error_factor (float) – Error factor.