# To calculate: # - Ae # - Thrust # Solution: energy_in = energy(T1, V1, m=m_rate) # Applying the conservation of energy equation def eqn_energy(Te): energy_out = energy(Te, Ve, m=m_rate) return energy_in + q - energy_out Te = num.solve_nr(eqn_energy, init=T1) rhoe = eos.rho(pe, Te) # Applying conservation of mass equation def eqn_mass(Ae): return mass(rhoe, Ae, Ve) - m_rate Ae = num.solve_nr(eqn_mass, init=1.0) momentum_in = m_rate * V1 momentum_out = m_rate * Ve pressure_thrust = (pe - p_amb) * Ae
# ------------------------------------ A1 = Ae = A = 1 # m^2, assumed = 1 as mass flow rate needs to be calculated per unit area # To calculate: # - heat added per unit mass # - mass flow rate per unit area # Solution: molar_mass = 12 * 1 + 16 * 2 R = prop.R(molar_mass) cp = prop.cp(R, gamma) energy_in = energy(T1, V1, cp, m=1) energy_out = energy(Te, Ve, cp, m=1) # Conservation of energy equation def eqn_energy(q): return energy_in + q - energy_out q = num.solve_nr(eqn_energy) # Using the ideal gas equation of state at the inlet rho1 = eos.rho(p1, T1, R) m = mass(rho1, A1, V1) print("The amount of heat being added to the carbon dioxide per unit mass of gas is %f J/kg." % q) print("The mass flow rate through the duct per unit cross-sectional area of the duct is %f kg/s-m^2." % m)
# To calculate: mass flow rate # Solution: molar_mass = 2.016 # kg/kmol R = prop.R(molar_mass) cp = prop.cp(R, gamma) Te = isen.T2(T1, pe / p1, gamma) # Conservation of energy equation def eqn_energy(Ve): return energy(T0, 0, cp) - energy(Te, Ve, cp) Ve = num.solve_nr(eqn_energy, init=100.0) # +ve initial guess # Conservation of momentum momentum_in = 0 pressure_thrust = (pe - p_amb) * Aexit def eqn_momentum(me): momentum_out = me * Ve return thrust - momentum_out + momentum_in - pressure_thrust me = num.solve_nr(eqn_momentum, init=0.0) print( "If the required thrust is %f MN, the required hydrogen mass flow rate is %f kg/s."
D3 = 9e-2 # m # ------------------------------------ # To calculate: V3 # Solution: rho1 = eos.rho(p1, T1) rho2 = eos.rho(p2, T2) rho3 = eos.rho(p3, T3) A1 = area_circle(D1) A2 = area_circle(D2) A3 = area_circle(D3) m1 = mass(rho1, A1, V1) m2 = mass(rho2, A2, V2) # mass conservation equation def eqn(V3): m3 = mass(rho3, A3, V3) return m1 + m2 - m3 V3 = num.solve_nr(eqn, V1) print("The velocity in the exit pipe is %f m/s." % V3) plt.imshow(plt.imread("images/q06_im01.svg.png")) plt.axis("off") plt.show()
T2 = -50 + 273 # K # ------------------------------------ # To calculate: T3 # Solution: # assume m1 = m2 = 1 m1 = 1 # kg/s m2 = m1 m3 = m1 + m2 # conservation of energy e1 = energy(T1, V1, m=m1) e2 = energy(T2, V2, m=m2) # e1 + e2 - e3 = 0 def eqn(T3): V3 = 0 return e1 + e2 - energy(T3, V3, m=m3) T3 = num.solve_nr(eqn, init=T1) print("The temperature of the air in the large chamber is %f K or %f deg. C." % (T3, T3 - 273)) plt.imshow(plt.imread("images/q05_im01.svg.png")) plt.axis("off") plt.show()
Ve = 30 # m/s Te = 80 + 273 # K pe = 2.45e6 # Pa # ------------------------------------ # To calculate: # - Heat added/removed per kilogram of air # - density of air at inlet of heat exchanger # - density of air at exit of heat exchanger # Solution: energy_in = energy(T1, V1) energy_out = energy(Te, Ve) # Conservation of energy equation def eqn_energy(q): return energy_in + q - energy_out q = num.solve_nr(eqn_energy) # sign of q indicates whether heat is added or removed qdir = "heat added" if q < 0: qdir = "heat removed" rho1 = eos.rho(p1, T1) rhoe = eos.rho(pe, Te) print("The %s per kilogram of air flowing through the heat exchanger is %f J/kg." % (qdir, abs(q))) print("The density of the air at the inlet of the heat exchanger is %f kg/m^3." % rho1) print("The density of the air at the exit of the heat exchanger is %f kg/m^3." % rhoe)