def cp2bhp(Cp, rpm, density, dia, power_units='hp', density_units='lb/ft**3', dia_units='in'): """ Returns the bhp, given propeller power coefficient (Cp), revolutions per minute (rpm), and propeller diameter. The power units may be specified as "hp", "ft-lb/mn", "ft-lb/s", "W" (watts) or "kW" (kilowatts), but default to "hp" if not specified. The density units may be specified as "lb/ft**3", "slug/ft**3" or "kg/m**3", but default to "lb/ft**3" if not specified. The diameter units may be specified as "in", "ft", or "m", but default to inches if not specified. """ # bhp = U.power_conv(bhp, from_units = power_units, to_units = 'W') density = U.density_conv(density, from_units=density_units, to_units='kg/m**3') dia = U.length_conv(dia, from_units=dia_units, to_units='m') bhp = Cp * (density * ((rpm / 60.)**3) * dia**5) bhp = U.power_conv(bhp, from_units='W', to_units=power_units) return bhp
def eff2thrust(eff, bhp, TAS, power_units='hp', speed_units='kt', thrust_units='lb'): """ Returns thrust, given prop efficiency, true airspeed and brake power. Matches the results from the Hartzell prop map program fairly closely. """ TAS = U.speed_conv(TAS, from_units=speed_units, to_units='m/s') bhp = U.power_conv(bhp, from_units=power_units, to_units='W') thrust = eff * bhp / TAS return U.force_conv(thrust, from_units='N', to_units=thrust_units)
def BMEP(bhp, rpm, disp, power_units=default_power_units, vol_units=default_vol_units, press_units=default_press_units): """ Return brake mean effective pressure, given brake power, rpm and displacement. Rpm is revolutions per minute. """ bhp = unit.power_conv(bhp, power_units, 'hp') disp = unit.vol_conv(disp, vol_units, 'in**3') bmep = 2 * bhp * 33000. * 12 / (rpm * disp) return bmep
def test_04(self): Value = U.power_conv(0.74569987, from_units='kW', to_units='ft-lb/s') Truth = 550 self.assertLessEqual(RE(Value, Truth), 1e-5)
def test_02(self): Value = U.power_conv(33000, from_units='ft-lb/mn', to_units='hp') Truth = 1 self.assertLessEqual(RE(Value, Truth), 1e-5)