Esempio n. 1
0
	def __init__(self, h):
		# Cantera Solution object
		self.gas = ct.Solution('air.xml')

		# Discretised altitude steps
		self.h = h

		# Average molecular diameter of gas
		self.d = 4E-10

		self.steps = len(h)

		self.rho = np.zeros(self.steps)
		self.p = np.zeros(self.steps)
		self.T = np.zeros(self.steps)
		self.a = np.zeros(self.steps)
		self.k = np.zeros(self.steps)
		self.mu = np.zeros(self.steps)

		for index, alt in enumerate(self.h):
			self.rho[index] = atm.alt2density(alt, alt_units='m', density_units='kg/m**3')
			self.p[index] = atm.alt2press(alt, press_units='pa', alt_units='m')
			self.T[index] = atm.alt2temp(alt, alt_units='m', temp_units='K')
			self.a[index] = atm.temp2speed_of_sound(self.T[index], temp_units='K', speed_units='m/s')

		for index, alt in enumerate(self.h):
			self.gas.TP = self.T[index], self.p[index]
			self.k[index] = self.gas.cp / self.gas.cv
			self.mu[index] = self.gas.viscosity

		print 'ATMOSPHERIC MODEL COMPUTED (US76)'

		return None
Esempio n. 2
0
def tip_mach(tas,
             rpm,
             temperature,
             dia,
             speed_units='kt',
             temp_units='C',
             dia_units='in'):
    """
    Returns the mach number of the propeller blade tip, given the
    true airspeed (tas), revolutions per minute (rpm), temperature and
    propeller diameter.

    The speed units may be specified as "kt", "mph", "km/h" or "ft/s", but
    default to "kt" if not specified.

    The temperature units may be specified as "C", "F", "K" or "R", but
    default to deg C if not specified.

    The diameter units may be specified as "in", "ft", or "m", but default
    to inches if not specified.
    """
    dia = U.length_conv(dia, from_units=dia_units, to_units='m')
    tas = U.speed_conv(tas, from_units=speed_units, to_units='m/s')
    speed_of_sound = SA.temp2speed_of_sound(temperature,
                                            temp_units=temp_units,
                                            speed_units='m/s')

    rotation_speed = dia * rpm * np.pi / 60
    tip_speed = np.sqrt(tas**2 + rotation_speed**2)
    tip_mach = tip_speed / speed_of_sound

    return tip_mach
Esempio n. 3
0
    def test_01(self):

        # speed of sound at 5,000 ft
        # Truth value from NASA RP 1046

        Value = SA.temp2speed_of_sound(SA.alt2temp(5000))
        Truth = 650.01
        self.assertLessEqual(RE(Value, Truth), 1e-5)
Esempio n. 4
0
    def test_04(self):

        # speed of sound at 10,000 m
        # Truth value from NASA RP 1046

        Value = SA.temp2speed_of_sound(SA.alt2temp(10000, alt_units='m'
                ))
        Truth = 582.11
        self.assertLessEqual(RE(Value, Truth), 1e-5)
Esempio n. 5
0
    def test_03(self):

        # speed of sound in km/h at 2,000 m, with temp in deg R
        # Truth value from NASA RP 1046

        Value = SA.temp2speed_of_sound(SA.alt2temp(2000, alt_units='m',
                temp_units='R'), speed_units='km/h', temp_units='R')
        Truth = 1197.1
        self.assertLessEqual(RE(Value, Truth), 1e-5)
Esempio n. 6
0
    def test_02(self):

        # speed of sound in mph at 8,000 ft
        # Truth value from NASA RP 1046

        Value = SA.temp2speed_of_sound(SA.alt2temp(8000),
                speed_units='mph')
        Truth = 739.98
        self.assertLessEqual(RE(Value, Truth), 1e-5)
Esempio n. 7
0
	def __init__(self, h, T_thermosphere):
		# Cantera Solution object
		self.gas = ct.Solution('air.xml')

		# Discretised altitude steps
		self.h = h

		# Average molecular diameter of gas
		self.d = 4E-10

		# Ratio of specific heats
		self.steps = len(h)

		self.rho = np.zeros(self.steps)
		self.p = np.zeros(self.steps)
		self.T = np.zeros(self.steps)
		self.a = np.zeros(self.steps)
		self.k = np.zeros(self.steps)
		self.mu = np.zeros(self.steps)

		# Call Jacchia77 model
		data = j77.j77sri(np.max(h), T_thermosphere)
		data_np = np.array(data)

		h_int = spint.griddata
		T_int = spint.griddata
		mw_int = spint.griddata
		n = spint.griddata

		for index, alt in enumerate(self.h):
			self.rho[index] = atm.alt2density(alt, alt_units='m', density_units='kg/m**3')
			self.p[index] = atm.alt2press(alt, press_units='pa', alt_units='m')
			self.T[index] = atm.alt2temp(alt, alt_units='m', temp_units='K')
			self.a[index] = atm.temp2speed_of_sound(self.T[index], temp_units='K', speed_units='m/s')

		for index, alt in enumerate(self.h):
			self.gas.TP = self.T[index], self.p[index]
			self.k[index] = self.gas.cp / self.gas.cv
			self.mu[index] = self.gas.viscosity
		return None