Esempio n. 1
0
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#
# --------------------------------------------------------------------
#    Testing the influent/effluent/pipe/reactor classes.
#

from PooPyLab.utils import pfd, run

if __name__ == '__main__':

    import MLE

    wwtp = MLE.construct()

    pfd.check(wwtp)

    pfd.show(wwtp)

    run.get_steady_state(wwtp,
                         target_SRT=MLE.SRT,
                         verbose=False,
                         diagnose=False,
                         mn='BDF',
                         fDO=True,
                         DOsat=10)
    p2 = pipe()

    RAS = pipe()  # p3

    p4 = pipe()  # to outlet

    outlet = effluent()

    splt = splitter()

    wwtp = [inlet, p1, p2, RAS, p4, ra, outlet, splt]

    #pdb.set_trace()
    def construct_bad_pfd():
        # this PFD has a mainstream-only loop
        inlet.set_downstream_main(p1)
        p1.set_downstream_main(ra)
        ra.set_downstream_main(p2)
        p2.set_downstream_main(splt)
        splt.set_downstream_main(RAS)
        splt.set_downstream_side(p4)
        RAS.set_downstream_main(ra)
        p4.set_downstream_main(outlet)
        print("PFD constructed.")
        return None

    construct_bad_pfd()
    check(wwtp)
    show(wwtp)