Beispiel #1
0
    def __init__(self, srcPres, resPres):
        SimNode.__init__(self, "simpleGasModel", NodeType.MODEL)
        # create all the nodes...
        #
        pipeResist = 0.1
        gasSrc = GasSource("gasSrc", srcPres)  #  bar air source.
        self.addChildNode(gasSrc)
        valveRin = Pipe(
            "valveRin",
            1,  # pressure
            pipeResist,  # resistance
            True)
        # valve initially open.
        self.addChildNode(valveRin)
        reservoir = Reservoir(
            "reservoir",
            resPres,  # pressure
            2)  # 2 liter volume
        self.addChildNode(reservoir)

        self._gasSrc = gasSrc
        self._valveRin = valveRin
        self._reservoir = reservoir

        # gasSrc <-> valveRin <-> resovior
        # then connect them up..
        gasSrc.connect(valveRin)
        valveRin.connect(reservoir)
Beispiel #2
0
    def __init__(self):
        SimNode.__init__(self, "simpleGasModel", NodeType.MODEL)
        # create all the nodes...
        #
        pipeResist = 0.1
        self._srcO2 = GasSource("srcO2", 3, 1.0)  #  3 bar, 100% O2
        self.addChildNode(self._srcO2)

        self._srcAir = GasSource("srcAir", 3)  # 1 bar air sink
        self.addChildNode(self._srcAir)

        self._gasSink = GasSource("gasSink", 1)  # 1 bar air sink

        self._valveO2In = Pipe(
            "valveO2In",
            1,  # pressure
            pipeResist,  # resistance
            False)
        # open valve

        self.addChildNode(self._valveO2In)

        self._reservoir = Reservoir(
            "reservoir",
            1,  # pressure
            2)  # 2 liter volume
        self.addChildNode(self._reservoir)

        self._valveAirIn = Pipe(
            "valveAirIn",
            1,  # pressure
            pipeResist,  # resistance
            False)
        # closed valve.
        self.addChildNode(self._valveAirIn)

        self._valveGasOut = Pipe("valveGasOut", 1, pipeResist, False)
        self.addChildNode(self._valveGasOut)

        #
        # pressures are in absolute pressure
        # temperature is 21c
        #   first flow into at step 1 should be 3/.1 = 20
        #    wha??
        # srcO2 -- valveO2In -- resovire -- valveAirIn -- srcAir
        #                      _gasOut
        self._srcO2.connect(self._valveO2In)
        self._valveO2In.connect(self._reservoir)
        self._srcAir.connect(self._valveAirIn)
        self._valveAirIn.connect(self._reservoir)
        self._reservoir.connect(self._valveGasOut)
        self._valveGasOut.connect(self._gasSink)
Beispiel #3
0
    def __init__(self):
        SimNode.__init__(self, "simpleGasModel", NodeType.MODEL)
        # create all the nodes...
        #
        pipeResist = 0.1
        gasSrc = GasSource("gasSrc", 3)  #  bar air source.
        self.addChildNode(gasSrc)
        valveRin = Pipe(
            "valveRin",
            1,  # pressure
            pipeResist,  # resistance
            True)
        # open valve
        self.addChildNode(valveRin)
        lungs = Lungs(
            "lungs",
            1,  # pressure
            2)  # 2 liter volume
        self.addChildNode(lungs)
        valveRout = Pipe(
            "valveRout",
            1,  # pressure
            pipeResist,  # resistance
            False)
        # closed valve.
        self.addChildNode(valveRout)
        gasSink = GasSource("gasSink", 1)  # 1 bar air sink
        self.addChildNode(gasSink)

        self._gasSrc = gasSrc
        self._valveRin = valveRin
        self._lungs = lungs
        self._valveRout = valveRout
        self._gasSink = gasSink

        #
        # gasSrc <-> valveRin <-> resovior <-> valveRout <-> gasSink
        #  3bar        .1R         1 liter      .1R          1bar
        # pressures are in absolute pressure
        # temperature is 21c
        #   first flow into at step 1 should be 3/.1 = 20
        #    wha??

        # then connect them up..
        gasSrc.connect(valveRin)
        valveRin.connect(lungs)
        lungs.connect(valveRout)
        valveRout.connect(gasSink)
Beispiel #4
0
    def __init__(self, srcPres, resPres):
        SimNode.__init__(self, "simpleGasModel", NodeType.MODEL)
        # create all the nodes...
        #
        pipeResist = 0.1
        gasSrc = GasSource("gasSrc", srcPres)  #  bar air source.
        self.addChildNode(gasSrc)
        valveRin = Pipe(
            "valveRin",
            1,  # pressure
            pipeResist,  # resistance
            True)
        # valve initially open.
        self.addChildNode(valveRin)
        lungs = Lungs(
            "lungs",
            resPres,  # pressure
            2,  # 2 liter volume
            2)  # compliance of .5

        self.addChildNode(lungs)
        valveRout = Pipe("valveRout", 1, pipeResist, False)
        self.addChildNode(valveRout)
        gasSink = GasSource("gasSink", 1)
        self.addChildNode(gasSink)

        self._gasSrc = gasSrc
        self._valveRin = valveRin
        self._lungs = lungs

        # gasSrc <-> valveRin <-> resovior
        # then connect them up..
        gasSrc.connect(valveRin)
        valveRin.connect(lungs)
        lungs.connect(valveRout)
        valveRout.connect(gasSink)