Skip to content

Commit

Permalink
Merge 7640269 into b55fa06
Browse files Browse the repository at this point in the history
  • Loading branch information
planes committed Apr 27, 2022
2 parents b55fa06 + 7640269 commit 7f7d23e
Show file tree
Hide file tree
Showing 10 changed files with 200 additions and 88 deletions.
6 changes: 2 additions & 4 deletions regression/scripts/VTOL/test_Stopped_Rotor.py
Expand Up @@ -74,7 +74,7 @@ def main():

# RPM of rotor check during hover
RPM = results.segments.climb_1.conditions.propulsion.lift_rotor_rpm[0][0]
RPM_true = 2403.0053609143974
RPM_true = 2403.004214209376
print(RPM)
diff_RPM = np.abs(RPM - RPM_true)
print('RPM difference')
Expand All @@ -83,7 +83,7 @@ def main():

# Battery Energy Check During Transition
battery_energy_hover_to_transition = results.segments.transition_1.conditions.propulsion.battery_energy[:,0]
battery_energy_hover_to_transition_true = np.array([3.36372831e+08, 3.34188966e+08, 3.32108809e+08])
battery_energy_hover_to_transition_true = np.array([3.36372833e+08, 3.34188971e+08, 3.32108816e+08])

print(battery_energy_hover_to_transition)
diff_battery_energy_hover_to_transition = np.abs(battery_energy_hover_to_transition - battery_energy_hover_to_transition_true)
Expand Down Expand Up @@ -266,8 +266,6 @@ def mission_setup(analyses,vehicle):
segment.process.iterate.conditions.stability = SUAVE.Methods.skip
segment.process.finalize.post_process.stability = SUAVE.Methods.skip
segment = vehicle.networks.lift_cruise.add_transition_unknowns_and_residuals_to_segment(segment,
initial_prop_power_coefficient = 0.2,
initial_lift_rotor_power_coefficient = 0.01,
initial_throttle_lift = 0.9,)

# add to misison
Expand Down
1 change: 1 addition & 0 deletions regression/scripts/Vehicles/Tiltrotor.py
Expand Up @@ -412,6 +412,7 @@ def vehicle_setup():
prop.design_thrust = (1.1*Hover_Load)/net.number_of_propeller_engines
prop.origin = [[2.,5.7,0.784]]
prop.rotation = -1
prop.sol_tolerance = 1e-4
prop.symmetry = True
prop.variable_pitch = True
prop.airfoil_geometry = ['../Vehicles/Airfoils/NACA_4412.txt']
Expand Down
Expand Up @@ -78,6 +78,7 @@ def main():
[677.94878779, 589.51079809, 503.24817575, 418.7527992 , 335.57780983]]



assert (np.all(np.nan_to_num(np.abs(climb_rate-climb_rate_r)/climb_rate_r) < 1e-6)), "Electric V_h Diagram Regression Failed"

return
Expand Down
Expand Up @@ -111,11 +111,11 @@ def test_2():
Cp = results.power_coefficient
etap = results.efficiency

thrust_r = 645.8624436654369
torque_r = 127.10005358627888
power_r = 29281.750271951667
Cp_r = 0.037380704154712806
etap_r = 0.22056825075927722
thrust_r = 645.8643152096909
torque_r = 127.10023264665021
power_r = 29281.791524499793
Cp_r = 0.03738075681718287
etap_r = 0.22056857916951647


assert (np.abs(thrust - thrust_r) / thrust_r < 1e-6), "Propeller Single Point Regression Failed at Thrust Test"
Expand Down
30 changes: 15 additions & 15 deletions regression/scripts/propeller/propeller_test.py
Expand Up @@ -205,28 +205,28 @@ def main():
plot_results(outputr, rot,'black','-','P')

# Truth values for propeller with airfoil geometry defined
F_a_truth = 3352.3646678384716
Q_a_truth = 978.76084883
P_a_truth = 202761.66815935
Cplast_a_truth = 0.10450829
F_a_truth = 3352.366469630676
Q_a_truth = 978.76113592
P_a_truth = 202761.72763161
Cplast_a_truth = 0.10450832

# Truth values for propeller without airfoil geometry defined
F_truth = 2629.0134410677906
Q_truth = 787.38493275
P_truth = 163115.92626346
Cplast_truth = 0.08407391
F_truth = 2629.013537561697
Q_truth = 787.38469662
P_truth = 163115.87734548
Cplast_truth = 0.08407389

# Truth values for rotor with airfoil geometry defined
Fr_a_truth = 1499.6757509190838
Qr_a_truth = 139.10603263
Pr_a_truth = 28817.42895722
Fr_a_truth = 1499.6766372165007
Qr_a_truth = 139.1060306
Pr_a_truth = 28817.42853679
Cplastr_a_truth = 0.04532838

# Truth values for rotor without airfoil geometry defined
Fr_truth = 1250.1858330726345
Qr_truth = 121.95427719
Pr_truth = 25264.24377481
Cplastr_truth = 0.0397394
Fr_truth = 1250.1858821890885
Qr_truth = 121.95416738
Pr_truth = 25264.22102656
Cplastr_truth = 0.03973936

# Store errors
error = Data()
Expand Down
6 changes: 3 additions & 3 deletions regression/scripts/segments/transition_segment_test.py
Expand Up @@ -60,9 +60,9 @@ def main():


# Truth values
departure_throttle_truth = np.array([0.65161055, 0.65183869, 0.65231038, 0.65255397])
transition_1_throttle_truth = np.array([0.65435655, 0.64938063, 0.52075798, 0.58035463])
cruise_throttle_truth = np.array([0.46376496, 0.46410324, 0.46478155, 0.46512157])
departure_throttle_truth = np.array([0.65161054, 0.65183868, 0.65231039, 0.65255397])
transition_1_throttle_truth = np.array([0.65434873, 0.64834806, 0.52075861, 0.58035428])
cruise_throttle_truth = np.array([0.46376169, 0.46409995, 0.4647782 , 0.4651182 ])
transition_y_axis_rotations_truth = np.array([1.36961133, 1.34327318, 1.10250854, 0.06580108])

# Store errors
Expand Down
4 changes: 2 additions & 2 deletions regression/scripts/slipstream/propeller_interactions.py
Expand Up @@ -64,15 +64,15 @@ def main():
T, Q, P, Cp, outputs , etap = run_downstream_propeller(prop, propeller_wake, conditions, plot_performance=plot_flag)

# compare regression results:
T_iso_true, Q_iso_true, P_iso_true, Cp_iso_true, etap_iso_true = 3.22978737601075, 0.07191506, 48.9510291, 0.04572029, 0.58991371
T_iso_true, Q_iso_true, P_iso_true, Cp_iso_true, etap_iso_true = 3.229745783054581, 0.07191487, 48.95089701, 0.04572016, 0.5899077

assert(abs(np.linalg.norm(T_iso)-T_iso_true)<1e-6)
assert(abs(Q_iso-Q_iso_true)<1e-6)
assert(abs(P_iso-P_iso_true)<1e-6)
assert(abs(Cp_iso-Cp_iso_true)<1e-6)
assert(abs(etap_iso-etap_iso_true)<1e-6)

T_true, Q_true, P_true, Cp_true, etap_true = 3.4488441181831626,0.07228313,49.20156567,0.04595429,0.62671635
T_true, Q_true, P_true, Cp_true, etap_true = 3.4500540433063036,0.07229935,49.2126083,0.0459646,0.62679554

assert(abs(np.linalg.norm(T)-T_true)<1e-6)
assert(abs(Q-Q_true)<1e-6)
Expand Down
7 changes: 4 additions & 3 deletions regression/scripts/slipstream/slipstream_test.py
Expand Up @@ -208,9 +208,10 @@ def Lift_Rotor_Slipstream(wake_fidelity):

def regress_2(results):

CL_truth = 0.41607982
CDi_truth = 0.00895358
CM_truth = 0.069561
CL_truth = 0.41607938
CDi_truth = 0.00895905
CM_truth = 0.06956314



CL = results.CL
Expand Down
1 change: 1 addition & 0 deletions trunk/SUAVE/Components/Energy/Converters/Rotor.py
Expand Up @@ -83,6 +83,7 @@ def __defaults__(self):
self.vtk_airfoil_points = 40
self.induced_power_factor = 1.48 # accounts for interference effects
self.profile_drag_coefficient = .03
self.sol_tolerance = 1e-8

self.use_2d_analysis = False # True if rotor is at an angle relative to freestream or nonuniform freestream
self.nonuniform_freestream = False
Expand Down

0 comments on commit 7f7d23e

Please sign in to comment.