Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2a0e4bf
Cleaned up the first part of this.
Kenneth-T-Moore Jun 30, 2026
46d7ea9
Merge branch 'main' of github.com:OpenMDAO/Aviary into rho_sea_level
Kenneth-T-Moore Jul 7, 2026
0104532
Merge branch 'main' of github.com:OpenMDAO/Aviary into rho_sea_level
Kenneth-T-Moore Jul 8, 2026
de4b7aa
Added density to the ADH. Should build off Eliot's PR from here.
Kenneth-T-Moore Jul 8, 2026
42a30ef
Merge branch 'gravity' of github.com:ehariton/om-Aviary into rho_sea_…
Kenneth-T-Moore Jul 8, 2026
c152371
Pull default sea level density from the atmosphere model in use."
Kenneth-T-Moore Jul 9, 2026
d98466f
Getting some more tests to pass with the removal of the density const…
Kenneth-T-Moore Jul 10, 2026
1519c86
Tests are passing. Still two more things to replace.
Kenneth-T-Moore Jul 10, 2026
65229a8
Merge conflicts
Kenneth-T-Moore Jul 14, 2026
88e3f3e
Completed, a few tests failing
Kenneth-T-Moore Jul 14, 2026
4ca8a40
Test fix
Kenneth-T-Moore Jul 14, 2026
bb123b8
Test fix
Kenneth-T-Moore Jul 14, 2026
db49587
There is a bugfix that is heading to openmdao dev
Kenneth-T-Moore Jul 14, 2026
9ab9a8e
missed one comp
Kenneth-T-Moore Jul 14, 2026
c0aca77
RUFF
Kenneth-T-Moore Jul 15, 2026
ad65329
RUFF
Kenneth-T-Moore Jul 15, 2026
7db3f4c
clean up one test
Kenneth-T-Moore Jul 15, 2026
bd9b74d
RUFF
Kenneth-T-Moore Jul 15, 2026
77335a7
resolve conflicts
Kenneth-T-Moore Jul 15, 2026
adeab98
full retrigger CI
Kenneth-T-Moore Jul 16, 2026
599442b
Small fix for test failure
Kenneth-T-Moore Jul 16, 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
5 changes: 4 additions & 1 deletion .github/workflows/test_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ jobs:
with:
NAME: 'latest'
OPENMDAO_PIXI_ENVIRONMENT: 'py313'
OPENMDAO_INSTALL_FROM: 'pypi'
#OPENMDAO_INSTALL_FROM: 'pypi'
#OPENMDAO: ''
# Bug fix on dev.
OPENMDAO_INSTALL_FROM: 'github'
OPENMDAO: ''
SNOPT: '7.7'
DYMOS: 'latest'
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ jobs:
with:
NAME: 'latest'
OPENMDAO_PIXI_ENVIRONMENT: 'py313'
OPENMDAO_INSTALL_FROM: 'pypi'
#OPENMDAO_INSTALL_FROM: 'pypi'
#OPENMDAO: ''
# Bug fix on dev.
OPENMDAO_INSTALL_FROM: 'github'
OPENMDAO: ''
SNOPT: '7.7'
DYMOS: 'latest'
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ jobs:
- NAME: oldest-supported
OS: ubuntu-24.04
OPENMDAO_PIXI_ENVIRONMENT: 'py311'
OPENMDAO_INSTALL_FROM: 'pypi'
OPENMDAO: '3.43.0'
#OPENMDAO_INSTALL_FROM: 'pypi'
#OPENMDAO: '3.43.0'
# Bug fix on dev.
OPENMDAO_INSTALL_FROM: 'github'
OPENMDAO: ''
SNOPT: '7.7'
DYMOS: '1.13.1'
COVERAGE: true
Expand Down
2 changes: 0 additions & 2 deletions aviary/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
GRAV_ENGLISH_LBM,
GRAV_METRIC_GASP,
PSLS_PSF,
RHO_SEA_LEVEL_ENGLISH,
RHO_SEA_LEVEL_METRIC,
TSLS_DEGR,
)
from aviary.subsystems.test.subsystem_tester import (
Expand Down
5 changes: 2 additions & 3 deletions aviary/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@
GRAV_METRIC_GASP = 9.81 # m/s^2
GRAV_ENGLISH_GASP = 32.2 # ft/s^2
GRAV_ENGLISH_LBM = 1.0 # lbf/lbm
# See issue 1169 for the value of RHO_SEA_LEVEL_ENGLISH
RHO_SEA_LEVEL_ENGLISH = 0.0023769 # slug/ft^3
RHO_SEA_LEVEL_METRIC = 1.225 # kg/m^3

# sea level standard pressure in psf
PSLS_PSF = 2116.22

# sea level standard temperature in deg R
TSLS_DEGR = 518.67
12 changes: 9 additions & 3 deletions aviary/interface/test/sizing_results_for_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@
],
[
"aircraft:design:gross_mass",
175400.0,
175399.99999999997,
"lbm",
"<class 'float'>"
],
Expand Down Expand Up @@ -1136,9 +1136,15 @@
"m/s**2",
"<class 'float'>"
],
[
"mission:sea_level_density",
0.0023769,
"slug/ft**3",
"<class 'float'>"
],
[
"mission:gross_mass",
175400.0,
175399.99999999997,
"lbm",
"<class 'float'>"
],
Expand All @@ -1154,4 +1160,4 @@
"unitless",
"<class 'bool'>"
]
]
]
3 changes: 3 additions & 0 deletions aviary/interface/test/test_save_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from aviary.core.aviary_problem import reload_aviary_problem
from aviary.models.missions.energy_state_default import phase_info, phase_info_parameterization
from aviary.utils.functions import get_path
from aviary.variable_info.variables import Mission


@use_tempdirs
Expand All @@ -34,6 +35,8 @@ def test_save_json(self):

# Preprocess inputs
prob.check_and_preprocess_inputs()
prob.aviary_inputs.set_val(Mission.SEA_LEVEL_DENSITY, 0.0023769, units='slug/ft**3')

prob.add_pre_mission_systems()
prob.add_phases()
prob.add_post_mission_systems()
Expand Down
12 changes: 8 additions & 4 deletions aviary/mission/energy_state/phases/simplified_landing.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import openmdao.api as om

from aviary.constants import GRAV_ENGLISH_LBM, RHO_SEA_LEVEL_ENGLISH
from aviary.constants import GRAV_ENGLISH_LBM
from aviary.subsystems.atmosphere.atmosphere import Atmosphere
from aviary.variable_info.functions import add_aviary_input, add_aviary_output
from aviary.variable_info.functions import add_aviary_input, add_aviary_option, add_aviary_output
from aviary.variable_info.variables import Aircraft, Dynamic, Mission


class LandingCalc(om.ExplicitComponent):
"""Calculate the distance covered over the ground and approach velocity during landing."""

def initialize(self):
add_aviary_option(self, Mission.SEA_LEVEL_DENSITY, units='slug/ft**3')

def setup(self):
add_aviary_input(self, Mission.FINAL_MASS, units='lbm')
add_aviary_input(self, Dynamic.Atmosphere.DENSITY, units='slug/ft**3')
Expand All @@ -22,7 +25,8 @@ def setup(self):
self.declare_partials(Mission.Landing.GROUND_DISTANCE, '*')

def compute(self, inputs, outputs):
rho_SL = RHO_SEA_LEVEL_ENGLISH
rho_SL = self.options[Mission.SEA_LEVEL_DENSITY][0]

landing_weight = inputs[Mission.FINAL_MASS] * GRAV_ENGLISH_LBM
rho = inputs[Dynamic.Atmosphere.DENSITY]
planform_area = inputs[Aircraft.Wing.AREA]
Expand All @@ -43,7 +47,7 @@ def compute(self, inputs, outputs):
outputs[Mission.Landing.INITIAL_VELOCITY] = V_app

def compute_partials(self, inputs, J):
rho_SL = RHO_SEA_LEVEL_ENGLISH
rho_SL = self.options[Mission.SEA_LEVEL_DENSITY][0]
landing_weight = inputs[Mission.FINAL_MASS] * GRAV_ENGLISH_LBM
rho = inputs[Dynamic.Atmosphere.DENSITY]
planform_area = inputs[Aircraft.Wing.AREA]
Expand Down
11 changes: 7 additions & 4 deletions aviary/mission/energy_state/phases/simplified_takeoff.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import openmdao.api as om

from aviary.constants import GRAV_ENGLISH_LBM, RHO_SEA_LEVEL_METRIC
from aviary.constants import GRAV_ENGLISH_LBM
from aviary.subsystems.atmosphere.atmosphere import Atmosphere
from aviary.variable_info.functions import add_aviary_input, add_aviary_output
from aviary.variable_info.functions import add_aviary_input, add_aviary_option, add_aviary_output
from aviary.variable_info.variables import Aircraft, Dynamic, Mission


Expand Down Expand Up @@ -87,6 +87,9 @@ class FinalTakeoffConditions(om.ExplicitComponent):
final mass, and final altitude.
"""

def initialize(self):
add_aviary_option(self, Mission.SEA_LEVEL_DENSITY, units='kg/m**3')

def setup(self):
self.add_input(
'v_stall',
Expand Down Expand Up @@ -151,7 +154,7 @@ def setup_partials(self):
)

def compute(self, inputs, outputs):
rho_SL = RHO_SEA_LEVEL_METRIC
rho_SL = self.options[Mission.SEA_LEVEL_DENSITY][0]

v_stall = inputs['v_stall']
gross_mass = inputs['mass']
Expand Down Expand Up @@ -195,7 +198,7 @@ def compute(self, inputs, outputs):
outputs[Mission.Takeoff.FINAL_ALTITUDE] = 35

def compute_partials(self, inputs, J):
rho_SL = RHO_SEA_LEVEL_METRIC
rho_SL = self.options[Mission.SEA_LEVEL_DENSITY][0]

ramp_weight = inputs['mass'] * GRAV_ENGLISH_LBM
rho = inputs[Dynamic.Atmosphere.DENSITY]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from openmdao.utils.testing_utils import use_tempdirs

from aviary.mission.energy_state.phases.build_landing import Landing
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, Mission


Expand All @@ -29,7 +31,12 @@ def test_case1(self):
Mission.FINAL_MASS,
val=150_000,
)

options = get_option_defaults()
options.set_val(Mission.SEA_LEVEL_DENSITY, 0.0023769, units='slug/ft**3')
setup_model_options(prob, options)
prob.run_model()

partial_data = prob.check_partials(
out_stream=None, method='cs', compact_print=False, excludes=['*atmosphere*']
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from openmdao.utils.testing_utils import use_tempdirs

from aviary.mission.energy_state.phases.build_takeoff import Takeoff
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, Mission


Expand All @@ -27,7 +29,12 @@ def test_case1(self):
)
prob.setup(force_alloc_complex=True)
prob.set_val(Mission.Takeoff.LIFT_OVER_DRAG, 2)

options = get_option_defaults()
options.set_val(Mission.SEA_LEVEL_DENSITY, 0.0023769, units='slug/ft**3')
setup_model_options(prob, options)
prob.run_model()

partial_data = prob.check_partials(
out_stream=None, method='cs', compact_print=False, excludes=['*atmosphere*']
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from openmdao.utils.assert_utils import assert_check_partials, assert_near_equal
from openmdao.utils.testing_utils import use_tempdirs

from aviary import constants
from aviary.mission.energy_state.phases.simplified_landing import LandingCalc, LandingGroup
from aviary.variable_info.variables import Aircraft, Dynamic, Mission

Expand All @@ -22,9 +21,7 @@ def setUp(self):
)

self.prob.model.set_input_defaults(Mission.FINAL_MASS, val=152800.0, units='lbm')
self.prob.model.set_input_defaults(
Dynamic.Atmosphere.DENSITY, val=constants.RHO_SEA_LEVEL_METRIC, units='kg/m**3'
)
self.prob.model.set_input_defaults(Dynamic.Atmosphere.DENSITY, val=1.225, units='kg/m**3')
self.prob.model.set_input_defaults(Aircraft.Wing.AREA, val=1370.0, units='ft**2')
self.prob.model.set_input_defaults(
Mission.Landing.LIFT_COEFFICIENT_MAX, val=3, units='unitless'
Expand Down
16 changes: 11 additions & 5 deletions aviary/mission/energy_state/phases/test/test_simplified_takeoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from openmdao.utils.assert_utils import assert_check_partials, assert_near_equal
from openmdao.utils.testing_utils import use_tempdirs

from aviary import constants
from aviary.mission.energy_state.phases.simplified_takeoff import (
FinalTakeoffConditions,
StallSpeed,
Expand All @@ -33,7 +32,7 @@ def setUp(self):

self.prob.model.set_input_defaults('mass', val=181200.0, units='lbm') # check
self.prob.model.set_input_defaults(
Dynamic.Atmosphere.DENSITY, val=constants.RHO_SEA_LEVEL_METRIC, units='kg/m**3'
Dynamic.Atmosphere.DENSITY, val=1.225, units='kg/m**3'
) # check
self.prob.model.set_input_defaults(
'planform_area', val=1370.0, units='ft**2'
Expand All @@ -59,14 +58,21 @@ class FinalConditionsTest(unittest.TestCase):

def setUp(self):
self.prob = om.Problem()
self.prob.model.add_subsystem('comp', FinalTakeoffConditions(), promotes=['*'])
opts = {
Mission.SEA_LEVEL_DENSITY: (0.0023769, 'slug/ft**3'),
}
self.prob.model.add_subsystem(
'comp',
FinalTakeoffConditions(**opts),
promotes=['*'],
)

self.prob.model.set_input_defaults('v_stall', val=100, units='m/s') # not actual value
self.prob.model.set_input_defaults('mass', val=181200.0, units='lbm') # check
self.prob.model.set_input_defaults(Mission.Takeoff.FUEL_MASS, val=577, units='lbm') # check
self.prob.model.set_input_defaults(
Dynamic.Atmosphere.DENSITY,
val=constants.RHO_SEA_LEVEL_ENGLISH,
val=0.0023769,
units='slug/ft**3',
) # check
self.prob.model.set_input_defaults(Aircraft.Wing.AREA, val=1370.0, units='ft**2') # check
Expand Down Expand Up @@ -127,7 +133,7 @@ def test_case1(self):
prob.model.set_input_defaults(Mission.Takeoff.FUEL_MASS, val=577, units='lbm') # check
prob.model.set_input_defaults(
Dynamic.Atmosphere.DENSITY,
val=constants.RHO_SEA_LEVEL_ENGLISH,
val=0.0023769,
units='slug/ft**3',
) # check
prob.model.set_input_defaults(Aircraft.Wing.AREA, val=1370.0, units='ft**2') # check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from openmdao.utils.assert_utils import assert_check_partials, assert_near_equal
from openmdao.utils.testing_utils import use_tempdirs

from aviary.constants import RHO_SEA_LEVEL_METRIC
from aviary.mission.solved_two_dof.ode.unsteady_solved_flight_conditions import (
UnsteadySolvedFlightConditions,
)
Expand Down Expand Up @@ -68,7 +67,7 @@ def _test_unsteady_flight_conditions(self, ground_roll=False, input_speed_type=S
tas = p.get_val(Dynamic.Mission.VELOCITY, units='m/s')
sos = p.get_val(Dynamic.Atmosphere.SPEED_OF_SOUND, units='m/s')
rho = p.get_val(Dynamic.Atmosphere.DENSITY, units='kg/m**3')
rho_sl = RHO_SEA_LEVEL_METRIC
rho_sl = 1.225 # kg/m**3
dTAS_dt_approx = p.get_val('dTAS_dt_approx')

assert_near_equal(mach, tas / sos)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy as np
import openmdao.api as om

from aviary.constants import RHO_SEA_LEVEL_ENGLISH
from aviary.mission.solved_two_dof.ode.unsteady_solved_eom import UnsteadySolvedEOM
from aviary.utils.aviary_values import AviaryValues
from aviary.variable_info.variables import Dynamic
Expand Down Expand Up @@ -140,11 +139,6 @@ def setup(self):

# Set common default values for promoted inputs
onn = np.ones(nn)
self.set_input_defaults(
name=Dynamic.Atmosphere.DENSITY,
val=RHO_SEA_LEVEL_ENGLISH * onn,
units='slug/ft**3',
)
self.set_input_defaults(
name=Dynamic.Atmosphere.SPEED_OF_SOUND, val=1116.4 * onn, units='ft/s'
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import numpy as np
import openmdao.api as om
from aviary.variable_info.functions import add_aviary_input, add_aviary_output
from aviary.variable_info.functions import add_aviary_input, add_aviary_option, add_aviary_output

from aviary import constants
from aviary.variable_info.enums import SpeedType
from aviary.variable_info.variables import Dynamic
from aviary.variable_info.variables import Dynamic, Mission


class UnsteadySolvedFlightConditions(om.ExplicitComponent):
Expand Down Expand Up @@ -59,6 +58,7 @@ def initialize(self):
'Removes altitude rate as an output and adjust '
'the TAS rate equation.',
)
add_aviary_option(self, Mission.SEA_LEVEL_DENSITY, units='kg/m**3')

def setup(self):
nn = self.options['num_nodes']
Expand Down Expand Up @@ -302,7 +302,7 @@ def compute(self, inputs, outputs):
ground_roll = self.options['ground_roll']

rho = inputs[Dynamic.Atmosphere.DENSITY]
rho_sl = constants.RHO_SEA_LEVEL_METRIC
rho_sl = self.options[Mission.SEA_LEVEL_DENSITY][0]
sqrt_rho_rho_sl = np.sqrt(rho / rho_sl)
sos = inputs[Dynamic.Atmosphere.SPEED_OF_SOUND]

Expand Down Expand Up @@ -345,7 +345,7 @@ def compute_partials(self, inputs, partials):
ground_roll = self.options['ground_roll']

rho = inputs[Dynamic.Atmosphere.DENSITY]
rho_sl = constants.RHO_SEA_LEVEL_METRIC
rho_sl = self.options[Mission.SEA_LEVEL_DENSITY][0]
sqrt_rho_rho_sl = np.sqrt(rho / rho_sl)
dsqrt_rho_rho_sl_drho = 0.5 / sqrt_rho_rho_sl / rho_sl
sos = inputs[Dynamic.Atmosphere.SPEED_OF_SOUND]
Expand Down
7 changes: 0 additions & 7 deletions aviary/mission/solved_two_dof/ode/unsteady_solved_ode.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy as np
import openmdao.api as om

from aviary.constants import RHO_SEA_LEVEL_ENGLISH as rho_sl
from aviary.mission.two_dof.ode.two_dof_ode import TwoDOFODE
from aviary.mission.solved_two_dof.ode.gamma_comp import GammaComp
from aviary.mission.solved_two_dof.ode.unsteady_solved_eom import UnsteadySolvedEOM
Expand Down Expand Up @@ -278,12 +277,6 @@ def setup(self):
)

onn = np.ones(nn)
self.set_input_defaults(
name=Dynamic.Atmosphere.DENSITY, val=rho_sl * onn, units='slug/ft**3'
)
self.set_input_defaults(
name=Dynamic.Atmosphere.SPEED_OF_SOUND, val=1116.4 * onn, units='ft/s'
)
if not self.options['ground_roll']:
self.set_input_defaults(
name=Dynamic.Mission.FLIGHT_PATH_ANGLE, val=0.0 * onn, units='rad'
Expand Down
Loading
Loading