From 64bab5d8422ba8748a484e9a9433c009ff72861e Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Tue, 30 Jun 2026 18:34:29 +0000 Subject: [PATCH 01/16] gravity constants, enums added but some tests not passing --- aviary/constants.py | 8 ++ aviary/core/aviary_group.py | 8 ++ aviary/subsystems/atmosphere/atmosphere.py | 67 ++-------------- .../atmosphere/utils/get_atmosphere_data.py | 77 +++++++++++++++++++ aviary/variable_info/enums.py | 8 +- aviary/variable_info/variable_meta_data.py | 14 +++- aviary/variable_info/variables.py | 1 + 7 files changed, 121 insertions(+), 62 deletions(-) create mode 100644 aviary/subsystems/atmosphere/utils/get_atmosphere_data.py diff --git a/aviary/constants.py b/aviary/constants.py index 39e56aa8bc..2af73447b0 100644 --- a/aviary/constants.py +++ b/aviary/constants.py @@ -2,6 +2,14 @@ units.add_unit('distance_units', '1*m') +GRAV_EARTH = (9.80665, 'm/s**2') # NIST https://physics.nist.gov/cgi-bin/cuu/Value?gn|search_for=gravity +GRAV_MARS = (3.712, 'm/s**2') # Mars Global Reference Atmospheric Model (Mars-GRAM) 2024: User Guide, NASA/TM-20240012934 +GRAV_VENUS = (8.870, '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_MARS = (3386200, 'm') # Mars Global Reference Atmospheric Model (Mars-GRAM) 2024: User Guide, NASA/TM-20240012934, avg of equatorial and polar radii +RADIUS_VENUS = (6051800, 'm') # Venus Global Reference Atmospheric Model (Venus-GRAM): User Guide, NASA/TM-20210022168, avg of equatorial and polar radii + GRAV_METRIC_GASP = 9.81 # m/s^2 GRAV_ENGLISH_GASP = 32.2 # ft/s^2 GRAV_METRIC_FLOPS = 9.80665 # m/s^2 diff --git a/aviary/core/aviary_group.py b/aviary/core/aviary_group.py index 9a9544a3af..bbc79b4f16 100644 --- a/aviary/core/aviary_group.py +++ b/aviary/core/aviary_group.py @@ -41,6 +41,7 @@ PhaseType, ProblemType, Verbosity, + AtmosphereModel, ) from aviary.variable_info.functions import setup_trajectory_params from aviary.variable_info.variables import Aircraft, Mission, Settings @@ -453,6 +454,13 @@ def check_and_preprocess_inputs(self, verbosity=None): # Other specific self.*** are defined in here as well that are specific to each builder self.configurator.initial_guesses(self) + # Set the gravity model based on the atmosphere model to enable calculation of weight from mass + from aviary.subsystems.atmosphere.utils.get_atmosphere_data import get_atmosphere_data + if Settings.ATMOSPHERE_MODEL not in aviary_inputs: + aviary_inputs.set_val(Settings.ATMOSPHERE_MODEL, AtmosphereModel.STANDARD) # set the default atmosphere model + _,_,_,planet_gravity= get_atmosphere_data(aviary_inputs.get_val(Settings.ATMOSPHERE_MODEL)) + aviary_inputs.set_val(Settings.GRAVITY, val=planet_gravity) # contains both value and units as a tuple. + # TODO this seems like the wrong place to define the core subsystems. Maybe move to # load_inputs? ## Set Up Core Subsystems ## diff --git a/aviary/subsystems/atmosphere/atmosphere.py b/aviary/subsystems/atmosphere/atmosphere.py index bec651006d..94a2f7505c 100644 --- a/aviary/subsystems/atmosphere/atmosphere.py +++ b/aviary/subsystems/atmosphere/atmosphere.py @@ -1,24 +1,10 @@ import numpy as np import openmdao.api as om -from aviary.subsystems.atmosphere.data.MIL_SPEC_210A_Cold import atm_data as cold_210A -from aviary.subsystems.atmosphere.data.MIL_SPEC_210A_Hot import atm_data as hot_210A -from aviary.subsystems.atmosphere.data.MIL_SPEC_210A_Polar import atm_data as polar_210A -from aviary.subsystems.atmosphere.data.MIL_SPEC_210A_Tropical import atm_data as tropical_210A -from aviary.subsystems.atmosphere.data.StandardAtm1976 import atm_data as USatm1976 -from aviary.subsystems.atmosphere.data.MarsReference2024 import atm_data as MarsReference2024 -from aviary.subsystems.atmosphere.data.MarsHellasHot import atm_data as MarsHellasHot -from aviary.subsystems.atmosphere.data.MarsHellasCold import atm_data as MarsHellasCold -from aviary.subsystems.atmosphere.data.MarsEquatorHot import atm_data as MarsEquatorHot -from aviary.subsystems.atmosphere.data.MarsEquatorCold import atm_data as MarsEquatorCold -from aviary.subsystems.atmosphere.data.MarsPolarHot import atm_data as MarsPolarHot -from aviary.subsystems.atmosphere.data.MarsPolarCold import atm_data as MarsPolarCold -from aviary.subsystems.atmosphere.data.VenusReference2021 import atm_data as VenusReference2021 from aviary.subsystems.atmosphere.flight_conditions import FlightConditions from aviary.variable_info.enums import AtmosphereModel, SpeedType -from aviary.variable_info.functions import add_aviary_option from aviary.variable_info.variables import Dynamic, Settings - +from aviary.subsystems.atmosphere.utils.get_atmosphere_data import get_atmosphere_data class Atmosphere(om.Group): """ @@ -71,7 +57,6 @@ def setup(self): promotes=['*'], ) - class AtmosphereComp(om.ExplicitComponent): """ Component model for atmosphere tables. @@ -117,52 +102,17 @@ def setup(self): self._dt = self.options['delta_T_Celcius'] - self._R0 = 0 # instantiate and add correct value later + self.source_data, self.planet, planet_radius , _= get_atmosphere_data(self.options[Settings.ATMOSPHERE_MODEL]) + + self._R0 = planet_radius[0] # in meters + self._geometric = self.options['h_def'] == 'geometric' # From the U.S. Standard Atmosphere 1976 publication located here # https://www.ngdc.noaa.gov/stp/space-weather/online-publications/miscellaneous/us-standard-atmosphere-1976/us-standard-atmosphere_st76-1562_noaa.pdf Rs = 8314.32 # J/(kmol*K), Ideal Gas constant - - if self.options[Settings.ATMOSPHERE_MODEL] is AtmosphereModel.STANDARD: - self.source_data = USatm1976 - self.planet = 'Earth' - elif self.options[Settings.ATMOSPHERE_MODEL] is AtmosphereModel.TROPICAL: - self.source_data = tropical_210A - self.planet = 'Earth' - elif self.options[Settings.ATMOSPHERE_MODEL] is AtmosphereModel.POLAR: - self.source_data = polar_210A - self.planet = 'Earth' - elif self.options[Settings.ATMOSPHERE_MODEL] is AtmosphereModel.HOT: - self.source_data = hot_210A - self.planet = 'Earth' - elif self.options[Settings.ATMOSPHERE_MODEL] is AtmosphereModel.COLD: - self.source_data = cold_210A - self.planet = 'Earth' - elif self.options[Settings.ATMOSPHERE_MODEL] is AtmosphereModel.MARS_REFERENCE: - self.source_data = MarsReference2024 - self.planet = 'Mars' - elif self.options[Settings.ATMOSPHERE_MODEL] is AtmosphereModel.MARS_HELLAS_HOT: - self.source_data = MarsHellasHot - self.planet = 'Mars' - elif self.options[Settings.ATMOSPHERE_MODEL] is AtmosphereModel.MARS_HELLAS_COLD: - self.source_data = MarsHellasCold - self.planet = 'Mars' - elif self.options[Settings.ATMOSPHERE_MODEL] is AtmosphereModel.MARS_EQUATOR_HOT: - self.source_data = MarsEquatorHot - self.planet = 'Mars' - elif self.options[Settings.ATMOSPHERE_MODEL] is AtmosphereModel.MARS_EQUATOR_COLD: - self.source_data = MarsEquatorCold - self.planet = 'Mars' - elif self.options[Settings.ATMOSPHERE_MODEL] is AtmosphereModel.MARS_POLAR_HOT: - self.source_data = MarsPolarHot - self.planet = 'Mars' - elif self.options[Settings.ATMOSPHERE_MODEL] is AtmosphereModel.MARS_POLAR_COLD: - self.source_data = MarsPolarCold - self.planet = 'Mars' - elif self.options[Settings.ATMOSPHERE_MODEL] is AtmosphereModel.VENUS_REFERENCE: - self.source_data = VenusReference2021 - self.planet = 'Venus' + M_air = 0 # + gamma = 0 # # The constants below are used as a simplification to enable calculation of properties not given by by source data tables if self.planet == 'Earth': @@ -170,7 +120,6 @@ def setup(self): gamma = 1.4 # Ratio of specific heats self._S = 110.4 # (K) Southerlands constant for Earth air self._beta = 1.458e-6 # (s*m*K**(1/2)) viscosity scaling coefficient - self._R0 = 6_356_766 # (meters) The effective Earth Radius elif self.planet == 'Mars': M_air = 43.34 # (kg/kmol), mean molar mass of Mars atmosphere https://descanso.jpl.nasa.gov/propagation/mars/MarsPub_sec4.pdf gamma = 1.36 # Ratio of specific heats, Based on averaging values from Hellas_summar, Hellas_winter, Equatorial_summar, @@ -180,7 +129,6 @@ def setup(self): self._beta = 1.503e-6 # (s*m*K**(1/2)) viscosity scaling coefficient calculated from other constants listed for C02 # https://doc.comsol.com/5.6/doc/com.comsol.help.cfd/cfd_ug_fluidflow_high_mach.08.27.html # Calculated via the equation: self_beta = 1.370**10-5 * (273+self._S)/273**(3/2) - self._R0 = 3_396_200 # (meters) Mean Equatorial Radius of Mars elif self.planet == 'Venus': # 96% CO2 atmosphere M_air = 43.45 # (kg/kmol) Venus, 12 Apr 2024, by Cedric Gillmann et al. https://arxiv.org/html/2404.07669v2 @@ -189,7 +137,6 @@ def setup(self): self._S = 222 # (K) we use the constant for CO2 which is simillar to Mars because this atmosphere is primarily driven by CO2 interaction. self._beta = 1.503e-6 # (s*m*K**(1/2)) viscosity scaling coefficient calculated from other constants listed for C02, the same way as was done for Mars # the only input the the equation os self._S so this result is the same as Mars - self._R0 = 6_051_800 # (meters) Mean Equatorial Radius self._R_air = Rs / M_air # (J/ (kg * K)), gas constant for atmosphere self._K = gamma * Rs / M_air # (J/(kg * K)) diff --git a/aviary/subsystems/atmosphere/utils/get_atmosphere_data.py b/aviary/subsystems/atmosphere/utils/get_atmosphere_data.py new file mode 100644 index 0000000000..872751f402 --- /dev/null +++ b/aviary/subsystems/atmosphere/utils/get_atmosphere_data.py @@ -0,0 +1,77 @@ +from aviary.variable_info.enums import Gravity +from aviary.subsystems.atmosphere.data.MIL_SPEC_210A_Cold import atm_data as cold_210A +from aviary.subsystems.atmosphere.data.MIL_SPEC_210A_Hot import atm_data as hot_210A +from aviary.subsystems.atmosphere.data.MIL_SPEC_210A_Polar import atm_data as polar_210A +from aviary.subsystems.atmosphere.data.MIL_SPEC_210A_Tropical import atm_data as tropical_210A +from aviary.subsystems.atmosphere.data.StandardAtm1976 import atm_data as USatm1976 +from aviary.subsystems.atmosphere.data.MarsReference2024 import atm_data as MarsReference2024 +from aviary.subsystems.atmosphere.data.MarsHellasHot import atm_data as MarsHellasHot +from aviary.subsystems.atmosphere.data.MarsHellasCold import atm_data as MarsHellasCold +from aviary.subsystems.atmosphere.data.MarsEquatorHot import atm_data as MarsEquatorHot +from aviary.subsystems.atmosphere.data.MarsEquatorCold import atm_data as MarsEquatorCold +from aviary.subsystems.atmosphere.data.MarsPolarHot import atm_data as MarsPolarHot +from aviary.subsystems.atmosphere.data.MarsPolarCold import atm_data as MarsPolarCold +from aviary.subsystems.atmosphere.data.VenusReference2021 import atm_data as VenusReference2021 +from aviary.variable_info.enums import AtmosphereModel +from aviary.constants import RADIUS_EARTH, RADIUS_MARS, RADIUS_VENUS + +def get_atmosphere_data(atmosphere_model): + """ + Return the atmosphere source data, planet name, and gravitational constant + associated with the requested atmosphere model. + + Parameters + ---------- + atmosphere_model : AtmosphereModel + Atmosphere model enum. + + Returns + ------- + tuple + (source_data, planet, gravity) + """ + atmosphere_lookup = { + AtmosphereModel.STANDARD: + (USatm1976, 'Earth', RADIUS_EARTH, Gravity.EARTH), + + AtmosphereModel.TROPICAL: + (tropical_210A, 'Earth', RADIUS_EARTH, Gravity.EARTH), + + AtmosphereModel.POLAR: + (polar_210A, 'Earth', RADIUS_EARTH, Gravity.EARTH), + + AtmosphereModel.HOT: + (hot_210A, 'Earth', RADIUS_EARTH, Gravity.EARTH), + + AtmosphereModel.COLD: + (cold_210A, 'Earth', RADIUS_EARTH, Gravity.EARTH), + + AtmosphereModel.MARS_REFERENCE: + (MarsReference2024, 'Mars', RADIUS_MARS, Gravity.MARS), + + AtmosphereModel.MARS_HELLAS_HOT: + (MarsHellasHot, 'Mars', RADIUS_MARS, Gravity.MARS), + + AtmosphereModel.MARS_HELLAS_COLD: + (MarsHellasCold, 'Mars', RADIUS_MARS, Gravity.MARS), + + AtmosphereModel.MARS_EQUATOR_HOT: + (MarsEquatorHot, 'Mars', RADIUS_MARS, Gravity.MARS), + + AtmosphereModel.MARS_EQUATOR_COLD: + (MarsEquatorCold, 'Mars', RADIUS_MARS, Gravity.MARS), + + AtmosphereModel.MARS_POLAR_HOT: + (MarsPolarHot, 'Mars', RADIUS_MARS, Gravity.MARS), + + AtmosphereModel.MARS_POLAR_COLD: + (MarsPolarCold, 'Mars', RADIUS_MARS, Gravity.MARS), + + AtmosphereModel.VENUS_REFERENCE: + (VenusReference2021, 'Venus', RADIUS_VENUS, Gravity.VENUS), + } + + try: + return atmosphere_lookup[atmosphere_model] + except KeyError: + raise ValueError(f'Unsupported atmosphere model: {atmosphere_model}') \ No newline at end of file diff --git a/aviary/variable_info/enums.py b/aviary/variable_info/enums.py index 5d6487927e..81d518c0d5 100644 --- a/aviary/variable_info/enums.py +++ b/aviary/variable_info/enums.py @@ -1,5 +1,5 @@ from enum import Enum, IntEnum, auto, unique - +import aviary.constants as constants class AircraftTypes(Enum): """Aircraft types.""" @@ -95,6 +95,12 @@ class EngineDeckType(Enum): def __str__(self): return self.value +class Gravity(Enum): + """Set the gravitational constant based on planet.""" + + EARTH = constants.GRAV_EARTH + MARS = constants.GRAV_MARS + VENUS = constants.GRAV_VENUS @unique class GASPEngineType(Enum): diff --git a/aviary/variable_info/variable_meta_data.py b/aviary/variable_info/variable_meta_data.py index dfef2a2cb2..580ae39e44 100644 --- a/aviary/variable_info/variable_meta_data.py +++ b/aviary/variable_info/variable_meta_data.py @@ -15,6 +15,7 @@ ProblemType, Verbosity, AtmosphereModel, + Gravity, ) from aviary.variable_info.variables import Aircraft, Dynamic, Mission, Settings @@ -7729,7 +7730,7 @@ 'mars_equator_cold, mars_polar_hot, mars_polar_cold, venus_reference', option=True, types=AtmosphereModel, - default_value=AtmosphereModel.STANDARD, + # default_value=AtmosphereModel.STANDARD, # this default is executed and used before setup so it is in aviary_group.py ) add_meta_data( @@ -7742,6 +7743,17 @@ default_value=None, ) +add_meta_data( + # Gravity model is set automatically based on Settings.ATMOSPHERE_MODEL + Settings.GRAVITY, + meta_data=_MetaData, + historical_name={'GASP': None, 'FLOPS': None}, + desc='Gravitational acceleration of the planet.', + types=Gravity, + option=True, + default_value=Gravity.EARTH, +) + add_meta_data( Settings.MASS_METHOD, meta_data=_MetaData, diff --git a/aviary/variable_info/variables.py b/aviary/variable_info/variables.py index 8ebb486e91..d6f727f713 100644 --- a/aviary/variable_info/variables.py +++ b/aviary/variable_info/variables.py @@ -771,6 +771,7 @@ class Settings: AERODYNAMICS_METHOD = 'settings:aerodynamics_method' ATMOSPHERE_MODEL = 'settings:atmosphere_model' EQUATIONS_OF_MOTION = 'settings:equations_of_motion' + GRAVITY = 'settings:gravity' MASS_METHOD = 'settings:mass_method' PAYLOAD_RANGE = 'settings:payload_range' PROBLEM_TYPE = 'settings:problem_type' From 7c177fd477bd82660da28974978fbc75c9c28181 Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Mon, 6 Jul 2026 19:17:49 +0000 Subject: [PATCH 02/16] removed enums as not necessary, test_fuselage.py is now running, but a number of unexpected tiny errors (1e-6) in other tests --- aviary/core/aviary_group.py | 7 ----- .../atmosphere/utils/get_atmosphere_data.py | 31 +++++++++---------- aviary/utils/preprocessors.py | 10 ++++++ aviary/variable_info/enums.py | 8 ----- aviary/variable_info/variable_meta_data.py | 26 ++++++++-------- aviary/variable_info/variables.py | 2 +- 6 files changed, 39 insertions(+), 45 deletions(-) diff --git a/aviary/core/aviary_group.py b/aviary/core/aviary_group.py index bbc79b4f16..7013327cf2 100644 --- a/aviary/core/aviary_group.py +++ b/aviary/core/aviary_group.py @@ -454,13 +454,6 @@ def check_and_preprocess_inputs(self, verbosity=None): # Other specific self.*** are defined in here as well that are specific to each builder self.configurator.initial_guesses(self) - # Set the gravity model based on the atmosphere model to enable calculation of weight from mass - from aviary.subsystems.atmosphere.utils.get_atmosphere_data import get_atmosphere_data - if Settings.ATMOSPHERE_MODEL not in aviary_inputs: - aviary_inputs.set_val(Settings.ATMOSPHERE_MODEL, AtmosphereModel.STANDARD) # set the default atmosphere model - _,_,_,planet_gravity= get_atmosphere_data(aviary_inputs.get_val(Settings.ATMOSPHERE_MODEL)) - aviary_inputs.set_val(Settings.GRAVITY, val=planet_gravity) # contains both value and units as a tuple. - # TODO this seems like the wrong place to define the core subsystems. Maybe move to # load_inputs? ## Set Up Core Subsystems ## diff --git a/aviary/subsystems/atmosphere/utils/get_atmosphere_data.py b/aviary/subsystems/atmosphere/utils/get_atmosphere_data.py index 872751f402..2dd82f33a4 100644 --- a/aviary/subsystems/atmosphere/utils/get_atmosphere_data.py +++ b/aviary/subsystems/atmosphere/utils/get_atmosphere_data.py @@ -1,4 +1,3 @@ -from aviary.variable_info.enums import Gravity from aviary.subsystems.atmosphere.data.MIL_SPEC_210A_Cold import atm_data as cold_210A from aviary.subsystems.atmosphere.data.MIL_SPEC_210A_Hot import atm_data as hot_210A from aviary.subsystems.atmosphere.data.MIL_SPEC_210A_Polar import atm_data as polar_210A @@ -13,7 +12,7 @@ from aviary.subsystems.atmosphere.data.MarsPolarCold import atm_data as MarsPolarCold from aviary.subsystems.atmosphere.data.VenusReference2021 import atm_data as VenusReference2021 from aviary.variable_info.enums import AtmosphereModel -from aviary.constants import RADIUS_EARTH, RADIUS_MARS, RADIUS_VENUS +from aviary.constants import RADIUS_EARTH, RADIUS_MARS, RADIUS_VENUS, GRAV_EARTH, GRAV_MARS, GRAV_VENUS def get_atmosphere_data(atmosphere_model): """ @@ -32,46 +31,46 @@ def get_atmosphere_data(atmosphere_model): """ atmosphere_lookup = { AtmosphereModel.STANDARD: - (USatm1976, 'Earth', RADIUS_EARTH, Gravity.EARTH), + (USatm1976, 'Earth', RADIUS_EARTH, GRAV_EARTH), AtmosphereModel.TROPICAL: - (tropical_210A, 'Earth', RADIUS_EARTH, Gravity.EARTH), + (tropical_210A, 'Earth', RADIUS_EARTH, GRAV_EARTH), AtmosphereModel.POLAR: - (polar_210A, 'Earth', RADIUS_EARTH, Gravity.EARTH), + (polar_210A, 'Earth', RADIUS_EARTH, GRAV_EARTH), AtmosphereModel.HOT: - (hot_210A, 'Earth', RADIUS_EARTH, Gravity.EARTH), + (hot_210A, 'Earth', RADIUS_EARTH, GRAV_EARTH), AtmosphereModel.COLD: - (cold_210A, 'Earth', RADIUS_EARTH, Gravity.EARTH), + (cold_210A, 'Earth', RADIUS_EARTH, GRAV_EARTH), AtmosphereModel.MARS_REFERENCE: - (MarsReference2024, 'Mars', RADIUS_MARS, Gravity.MARS), + (MarsReference2024, 'Mars', RADIUS_MARS, GRAV_MARS), AtmosphereModel.MARS_HELLAS_HOT: - (MarsHellasHot, 'Mars', RADIUS_MARS, Gravity.MARS), + (MarsHellasHot, 'Mars', RADIUS_MARS, GRAV_MARS), AtmosphereModel.MARS_HELLAS_COLD: - (MarsHellasCold, 'Mars', RADIUS_MARS, Gravity.MARS), + (MarsHellasCold, 'Mars', RADIUS_MARS, GRAV_MARS), AtmosphereModel.MARS_EQUATOR_HOT: - (MarsEquatorHot, 'Mars', RADIUS_MARS, Gravity.MARS), + (MarsEquatorHot, 'Mars', RADIUS_MARS, GRAV_MARS), AtmosphereModel.MARS_EQUATOR_COLD: - (MarsEquatorCold, 'Mars', RADIUS_MARS, Gravity.MARS), + (MarsEquatorCold, 'Mars', RADIUS_MARS, GRAV_MARS), AtmosphereModel.MARS_POLAR_HOT: - (MarsPolarHot, 'Mars', RADIUS_MARS, Gravity.MARS), + (MarsPolarHot, 'Mars', RADIUS_MARS, GRAV_MARS), AtmosphereModel.MARS_POLAR_COLD: - (MarsPolarCold, 'Mars', RADIUS_MARS, Gravity.MARS), + (MarsPolarCold, 'Mars', RADIUS_MARS, GRAV_MARS), AtmosphereModel.VENUS_REFERENCE: - (VenusReference2021, 'Venus', RADIUS_VENUS, Gravity.VENUS), + (VenusReference2021, 'Venus', RADIUS_VENUS, GRAV_VENUS), } try: return atmosphere_lookup[atmosphere_model] except KeyError: - raise ValueError(f'Unsupported atmosphere model: {atmosphere_model}') \ No newline at end of file + raise ValueError(f'Could not find {atmosphere_model} in get_atmosphere_data().') \ No newline at end of file diff --git a/aviary/utils/preprocessors.py b/aviary/utils/preprocessors.py index cc4fefbe36..ccf9e44992 100644 --- a/aviary/utils/preprocessors.py +++ b/aviary/utils/preprocessors.py @@ -92,6 +92,16 @@ def preprocess_options( ): aviary_options.set_val(Aircraft.Design.PERCENT_EXCRESCENCE_DRAG, 0.06) + # preprocess atmosphere / GRAV?? + # Set the gravity model based on the atmosphere model to enable calculation of weight from mass + from aviary.subsystems.atmosphere.utils.get_atmosphere_data import get_atmosphere_data + if Settings.ATMOSPHERE_MODEL not in aviary_options: + aviary_options.set_val(Settings.ATMOSPHERE_MODEL, meta_data[Settings.ATMOSPHERE_MODEL]['default_value']) + _,_,_,planet_gravity= get_atmosphere_data(aviary_options.get_val(Settings.ATMOSPHERE_MODEL)) + if Mission.GRAVITY not in aviary_options: # Check to see if the user has set a gravity profile. + # No gravity profile is set, set it now. + aviary_options.set_val(Mission.GRAVITY, val=planet_gravity[0], units=planet_gravity[1]) # contains both value and units as a tuple. + def preprocess_crewpayload(aviary_options: AviaryValues, meta_data=CoreMetaData, verbosity=None): """ diff --git a/aviary/variable_info/enums.py b/aviary/variable_info/enums.py index 81d518c0d5..8d4583cac3 100644 --- a/aviary/variable_info/enums.py +++ b/aviary/variable_info/enums.py @@ -1,5 +1,4 @@ from enum import Enum, IntEnum, auto, unique -import aviary.constants as constants class AircraftTypes(Enum): """Aircraft types.""" @@ -95,13 +94,6 @@ class EngineDeckType(Enum): def __str__(self): return self.value -class Gravity(Enum): - """Set the gravitational constant based on planet.""" - - EARTH = constants.GRAV_EARTH - MARS = constants.GRAV_MARS - VENUS = constants.GRAV_VENUS - @unique class GASPEngineType(Enum): """ diff --git a/aviary/variable_info/variable_meta_data.py b/aviary/variable_info/variable_meta_data.py index 580ae39e44..629de77b45 100644 --- a/aviary/variable_info/variable_meta_data.py +++ b/aviary/variable_info/variable_meta_data.py @@ -15,9 +15,9 @@ ProblemType, Verbosity, AtmosphereModel, - Gravity, ) from aviary.variable_info.variables import Aircraft, Dynamic, Mission, Settings +import aviary.constants as constants # --------------------------- # Meta data associated with variables in the aircraft data hierarchy. @@ -6893,6 +6893,17 @@ 'specifies a taxi phase as part of the regular mission phases.', ) +add_meta_data( + Mission.GRAVITY, + meta_data=_MetaData, + historical_name={'GASP': None, 'FLOPS': None}, + desc='Gravitational acceleration of the planet.', + types=float, + option=True, + # The default gravity model is set based on Settings.ATMOSPHERE_MODEL + units='m/s**2' +) + add_meta_data( Mission.GROSS_MASS, meta_data=_MetaData, @@ -7730,7 +7741,7 @@ 'mars_equator_cold, mars_polar_hot, mars_polar_cold, venus_reference', option=True, types=AtmosphereModel, - # default_value=AtmosphereModel.STANDARD, # this default is executed and used before setup so it is in aviary_group.py + default_value=AtmosphereModel.STANDARD, ) add_meta_data( @@ -7743,17 +7754,6 @@ default_value=None, ) -add_meta_data( - # Gravity model is set automatically based on Settings.ATMOSPHERE_MODEL - Settings.GRAVITY, - meta_data=_MetaData, - historical_name={'GASP': None, 'FLOPS': None}, - desc='Gravitational acceleration of the planet.', - types=Gravity, - option=True, - default_value=Gravity.EARTH, -) - add_meta_data( Settings.MASS_METHOD, meta_data=_MetaData, diff --git a/aviary/variable_info/variables.py b/aviary/variable_info/variables.py index d6f727f713..a6a2ab7d74 100644 --- a/aviary/variable_info/variables.py +++ b/aviary/variable_info/variables.py @@ -676,6 +676,7 @@ class Mission: FINAL_MASS = 'mission:final_mass' FINAL_TIME = 'mission:final_time' FUEL_MASS = 'mission:fuel_mass' + GRAVITY = 'mission:gravity' GROSS_MASS = 'mission:gross_mass' OPERATING_ITEMS_MASS = 'mission:operating_items_mass' OPERATING_ITEMS_MASS_ADDITIONAL = 'mission:operating_items_mass_additional' @@ -771,7 +772,6 @@ class Settings: AERODYNAMICS_METHOD = 'settings:aerodynamics_method' ATMOSPHERE_MODEL = 'settings:atmosphere_model' EQUATIONS_OF_MOTION = 'settings:equations_of_motion' - GRAVITY = 'settings:gravity' MASS_METHOD = 'settings:mass_method' PAYLOAD_RANGE = 'settings:payload_range' PROBLEM_TYPE = 'settings:problem_type' From 86b0ecaabb5a484fcb500766926e2ea3093c95f9 Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Mon, 6 Jul 2026 20:07:14 +0000 Subject: [PATCH 03/16] ruff --- aviary/constants.py | 27 ++++++-- aviary/core/aviary_group.py | 1 - aviary/subsystems/atmosphere/atmosphere.py | 12 ++-- .../atmosphere/utils/get_atmosphere_data.py | 63 +++++++------------ aviary/utils/preprocessors.py | 13 ++-- aviary/variable_info/enums.py | 2 + aviary/variable_info/variable_meta_data.py | 4 +- 7 files changed, 65 insertions(+), 57 deletions(-) diff --git a/aviary/constants.py b/aviary/constants.py index 2af73447b0..7962763e1c 100644 --- a/aviary/constants.py +++ b/aviary/constants.py @@ -2,13 +2,28 @@ units.add_unit('distance_units', '1*m') -GRAV_EARTH = (9.80665, 'm/s**2') # NIST https://physics.nist.gov/cgi-bin/cuu/Value?gn|search_for=gravity -GRAV_MARS = (3.712, 'm/s**2') # Mars Global Reference Atmospheric Model (Mars-GRAM) 2024: User Guide, NASA/TM-20240012934 -GRAV_VENUS = (8.870, 'm/s**2') # Venus Global Reference Atmospheric Model (Venus-GRAM): User Guide, NASA/TM-20210022168 +GRAV_EARTH = ( + 9.80665, + 'm/s**2', +) # NIST https://physics.nist.gov/cgi-bin/cuu/Value?gn|search_for=gravity +GRAV_MARS = ( + 3.712, + 'm/s**2', +) # Mars Global Reference Atmospheric Model (Mars-GRAM) 2024: User Guide, NASA/TM-20240012934 +GRAV_VENUS = ( + 8.870, + '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_MARS = (3386200, 'm') # Mars Global Reference Atmospheric Model (Mars-GRAM) 2024: User Guide, NASA/TM-20240012934, avg of equatorial and polar radii -RADIUS_VENUS = (6051800, 'm') # Venus Global Reference Atmospheric Model (Venus-GRAM): User Guide, NASA/TM-20210022168, avg of equatorial and polar radii +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_VENUS = ( + 6051800, + 'm', +) # Venus Global Reference Atmospheric Model (Venus-GRAM): User Guide, NASA/TM-20210022168, avg of equatorial and polar radius GRAV_METRIC_GASP = 9.81 # m/s^2 GRAV_ENGLISH_GASP = 32.2 # ft/s^2 diff --git a/aviary/core/aviary_group.py b/aviary/core/aviary_group.py index 7013327cf2..9a9544a3af 100644 --- a/aviary/core/aviary_group.py +++ b/aviary/core/aviary_group.py @@ -41,7 +41,6 @@ PhaseType, ProblemType, Verbosity, - AtmosphereModel, ) from aviary.variable_info.functions import setup_trajectory_params from aviary.variable_info.variables import Aircraft, Mission, Settings diff --git a/aviary/subsystems/atmosphere/atmosphere.py b/aviary/subsystems/atmosphere/atmosphere.py index 94a2f7505c..9536ef28dc 100644 --- a/aviary/subsystems/atmosphere/atmosphere.py +++ b/aviary/subsystems/atmosphere/atmosphere.py @@ -6,6 +6,7 @@ from aviary.variable_info.variables import Dynamic, Settings from aviary.subsystems.atmosphere.utils.get_atmosphere_data import get_atmosphere_data + class Atmosphere(om.Group): """ Group that contains atmospheric conditions for the aircraft's current flight @@ -57,6 +58,7 @@ def setup(self): promotes=['*'], ) + class AtmosphereComp(om.ExplicitComponent): """ Component model for atmosphere tables. @@ -102,17 +104,19 @@ def setup(self): self._dt = self.options['delta_T_Celcius'] - self.source_data, self.planet, planet_radius , _= get_atmosphere_data(self.options[Settings.ATMOSPHERE_MODEL]) + self.source_data, self.planet, planet_radius, _ = get_atmosphere_data( + self.options[Settings.ATMOSPHERE_MODEL] + ) - self._R0 = planet_radius[0] # in meters + self._R0 = planet_radius[0] # in meters self._geometric = self.options['h_def'] == 'geometric' # From the U.S. Standard Atmosphere 1976 publication located here # https://www.ngdc.noaa.gov/stp/space-weather/online-publications/miscellaneous/us-standard-atmosphere-1976/us-standard-atmosphere_st76-1562_noaa.pdf Rs = 8314.32 # J/(kmol*K), Ideal Gas constant - M_air = 0 # - gamma = 0 # + M_air = 0 # + gamma = 0 # # The constants below are used as a simplification to enable calculation of properties not given by by source data tables if self.planet == 'Earth': diff --git a/aviary/subsystems/atmosphere/utils/get_atmosphere_data.py b/aviary/subsystems/atmosphere/utils/get_atmosphere_data.py index 2dd82f33a4..7fc8f0dc2f 100644 --- a/aviary/subsystems/atmosphere/utils/get_atmosphere_data.py +++ b/aviary/subsystems/atmosphere/utils/get_atmosphere_data.py @@ -12,7 +12,15 @@ from aviary.subsystems.atmosphere.data.MarsPolarCold import atm_data as MarsPolarCold from aviary.subsystems.atmosphere.data.VenusReference2021 import atm_data as VenusReference2021 from aviary.variable_info.enums import AtmosphereModel -from aviary.constants import RADIUS_EARTH, RADIUS_MARS, RADIUS_VENUS, GRAV_EARTH, GRAV_MARS, GRAV_VENUS +from aviary.constants import ( + RADIUS_EARTH, + RADIUS_MARS, + RADIUS_VENUS, + GRAV_EARTH, + GRAV_MARS, + GRAV_VENUS, +) + def get_atmosphere_data(atmosphere_model): """ @@ -30,47 +38,22 @@ def get_atmosphere_data(atmosphere_model): (source_data, planet, gravity) """ atmosphere_lookup = { - AtmosphereModel.STANDARD: - (USatm1976, 'Earth', RADIUS_EARTH, GRAV_EARTH), - - AtmosphereModel.TROPICAL: - (tropical_210A, 'Earth', RADIUS_EARTH, GRAV_EARTH), - - AtmosphereModel.POLAR: - (polar_210A, 'Earth', RADIUS_EARTH, GRAV_EARTH), - - AtmosphereModel.HOT: - (hot_210A, 'Earth', RADIUS_EARTH, GRAV_EARTH), - - AtmosphereModel.COLD: - (cold_210A, 'Earth', RADIUS_EARTH, GRAV_EARTH), - - AtmosphereModel.MARS_REFERENCE: - (MarsReference2024, 'Mars', RADIUS_MARS, GRAV_MARS), - - AtmosphereModel.MARS_HELLAS_HOT: - (MarsHellasHot, 'Mars', RADIUS_MARS, GRAV_MARS), - - AtmosphereModel.MARS_HELLAS_COLD: - (MarsHellasCold, 'Mars', RADIUS_MARS, GRAV_MARS), - - AtmosphereModel.MARS_EQUATOR_HOT: - (MarsEquatorHot, 'Mars', RADIUS_MARS, GRAV_MARS), - - AtmosphereModel.MARS_EQUATOR_COLD: - (MarsEquatorCold, 'Mars', RADIUS_MARS, GRAV_MARS), - - AtmosphereModel.MARS_POLAR_HOT: - (MarsPolarHot, 'Mars', RADIUS_MARS, GRAV_MARS), - - AtmosphereModel.MARS_POLAR_COLD: - (MarsPolarCold, 'Mars', RADIUS_MARS, GRAV_MARS), - - AtmosphereModel.VENUS_REFERENCE: - (VenusReference2021, 'Venus', RADIUS_VENUS, GRAV_VENUS), + AtmosphereModel.STANDARD: (USatm1976, 'Earth', RADIUS_EARTH, GRAV_EARTH), + AtmosphereModel.TROPICAL: (tropical_210A, 'Earth', RADIUS_EARTH, GRAV_EARTH), + AtmosphereModel.POLAR: (polar_210A, 'Earth', RADIUS_EARTH, GRAV_EARTH), + AtmosphereModel.HOT: (hot_210A, 'Earth', RADIUS_EARTH, GRAV_EARTH), + AtmosphereModel.COLD: (cold_210A, 'Earth', RADIUS_EARTH, GRAV_EARTH), + AtmosphereModel.MARS_REFERENCE: (MarsReference2024, 'Mars', RADIUS_MARS, GRAV_MARS), + AtmosphereModel.MARS_HELLAS_HOT: (MarsHellasHot, 'Mars', RADIUS_MARS, GRAV_MARS), + AtmosphereModel.MARS_HELLAS_COLD: (MarsHellasCold, 'Mars', RADIUS_MARS, GRAV_MARS), + AtmosphereModel.MARS_EQUATOR_HOT: (MarsEquatorHot, 'Mars', RADIUS_MARS, GRAV_MARS), + AtmosphereModel.MARS_EQUATOR_COLD: (MarsEquatorCold, 'Mars', RADIUS_MARS, GRAV_MARS), + AtmosphereModel.MARS_POLAR_HOT: (MarsPolarHot, 'Mars', RADIUS_MARS, GRAV_MARS), + AtmosphereModel.MARS_POLAR_COLD: (MarsPolarCold, 'Mars', RADIUS_MARS, GRAV_MARS), + AtmosphereModel.VENUS_REFERENCE: (VenusReference2021, 'Venus', RADIUS_VENUS, GRAV_VENUS), } try: return atmosphere_lookup[atmosphere_model] except KeyError: - raise ValueError(f'Could not find {atmosphere_model} in get_atmosphere_data().') \ No newline at end of file + raise ValueError(f'Could not find {atmosphere_model} in get_atmosphere_data().') diff --git a/aviary/utils/preprocessors.py b/aviary/utils/preprocessors.py index ccf9e44992..6455e6d479 100644 --- a/aviary/utils/preprocessors.py +++ b/aviary/utils/preprocessors.py @@ -95,12 +95,17 @@ def preprocess_options( # preprocess atmosphere / GRAV?? # Set the gravity model based on the atmosphere model to enable calculation of weight from mass from aviary.subsystems.atmosphere.utils.get_atmosphere_data import get_atmosphere_data + if Settings.ATMOSPHERE_MODEL not in aviary_options: - aviary_options.set_val(Settings.ATMOSPHERE_MODEL, meta_data[Settings.ATMOSPHERE_MODEL]['default_value']) - _,_,_,planet_gravity= get_atmosphere_data(aviary_options.get_val(Settings.ATMOSPHERE_MODEL)) - if Mission.GRAVITY not in aviary_options: # Check to see if the user has set a gravity profile. + aviary_options.set_val( + Settings.ATMOSPHERE_MODEL, meta_data[Settings.ATMOSPHERE_MODEL]['default_value'] + ) + _, _, _, planet_gravity = get_atmosphere_data(aviary_options.get_val(Settings.ATMOSPHERE_MODEL)) + if Mission.GRAVITY not in aviary_options: # Check to see if the user has set a gravity profile. # No gravity profile is set, set it now. - aviary_options.set_val(Mission.GRAVITY, val=planet_gravity[0], units=planet_gravity[1]) # contains both value and units as a tuple. + aviary_options.set_val( + Mission.GRAVITY, val=planet_gravity[0], units=planet_gravity[1] + ) # contains both value and units as a tuple. def preprocess_crewpayload(aviary_options: AviaryValues, meta_data=CoreMetaData, verbosity=None): diff --git a/aviary/variable_info/enums.py b/aviary/variable_info/enums.py index 8d4583cac3..5d6487927e 100644 --- a/aviary/variable_info/enums.py +++ b/aviary/variable_info/enums.py @@ -1,5 +1,6 @@ from enum import Enum, IntEnum, auto, unique + class AircraftTypes(Enum): """Aircraft types.""" @@ -94,6 +95,7 @@ class EngineDeckType(Enum): def __str__(self): return self.value + @unique class GASPEngineType(Enum): """ diff --git a/aviary/variable_info/variable_meta_data.py b/aviary/variable_info/variable_meta_data.py index 629de77b45..c51020b087 100644 --- a/aviary/variable_info/variable_meta_data.py +++ b/aviary/variable_info/variable_meta_data.py @@ -17,7 +17,7 @@ AtmosphereModel, ) from aviary.variable_info.variables import Aircraft, Dynamic, Mission, Settings -import aviary.constants as constants +import aviary.constants as constants # --------------------------- # Meta data associated with variables in the aircraft data hierarchy. @@ -6901,7 +6901,7 @@ types=float, option=True, # The default gravity model is set based on Settings.ATMOSPHERE_MODEL - units='m/s**2' + units='m/s**2', ) add_meta_data( From ab3a67276a4d3c2c749733d90ae7c60d6a035f2b Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Mon, 6 Jul 2026 20:11:28 +0000 Subject: [PATCH 04/16] removed constants import --- aviary/variable_info/variable_meta_data.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aviary/variable_info/variable_meta_data.py b/aviary/variable_info/variable_meta_data.py index c51020b087..68f013490f 100644 --- a/aviary/variable_info/variable_meta_data.py +++ b/aviary/variable_info/variable_meta_data.py @@ -17,7 +17,6 @@ AtmosphereModel, ) from aviary.variable_info.variables import Aircraft, Dynamic, Mission, Settings -import aviary.constants as constants # --------------------------- # Meta data associated with variables in the aircraft data hierarchy. From c138311b6ea329be2d6bd01e028caf556a575941 Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Wed, 8 Jul 2026 18:12:41 +0000 Subject: [PATCH 05/16] reverted radius earth to old constant to separate out tests failing from that change from all other 1st changes for gravity pr --- aviary/constants.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aviary/constants.py b/aviary/constants.py index 7962763e1c..7a376d5f1a 100644 --- a/aviary/constants.py +++ b/aviary/constants.py @@ -15,7 +15,10 @@ '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 = (6371009, 'm') # Source: GRS80, mean earth radius (rounded to nearest meter) +# TBD update in follow-on PR to above +RADIUS_EARTH = 6_356_766 + RADIUS_MARS = ( 3386200, 'm', @@ -25,9 +28,9 @@ 'm', ) # Venus Global Reference Atmospheric Model (Venus-GRAM): User Guide, NASA/TM-20210022168, avg of equatorial and polar radius +GNS = 9.8236930 # grav_accel_at_surface_earth # remove this asap GRAV_METRIC_GASP = 9.81 # m/s^2 GRAV_ENGLISH_GASP = 32.2 # ft/s^2 -GRAV_METRIC_FLOPS = 9.80665 # m/s^2 GRAV_ENGLISH_FLOPS = 32.17399 # ft/s^2 GRAV_ENGLISH_LBM = 1.0 # lbf/lbm # See issue 1169 for the value of RHO_SEA_LEVEL_ENGLISH From 37ae334c6e7ea439ba336d1ab8bab383678db63d Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Wed, 8 Jul 2026 18:18:36 +0000 Subject: [PATCH 06/16] added back in GRAV_METRIC_FLOPS definition accidentially removed too soon --- aviary/constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aviary/constants.py b/aviary/constants.py index 7a376d5f1a..c0fb2b33eb 100644 --- a/aviary/constants.py +++ b/aviary/constants.py @@ -30,6 +30,7 @@ GNS = 9.8236930 # grav_accel_at_surface_earth # remove this asap GRAV_METRIC_GASP = 9.81 # m/s^2 +GRAV_METRIC_FLOPS = 9.80665 # m/s^2 GRAV_ENGLISH_GASP = 32.2 # ft/s^2 GRAV_ENGLISH_FLOPS = 32.17399 # ft/s^2 GRAV_ENGLISH_LBM = 1.0 # lbf/lbm From 91e7cbb070e150eceea3e5050692ef7c531891f7 Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Wed, 8 Jul 2026 18:19:32 +0000 Subject: [PATCH 07/16] converted earth radius to tuple --- aviary/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aviary/constants.py b/aviary/constants.py index c0fb2b33eb..4d28b94ac3 100644 --- a/aviary/constants.py +++ b/aviary/constants.py @@ -17,7 +17,7 @@ # RADIUS_EARTH = (6371009, 'm') # Source: GRS80, mean earth radius (rounded to nearest meter) # TBD update in follow-on PR to above -RADIUS_EARTH = 6_356_766 +RADIUS_EARTH = (6356766, 'm') RADIUS_MARS = ( 3386200, From 6dcf86438c2bc63f500cec34c0568b00ff64201b Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Wed, 8 Jul 2026 18:21:58 +0000 Subject: [PATCH 08/16] reverted mars radius as well --- aviary/constants.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aviary/constants.py b/aviary/constants.py index 4d28b94ac3..fd92b3b989 100644 --- a/aviary/constants.py +++ b/aviary/constants.py @@ -16,13 +16,13 @@ ) # 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) -# TBD update in follow-on PR to above -RADIUS_EARTH = (6356766, 'm') +RADIUS_EARTH = (6356766, '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_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_VENUS = ( 6051800, 'm', From cd6e55142bff79ab3729a8c8fa851f66fbdfaa29 Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Wed, 8 Jul 2026 18:29:50 +0000 Subject: [PATCH 09/16] merge main --- aviary/constants.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aviary/constants.py b/aviary/constants.py index fd92b3b989..19f84f8577 100644 --- a/aviary/constants.py +++ b/aviary/constants.py @@ -16,13 +16,13 @@ ) # 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 = (6356766, '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_MARS = (3396200, 'm') # TODO remove and replace with above +RADIUS_MARS = (3396200, 'm') # TODO remove and replace with above RADIUS_VENUS = ( 6051800, 'm', From b520a7f7846b9c7a87753971e4b942f97e2f32e5 Mon Sep 17 00:00:00 2001 From: Kenneth-T-Moore Date: Wed, 8 Jul 2026 15:15:23 -0400 Subject: [PATCH 10/16] Update the json test for the new variables. --- aviary/interface/test/sizing_results_for_test.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/aviary/interface/test/sizing_results_for_test.json b/aviary/interface/test/sizing_results_for_test.json index 760aa600f8..a40cc28e86 100644 --- a/aviary/interface/test/sizing_results_for_test.json +++ b/aviary/interface/test/sizing_results_for_test.json @@ -1124,6 +1124,18 @@ "unitless", "" ], + [ + "settings:atmosphere_model", + "STANDARD", + "unitless", + "" + ], + [ + "mission:gravity", + 9.80665, + "m/s**2", + "" + ], [ "mission:gross_mass", 175400.0, @@ -1142,4 +1154,4 @@ "unitless", "" ] -] +] \ No newline at end of file From 2fd8a5275d9e45a4d0bfd2686710aac75d2fb25b Mon Sep 17 00:00:00 2001 From: Kenneth-T-Moore Date: Wed, 8 Jul 2026 15:16:43 -0400 Subject: [PATCH 11/16] Update the json test for the new variables. --- aviary/interface/test/sizing_results_for_test.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aviary/interface/test/sizing_results_for_test.json b/aviary/interface/test/sizing_results_for_test.json index a40cc28e86..4d4dbdbdfb 100644 --- a/aviary/interface/test/sizing_results_for_test.json +++ b/aviary/interface/test/sizing_results_for_test.json @@ -1154,4 +1154,4 @@ "unitless", "" ] -] \ No newline at end of file +] From 2e5191d9e5931370e6244594f0bb12fba8be5530 Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Thu, 9 Jul 2026 15:13:30 +0000 Subject: [PATCH 12/16] updated earth and mars radius to desired values based on references, corrected test now erroring out on the order of 5e-6 --- aviary/constants.py | 12 ++--- .../ode/test/test_breguet_cruise_ode.py | 4 +- .../two_dof/ode/test/test_flight_ode.py | 16 +++--- .../ode/test/test_simple_cruise_ode.py | 2 +- aviary/models/engines/turbofan_23k_1.csv | 2 +- .../atmosphere/test/test_atmosphere.py | 54 +++++++++---------- .../propulsion/test/test_turboprop_model.py | 31 ++++------- 7 files changed, 55 insertions(+), 66 deletions(-) diff --git a/aviary/constants.py b/aviary/constants.py index 19f84f8577..1a5c1e587f 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..a6c8eb9380 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,7 +57,7 @@ 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[Dynamic.Mission.DISTANCE], np.array([0.0, 923.38992577]), tol) assert_near_equal(self.prob['time'], np.array([0, 8280.30660691]), tol) assert_near_equal( self.prob[Dynamic.Mission.SPECIFIC_ENERGY_RATE_EXCESS], @@ -123,7 +123,7 @@ 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[Dynamic.Mission.DISTANCE], np.array([0.0, 66.37459993]), tol) assert_near_equal(self.prob['time'], np.array([0, 595.19714299]), tol) assert_near_equal( self.prob[Dynamic.Mission.SPECIFIC_ENERGY_RATE_EXCESS], 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..a5fb29bc89 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,7 +61,7 @@ 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( diff --git a/aviary/models/engines/turbofan_23k_1.csv b/aviary/models/engines/turbofan_23k_1.csv index 9b49987b0c..7a9a186001 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 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_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() From b1c9cd86bf3e7eed8489c2fbad687ff9477d637c Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Thu, 9 Jul 2026 17:36:37 +0000 Subject: [PATCH 13/16] tweaking values to bring them in line with new earth radius data --- .../two_dof/ode/test/test_breguet_cruise_ode.py | 14 +++++++------- aviary/models/engines/turbofan_23k_1.csv | 14 +++++++------- .../propulsion/test/test_propulsion_mission.py | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) 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 a6c8eb9380..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 @@ -58,15 +58,15 @@ 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.38992577]), tol) - assert_near_equal(self.prob['time'], np.array([0, 8280.30660691]), 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, ) @@ -124,20 +124,20 @@ 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.37459993]), tol) - assert_near_equal(self.prob['time'], np.array([0, 595.19714299]), 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/models/engines/turbofan_23k_1.csv b/aviary/models/engines/turbofan_23k_1.csv index 7a9a186001..e220c64af1 100644 --- a/aviary/models/engines/turbofan_23k_1.csv +++ b/aviary/models/engines/turbofan_23k_1.csv @@ -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/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) From 7f3d57bbc49dc9165611f3c4564f7f51f6785ff9 Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Thu, 9 Jul 2026 19:50:12 +0000 Subject: [PATCH 14/16] small tweaks on values for tests --- aviary/mission/two_dof/ode/test/test_simple_cruise_ode.py | 2 +- .../benchmark_tests/test_battery_in_a_mission.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 a5fb29bc89..b078f31460 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,7 +61,7 @@ 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.88463177 4.90286726]), + np.array([3.88463177, 4.90286726]), tol, ) assert_near_equal( 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..ae01ea4e2b 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,7 +101,7 @@ 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'), + cumulative_energy_var: (38.46816871, 'kW*h'), av.Mission.FUEL_MASS: (1249.64666191, 'lbm'), } From 24a1c31ef144f9b18c75516857e18d3b7ea74755 Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Thu, 9 Jul 2026 19:53:02 +0000 Subject: [PATCH 15/16] update test values --- .../benchmark_tests/test_battery_in_a_mission.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ae01ea4e2b..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 @@ -102,7 +102,7 @@ def test_subsystems_in_a_mission(self): ) expected_scalar_values = { cumulative_energy_var: (38.46816871, 'kW*h'), - av.Mission.FUEL_MASS: (1249.64666191, 'lbm'), + av.Mission.FUEL_MASS: (1249.64650547, 'lbm'), } for var_name, (expected, units) in expected_scalar_values.items(): From 6d6fc82b1f0e408d7609dd48b0230600de74f274 Mon Sep 17 00:00:00 2001 From: Eliot Aretskin-Hariton Date: Thu, 9 Jul 2026 20:03:15 +0000 Subject: [PATCH 16/16] small number tweaks --- aviary/mission/two_dof/ode/test/test_simple_cruise_ode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b078f31460..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 @@ -66,7 +66,7 @@ def test_cruise(self): ) assert_near_equal( self.prob[Dynamic.Mission.ALTITUDE_RATE_MAX], - np.array([3.88465429, 4.90288542]), + np.array([3.88463177, 4.90286726]), tol, )