diff --git a/aviary/constants.py b/aviary/constants.py index b0ed5e5229..ca813d4aa9 100644 --- a/aviary/constants.py +++ b/aviary/constants.py @@ -15,14 +15,12 @@ 'm/s**2', ) # Venus Global Reference Atmospheric Model (Venus-GRAM): User Guide, NASA/TM-20210022168 -# RADIUS_EARTH = (6371009, 'm') # Source: GRS80, mean earth radius (rounded to nearest meter) -RADIUS_EARTH = (6356766, 'm') # TODO remove and replace with above +RADIUS_EARTH = (6371009, 'm') # Source: GRS80, mean earth radius (rounded to nearest meter) -# RADIUS_MARS = ( -# 3386200, -# 'm', -# ) # Mars Global Reference Atmospheric Model (Mars-GRAM) 2024: User Guide, NASA/TM-20240012934, avg of equatorial and polar radius -RADIUS_MARS = (3396200, 'm') # TODO remove and replace with above +RADIUS_MARS = ( + 3386200, + 'm', +) # Mars Global Reference Atmospheric Model (Mars-GRAM) 2024: User Guide, NASA/TM-20240012934, avg of equatorial and polar radius RADIUS_VENUS = ( 6051800, 'm', diff --git a/aviary/mission/two_dof/ode/test/test_breguet_cruise_ode.py b/aviary/mission/two_dof/ode/test/test_breguet_cruise_ode.py index d7d30f8e30..3bfb1c518b 100644 --- a/aviary/mission/two_dof/ode/test/test_breguet_cruise_ode.py +++ b/aviary/mission/two_dof/ode/test/test_breguet_cruise_ode.py @@ -57,16 +57,16 @@ def test_cruise(self): tol = tol = 1e-6 assert_near_equal(self.prob[Dynamic.Mission.VELOCITY_RATE], np.array([0.0, 0.0]), tol) - assert_near_equal(self.prob[Dynamic.Mission.DISTANCE], np.array([0.0, 923.39168758]), tol) - assert_near_equal(self.prob['time'], np.array([0, 8280.30660691]), tol) + assert_near_equal(self.prob[Dynamic.Mission.DISTANCE], np.array([0.0, 923.38992577]), tol) + assert_near_equal(self.prob['time'], np.array([0, 8280.29080821]), tol) assert_near_equal( self.prob[Dynamic.Mission.SPECIFIC_ENERGY_RATE_EXCESS], - np.array([3.88465429, 4.90288541]), + np.array([3.88463177, 4.90286726]), tol, ) assert_near_equal( self.prob[Dynamic.Mission.ALTITUDE_RATE_MAX], - np.array([3.88465429, 4.90288542]), + np.array([3.88463177, 4.90286726]), tol, ) @@ -123,21 +123,21 @@ def test_electric_cruise(self): tol = tol = 1e-6 assert_near_equal(self.prob[Dynamic.Mission.VELOCITY_RATE], np.array([0.0, 0.0]), tol) - assert_near_equal(self.prob[Dynamic.Mission.DISTANCE], np.array([0.0, 66.37436515]), tol) - assert_near_equal(self.prob['time'], np.array([0, 595.19714299]), tol) + assert_near_equal(self.prob[Dynamic.Mission.DISTANCE], np.array([0.0, 66.37459993]), tol) + assert_near_equal(self.prob['time'], np.array([0, 595.19924828]), tol) assert_near_equal( self.prob[Dynamic.Mission.SPECIFIC_ENERGY_RATE_EXCESS], - np.array([3.89228205, 4.91098053]), + np.array([3.89225953, 4.91096237]), tol, ) assert_near_equal( self.prob[Dynamic.Mission.ALTITUDE_RATE_MAX], - np.array([3.89228205, 4.91098053]), + np.array([3.89225953, 4.91096237]), tol, ) assert_near_equal( self.prob[Dynamic.Vehicle.Propulsion.ELECTRIC_POWER_IN_TOTAL], - np.array([4.45946124, 4.15324496]), + np.array([4.45947061, 4.15325208]), tol, ) diff --git a/aviary/mission/two_dof/ode/test/test_flight_ode.py b/aviary/mission/two_dof/ode/test/test_flight_ode.py index f748faeb25..fc93973e49 100644 --- a/aviary/mission/two_dof/ode/test/test_flight_ode.py +++ b/aviary/mission/two_dof/ode/test/test_flight_ode.py @@ -116,9 +116,9 @@ def test_end_of_climb(self): self.prob.run_model() testvals = { - Dynamic.Vehicle.ANGLE_OF_ATTACK: [3.99983993, 4.04378041], - Dynamic.Vehicle.LIFT_COEFFICIENT: [0.50719248, 0.61320271], - Dynamic.Vehicle.DRAG_COEFFICIENT: [0.02520388, 0.0312557], + Dynamic.Vehicle.ANGLE_OF_ATTACK: [3.99983969, 4.04381706], + Dynamic.Vehicle.LIFT_COEFFICIENT: [0.50719248, 0.613207], + Dynamic.Vehicle.DRAG_COEFFICIENT: [0.02520388, 0.03125595], Dynamic.Mission.ALTITUDE_RATE: [52.68288688, 9.32639661], # ft/s # TAS (kts -> ft/s) * cos(gamma), [319, 459] kts # ft/s @@ -127,7 +127,7 @@ def test_end_of_climb(self): -11418.00064615, -6042.88107957, ], - 'theta': [0.16776765, 0.08262117], # rad ([9.47740, 4.59730] deg), + 'theta': [0.16776764, 0.08262176], # rad ([9.47740, 4.59730] deg), # rad, gamma Dynamic.Mission.FLIGHT_PATH_ANGLE: [0.09795727, 0.01204389], Dynamic.Vehicle.Propulsion.THRUST_TOTAL: [25555.79617743, 10773.48189764], @@ -182,9 +182,9 @@ def test_high_alt(self): self.prob.run_model() testvals = { - Dynamic.Vehicle.ANGLE_OF_ATTACK: np.array([3.21974886, 1.20407839]), - Dynamic.Vehicle.LIFT_COEFFICIENT: np.array([0.51684124, 0.25916936]), - Dynamic.Vehicle.DRAG_COEFFICIENT: np.array([0.02633437, 0.01729238]), + Dynamic.Vehicle.ANGLE_OF_ATTACK: np.array([3.21977893, 1.20407788]), + Dynamic.Vehicle.LIFT_COEFFICIENT: np.array([0.51684476, 0.25916936]), + Dynamic.Vehicle.DRAG_COEFFICIENT: np.array([0.02633452, 0.01729237]), # ft/s Dynamic.Mission.ALTITUDE_RATE: np.array([-37.03297068, -44.19020778]), # TAS (ft/s) * cos(gamma), [458.67774, 437.62297] kts @@ -193,7 +193,7 @@ def test_high_alt(self): Dynamic.Vehicle.Propulsion.FUEL_MASS_FLOW_RATE_NEGATIVE_TOTAL: np.array( [-452.29666667, -997.48350936] ), - 'EAS': [418.57187298, 590.73344999], # ft/s ([247.95894, 349.99997] kts) + 'EAS': [418.57044883, 590.73344999], # ft/s ([247.95894, 349.99997] kts) Dynamic.Atmosphere.MACH: [0.8, 0.69721946], # gamma, rad ([-2.908332, -3.723388] deg) Dynamic.Mission.FLIGHT_PATH_ANGLE: [-0.04784061, -0.05986972], diff --git a/aviary/mission/two_dof/ode/test/test_simple_cruise_ode.py b/aviary/mission/two_dof/ode/test/test_simple_cruise_ode.py index 6ec2a1870b..ceb3c36458 100644 --- a/aviary/mission/two_dof/ode/test/test_simple_cruise_ode.py +++ b/aviary/mission/two_dof/ode/test/test_simple_cruise_ode.py @@ -61,12 +61,12 @@ def test_cruise(self): assert_near_equal(self.prob['time'], np.array([0, 8280.30660691]), tol) assert_near_equal( self.prob[Dynamic.Mission.SPECIFIC_ENERGY_RATE_EXCESS], - np.array([3.88465429, 4.90288541]), + np.array([3.88463177, 4.90286726]), tol, ) assert_near_equal( self.prob[Dynamic.Mission.ALTITUDE_RATE_MAX], - np.array([3.88465429, 4.90288542]), + np.array([3.88463177, 4.90286726]), tol, ) diff --git a/aviary/models/engines/turbofan_23k_1.csv b/aviary/models/engines/turbofan_23k_1.csv index 9b49987b0c..e220c64af1 100644 --- a/aviary/models/engines/turbofan_23k_1.csv +++ b/aviary/models/engines/turbofan_23k_1.csv @@ -116,7 +116,7 @@ Mach Number (input), Altitude (ft, input), Throttle (input), Thrust (lbf, output 0.0, 30000.0, 0.801, 2808.161, -2068.88, 2676.95 0.0, 30000.0, 0.8626, 14043.93, 6579.6, 2882.87 0.0, 30000.0, 0.9242, 29400.55, 4365.93, 3088.79 - 0.0, 30000.0, 0.9859, 60041.21, 12221.7, 3294.71 + 0.0, 30000.0, 0.9858, 60041.21, 12221.7, 3294.71 0.0, 33000.0, 0.0, 183.1717, 183.172, 0.0 0.0, 33000.0, 0.3601, 73148.22, 8353.32, 1203.52 0.0, 33000.0, 0.4201, 57096.47, 6361.09, 1404.1 @@ -272,7 +272,7 @@ Mach Number (input), Altitude (ft, input), Throttle (input), Thrust (lbf, output 0.05, 30000.0, 0.6781, -612.2555, 406.931, 2266.25 0.05, 30000.0, 0.7398, 1491.772, -206.138, 2472.27 0.05, 30000.0, 0.8014, 3295.707, -1231.19, 2678.29 - 0.05, 30000.0, 0.8631, 12370.15, 5613.44, 2884.31 + 0.05, 30000.0, 0.8630, 12370.15, 5613.44, 2884.31 0.05, 30000.0, 0.9247, 24896.87, 4169.04, 3090.34 0.05, 30000.0, 0.9863, 49261.2, 10598.3, 3296.36 0.05, 33000.0, 0.0, 183.4465, 183.447, 0.0 @@ -551,7 +551,7 @@ Mach Number (input), Altitude (ft, input), Throttle (input), Thrust (lbf, output 0.15, 21000.0, 0.5336, 1347.889, 783.42, 1783.41 0.15, 21000.0, 0.6003, 2219.631, 808.77, 2006.34 0.15, 21000.0, 0.667, 3067.974, 938.153, 2229.27 - 0.15, 21000.0, 0.7338, 2816.955, 1172.64, 2452.19 + 0.15, 21000.0, 0.7337, 2816.955, 1172.64, 2452.19 0.15, 21000.0, 0.8005, 5736.527, 1786.35, 2675.12 0.15, 21000.0, 0.8672, 9241.063, 3136.89, 2898.05 0.15, 21000.0, 0.9339, 11521.47, 4207.99, 3120.97 @@ -579,7 +579,7 @@ Mach Number (input), Altitude (ft, input), Throttle (input), Thrust (lbf, output 0.15, 27000.0, 0.9524, 5125.502, 3407.13, 3183.07 0.15, 30000.0, 0.0, 210.3324, 210.332, 0.0 0.15, 30000.0, 0.3714, -967.3588, 582.346, 1241.08 - 0.15, 30000.0, 0.4333, 347.277, 675.53, 1447.92 + 0.15, 30000.0, 0.4332, 347.277, 675.53, 1447.92 0.15, 30000.0, 0.4951, 1661.607, 768.81, 1654.77 0.15, 30000.0, 0.557, 2976.094, 862.034, 1861.61 0.15, 30000.0, 0.6189, 2931.884, 410.83, 2068.46 @@ -1346,7 +1346,7 @@ Mach Number (input), Altitude (ft, input), Throttle (input), Thrust (lbf, output 0.4, 27000.0, 0.6523, 1475.572, 755.644, 2180.14 0.4, 27000.0, 0.7176, 2716.512, 1128.13, 2398.16 0.4, 27000.0, 0.7828, 4217.789, 1654.76, 2616.17 - 0.4, 27000.0, 0.8481, 5842.676, 2330.43, 2834.18 + 0.4, 27000.0, 0.8480, 5842.676, 2330.43, 2834.18 0.4, 27000.0, 0.9133, 7939.486, 3106.92, 3052.2 0.4, 27000.0, 0.9785, 9155.314, 3925.65, 3270.21 0.4, 30000.0, 0.0, 228.0843, 228.084, 0.0 @@ -1669,7 +1669,7 @@ Mach Number (input), Altitude (ft, input), Throttle (input), Thrust (lbf, output 0.5, 33000.0, 0.5672, 390.9254, 299.0, 1895.54 0.5, 33000.0, 0.6302, 981.3919, 551.064, 2106.16 0.5, 33000.0, 0.6932, 1715.961, 846.817, 2316.77 - 0.5, 33000.0, 0.7563, 2950.938, 1294.56, 2527.39 + 0.5, 33000.0, 0.7562, 2950.938, 1294.56, 2527.39 0.5, 33000.0, 0.8193, 4283.182, 1800.03, 2738.0 0.5, 33000.0, 0.8823, 5594.077, 2358.21, 2948.62 0.5, 33000.0, 0.9453, 6646.168, 2951.3, 3159.23 @@ -1808,7 +1808,7 @@ Mach Number (input), Altitude (ft, input), Throttle (input), Thrust (lbf, output 0.55, 30000.0, 0.7841, 3563.936, 1618.71, 2620.53 0.55, 30000.0, 0.8495, 5155.267, 2270.37, 2838.91 0.55, 30000.0, 0.9148, 6746.392, 3017.25, 3057.29 - 0.55, 30000.0, 0.9802, 8117.883, 3833.5, 3275.66 + 0.55, 30000.0, 0.9801, 8117.883, 3833.5, 3275.66 0.55, 33000.0, 0.0, 218.4692, 218.469, 0.0 0.55, 33000.0, 0.3819, -2025.39, -521.596, 1276.33 0.55, 33000.0, 0.4456, -1287.775, -244.072, 1489.05 @@ -2392,7 +2392,7 @@ Mach Number (input), Altitude (ft, input), Throttle (input), Thrust (lbf, output 0.75, 36000.0, 0.78, 2515.761, 1389.19, 2606.63 0.75, 36000.0, 0.845, 3764.579, 1975.59, 2823.85 0.75, 36000.0, 0.91, 5018.906, 2636.88, 3041.07 - 0.75, 36000.0, 0.975, 6063.22, 3334.02, 3258.29 + 0.75, 36000.0, 0.9749, 6063.22, 3334.02, 3258.29 0.75, 39000.0, 0.0, 192.3188, 192.319, 0.0 0.75, 39000.0, 0.3894, -2080.694, -571.283, 1301.52 0.75, 39000.0, 0.4544, -1459.096, -309.662, 1518.45 diff --git a/aviary/subsystems/atmosphere/test/test_atmosphere.py b/aviary/subsystems/atmosphere/test/test_atmosphere.py index cd0027bffe..aa0939363d 100644 --- a/aviary/subsystems/atmosphere/test/test_atmosphere.py +++ b/aviary/subsystems/atmosphere/test/test_atmosphere.py @@ -774,47 +774,47 @@ def test_case1(self): expected_temp = [ 214.0, 214.0, - 212.90367517, - 205.06165228, - 175.32748498, - 144.92608122, - 138.76963819, + 212.90368601, + 205.06183381, + 175.32844222, + 144.92822046, + 138.76916394, ] # (K) expected_pressure = [ - 1.00063894e03, + 1.00064083e03, 6.36000000e02, - 4.03263659e02, - 2.54700751e02, - 3.36257797e01, - 9.85028628e-01, - 6.05868760e-02, + 4.03264437e02, + 2.54702817e02, + 3.36282855e01, + 9.85410669e-01, + 6.06174901e-02, ] # (Pa) expected_density = [ - 2.45157229e-02, + 2.45157695e-02, 1.55000000e-02, - 9.90639679e-03, - 6.48607867e-03, - 1.00353097e-03, - 3.55496703e-05, - 2.34696016e-06, + 9.90641566e-03, + 6.48612606e-03, + 1.00360200e-03, + 3.55628176e-05, + 2.34820930e-06, ] # (kg/m**3) expected_sos = [ 236.28995258, 236.28995258, - 235.68391712, - 231.30264265, - 213.8766485, - 194.45165464, - 190.27669372, + 235.68392312, + 231.30274503, + 213.87723235, + 194.45308977, + 190.27636859, ] # (m/s) expected_viscosity = [ 1.07917817e-05, 1.07917817e-05, - 1.07359540e-05, - 1.03346336e-05, - 8.78183710e-06, - 7.14661229e-06, - 6.81036963e-06, + 1.07359545e-05, + 1.03346429e-05, + 8.78188786e-06, + 7.14672886e-06, + 6.81034367e-06, ] # (Pa*s) expected_values = { diff --git a/aviary/subsystems/propulsion/test/test_propulsion_mission.py b/aviary/subsystems/propulsion/test/test_propulsion_mission.py index bc46254047..4bb1b4b67b 100644 --- a/aviary/subsystems/propulsion/test/test_propulsion_mission.py +++ b/aviary/subsystems/propulsion/test/test_propulsion_mission.py @@ -494,11 +494,11 @@ def test_case_no_max_thrust_turboprop(self): max_thrust = self.prob.get_val(Dynamic.Vehicle.Propulsion.THRUST_MAX_TOTAL, units='lbf') expected_thrust = np.array( - [42629.8926234, 34593.95599731, 20003.65216215, 12039.90789131, 8385.52777847] + [42629.8926234, 34593.95597499, 20003.65216215, 12039.90789131, 8385.527778477] ) expected_max_thrust = np.array( - [42629.8926234, 41028.5558649, 29561.74, 22590.025, 20411.435] + [42629.8926234, 41028.55584259, 29561.74, 22590.025, 20411.435] ) assert_near_equal(thrust, expected_thrust, tolerance=1e-10) diff --git a/aviary/subsystems/propulsion/test/test_turboprop_model.py b/aviary/subsystems/propulsion/test/test_turboprop_model.py index e019826a7b..2c579dbdaa 100644 --- a/aviary/subsystems/propulsion/test/test_turboprop_model.py +++ b/aviary/subsystems/propulsion/test/test_turboprop_model.py @@ -130,7 +130,6 @@ def test_case_1(self): 37.7, 610.28630998, 647.98630998, - # 4183.87495338, -195.8, ), ( @@ -138,15 +137,13 @@ def test_case_1(self): 136.3, 4047.57495338, 4183.87495338, - # 4183.87495338, -644.0, ), ( - 778.21130479, + 778.20881977, 21.3, - 558.33650216, - 579.63650216, - # 579.63650216, + 558.33473407, + 579.63473407, -839.7, ), ] @@ -209,7 +206,6 @@ def test_case_2(self): 37.507376, 610.67122085, 648.17859685, - # 4174.43077943, -195.78762, ), ( @@ -217,15 +213,13 @@ def test_case_2(self): 136.3, 4047.57495338, 4183.87495338, - # 4183.87495338, -644.0, ), ( - 778.21130479, + 778.20881977, 21.3, - 558.33650216, - 579.63650216, - # 579.63650216, + 558.33473407, + 579.63473407, -839.7, ), ] @@ -276,7 +270,6 @@ def test_case_3(self): 0.0, 610.28630998, 610.28630998, - # 4047.57495338, -195.8, ), ( @@ -284,15 +277,13 @@ def test_case_3(self): 0.0, 4047.57495338, 4047.57495338, - # 4047.57495338, -644.0, ), ( - 778.21130479, + 778.20881977, 0.0, - 558.33650216, - 558.33650216, - # 558.33650216, + 558.33473407, + 558.33473407, -839.7, ), ] @@ -364,7 +355,7 @@ def test_electroprop_fixed_RPM(self): prop_thrust_expected = total_thrust_expected = [ 610.28631174, 2083.18866404, - 184.42047241, + 184.42091722, ] electric_power_expected = [0.0, 303.31014553, 303.31014553] @@ -439,7 +430,7 @@ def test_control_rpm_turboprop(self): truth_vals = [ (111.99507922, 37.507376, 910.70245568, 948.20983168, -195.78762), (1119.99609612, 136.3, 2752.73508087, 2889.03508087, -644), - (778.21130479, 21.3, 558.33650216, 579.63650216, -839.7), + (778.20881977, 21.3, 558.33473407, 579.63473407, -839.7), ] options = get_option_defaults() diff --git a/aviary/validation_cases/benchmark_tests/test_battery_in_a_mission.py b/aviary/validation_cases/benchmark_tests/test_battery_in_a_mission.py index 1d12b2377d..cfcff344e7 100644 --- a/aviary/validation_cases/benchmark_tests/test_battery_in_a_mission.py +++ b/aviary/validation_cases/benchmark_tests/test_battery_in_a_mission.py @@ -101,8 +101,8 @@ def test_subsystems_in_a_mission(self): f'traj.cruise2.timeseries.{av.Dynamic.Vehicle.CUMULATIVE_ELECTRIC_ENERGY_USED}' ) expected_scalar_values = { - cumulative_energy_var: (38.46817379, 'kW*h'), - av.Mission.FUEL_MASS: (1249.64666191, 'lbm'), + cumulative_energy_var: (38.46816871, 'kW*h'), + av.Mission.FUEL_MASS: (1249.64650547, 'lbm'), } for var_name, (expected, units) in expected_scalar_values.items():