def tobera(h, p5t, T5t, T2t): # Tobera p9 = isa.pres_isa(h) Ttob = (T5t + T2t) * 0.5 T9 = (((p9/p5t)**((air.gamma_air(Ttob) - 1)/air.gamma_air(Ttob)) - 1) * rend_tobera(h) + 1) * T5t return T9, p9
def turborreactor(m, T0, G0, p0): # Difusor: T2t = gas.stagnation_temperature_from_mach(m, T0) P2t = gas.stagnation_pressure_from_mach(m, p0, T0) # Generador de Gas: T5t, P5t, _, _ = generador_gas(P2t, T2t, G0) # Tobera P9 = isa.pres_isa(h) T9 = T5t * (rend_tobera(h) * ((P9 / P5t) ** (air.gamma_air((T5t + T2t) / 2) - 1) / air.gamma_air((T5t + T2t) / 2)) + 1)
""" pyturb isa.py tests M Rodriguez """ import numpy as np import isa np.testing.assert_almost_equal(isa.temp_isa(0), [15 + 273.15]) np.testing.assert_almost_equal(isa.pres_isa(0), [101325]) np.testing.assert_almost_equal(isa.temp_isa(11000), [216.65]) np.testing.assert_almost_equal(isa.pres_isa(11000), 22700.0, decimal=-2)
p0 = np.zeros_like(T0) v0 = np.zeros_like(T0) G0 = np.zeros_like(T0) E = np.zeros_like(T0) # ... area = np.pi * 0.4**2 ii = 0 for h in height: for m in mach: # Condiciones ambiente: T0[ii] = isa.temp_isa(h) p0[ii] = isa.pres_isa(h) rho0 = p0[ii] / (T0[ii] * air.R_air) v0[ii] = m * gas.sound_speed(T0[ii]) G0[ii] = rho0 * area * v0[ii] # Difusor: T2t, p2t = turborreactor.difusor(m, p0[ii], T0[ii]) # Generador de Gas: T5t, p5t, _, _, c = generador_gas.generador_gas(T2t, p2t, G0[ii]) # Tobera: T9, p9 = turborreactor.tobera(h, p5t, T5t, T2t) v9 = gas.velocity_from_stagnation_temperature(T5t, T9) # Actuaciones: