Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions aviary/docs/user_guide_unreviewed/subsystems/atmosphere.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"metadata": {},
"source": [
"# User options reference for AtmosphereComp and AtmosphereGroup\n",
"There are some critical options you can pass to atmosphere that you should know about. These options will allow you to change which source data you use, swap between geocentric or geodetic altitude inputs, and add a temperature offset. Changing the source data swaps the akima splines used to calculate temperature, pressure, and density as a function of altitude. \n",
"There are some critical options you can pass to atmosphere that you should know about. These options will allow you to change which source data you use, swap between geopotential or geometric altitude inputs, and add a temperature offset. Changing the source data swaps the akima splines used to calculate temperature, pressure, and density as a function of altitude. \n",
"\n",
"All the options and their defaults and functions are shown below."
]
Expand Down Expand Up @@ -134,11 +134,11 @@
"\n",
"Your units inside of `_raw_data` should be one of the following: \n",
"English: [altitude (ft, ), temperature (degF), pressure (inHg at 60degF), density (lbm/ft**3)]\n",
"Altitude can be in either in geodetic or deocentric\n",
"Altitude can be in either in geometric or geopotential\n",
"Pressure will only translate properly if given in inHg at 60degF. However, many data sets use inHg at 30degF. \n",
"\n",
"SI Units: [altitude (m), temperature (degK), pressure (millibar), density (kg/m^3)]\n",
"Altitude can be in either in geodetic or deocentric\n",
"Altitude can be in either in geometric or geopotential\n",
"\n",
"If your units do not match either English or SI as designated above, you will need to modify the `build_akima_coefs` function to properly translate your raw data into SI units. (All calculations inside of atmosphere.py are happening in SI units with SI akima splines)\n",
"\n",
Expand Down
18 changes: 9 additions & 9 deletions aviary/subsystems/atmosphere/atmosphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ def initialize(self):

self.options.declare(
'h_def',
values=('geopotential', 'geodetic'),
default='geodetic',
values=('geopotential', 'geometric'),
default='geometric',
desc='The definition of altitude provided as input to the component. If '
'"geodetic", it will be converted to geopotential based on Equation 19 in '
'"geometric", it will be converted to geopotential based on Equation 19 in '
'the original standard.',
)

Expand Down Expand Up @@ -83,9 +83,9 @@ def initialize(self):
)
self.options.declare(
'h_def',
values=('geopotential', 'geodetic'),
values=('geopotential', 'geometric'),
default='geopotential',
desc='The definition of altitude provided as input to the component. If "geodetic",'
desc='The definition of altitude provided as input to the component. If "geometric",'
'it will be converted to geopotential based on Equation 19 in the original standard.',
)
add_aviary_option(self, Settings.ATMOSPHERE_MODEL)
Expand All @@ -102,7 +102,7 @@ def setup(self):

self._dt = self.options['delta_T_Celcius']

self._geodetic = self.options['h_def'] == 'geodetic'
self._geometric = self.options['h_def'] == 'geometric'
self._R0 = 6_356_766 # (meters) The effective Earth Radius
# 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
Expand Down Expand Up @@ -183,7 +183,7 @@ def compute(self, inputs, outputs):
table_points = self.source_data.alt
h = inputs[Dynamic.Mission.ALTITUDE]

if self._geodetic:
if self._geometric:
h = (
h / (self._R0 + h) * self._R0
) # Equation 19 from the U.S. Standard Atmosphere 1976 publication
Expand Down Expand Up @@ -244,7 +244,7 @@ def compute_partials(self, inputs, partials):
h = inputs[Dynamic.Mission.ALTITUDE]
dz_dh = 1.0

if self._geodetic:
if self._geometric:
dz_dh = (self._R0 / (self._R0 + h)) ** 2
h = h / (self._R0 + h) * self._R0 # Equation 19 from the original standard.

Expand Down Expand Up @@ -308,7 +308,7 @@ def compute_partials(self, inputs, partials):
)
partials[Dynamic.Atmosphere.SPEED_OF_SOUND, Dynamic.Mission.ALTITUDE][...] = dsos_dh.ravel()

if self._geodetic:
if self._geometric:
partials[Dynamic.Atmosphere.TEMPERATURE, Dynamic.Mission.ALTITUDE][...] *= dz_dh
partials[Dynamic.Atmosphere.STATIC_PRESSURE, Dynamic.Mission.ALTITUDE][...] *= dz_dh
partials[Dynamic.Atmosphere.DENSITY, Dynamic.Mission.ALTITUDE][...] *= dz_dh
Expand Down
12 changes: 6 additions & 6 deletions aviary/subsystems/atmosphere/test/test_atmosphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@


class USatm1976TestCase1(unittest.TestCase):
def test_geocentric(self):
def test_geopotential(self):
self.prob = om.Problem()

self.prob.model.add_subsystem(
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_geocentric(self):

assert_check_partials(partial_data)

def test_geocentric_delta_T(self):
def test_geopotential_delta_T(self):
self.prob = om.Problem()

self.prob.model.add_subsystem(
Expand Down Expand Up @@ -177,12 +177,12 @@ def test_geocentric_delta_T(self):

assert_check_partials(partial_data)

def test_geodetic(self):
def test_geometric(self):
self.prob = om.Problem()

self.prob.model.add_subsystem(
'atmo',
AtmosphereComp(delta_T_Celcius=0, num_nodes=7, h_def='geodetic'),
AtmosphereComp(delta_T_Celcius=0, num_nodes=7, h_def='geometric'),
promotes=['*'],
)

Expand Down Expand Up @@ -219,12 +219,12 @@ def test_geodetic(self):

assert_check_partials(partial_data)

def test_geodetic_delta_T(self):
def test_geometric_delta_T(self):
self.prob = om.Problem()

self.prob.model.add_subsystem(
'atmo',
AtmosphereComp(delta_T_Celcius=15, num_nodes=7, h_def='geodetic'),
AtmosphereComp(delta_T_Celcius=15, num_nodes=7, h_def='geometric'),
promotes=['*'],
)

Expand Down
2 changes: 1 addition & 1 deletion aviary/variable_info/variable_meta_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6373,7 +6373,7 @@
meta_data=_MetaData,
historical_name={'GASP': None, 'FLOPS': None},
units='ft',
desc='Current altitude of the vehicle',
desc='Current geometric altitude of the vehicle',
default_value=0.0,
multivalue=True,
)
Expand Down
Loading