def compute_P_and_eff(aeroPower, ratedPower, Omega_rpm, drivetrainType, drivetrainEff): if not np.any(drivetrainEff): drivetrainType = drivetrainType.upper() if drivetrainType == "GEARED": constant = 0.01289 linear = 0.08510 quadratic = 0.0 elif drivetrainType == "SINGLE_STAGE": constant = 0.01331 linear = 0.03655 quadratic = 0.06107 elif drivetrainType == "MULTI_DRIVE": constant = 0.01547 linear = 0.04463 quadratic = 0.05790 elif drivetrainType in [ "PM_DIRECT_DRIVE", "DIRECT_DRIVE", "DIRECT DRIVE" ]: constant = 0.01007 linear = 0.02000 quadratic = 0.06899 elif drivetrainType == "CONSTANT_EFF": constant = 0.00 linear = 0.07 quadratic = 0.0 else: raise ValueError( "The drivetrain model is not supported! Please check rotor_power.py" ) Pbar0 = aeroPower / ratedPower # handle negative power case (with absolute value) Pbar1, dPbar1_dPbar0 = smooth_abs(Pbar0, dx=0.01) # truncate idealized power curve for purposes of efficiency calculation Pbar, dPbar_dPbar1, _ = smooth_min(Pbar1, 1.0, pct_offset=0.01) # compute efficiency eff = 1.0 - (constant / Pbar + linear + quadratic * Pbar) eff = np.maximum(eff, 1e-3) else: # Use table lookup from rpm to calculate total efficiency eff = np.interp(Omega_rpm, drivetrainEff[:, 0], drivetrainEff[:, 1]) return aeroPower * eff, eff
def compute_P_and_eff(aeroPower, ratedPower, drivetrainType, drivetrainEff): if drivetrainEff == 0.0: drivetrainType = drivetrainType.upper() if drivetrainType == 'GEARED': constant = 0.01289 linear = 0.08510 quadratic = 0.0 elif drivetrainType == 'SINGLE_STAGE': constant = 0.01331 linear = 0.03655 quadratic = 0.06107 elif drivetrainType == 'MULTI_DRIVE': constant = 0.01547 linear = 0.04463 quadratic = 0.05790 elif drivetrainType == 'PM_DIRECT_DRIVE': constant = 0.01007 linear = 0.02000 quadratic = 0.06899 elif drivetrainType == 'CONSTANT_EFF': constant = 0.00 linear = 0.07 quadratic = 0.0 elif drivetrainType == 'DIRECT DRIVE': constant = 0.00 linear = 0.07 quadratic = 0.0 else: exit( 'The drivetrain model is not supported! Please check servose.py' ) Pbar0 = aeroPower / ratedPower # handle negative power case (with absolute value) Pbar1, dPbar1_dPbar0 = smooth_abs(Pbar0, dx=0.01) # truncate idealized power curve for purposes of efficiency calculation Pbar, dPbar_dPbar1, _ = smooth_min(Pbar1, 1.0, pct_offset=0.01) # compute efficiency eff = 1.0 - (constant / Pbar + linear + quadratic * Pbar) else: eff = drivetrainEff return aeroPower * eff, eff
def hoopStressEurocode(d, t, L_reinforced, hoop): """default method for scaling hoop stress using Eurocode method GB 06/21/2018: Ansys comparisons for submerged case suggests this over-compensates for stiffener I'm not even sure the Eurocode is implemented correctly here. Suggest using the standard hoop stress expression above or API's handling of ring stiffeners below. """ r = d / 2.0 - t / 2.0 # radius of cylinder middle surface omega = L_reinforced / np.sqrt(r * t) C_theta = 1.5 # clamped-clamped k_w = 0.46 * (1.0 + 0.1 * np.sqrt(C_theta / omega * r / t)) k_w, _, _ = smooth_max(k_w, 0.65) k_w, _, _ = smooth_min(k_w, 1.0) return k_w * hoop