The Brown Book
Documentation for the PooPyLab project
pfd.py File Reference

Namespaces

 pfd
 Global functions for process flow diagram related operations.
 

Functions

def PooPyLab.utils.pfd._check_connection (pfd=[])
 Check the validity of connections on the process flow diagram. More...
 
def PooPyLab.utils.pfd._id_upstream_type (me, upds)
 Identify the type of a discharger connected to the inlet. More...
 
def PooPyLab.utils.pfd._check_WAS (mywas)
 Check the validity of the WAS units in the pfd. More...
 
def PooPyLab.utils.pfd._check_sidestream_flows (mysplitters)
 Check the validity of the sidestreams of all splitter types. More...
 
def PooPyLab.utils.pfd._find_main_only_prefix (cur, pms)
 Find the mainstream only loop in the PFD. More...
 
def PooPyLab.utils.pfd._has_main_only_loops (pfd)
 Analyze a PFD and see whether it has a loop only via mainstream outlets. More...
 
def PooPyLab.utils.pfd.get_all_units (wwtp, type='ASMReactor')
 Return all the units of a specific type in a treatment plant PFD. More...
 
def PooPyLab.utils.pfd.check (wwtp)
 Check the validity of the PFD against the rules. More...
 
def PooPyLab.utils.pfd.show (wwtp=[])
 Show the verbal description of the PFD. More...
 

Function Documentation

◆ _check_connection()

def PooPyLab.utils.pfd._check_connection (   pfd = [])
private

Check the validity of connections on the process flow diagram.

All units are connected for their main- and sidestream outlets other than the exceptions made in initializations. This function checks and count the loose ends found in the PFD.

Parameters
pfdProcess Flow Diagram (list of all unit processes in the WWTP);
Return
# of loose ends (int)

◆ _id_upstream_type()

def PooPyLab.utils.pfd._id_upstream_type (   me,
  upds 
)
private

Identify the type of a discharger connected to the inlet.

This function identifies the type of an upstream discharger (upds) of (me)

Parameters
mea process unit
updsan upstream discharger of "me"
Return
strings such as {'VOID'|'INFLUENT'|'SPLITTER_MAIN'|'SPLITTER_SIDE'}

◆ _check_WAS()

def PooPyLab.utils.pfd._check_WAS (   mywas)
private

Check the validity of the WAS units in the pfd.

Rules
1) A WAS unit shall connect w/ a splitter's sidestream via ONE pipe;
2) Only 0 or 1 WAS can connect to an SRT controlling splitter;
Parameters
mywasthe WAS unit under analysis
Return
Whether the WAS connection is valid (bool),
The SRT controlling splitter connected to this WAS unit

◆ _check_sidestream_flows()

def PooPyLab.utils.pfd._check_sidestream_flows (   mysplitters)
private

Check the validity of the sidestreams of all splitter types.

Rules
1) Sidestream flows shall be defined by user;
2) SRT controlling splitters or final_clarifiers are exempted from 1);
3) A final clarifier's sidestream flow is determined during runtime;
4) The main loop shall update its side outlet or main outlet flows.
Parameters
mysplittersSplitters to be checked;
Return
total # of sidestreams with undefined flow rates (int)

◆ _find_main_only_prefix()

def PooPyLab.utils.pfd._find_main_only_prefix (   cur,
  pms 
)
private

Find the mainstream only loop in the PFD.

Rules
1) A recycle/recirculation (loop) shall be via a splitter sidestream;
Parameters
curcurrent process unit;
pmslist of mainstream units (prefixes) leading to "cur".
Return
bool
See
_has_main_only_loops().

◆ _has_main_only_loops()

def PooPyLab.utils.pfd._has_main_only_loops (   pfd)
private

Analyze a PFD and see whether it has a loop only via mainstream outlets.

Rule
1) Loops with mainstreams only are not allowed in the PFD
Parameters
pfdProcess Flow Diagram (list of process units in the WWTP);
Return
bool
See
_find_main_only_prefix().

◆ get_all_units()

def PooPyLab.utils.pfd.get_all_units (   wwtp,
  type = 'ASMReactor' 
)

Return all the units of a specific type in a treatment plant PFD.

Parameters
wwtpa collection (list) of process units;
typetype of process units of interest.
Return
a list of process units

◆ check()

def PooPyLab.utils.pfd.check (   wwtp)

Check the validity of the PFD against the rules.

Parameters
wwtpa collection (list) of process units;
Return
bool
See
_check_connection();
_check_WAS();
_check_sidestream_flows();

◆ show()

def PooPyLab.utils.pfd.show (   wwtp = [])

Show the verbal description of the PFD.

Parameters
wwtpa collection (list) of process units;
Return
None