Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
75cd085
removed GRAV_METRIC_GASP and all tests passing
ehariton Jul 15, 2026
6dea52b
removed GRAV_ENGLISH_GASP from groundroll_eom.py, all tests passing
ehariton Jul 15, 2026
5bcaf5a
removed GRAV_ENGLISH_GASP from accel_eom.py and all tests passing
ehariton Jul 15, 2026
28562fb
removed GRAV_ENGLISH_GASP from flight_path_eom.py. There were residua…
ehariton Jul 15, 2026
a81557a
removed GRAV_ENGLISH_GASP from interference.py and all tests passing
ehariton Jul 15, 2026
6b31662
removed GRAV_ENGLISH_GASP from landing_eom.py all tests passing
ehariton Jul 15, 2026
1e6c8a2
completely removed GRAV_ENGLISH_GASP all tests passing, no benchmarks…
ehariton Jul 15, 2026
c80f992
ruff
ehariton Jul 15, 2026
8ccf207
remove GNS as a gravity variable and replaced with constants.GRAVITY
ehariton Jul 15, 2026
66e3715
added some notes for convert_geopotential_altitude()
ehariton Jul 15, 2026
38ba1c4
Merge branch 'main' into gravity_v4
ehariton Jul 15, 2026
83954d5
simplifeid convert_geopotential_altitude() changes to be minimal
ehariton Jul 23, 2026
fad3915
merge upstream
ehariton Jul 23, 2026
0b4b517
merge with main conflicts sorted
ehariton Jul 23, 2026
2656912
ruff
ehariton Jul 23, 2026
81a3ef8
added some warnings for EndineDeck conversion on non-earth planets
ehariton Jul 23, 2026
776b3bb
ruff
ehariton Jul 23, 2026
462f662
added a warning for using an aero method that is restricted to earth
ehariton Jul 24, 2026
28d037b
merge main
ehariton Jul 24, 2026
77f2c9f
merge main
ehariton Aug 6, 2026
e8f0d3f
small corrections based on reviewer feedback
ehariton Aug 6, 2026
76fca62
merge main
ehariton Aug 6, 2026
ce7fb69
merge main
ehariton Aug 7, 2026
f2ff662
tiny changes to off-design check, potentially due to new radius of ea…
ehariton Aug 11, 2026
28503b5
reverting test values and setting a gravity value in options that pro…
ehariton Aug 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions aviary/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@
)
from aviary.utils.options import list_options
from aviary.constants import (
GRAV_ENGLISH_GASP,
GRAV_ENGLISH_LBM,
GRAV_METRIC_GASP,
PSLS_PSF,
TSLS_DEGR,
)
Expand Down
34 changes: 21 additions & 13 deletions aviary/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,40 @@
GRAV_EARTH = (
9.80665,
'm/s**2',
) # NIST https://physics.nist.gov/cgi-bin/cuu/Value?gn|search_for=gravity
)
# 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
)
# 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
)
# 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)
# convert_geopotential_altitude() is a python utility function that require RADIUS_EARTH to be specified in meters!
RADIUS_EARTH = (
6371009.0,
'm',
) # Source: GRS80, mean earth radius (rounded to nearest meter)
# convert_geopotential_altitude() is a python utility function for engine decs that require RADIUS_EARTH to be specified in meters!

RADIUS_MARS = (
3386200,
3386200.0,
'm',
) # Mars Global Reference Atmospheric Model (Mars-GRAM) 2024: User Guide, NASA/TM-20240012934, avg of equatorial and polar radius
)
# Mars Global Reference Atmospheric Model (Mars-GRAM) 2024: User Guide, NASA/TM-20240012934, avg of equatorial and polar radius

RADIUS_VENUS = (
6051800,
6051800.0,
'm',
) # Venus Global Reference Atmospheric Model (Venus-GRAM): User Guide, NASA/TM-20210022168, avg of equatorial and polar radius
)
# 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 # TODO: Remove this from other parts of Aviary
GRAV_METRIC_GASP = 9.81 # m/s^2
GRAV_ENGLISH_GASP = 32.2 # ft/s^2
GRAV_ENGLISH_LBM = 1.0 # lbf/lbm
GRAV_ENGLISH_LBM = 1.0 # lbf/lbm, Only valid for earth sea level conversions!

# sea level standard pressure in psf
PSLS_PSF = 2116.22
Expand Down
1 change: 0 additions & 1 deletion aviary/mission/energy_state/ode/landing_eom.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
FlightPathAngleRate,
VelocityRate,
)
from aviary.utils.aviary_values import AviaryValues
from aviary.variable_info.functions import add_aviary_input, add_aviary_option
from aviary.variable_info.variables import Dynamic, Mission

Expand Down
30 changes: 17 additions & 13 deletions aviary/mission/solved_two_dof/ode/groundroll_eom.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import numpy as np
import openmdao.api as om

from aviary.constants import GRAV_ENGLISH_GASP, GRAV_ENGLISH_LBM
from aviary.variable_info.functions import add_aviary_input, add_aviary_output
from aviary.constants import GRAV_ENGLISH_LBM
from aviary.variable_info.functions import add_aviary_input, add_aviary_output, add_aviary_option
from aviary.variable_info.variables import Aircraft, Dynamic, Mission


Expand All @@ -12,6 +12,8 @@ class GroundrollEOM(om.ExplicitComponent):
def initialize(self):
self.options.declare('num_nodes', types=int)

add_aviary_option(self, Mission.GRAVITY, units='ft/s**2')

def setup(self):
nn = self.options['num_nodes']

Expand Down Expand Up @@ -133,8 +135,9 @@ def setup_partials(self):
self.declare_partials('angle_of_attack_rate', ['*'])

def compute(self, inputs, outputs):
mu = inputs[Mission.Takeoff.ROLLING_FRICTION_COEFFICIENT]
grav_english = self.options[Mission.GRAVITY][0]

mu = inputs[Mission.Takeoff.ROLLING_FRICTION_COEFFICIENT]
weight = inputs[Dynamic.Vehicle.MASS] * GRAV_ENGLISH_LBM
thrust = inputs[Dynamic.Vehicle.Propulsion.THRUST_TOTAL]
incremented_lift = inputs[Dynamic.Vehicle.LIFT]
Expand All @@ -158,7 +161,7 @@ def compute(self, inputs, outputs):
- weight * np.sin(gamma)
- mu * normal_force
)
* GRAV_ENGLISH_GASP
* grav_english
/ weight
)
outputs[Dynamic.Mission.FLIGHT_PATH_ANGLE_RATE] = np.zeros(nn)
Expand All @@ -171,8 +174,9 @@ def compute(self, inputs, outputs):
outputs['angle_of_attack_rate'] = np.zeros(nn)

def compute_partials(self, inputs, J):
mu = inputs[Mission.Takeoff.ROLLING_FRICTION_COEFFICIENT]
grav_english = self.options[Mission.GRAVITY][0]

mu = inputs[Mission.Takeoff.ROLLING_FRICTION_COEFFICIENT]
weight = inputs[Dynamic.Vehicle.MASS] * GRAV_ENGLISH_LBM
thrust = inputs[Dynamic.Vehicle.Propulsion.THRUST_TOTAL]
incremented_lift = inputs[Dynamic.Vehicle.LIFT]
Expand Down Expand Up @@ -214,17 +218,17 @@ def compute_partials(self, inputs, J):
dNF_dIwing[normal_force1 < 0] = 0

J[Dynamic.Mission.VELOCITY_RATE, Dynamic.Vehicle.Propulsion.THRUST_TOTAL] = (
(dTAlF_dThrust - mu * dNF_dThrust) * GRAV_ENGLISH_GASP / weight
(dTAlF_dThrust - mu * dNF_dThrust) * grav_english / weight
)
J[Dynamic.Mission.VELOCITY_RATE, Dynamic.Vehicle.ANGLE_OF_ATTACK] = (
(dTAlF_dAlpha - mu * dNF_dAlpha) * GRAV_ENGLISH_GASP / weight
(dTAlF_dAlpha - mu * dNF_dAlpha) * grav_english / weight
)
J[Dynamic.Mission.VELOCITY_RATE, Aircraft.Wing.INCIDENCE] = (
(dTAlF_dIwing - mu * dNF_dIwing) * GRAV_ENGLISH_GASP / weight
(dTAlF_dIwing - mu * dNF_dIwing) * grav_english / weight
)
J[Dynamic.Mission.VELOCITY_RATE, Dynamic.Vehicle.DRAG] = -GRAV_ENGLISH_GASP / weight
J[Dynamic.Mission.VELOCITY_RATE, Dynamic.Vehicle.DRAG] = -grav_english / weight
J[Dynamic.Mission.VELOCITY_RATE, Dynamic.Vehicle.MASS] = (
GRAV_ENGLISH_GASP
grav_english
* GRAV_ENGLISH_LBM
* (
weight * (-np.sin(gamma) - mu * dNF_dWeight)
Expand All @@ -238,13 +242,13 @@ def compute_partials(self, inputs, J):
/ weight**2
)
J[Dynamic.Mission.VELOCITY_RATE, Dynamic.Mission.FLIGHT_PATH_ANGLE] = (
-np.cos(gamma) * GRAV_ENGLISH_GASP
-np.cos(gamma) * grav_english
)
J[Dynamic.Mission.VELOCITY_RATE, Dynamic.Vehicle.LIFT] = (
GRAV_ENGLISH_GASP * (-mu * dNF_dLift) / weight
grav_english * (-mu * dNF_dLift) / weight
)
J[Dynamic.Mission.VELOCITY_RATE, Mission.Takeoff.ROLLING_FRICTION_COEFFICIENT] = (
(-normal_force) * GRAV_ENGLISH_GASP / weight
(-normal_force) * grav_english / weight
)

J[Dynamic.Mission.ALTITUDE_RATE, Dynamic.Mission.VELOCITY] = np.sin(gamma)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
class GroundrollEOMTestCase(unittest.TestCase):
def setUp(self):
self.prob = om.Problem()
self.prob.model.add_subsystem('group', GroundrollEOM(num_nodes=2), promotes=['*'])
options = {Mission.GRAVITY: (32.2, 'ft/s**2')}
self.prob.model.add_subsystem(
'group', GroundrollEOM(num_nodes=2, **options), promotes=['*']
)
self.prob.model.set_input_defaults(
Dynamic.Vehicle.MASS, val=175400 * np.ones(2), units='lbm'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from aviary.utils.test_utils.IO_test_util import check_prob_outputs
from aviary.variable_info.functions import setup_model_options
from aviary.variable_info.options import get_option_defaults
from aviary.variable_info.variables import Aircraft, Dynamic
from aviary.variable_info.variables import Aircraft, Dynamic, Mission


@use_tempdirs
Expand All @@ -23,6 +23,7 @@ def setUp(self):

aviary_options = get_option_defaults()
aviary_options.set_val(Aircraft.Engine.GLOBAL_THROTTLE, True)
aviary_options.set_val(Mission.GRAVITY, val=32.2, units='ft/s**2')
default_mission_subsystems = get_default_mission_subsystems(
'GASP', [build_engine_deck(aviary_options)]
)
Expand Down
13 changes: 9 additions & 4 deletions aviary/mission/solved_two_dof/ode/unsteady_solved_eom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import openmdao.api as om
from openmdao.utils.units import convert_units

from aviary.constants import GRAV_ENGLISH_LBM, GRAV_METRIC_GASP
from aviary.variable_info.functions import add_aviary_input
from aviary.constants import GRAV_ENGLISH_LBM
from aviary.variable_info.functions import add_aviary_input, add_aviary_option
from aviary.variable_info.variables import Aircraft, Dynamic, Mission

LBF_TO_N = convert_units(1.0, 'lbf', 'N')
Expand Down Expand Up @@ -31,6 +31,8 @@ def initialize(self):
'the TAS rate equation.',
)

add_aviary_option(self, Mission.GRAVITY, units='m/s**2')

def setup(self):
nn = self.options['num_nodes']

Expand Down Expand Up @@ -214,6 +216,8 @@ def setup_partials(self):
self.declare_partials(of=['dgam_dt_approx', 'dgam_dt'], wrt=[Aircraft.Wing.INCIDENCE])

def compute(self, inputs, outputs):
grav_metric = self.options[Mission.GRAVITY][0]

tas = inputs[Dynamic.Mission.VELOCITY]
thrust = inputs[Dynamic.Vehicle.Propulsion.THRUST_TOTAL]
# convert to newtons # TODO: change this to use the units conversion
Expand All @@ -224,7 +228,7 @@ def compute(self, inputs, outputs):

i_wing = inputs[Aircraft.Wing.INCIDENCE]

g = GRAV_METRIC_GASP
g = grav_metric
m = weight / g

if self.options['ground_roll']:
Expand Down Expand Up @@ -269,6 +273,7 @@ def compute(self, inputs, outputs):
outputs['dgam_dt_approx'] = dgam_dr * dr_dt

def compute_partials(self, inputs, partials):
grav_metric = self.options[Mission.GRAVITY][0]
ground_roll = self.options['ground_roll']

thrust = inputs[Dynamic.Vehicle.Propulsion.THRUST_TOTAL]
Expand All @@ -291,7 +296,7 @@ def compute_partials(self, inputs, partials):

alpha_i = alpha - i_wing

g = GRAV_METRIC_GASP
g = grav_metric
m = weight / g

mtas = m * tas
Expand Down
19 changes: 12 additions & 7 deletions aviary/mission/two_dof/ode/accel_eom.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import numpy as np
import openmdao.api as om

from aviary.constants import GRAV_ENGLISH_GASP, GRAV_ENGLISH_LBM
from aviary.variable_info.functions import add_aviary_input, add_aviary_output
from aviary.variable_info.variables import Dynamic
from aviary.constants import GRAV_ENGLISH_LBM
from aviary.variable_info.functions import add_aviary_input, add_aviary_output, add_aviary_option
from aviary.variable_info.variables import Dynamic, Mission


class AccelerationRates(om.ExplicitComponent):
Expand All @@ -16,6 +16,8 @@ class AccelerationRates(om.ExplicitComponent):
def initialize(self):
self.options.declare('num_nodes', types=int)

add_aviary_option(self, Mission.GRAVITY, units='ft/s**2')

def setup(self):
nn = self.options['num_nodes']

Expand Down Expand Up @@ -79,23 +81,26 @@ def setup_partials(self):
)

def compute(self, inputs, outputs):
grav_english = self.options[Mission.GRAVITY][0]

weight = inputs[Dynamic.Vehicle.MASS] * GRAV_ENGLISH_LBM
drag = inputs[Dynamic.Vehicle.DRAG]
thrust = inputs[Dynamic.Vehicle.Propulsion.THRUST_TOTAL]
TAS = inputs[Dynamic.Mission.VELOCITY]

outputs[Dynamic.Mission.VELOCITY_RATE] = (GRAV_ENGLISH_GASP / weight) * (thrust - drag)
outputs[Dynamic.Mission.VELOCITY_RATE] = (grav_english / weight) * (thrust - drag)
outputs[Dynamic.Mission.DISTANCE_RATE] = TAS

def compute_partials(self, inputs, J):
grav_english = self.options[Mission.GRAVITY][0]
weight = inputs[Dynamic.Vehicle.MASS] * GRAV_ENGLISH_LBM
drag = inputs[Dynamic.Vehicle.DRAG]
thrust = inputs[Dynamic.Vehicle.Propulsion.THRUST_TOTAL]

J[Dynamic.Mission.VELOCITY_RATE, Dynamic.Vehicle.MASS] = (
-(GRAV_ENGLISH_GASP / weight**2) * (thrust - drag) * GRAV_ENGLISH_LBM
-(grav_english / weight**2) * (thrust - drag) * GRAV_ENGLISH_LBM
)
J[Dynamic.Mission.VELOCITY_RATE, Dynamic.Vehicle.DRAG] = -(GRAV_ENGLISH_GASP / weight)
J[Dynamic.Mission.VELOCITY_RATE, Dynamic.Vehicle.DRAG] = -(grav_english / weight)
J[Dynamic.Mission.VELOCITY_RATE, Dynamic.Vehicle.Propulsion.THRUST_TOTAL] = (
GRAV_ENGLISH_GASP / weight
grav_english / weight
)
Loading
Loading