epytc package

Submodules

epytc.arsenite_oxidation_arsenate_attachment_detachment module

Arsenite oxidation and arsenate attachment/detachment module Reactive species (bulk) - Aqueous arsenite (mg/L), Aqueous arsenate (mg/L), Aqueous arsenic (mg/L), Residual chlorine (mg/L), and Total organic carbon (mg/L) Reactive species (wall) - Adsorbed arsenate (mg/sq.m)

class epytc.arsenite_oxidation_arsenate_attachment_detachment.module[source]

Bases: object

Reynolds_number(num2, num3)[source]

Defining Reynolds number

Parameters:
  • num1 (Float) – Pipe flow velocity in metres per second

  • num2 (Float) – Pipe diameter in millimetres

  • num3 (Float) – Kinematic viscosity of water in square metres per second

Returns:

Reynolds number

Return type:

Float

Schmidt_number(num2)[source]

Defining Schmidt number

Parameters:
  • num1 (Float) – Kinematic viscosity of water in square metres per second

  • num2 (Float) – Molecular diffusivity of a bulk phase species in square metres per second

Returns:

Schmidt number

Return type:

Float

Sherwood_number(num2, num3, num4)[source]

Defining Sherwood number

Parameters:
  • num1 (Float) – Reynolds number

  • num2 (Float) – Schmidt number

  • num3 (Float) – Pipe diameter in millimetres

  • num4 (Float) – Pipe length in metres

Returns:

Schmidt number

Returns:

Sherwood number

Return type:

Float

area_per_unit_vol()[source]

Defining area of croos-section

Parameters:

num1 (Float) – Pipe diameter in millimetres

Returns:

Area of cross-section

Return type:

Float

details()[source]

Displaying the information about the MSRT model selected for water quality analysis

Returns:

Details of module

Return type:

String

first_order_reaction(num2, num3)[source]

Defining first-order reaction

Parameters:
  • num1 (Float) – Reaction rate constant

  • num2 (Float) – Concentration value

  • num3 (Integer) – Water quality simulation time step in seconds

Returns:

Solution of first-order ordinary differential equation

Return type:

Float

hydraulic_mean_radius()[source]

Defining hydraulic mean radius

Parameters:

num1 (Float) – Pipe diameter in millimetres

Returns:

Hydraulic mean radius

Return type:

Float

injection_pattern(num1, num2, arr1, arr2, arr3, arr4, str1)[source]

Defining source quality pattern for the injection node(s)

Parameters:
  • num1 (Float/Integer) – Base time period in day(s)

  • num2 (Float) – Variability in the pattern

  • arr1 (List) – Index value(s) of injection node(s)

  • arr2 (Array) – Start time step for the injection in the injection node(s)

  • arr3 (Array) – End time step for the injection in the injection node(s)

  • arr4 (Array) – Input value for the injection in the injection node(s)

  • str1 (String) – Input command for the pattern

Returns:

Values corresponding to source quality pattern at the injection node(s)

Return type:

Array

injection_quality(num2, arr1, arr2, str1)[source]

Defining source quality values for the injection node(s)

Parameters:
  • num1 (Integer) – Number of iterations

  • num2 (Float) – Variability in the random pattern for injection node quality

  • arr1 (List) – Index value(s) of injection node(s)

  • arr2 (Array) – Quality values for the injection node(s)

  • str1 (String) – Input command for the random pattern

Returns:

Values corresponding to source quality at the injection node(s)

Return type:

Array

mass_transfer_coefficient_ars(num2, num3, num4)[source]

Defining mass-transfer coefficient for arsenic

Parameters:
  • num1 (Float) – Molecular diffusivity of arsenic in square metres per second

  • num2 (Float) – Pipe diameter in millimetres

  • num3 (Float) – Pipe flow velocity is metres per second

  • num4 (Float) – Kinematic viscosity of water in square metres per second

Returns:

Schmidt number

Returns:

Mass-transfer coefficient for arsenic

Return type:

Float

mass_transfer_coefficient_cl(num2, num3)[source]

Defining mass-transfer coefficient for chlorine

Parameters:
  • num1 (Float) – Sherwood number

  • num2 (Float) – Molecular diffusivity of chlorine in square metres per second

  • num3 (Float) – Pipe diameter in millimetres

Returns:

Schmidt number

Returns:

Mass-transfer coefficient for chlorine

Return type:

Float

network()[source]

Getting basic details of the network

Parameters:

d (EPANET object) – EPANET model

Returns:

Network details

Return type:

List

pipe_reaction(num2, num3, num4, num5, num6, num7, arr1, arr2)[source]

Defining link reactions for the MSRT model selected

Parameters:
  • num1 (Integer) – Water quality simulation time step in seconds

  • num2 (Integer) – Link index

  • num3 (Float) – Grid index

  • num4 – Link flow velocity in metres per second

  • num5 (Float) – Link diameter in millimetres

  • num6 (Float) – Link length in metres

  • num7 (Float) – Link segment length in metres

  • arr1 (List) – List of variable values

  • arr2 (Array) – Matrix of link concentration values

Returns:

Values corresponding to growth or decay of the concentration of water quality parameters

Return type:

List

reservoir_pattern(num1, num2, arr1, arr2, arr3, str1)[source]

Defining source quality pattern for the reservoir(s)

Parameters:
  • num1 (Float/Integer) – Base time period in day(s)

  • num2 (Float) – Variability in the pattern

  • arr1 (Array) – Start time step for the injection in the reservoir(s)

  • arr2 (Array) – End time step for the injection in the reservoir(s)

  • arr3 (Array) – Input value for the injection in the reservoir(s)

  • str1 (String) – Input command for the pattern

Returns:

Values corresponding to source quality pattern at the reservoir(s)

Return type:

Array

reservoir_quality(num1, num2, arr1, str1)[source]

Defining source quality values for the reservoir(s)

Parameters:
  • num1 (Integer) – Number of iterations

  • num2 (Float) – Variability in the random pattern for source quality

  • arr1 (Array) – Quality values for the reservoir(s)

  • str1 (String) – Input command for the random pattern

Returns:

Values corresponding to source quality at the reservoir(s)

Return type:

Array

species()[source]

Defining the species information of the MSRT module selected

Returns:

Species information of the MSRT module

Return type:

String

tank_reaction(num2, num3, num4, num5, arr1, arr2, arr3)[source]

Defining tank reactions for the MSRT model selected

Parameters:
  • num1 (Integer) – Water quality simulation time step in seconds

  • num2 (Integer) – Present water quality step

  • num3 (Integer) – Tank index

  • num4 (Integer) – Tank volume in previous water quality step

  • num5 (Integer) – Tank volume in the present water quality step

  • arr1 (List) – List of variable values

  • arr2 (Array) – Matrix of initial tank concentration values

  • arr2 – Matrix of tank concentration values

Returns:

Values corresponding to growth or decay of the concentration of water quality parameters

Return type:

List

variables(num2)[source]

Defining variables of the MSRT module

Parameters:
  • num1 (Integer) – Number of iterations

  • num2 (Integer) – Number of variables corresponding to the MSRT module selected

Returns:

Matrix of variable values

Return type:

Array

zero_order_reaction()[source]

Defining zero-order reaction

Parameters:

num1 (Integer) – Water quality simulation time step in seconds

Returns:

Solution of zero-order ordinary differential equation

Return type:

Float

epytc.bacterial_regrowth module

Bacterial regrowth module Reactive species (bulk) - Chlorine (mg-Cl/L), RDOC (mg-C/L), BDOC (mg-C/L), free living bacteria (CFU/L), free dead bacteria (cells/L) Reactive species (wall) - ‘’

class epytc.bacterial_regrowth.module[source]

Bases: object

Reynolds_number(num2, num3)[source]

Defining Reynolds number

Parameters:
  • num1 (Float) – Pipe flow velocity in metres per second

  • num2 (Float) – Pipe diameter in millimetres

  • num3 (Float) – Kinematic viscosity of water in square metres per second

Returns:

Reynolds number

Return type:

Float

Schmidt_number(num2)[source]

Defining Schmidt number

Parameters:
  • num1 (Float) – Kinematic viscosity of water in square metres per second

  • num2 (Float) – Molecular diffusivity of a bulk phase species in square metres per second

Returns:

Schmidt number

Return type:

Float

Sherwood_number(num2, num3, num4)[source]

Defining Sherwood number

Parameters:
  • num1 (Float) – Reynolds number

  • num2 (Float) – Schmidt number

  • num3 (Float) – Pipe diameter in millimetres

  • num4 (Float) – Pipe length in metres

Returns:

Schmidt number

Returns:

Sherwood number

Return type:

Float

details()[source]

Displaying the information about the MSRT model selected for water quality analysis

Returns:

Details of module

Return type:

String

first_order_reaction(num2, num3)[source]

Defining first-order reaction

Parameters:
  • num1 (Float) – Reaction rate constant

  • num2 (Float) – Concentration value

  • num3 (Integer) – Water quality simulation time step in seconds

Returns:

Solution of first-order ordinary differential equation

Return type:

Float

hydraulic_mean_radius()[source]

Defining hydraulic mean radius

Parameters:

num1 (Float) – Pipe diameter in millimetres

Returns:

Hydraulic mean radius

Return type:

Float

injection_pattern(num1, num2, arr1, arr2, arr3, arr4, str1)[source]

Defining source quality pattern for the injection node(s)

Parameters:
  • num1 (Float/Integer) – Base time period in day(s)

  • num2 (Float) – Variability in the pattern

  • arr1 (List) – Index value(s) of injection node(s)

  • arr2 (Array) – Start time step for the injection in the injection node(s)

  • arr3 (Array) – End time step for the injection in the injection node(s)

  • arr4 (Array) – Input value for the injection in the injection node(s)

  • str1 (String) – Input command for the pattern

Returns:

Values corresponding to source quality pattern at the injection node(s)

Return type:

Array

injection_quality(num2, arr1, arr2, str1)[source]

Defining source quality values for the injection node(s)

Parameters:
  • num1 (Integer) – Number of iterations

  • num2 (Float) – Variability in the random pattern for injection node quality

  • arr1 (List) – Index value(s) of injection node(s)

  • arr2 (Array) – Quality values for the injection node(s)

  • str1 (String) – Input command for the random pattern

Returns:

Values corresponding to source quality at the injection node(s)

Return type:

Array

mass_transfer_coefficient(num2, num3)[source]

Defining mass-transfer coefficient

Parameters:
  • num1 (Float) – Sherwood number

  • num2 (Float) – Molecular diffusivity of a bulk phase species in square metres per second

  • num3 (Float) – Pipe diameter in millimetres

Returns:

Schmidt number

Returns:

Mass-transfer coefficient

Return type:

Float

network()[source]

Getting basic details of the network

Parameters:

d (EPANET object) – EPANET model

Returns:

Network details

Return type:

List

pipe_reaction(num2, num3, num4, num5, num6, num7, arr1, arr2)[source]

Defining link reactions for the MSRT model selected

Parameters:
  • num1 (Integer) – Water quality simulation time step in seconds

  • num2 (Integer) – Link index

  • num3 (Float) – Grid index

  • num4 – Link flow velocity in metres per second

  • num5 (Float) – Link diameter in millimetres

  • num6 (Float) – Link length in metres

  • num7 (Float) – Link segment length in metres

  • arr1 (List) – List of variable values

  • arr2 (Array) – Matrix of link concentration values

Returns:

Values corresponding to growth or decay of the concentration of water quality parameters

Return type:

List

reservoir_pattern(num1, num2, arr1, arr2, arr3, str1)[source]

Defining source quality pattern for the reservoir(s)

Parameters:
  • num1 (Float/Integer) – Base time period in day(s)

  • num2 (Float) – Variability in the pattern

  • arr1 (Array) – Start time step for the injection in the reservoir(s)

  • arr2 (Array) – End time step for the injection in the reservoir(s)

  • arr3 (Array) – Input value for the injection in the reservoir(s)

  • str1 (String) – Input command for the pattern

Returns:

Values corresponding to source quality pattern at the reservoir(s)

Return type:

Array

reservoir_quality(num1, num2, arr1, str1)[source]

Defining source quality values for the reservoir(s)

Parameters:
  • num1 (Integer) – Number of iterations

  • num2 (Float) – Variability in the random pattern for source quality

  • arr1 (Array) – Quality values for the reservoir(s)

  • str1 (String) – Input command for the random pattern

Returns:

Values corresponding to source quality at the reservoir(s)

Return type:

Array

species()[source]

Defining the species information of the MSRT module selected

Returns:

Species information of the MSRT module

Return type:

String

tank_reaction(num2, num3, num4, num5, arr1, arr2, arr3)[source]

Defining tank reactions for the MSRT model selected

Parameters:
  • num1 (Integer) – Water quality simulation time step in seconds

  • num2 (Integer) – Present water quality step

  • num3 (Integer) – Tank index

  • num4 (Integer) – Tank volume in previous water quality step

  • num5 (Integer) – Tank volume in the present water quality step

  • arr1 (List) – List of variable values

  • arr2 (Array) – Matrix of initial tank concentration values

  • arr2 – Matrix of tank concentration values

Returns:

Values corresponding to growth or decay of the concentration of water quality parameters

Return type:

List

variables(num2)[source]

Defining variables of the MSRT module

Parameters:
  • num1 (Integer) – Number of iterations

  • num2 (Integer) – Number of variables corresponding to the MSRT module selected

Returns:

Matrix of variable values

Return type:

Array

zero_order_reaction()[source]

Defining zero-order reaction

Parameters:

num1 (Integer) – Water quality simulation time step in seconds

Returns:

Solution of zero-order ordinary differential equation

Return type:

Float

epytc.chlorine_decay_thms_formation module

Chlorine decay and trihalomethanes formation module Reactive species (bulk) - Chlorine (mg-Cl/L), TOC (mg-C/L), and THMs (ug-THM/L) Reactive species (wall) - ‘’

class epytc.chlorine_decay_thms_formation.module[source]

Bases: object

Reynolds_number(num2, num3)[source]

Defining Reynolds number

Parameters:
  • num1 (Float) – Pipe flow velocity in metres per second

  • num2 (Float) – Pipe diameter in millimetres

  • num3 (Float) – Kinematic viscosity of water in square metres per second

Returns:

Reynolds number

Return type:

Float

Schmidt_number(num2)[source]

Defining Schmidt number

Parameters:
  • num1 (Float) – Kinematic viscosity of water in square metres per second

  • num2 (Float) – Molecular diffusivity of a bulk phase species in square metres per second

Returns:

Schmidt number

Return type:

Float

Sherwood_number(num2, num3, num4)[source]

Defining Sherwood number

Parameters:
  • num1 (Float) – Reynolds number

  • num2 (Float) – Schmidt number

  • num3 (Float) – Pipe diameter in millimetres

  • num4 (Float) – Pipe length in metres

Returns:

Schmidt number

Returns:

Sherwood number

Return type:

Float

details()[source]

Displaying the information about the MSRT model selected for water quality analysis

Returns:

Details of module

Return type:

String

first_order_reaction(num2, num3)[source]

Defining first-order reaction

Parameters:
  • num1 (Float) – Reaction rate constant

  • num2 (Float) – Concentration value

  • num3 (Integer) – Water quality simulation time step in seconds

Returns:

Solution of first-order ordinary differential equation

Return type:

Float

hydraulic_mean_radius()[source]

Defining hydraulic mean radius

Parameters:

num1 (Float) – Pipe diameter in millimetres

Returns:

Hydraulic mean radius

Return type:

Float

injection_pattern(num1, num2, arr1, arr2, arr3, arr4, str1)[source]

Defining source quality pattern for the injection node(s)

Parameters:
  • num1 (Float/Integer) – Base time period in day(s)

  • num2 (Float) – Variability in the pattern

  • arr1 (List) – Index value(s) of injection node(s)

  • arr2 (Array) – Start time step for the injection in the injection node(s)

  • arr3 (Array) – End time step for the injection in the injection node(s)

  • arr4 (Array) – Input value for the injection in the injection node(s)

  • str1 (String) – Input command for the pattern

Returns:

Values corresponding to source quality pattern at the injection node(s)

Return type:

Array

injection_quality(num2, arr1, arr2, str1)[source]

Defining source quality values for the injection node(s)

Parameters:
  • num1 (Integer) – Number of iterations

  • num2 (Float) – Variability in the random pattern for injection node quality

  • arr1 (List) – Index value(s) of injection node(s)

  • arr2 (Array) – Quality values for the injection node(s)

  • str1 (String) – Input command for the random pattern

Returns:

Values corresponding to source quality at the injection node(s)

Return type:

Array

mass_transfer_coefficient(num2, num3)[source]

Defining mass-transfer coefficient

Parameters:
  • num1 (Float) – Sherwood number

  • num2 (Float) – Molecular diffusivity of a bulk phase species in square metres per second

  • num3 (Float) – Pipe diameter in millimetres

Returns:

Schmidt number

Returns:

Mass-transfer coefficient

Return type:

Float

network()[source]

Getting basic details of the network

Parameters:

d (EPANET object) – EPANET model

Returns:

Network details

Return type:

List

pipe_reaction(num2, num3, num4, num5, num6, num7, arr1, arr2)[source]

Defining link reactions for the MSRT model selected

Parameters:
  • num1 (Integer) – Water quality simulation time step in seconds

  • num2 (Integer) – Link index

  • num3 (Float) – Grid index

  • num4 – Link flow velocity in metres per second

  • num5 (Float) – Link diameter in millimetres

  • num6 (Float) – Link length in metres

  • num7 (Float) – Link segment length in metres

  • arr1 (List) – List of variable values

  • arr2 (Array) – Matrix of link concentration values

Returns:

Values corresponding to growth or decay of the concentration of water quality parameters

Return type:

List

reservoir_pattern(num1, num2, arr1, arr2, arr3, str1)[source]

Defining source quality pattern for the reservoir(s)

Parameters:
  • num1 (Float/Integer) – Base time period in day(s)

  • num2 (Float) – Variability in the pattern

  • arr1 (Array) – Start time step for the injection in the reservoir(s)

  • arr2 (Array) – End time step for the injection in the reservoir(s)

  • arr3 (Array) – Input value for the injection in the reservoir(s)

  • str1 (String) – Input command for the pattern

Returns:

Values corresponding to source quality pattern at the reservoir(s)

Return type:

Array

reservoir_quality(num1, num2, arr1, str1)[source]

Defining source quality values for the reservoir(s)

Parameters:
  • num1 (Integer) – Number of iterations

  • num2 (Float) – Variability in the random pattern for source quality

  • arr1 (Array) – Quality values for the reservoir(s)

  • str1 (String) – Input command for the random pattern

Returns:

Values corresponding to source quality at the reservoir(s)

Return type:

Array

species()[source]

Defining the species information of the MSRT module selected

Returns:

Species information of the MSRT module

Return type:

String

tank_reaction(num2, num3, num4, num5, arr1, arr2, arr3)[source]

Defining tank reactions for the MSRT model selected

Parameters:
  • num1 (Integer) – Water quality simulation time step in seconds

  • num2 (Integer) – Present water quality step

  • num3 (Integer) – Tank index

  • num4 (Integer) – Tank volume in previous water quality step

  • num5 (Integer) – Tank volume in the present water quality step

  • arr1 (List) – List of variable values

  • arr2 (Array) – Matrix of initial tank concentration values

  • arr2 – Matrix of tank concentration values

Returns:

Values corresponding to growth or decay of the concentration of water quality parameters

Return type:

List

variables(num2)[source]

Defining variables of the MSRT module

Parameters:
  • num1 (Integer) – Number of iterations

  • num2 (Integer) – Number of variables corresponding to the MSRT module selected

Returns:

Matrix of variable values

Return type:

Array

zero_order_reaction()[source]

Defining zero-order reaction

Parameters:

num1 (Integer) – Water quality simulation time step in seconds

Returns:

Solution of zero-order ordinary differential equation

Return type:

Float

epytc.functions module

class epytc.functions.fn[source]

Bases: object

demand_data(arr2, str1)[source]

Cleaning demand data

Parameters:
  • arr1 (List) – Node demand ouput from EPANET hydraulic simulation

  • arr2 – Details of unwanted steps for water quality simulation

  • str1 (String) – Flow Unit

Returns:

Cleansed time output

Returns:

Cleansed demand output

Return type:

List

flow_data(arr2, str1)[source]

Cleaning flow data

Parameters:
  • arr1 (List) – Link flow ouput from EPANET hydraulic simulation

  • arr2 – Details of unwanted steps for water quality simulation

  • str1 (String) – Flow Unit

Returns:

Cleansed time output

Returns:

Cleansed flow output

Return type:

List

Getting incoming links to a specific node

Parameters:
  • num1 (Integer) – ID of a node

  • arr1 (List) – Matrix of end node indices

Returns:

List of incoming links

Return type:

List

maximum_segments(num2, arr1, arr2)[source]

Determining the maximum number of segments for pipe discretization

Parameters:
  • num1 (Float) – Tolerable flow velocity considered in metres per second

  • num2 (Integer) – Water quality simulation time step in seconds

  • arr1 (List) – Matrix of link lengths

  • arr2 (List) – Matrix of link velocity values

Returns:

Maximum number of pipe segments

Return type:

Integer

Estimating the minimum diameter to be specified for pumps and valves

Parameters:
  • num1 (Integer) – Count of links

  • num2 (Integer) – Count of pumps

  • num3 (Integer) – Count of valves

  • arr1 (List) – Matrix of link diameters

Returns:

Minimum diameter

Return type:

Float

Estimating the minimum length to be specified for pumps and valves

Parameters:
  • num1 (Integer) – Time steps in the filtered hydraulic report

  • num2 (Integer) – Water quality time step

  • num3 (Integer) – Tolerable flow velocity considered

  • arr1 (List) – Matrix of link flow velocities

Returns:

Minimum link length

Return type:

Float

msrt_info(num2, num3)[source]

Displaying the basic information about the MSRT model selected for the simulation

Parameters:
  • num1 (Integer) – Count of water quality parameters

  • num2 (Float/ Integer) – Count of bulk phase water quality parameters

  • num3 (Integer) – Count of wall phase water quality parameters

Returns:

Basic information about MSRT model

Return type:

String

network()[source]

Getting basic details of the network

Parameters:

d (EPANET object) – EPANET model

Returns:

Network details

Return type:

List

Displaying the information about the links (if any) omitted from water quality analysis

Parameters:
  • num1 (Integer) – Count of omitted links

  • arr1 (List) – Matrix of link names

  • arr2 (List) – Matrix of indices of omitted links

Returns:

Details of omitted links

Return type:

String

omitted_nodes(arr1, arr2)[source]

Displaying the information about the nodes (if any) omitted from water quality analysis

Parameters:
  • num1 (Integer) – Count of omitted nodes

  • arr1 (List) – Matrix of node names

  • arr2 (List) – Matrix of indices of omitted nodes

Returns:

Details of omitted nodes

Return type:

String

Getting outgoing links from a specific node

Parameters:
  • num1 (Integer) – ID of a node

  • arr1 (List) – Matrix of start node indices

Returns:

List of outgoing links

Return type:

List

pump_names(num2, arr1)[source]

Displaying the names of pumps

Parameters:
  • num1 (Integer) – Count of pumps

  • num2 (Integer) – Count of valves

  • arr1 (List) – Matrix of link names

Returns:

Names of pumps

Return type:

String

reservoir_names(arr1, arr2)[source]

Displaying the names of reservoirs

Parameters:
  • num1 (Integer) – Count of reservoirs

  • arr1 (List) – Matrix of node names

  • arr2 (List) – Matrix of reservoir indices

Returns:

Names of reservoirs

Return type:

String

simulation_info(num2, num3, num4)[source]

Displaying the basic information about the inputs selected for the simulation

Parameters:
  • num1 (Integer) – Maximum number of iterations

  • num2 (Float/ Integer) – Water quality simuation time in days

  • num3 (Integer) – Water quality simuation time step in seconds

  • num4 (Integer) – Total number of water quality simulation steps

Returns:

Basic information about simulation

Return type:

String

sync_time(H, num1, num2, num3, num4, num5, num6, num7, num8, str1, arr2)[source]

Synchronizing water quality and hydraulic time steps

Parameters:
  • d (EPANET object) – EPANET model

  • H (List) – Hydraulic simulation output from EPANET

  • num1 (Integer) – Current water quality time in the simulation in seconds

  • num2 (Integer) – Total steps in the hydraulic report ‘Time’ that was expected

  • num3 (Integer) – Base time period in seconds

  • num4 (Integer) – Total hydraulic simuation time in seconds

  • num5 (Integer) – Count of the day in water quality simulation

  • num6 (Float/ Integer) – Base time period in day(s)

  • num7 (Integer) – Water quality simulation time step in seconds

  • num8 (Integer) – Expected time step in the hydraulic report

  • str1 (Array) – Option for synchronization

  • arr1 – Input pattern governing quality values(input) at the reservoir

Returns:

Synchronized steps

Return type:

List

tank_names(arr1, arr2)[source]

Displaying the names of tanks

Parameters:
  • num1 (Integer) – Count of tanks

  • arr1 (List) – Matrix of node names

  • arr2 (List) – Matrix of tank indices

Returns:

Names of tanks

Return type:

String

tank_volume_data(arr2, str1)[source]

Cleaning tank volume data

Parameters:
  • arr1 (List) – Tank volume ouput from EPANET hydraulic simulation

  • arr2 – Details of unwanted steps for water quality simulation

  • str1 (String) – Flow Unit

Returns:

Cleansed time output

Returns:

Cleansed tank volume output

Return type:

List

time_data(arr2)[source]

Cleaning time data

Parameters:
  • arr1 (List) – Time ouput from EPANET hydraulic simulation

  • arr2 – Details of unwanted steps for water quality simulation

Returns:

Cleansed time output

Return type:

List

time_filter(num1, num2, num3)[source]

Filtering out unwanted time steps from hydraulic analysis output

Parameters:
  • H (List) – Hydraulic simulation output from EPANET

  • num1 (Float) – Ratio of time steps actually reported to time steps expected in the report

  • num2 (Integer) – Total steps in the hydraulic report ‘Time’ that was expected

  • num3 (Integer) – Hydraulic simulation time step in seconds

Returns:

Details of unwanted steps for water quality simulation

Return type:

List

valve_names(arr1)[source]

Displaying the names of valves

Parameters:
  • num1 (Integer) – Count of valves

  • arr1 (List) – Matrix of link names

Returns:

Names of valves

Return type:

String

velocity_data(arr2, str1)[source]

Cleaning velocity data

Parameters:
  • arr1 (List) – Link velocity ouput from EPANET hydraulic simulation

  • arr2 – Details of unwanted steps for water quality simulation

  • str1 (String) – Flow Unit

Returns:

Cleansed time output

Returns:

Cleansed velocity output

Return type:

List

epytc.main module

epytc.main.create_epytc()[source]

Creates an object of dataclass epytc-class

Returns:

An epytc_class object

Return type:

epytc_class

class epytc.main.epytc_class(module: str, maximum_iterations_required: int, simulation_period_days: int, simulation_time_step: int, base_period_days: int, minimum_pipe_flow_velocity: float, reservoir_quality_matrix: list[list[float]], reservoir_quality_pattern: str, reservoir_quality_pattern_random_variability: float, reservoir_injection_pattern: str, reservoir_injection_pattern_random_variability: float, reservoir_injection_start_time: list[list[float]], reservoir_injection_end_time: list[list[float]], reservoir_injection_input_value: list[list[float]], injection_nodes_index: list, injection_nodes_quality_matrix: list[list[float]], injection_node_quality_pattern: str, injection_node_quality_pattern_random_variability: float, injection_node_injection_pattern: str, injection_node_injection_pattern_random_variability: float, injection_node_injection_start_time: list[list[float]], injection_node_injection_end_time: list[list[float]], injection_node_injection_input_value: list[list[float]], hyd_wq_sync_option: str)[source]

Bases: object

base_period_days: int
hyd_wq_sync_option: str
injection_node_injection_end_time: list[list[float]]
injection_node_injection_input_value: list[list[float]]
injection_node_injection_pattern: str
injection_node_injection_pattern_random_variability: float
injection_node_injection_start_time: list[list[float]]
injection_node_quality_pattern: str
injection_node_quality_pattern_random_variability: float
injection_nodes_index: list
injection_nodes_quality_matrix: list[list[float]]
maximum_iterations_required: int
minimum_pipe_flow_velocity: float
module: str
reservoir_injection_end_time: list[list[float]]
reservoir_injection_input_value: list[list[float]]
reservoir_injection_pattern: str
reservoir_injection_pattern_random_variability: float
reservoir_injection_start_time: list[list[float]]
reservoir_quality_matrix: list[list[float]]
reservoir_quality_pattern: str
reservoir_quality_pattern_random_variability: float
simulation_period_days: int
simulation_time_step: int
epytc.main.execute_epytc(epytc: epytc_class)[source]

Execute the epytc module

Parameters:

epytc (epytc_class) – epytc object

epytc.pfas_formation module

Perfluorooctanoic acid formation module Reactive species (bulk) - Chlorine (mg-Cl/L), TOC (mg-C/L), PFOAA (ng/L), PFOAAmS (ng/L), and PFOA (ng/L) Reactive species (wall) - ‘’

class epytc.pfas_formation.module[source]

Bases: object

Reynolds_number(num2, num3)[source]

Defining Reynolds number

Parameters:
  • num1 (Float) – Pipe flow velocity in metres per second

  • num2 (Float) – Pipe diameter in millimetres

  • num3 (Float) – Kinematic viscosity of water in square metres per second

Returns:

Reynolds number

Return type:

Float

Schmidt_number(num2)[source]

Defining Schmidt number

Parameters:
  • num1 (Float) – Kinematic viscosity of water in square metres per second

  • num2 (Float) – Molecular diffusivity of a bulk phase species in square metres per second

Returns:

Schmidt number

Return type:

Float

Sherwood_number(num2, num3, num4)[source]

Defining Sherwood number

Parameters:
  • num1 (Float) – Reynolds number

  • num2 (Float) – Schmidt number

  • num3 (Float) – Pipe diameter in millimetres

  • num4 (Float) – Pipe length in metres

Returns:

Schmidt number

Returns:

Sherwood number

Return type:

Float

details()[source]

Displaying the information about the MSRT model selected for water quality analysis

Returns:

Details of module

Return type:

String

first_order_reaction(num2, num3)[source]

Defining first-order reaction

Parameters:
  • num1 (Float) – Reaction rate constant

  • num2 (Float) – Concentration value

  • num3 (Integer) – Water quality simulation time step in seconds

Returns:

Solution of first-order ordinary differential equation

Return type:

Float

hydraulic_mean_radius()[source]

Defining hydraulic mean radius

Parameters:

num1 (Float) – Pipe diameter in millimetres

Returns:

Hydraulic mean radius

Return type:

Float

injection_pattern(num1, num2, arr1, arr2, arr3, arr4, str1)[source]

Defining source quality pattern for the injection node(s)

Parameters:
  • num1 (Float/Integer) – Base time period in day(s)

  • num2 (Float) – Variability in the pattern

  • arr1 (List) – Index value(s) of injection node(s)

  • arr2 (Array) – Start time step for the injection in the injection node(s)

  • arr3 (Array) – End time step for the injection in the injection node(s)

  • arr4 (Array) – Input value for the injection in the injection node(s)

  • str1 (String) – Input command for the pattern

Returns:

Values corresponding to source quality pattern at the injection node(s)

Return type:

Array

injection_quality(num2, arr1, arr2, str1)[source]

Defining source quality values for the injection node(s)

Parameters:
  • num1 (Integer) – Number of iterations

  • num2 (Float) – Variability in the random pattern for injection node quality

  • arr1 (List) – Index value(s) of injection node(s)

  • arr2 (Array) – Quality values for the injection node(s)

  • str1 (String) – Input command for the random pattern

Returns:

Values corresponding to source quality at the injection node(s)

Return type:

Array

mass_transfer_coefficient(num2, num3)[source]

Defining mass-transfer coefficient

Parameters:
  • num1 (Float) – Sherwood number

  • num2 (Float) – Molecular diffusivity of a bulk phase species in square metres per second

  • num3 (Float) – Pipe diameter in millimetres

Returns:

Schmidt number

Returns:

Mass-transfer coefficient

Return type:

Float

network()[source]

Getting basic details of the network

Parameters:

d (EPANET object) – EPANET model

Returns:

Network details

Return type:

List

pipe_reaction(num2, num3, num4, num5, num6, num7, arr1, arr2)[source]

Defining link reactions for the MSRT model selected

Parameters:
  • num1 (Integer) – Water quality simulation time step in seconds

  • num2 (Integer) – Link index

  • num3 (Float) – Grid index

  • num4 – Link flow velocity in metres per second

  • num5 (Float) – Link diameter in millimetres

  • num6 (Float) – Link length in metres

  • num7 (Float) – Link segment length in metres

  • arr1 (List) – List of variable values

  • arr2 (Array) – Matrix of link concentration values

Returns:

Values corresponding to growth or decay of the concentration of water quality parameters

Return type:

List

reservoir_pattern(num1, num2, arr1, arr2, arr3, str1)[source]

Defining source quality pattern for the reservoir(s)

Parameters:
  • num1 (Float/Integer) – Base time period in day(s)

  • num2 (Float) – Variability in the pattern

  • arr1 (Array) – Start time step for the injection in the reservoir(s)

  • arr2 (Array) – End time step for the injection in the reservoir(s)

  • arr3 (Array) – Input value for the injection in the reservoir(s)

  • str1 (String) – Input command for the pattern

Returns:

Values corresponding to source quality pattern at the reservoir(s)

Return type:

Array

reservoir_quality(num1, num2, arr1, str1)[source]

Defining source quality values for the reservoir(s)

Parameters:
  • num1 (Integer) – Number of iterations

  • num2 (Float) – Variability in the random pattern for source quality

  • arr1 (Array) – Quality values for the reservoir(s)

  • str1 (String) – Input command for the random pattern

Returns:

Values corresponding to source quality at the reservoir(s)

Return type:

Array

species()[source]

Defining the species information of the MSRT module selected

Returns:

Species information of the MSRT module

Return type:

String

tank_reaction(num2, num3, num4, num5, arr1, arr2, arr3)[source]

Defining tank reactions for the MSRT model selected

Parameters:
  • num1 (Integer) – Water quality simulation time step in seconds

  • num2 (Integer) – Present water quality step

  • num3 (Integer) – Tank index

  • num4 (Integer) – Tank volume in previous water quality step

  • num5 (Integer) – Tank volume in the present water quality step

  • arr1 (List) – List of variable values

  • arr2 (Array) – Matrix of initial tank concentration values

  • arr2 – Matrix of tank concentration values

Returns:

Values corresponding to growth or decay of the concentration of water quality parameters

Return type:

List

variables(num2)[source]

Defining variables of the MSRT module

Parameters:
  • num1 (Integer) – Number of iterations

  • num2 (Integer) – Number of variables corresponding to the MSRT module selected

Returns:

Matrix of variable values

Return type:

Array

zero_order_reaction()[source]

Defining zero-order reaction

Parameters:

num1 (Integer) – Water quality simulation time step in seconds

Returns:

Solution of zero-order ordinary differential equation

Return type:

Float

epytc.run module

epytc.run.run_epytc(epytc)[source]

Runs the simulation using the data from the epytc object

Parameters:

epytc (epytc_class) – epytc object

Module contents