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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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 +]