Namespaces | |
run | |
Global functions for running simulations. | |
Functions | |
def | PooPyLab.utils.run.check_global_cnvg (wwtp) |
Check global convergence of the WWTP PFD. More... | |
def | PooPyLab.utils.run.show_concs (wwtp) |
Print the concentrations of the branches of each unit in the WWTP's PFD. More... | |
def | PooPyLab.utils.run._wwtp_active_vol (reactors=[]) |
Return the sum of asm reactors' active volume. More... | |
def | PooPyLab.utils.run.initial_guess (params={}, reactors=[], inf_flow=1.0, plant_inf=[]) |
Return the initial guess as the start of integration towards steady state. More... | |
def | PooPyLab.utils.run._forward (me, visited=[]) |
Set the flow data source by visiting process units along the flow paths. More... | |
def | PooPyLab.utils.run.forward_set_flow (wwtp) |
Set the _upstream_set_mo_flow flag of those influenced by the starters. More... | |
def | PooPyLab.utils.run._BFS (_to_visit, _visited) |
Breadth First Search type of traverse. More... | |
def | PooPyLab.utils.run.traverse_plant (wwtp, plant_inf) |
Visit every process units on the PFD starting from the influent. More... | |
def | PooPyLab.utils.run._sum_of_known_inflows (me, my_inlet_of_unknown_flow) |
Return the sum of all known flow rates of the inlet of a process unit. More... | |
def | PooPyLab.utils.run._backward (me) |
Set the flow data source by visiting process units against the flow paths. More... | |
def | PooPyLab.utils.run.backward_set_flow (start=[]) |
Back tracing to set the flows of the inlet units for those in starters. More... | |
def | PooPyLab.utils.run.get_steady_state (wwtp=[], target_SRT=5, verbose=False, diagnose=False) |
Integrate the entire plant towards a steady state at the target SRT. More... | |
def PooPyLab.utils.run.check_global_cnvg | ( | wwtp | ) |
Check global convergence of the WWTP PFD.
wwtp | list of process units in a WWTP's PFD |
def PooPyLab.utils.run.show_concs | ( | wwtp | ) |
Print the concentrations of the branches of each unit in the WWTP's PFD.
wwtp | list of process units in a WWTP's PFD |
|
private |
Return the sum of asm reactors' active volume.
reactors | list of reactors whose active volumes are of interest. |
def PooPyLab.utils.run.initial_guess | ( | params = {} , |
|
reactors = [] , |
|||
inf_flow = 1.0 , |
|||
plant_inf = [] |
|||
) |
Return the initial guess as the start of integration towards steady state.
The approach here is similar to that outlined in the IWA ASM1 report, where the total volume of all the reactors is treated as one CSTR.
params | model parameters adjusted to the project temperature; |
reactors | reactors whose volume will be used; |
inf_flow | wwtp's influent flow rate, m3/d; |
plant_inf | model components for the entire wwtp's influent. |
|
private |
Set the flow data source by visiting process units along the flow paths.
This function is to be called by forward_set_flow(). It follows the flow paths and decide whether additional flow data sources can be decided based on what's known.
me | current process unit under analysis; |
visisted | list of process units visited already. |
def PooPyLab.utils.run.forward_set_flow | ( | wwtp | ) |
Set the _upstream_set_mo_flow flag of those influenced by the starters.
wwtp | list of all units in a wwtp. |
|
private |
Breadth First Search type of traverse.
_to_visit | list of process units to be visited; |
_visited | list of process units visited. |
def PooPyLab.utils.run.traverse_plant | ( | wwtp, | |
plant_inf | |||
) |
Visit every process units on the PFD starting from the influent.
wwtp | list of all process units on the WWTP's PFD; |
plant_inf | plant influent unit. |
|
private |
Return the sum of all known flow rates of the inlet of a process unit.
me | current process unit; |
my_inlet_of_unknown_flow | discharger w/ flow into "me" unknown. |
|
private |
Set the flow data source by visiting process units against the flow paths.
This function is to be called by backward_set_flow(). It decide whether additional flow data sources can be decided based on (_mo_flow + _so_flow). If so, proceed and set the inflow and trace further upstream of "me".
me | current process unit under analysis; |
visisted | list of process units visited already. |
def PooPyLab.utils.run.backward_set_flow | ( | start = [] | ) |
Back tracing to set the flows of the inlet units for those in starters.
start | list of units whose inflow = mainstream flow + sidestream flow. |
def PooPyLab.utils.run.get_steady_state | ( | wwtp = [] , |
|
target_SRT = 5 , |
|||
verbose = False , |
|||
diagnose = False |
|||
) |
Integrate the entire plant towards a steady state at the target SRT.
Constant influent flows and loads are required. If the user only knows the dynamic influent characteristics, the averages should be used as the influent conditions.
wwtp | all process units in a wastewater treatment plant |
target_SRT | target solids retention time (d) for the steady state |
verbose | flag for more detailed output |
diagnose | flag for the use of cProfile for performance analysis |