예제 #1
0
#################################
Version 0.1
    Initial build
"""
# Valve parameters: name="", sys_flow_in=0.0, position=0, flow_coeff=0.0, open_press=0, close_press=0
# Pump parameters: name="", flow_rate=0.0, pump_head_in=0.0, press_out=0.0, pump_speed=0, displacement=0.0
from PipingSystems.pump.pump import CentrifPump, PositiveDisplacement
from PipingSystems.valve.valve import Gate, Globe, Relief

# Pump 1 group (centrifugal)
centrif_pump1 = CentrifPump("Centrifugal Pump", pump_head_in=20)
out_valve1 = Gate("Centrifugal Pump outlet",
                  flow_coeff=90,
                  sys_flow_in=centrif_pump1.get_flow)
throttle1 = Globe("Centrifugal Pump throttle",
                  flow_coeff=30,
                  sys_flow_in=centrif_pump1.get_flow)
in_valve2 = Gate("Gear Pump inlet",
                 flow_coeff=270,
                 sys_flow_in=centrif_pump1.get_flow)

# Pump 2 group (gear)
gear_pump1 = PositiveDisplacement("Gear Pump",
                                  displacement=0.096,
                                  pump_head_in=throttle1.press_out,
                                  press_out=10)
out_valve2 = Gate("Gear Pump outlet",
                  flow_coeff=270,
                  sys_flow_in=gear_pump1.get_flow)
recirc1 = Globe("Gear Pump throttle",
                flow_coeff=30,
예제 #2
0
from PipingSystems.pump.pump import CentrifPump, PositiveDisplacement
from PipingSystems.valve.valve import Gate, Globe, Relief

# Gate Valve 1
valve1 = Gate("Valve 1", position=100, flow_coeff=200, sys_flow_in=utility_formulas.gravity_flow_rate(2, 1.67),
              press_in=utility_formulas.static_press(14))
valve1.flow_out = valve1.flow_in
valve1.press_drop(valve1.flow_out)
valve1.get_press_out(valve1.press_in)

# Centrif Pump
pump1 = CentrifPump("Pump 1", pump_head_in=utility_formulas.press_to_head(valve1.press_out))
pump1.start_pump(1750, 50, 16)

# Globe valve 1
throttle1 = Globe("Throttle 1", position=100, flow_coeff=21, press_in=pump1.outlet_pressure,
                  sys_flow_in=pump1.flow)
throttle1.flow_out = throttle1.flow_in
throttle1.press_drop(throttle1.flow_out)
throttle1.valve_flow_out(throttle1.Cv, throttle1.deltaP)
throttle1.get_press_out(throttle1.press_in)

# Gate Valve 2
valve2 = Gate("Valve 2", position=100, flow_coeff=200, press_in=throttle1.press_out, sys_flow_in=throttle1.flow_out)
valve2.flow_out = valve2.flow_in
valve2.press_drop(valve2.flow_out)
valve2.valve_flow_out(valve2.Cv, valve2.deltaP)
valve2.get_press_out(valve2.press_in)

# Gate Valve 3
valve3 = Gate("Valve 3", position=100, flow_coeff=200, press_in=valve2.press_out, sys_flow_in=valve2.flow_out)
valve3.flow_out = valve3.flow_in
예제 #3
0
 def test_turn_handle(self):
     g = Globe(name="Globe1", flow_coeff=21)
     g.turn_handle(40)
     assert g.read_position() == "Globe1 is 40% open."
예제 #4
0
"""Assumes valves in series, with the first supplied by a tank 10 feet above the valve with a pipe length of 6 feet.
Water level is 4 feet above tank bottom; total water head = 14 feet.
"""

import utility_formulas

from PipingSystems.pump.pump import CentrifPump, PositiveDisplacement
from PipingSystems.valve.valve import Gate, Globe, Relief

valve1 = Gate("Valve 1",  position=100, flow_coeff=200, sys_flow_in=utility_formulas.gravity_flow_rate(2, 1.67),
              press_in=utility_formulas.static_press(14))
pump1 = CentrifPump("Pump 1")
throttle1 = Globe("Throttle 1", position=100, flow_coeff=21)
valve2 = Gate("Valve 2",  position=100, flow_coeff=200)
valve3 = Gate("Valve 3",  position=100, flow_coeff=200)
pump2 = PositiveDisplacement("Gear Pump", displacement=0.096, press_out=30)
relief1 = Relief("Relief 1",  position=0, open_press=60, close_press=55)
recirc1 = Globe("Throttle 2", position=100, flow_coeff=21)
valve4 = Gate("Valve 4",  position=100, flow_coeff=200)


# Utility functions
def test_grav_flow():
    flow_rate = utility_formulas.gravity_flow_rate(2, 1.67)
    assert flow_rate == 319.28008077388426


def test_static_press():
    press = utility_formulas.static_press(14)
    assert press == 6.068373888888889
예제 #5
0
 def test_read_position(self):
     g = Globe(name="Globe1", flow_coeff=21)
     assert g.read_position() == "Globe1 is 0% open."