Exemplo n.º 1
0
    def equations(self):
        r1 = self.outputs[0].connector.area / self.input.connector.area
        r2 = self.outputs[1].connector.area / self.input.connector.area

        eqns = [
            Equation([Term(self.outputs[0], 1.),
                      Term(self.input, -r1)]),
            Equation([Term(self.outputs[1], 1.),
                      Term(self.input, -r2)])
        ]

        eqns.append(self.continuity_equation())

        return eqns
Exemplo n.º 2
0
    def equations(self):
        eqns = []
        for node in self.nodes[:-1]:
            ratio = node.connector.area / self.nodes[-1].connector.area
            eqns.append(
                Equation([Term(node, 1.),
                          Term(self.nodes[-1], -ratio)]))

        eqns = [
            Equation([Term(self.nodes[-1], 1.),
                      Term(node, -1.)], 0.) for node in self.nodes[:-1]
        ]
        eqns.append(self.continuity_equation())

        return eqns
Exemplo n.º 3
0
 def equations(self):
     r = self.input.connector.r
     eqn = Equation([
         Term(self.input.connector.other(self.input), 1. / r),
         Term(self.input, -1. / r)
     ],
                    rhs=self.flow_rate)
     return [eqn, self.continuity_equation()]
Exemplo n.º 4
0
    def equations(self):
        vp_1 = self.input.connector.velocity_pressure
        vp_2 = self.output.connector.velocity_pressure

        eqn = Equation([Term(self.input, -1.),
                        Term(self.output, 1.)],
                       vp_1 - vp_2 - self.k_loss * (vp_1 + vp_2) / 2.)

        return [self.continuity_equation(), eqn]
Exemplo n.º 5
0
 def equations(self):
     p1 = self.input.connector.other(self.input)
     p2 = self.input
     p3 = self.output
     r1 = self.input.connector.r
     rv = self.r
     eqn = Equation(
         [Term(p2, rv / r1 + 1),
          Term(p1, -rv / r1),
          Term(p3, -1)])
     return [eqn, self.continuity_equation()]
Exemplo n.º 6
0
    def equations(self):
        c1 = self.input_1.connector
        c2 = self.input_2.connector
        c3 = self.output.connector
        vp_1 = c1.velocity_pressure
        vp_2 = c2.velocity_pressure
        vp_3 = c3.velocity_pressure

        eqn1 = Equation([Term(self.output, 1.), Term(self.input_1, -1.)])

        eqn2 = Equation([Term(self.output, 1.), Term(self.input_2, -1.)])

        if vp_1 - vp_3 > 0:
            eqn1.rhs = self.k_regain * (vp_1 - vp_3)
        else:
            eqn1.rhs = self.k_loss * (vp_1 - vp_3)

        if vp_2 - vp_3 > 0.:
            eqn2.rhs = self.k_regain * (vp_2 - vp_3)
        else:
            eqn2.rhs = self.k_loss * (vp_2 - vp_3)

        return [self.continuity_equation(), eqn1, eqn2]
Exemplo n.º 7
0
 def equations(self):
     return [
         Equation([Term(self.input, -1.),
                   Term(self.output, 1.)], self.dp),
         self.continuity_equation()
     ]
Exemplo n.º 8
0
 def equations(self):
     return [Equation([Term(self.node, 1.)], self.p)]