Skip to content

Gravity v4 - #1235

Merged
ehariton merged 25 commits into
OpenMDAO:mainfrom
ehariton:gravity_v4
Aug 11, 2026
Merged

Gravity v4 #1235
ehariton merged 25 commits into
OpenMDAO:mainfrom
ehariton:gravity_v4

Conversation

@ehariton

@ehariton ehariton commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

All gravity constants are now uniform and encapsulated in constants.py . The differences between FLOPS and GASP gravities have been eliminated.

Follow on to #1219, #1227, #1232.
Removes GRAV_ENGLISH_GASP and replaces with Mission.GRAVITY.

One reference to GNS as gravity in a standard python function was not replaced because this function seems to be trying to account for the rotation rate of the earth as well, so we just left it alone and put some warnings around it indicating it won't work for non-earth planets.

Related Issues

Resolves #1192

Backwards incompatibilities

None

AI Usage

None.

@ehariton
ehariton marked this pull request as ready for review July 15, 2026 16:55
Comment thread aviary/mission/two_dof/ode/test/test_flight_path_ode.py
Comment thread aviary/subsystems/aerodynamics/gasp_based/interference.py
Comment thread aviary/subsystems/propulsion/utils.py Outdated
Comment thread aviary/subsystems/propulsion/utils.py
Comment thread aviary/subsystems/propulsion/utils.py Outdated
@Kenneth-T-Moore Kenneth-T-Moore changed the title Gravity v4 - Draft Gravity v4 Jul 24, 2026
@ehariton
ehariton requested a review from cmbenne3 July 24, 2026 14:57
Comment thread aviary/subsystems/aerodynamics/gasp_based/interference.py
Comment thread aviary/subsystems/propulsion/utils.py Outdated
Comment thread aviary/subsystems/propulsion/utils.py Outdated
g = constants.GRAV_EARTH1[0]
radius_earth = constants.RADIUS_EARTH[0] # meters
if constants.RADIUS_EARTH[1] != 'm':
if constants.RADIUS_EARTH[1] != 'm' or constants.GRAV_EARTH1[1] != 'm/s**2':

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just convert units if they aren't what we expected

from openmdao.utils.units import convert_units

convert_units(val, old_units, new_units)

I'm not sure why we need to check that our hardcoded constants have their expected units to begin with though

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the convert_units function as requested. the equations inside of this helper function require particular units on input and can't convert on their own.

Comment thread aviary/constants.py Outdated
Comment thread aviary/constants.py Outdated
@jkirk5
jkirk5 added this pull request to the merge queue Aug 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 10, 2026
@jkirk5 jkirk5 mentioned this pull request Aug 10, 2026
@ehariton
ehariton added this pull request to the merge queue Aug 11, 2026
Merged via the queue into OpenMDAO:main with commit 870a8f0 Aug 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update values of constants

3 participants