예제 #1
0
    def test_simple_input(self):
        # Expected exit velocity and mass flow
        # Should be sonic throat too, due to vacuum at exit
        u_exit_expected = 1.0801234497346432
        m_dot_expected = 0.6847314563772704  # Should be equal to Gamma(1.4) (vandankerkhove function)
        p_exit = 0.5282817877171743  # Should be exit pressure for M=1
        AR_exit = 1
        T_chamber = 1
        R = 1
        gamma = 1.4
        p_chamber = 1
        A_throat = 1
        AR_exit = 1
        p_back = 0

        # Expected thrust
        F_expected = m_dot_expected * u_exit_expected + p_exit * A_throat * AR_exit
        res = IRT.thrust(p_chamber=p_chamber,
                         T_chamber=T_chamber,
                         A_throat=A_throat,
                         AR_exit=AR_exit,
                         p_back=p_back,
                         gamma=gamma,
                         R=R)
        self.assertEqual(res, F_expected)
예제 #2
0
 def test_TRP_example(self):
     # Slide 57-51 from Ideal Rocket Motor lecture from Thermal Rocket Propulsion course are used as example (Zandbergen)
     expected = 401.8e3
     gamma = 1.3
     R = 390.4
     p_chamber = 5.6e6
     p_back = 6.03e3
     T_chamber = 3400
     AR_exit = 49
     d_exit = 1.6
     A_exit = 0.25 * math.pi * d_exit**2
     A_throat = A_exit / AR_exit
     res = IRT.thrust(p_chamber=p_chamber,
                      T_chamber=T_chamber,
                      A_throat=A_throat,
                      AR_exit=AR_exit,
                      p_back=p_back,
                      gamma=gamma,
                      R=R)
     self.assertAlmostEqual(
         expected, res,
         -3)  # Slight rounding error again and 1 digit accuracy less