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
2 changes: 1 addition & 1 deletion aviary/docs/examples_unreviewed/OAS_subsystem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"## External Dependencies\n",
"\n",
"The user must install [OpenAeroStruct](https://github.com/mdolab/OpenAeroStruct) into their Python environment using the command 'pip install openaerostruct'.\n",
"The user must also install the [ambiance](https://ambiance.readthedocs.io/en/latest/) package using the command 'pip install ambiance'.\n",
"Atmospheric properties (speed of sound, density, and dynamic viscosity) are computed using Aviary's own `Atmosphere` subsystem, so no additional atmosphere package is required.\n",
"\n",
"## Subsystem Details\n",
"\n",
Expand Down
3 changes: 1 addition & 2 deletions aviary/docs/getting_started/installation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,9 @@
"## Packages For Running Tests\n",
"In order to run Aviary's test suite, you will need the following packages:\n",
"- *testflo*\n",
"- *ambiance*\n",
"- *openaerostruct*\n",
"\n",
"`testflo` is the core package that automates testing. The other two packages, `ambiance` and `openaerostruct`, are needed to run example cases that incorporate them as external subsystems. It is useful to be able to run these cases even if you have no interest in those specific tools to ensure that the interface for external subsystems is working correctly.\n",
"`testflo` is the core package that automates testing. The other package, `openaerostruct`, is needed to run example cases that incorporate it as an external subsystem. It is useful to be able to run these cases even if you have no interest in that specific tool to ensure that the interface for external subsystems is working correctly.\n",
"\n",
"(contribution-packages)=\n",
"## Packages For Contributing Code\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,42 @@
import numpy as np
import openmdao.api as om

try:
import ambiance
except ImportError:
raise ImportError(
"ambiance package not found. You can install it by running 'pip install ambiance'."
)

try:
import openaerostruct
except ImportError:
raise ImportError(
"openaerostruct package not found. You can install it by running 'pip install openaerostruct'."
)

from ambiance import Atmosphere
from openaerostruct.integration.aerostruct_groups import AerostructGeometry, AerostructPoint
from openaerostruct.structures.wingbox_fuel_vol_delta import WingboxFuelVolDelta

from aviary.subsystems.atmosphere.atmosphere import Atmosphere
from aviary.variable_info.variables import Dynamic


def _get_atmospheric_properties(altitude):
"""
Compute speed of sound, density, and dynamic viscosity at the given
altitude(s) [m] using Aviary's own Atmosphere group, in place of the
external ambiance package.
"""
atmos_prob = om.Problem()
atmos_prob.model.add_subsystem(
name='atmosphere',
subsys=Atmosphere(num_nodes=len(altitude)),
promotes=['*'],
)
atmos_prob.setup()
atmos_prob.set_val(Dynamic.Mission.ALTITUDE, altitude, units='m')
atmos_prob.run_model()

speed_of_sound = atmos_prob.get_val(Dynamic.Atmosphere.SPEED_OF_SOUND, units='m/s')
density = atmos_prob.get_val(Dynamic.Atmosphere.DENSITY, units='kg/m**3')
dynamic_viscosity = atmos_prob.get_val(Dynamic.Atmosphere.DYNAMIC_VISCOSITY, units='Pa*s')

return speed_of_sound, density, dynamic_viscosity


def user_mesh():
"""Generate a user defined mesh which is model specific."""
Expand Down Expand Up @@ -305,11 +323,7 @@ def compute(self, inputs, outputs):
altitude = np.array([inputs['cruise_altitude'][0], 0.0])
cruise_range = inputs['cruise_range'][0]

atmos = Atmosphere(altitude)

speed_of_sound = atmos.speed_of_sound
rho = atmos.density
dynamic_viscosity = atmos.dynamic_viscosity
speed_of_sound, rho, dynamic_viscosity = _get_atmospheric_properties(altitude)

velocity = np.array([mach[0] * speed_of_sound[0], mach[1] * speed_of_sound[1]])

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import importlib.util
import unittest

import aviary.api as av
Expand All @@ -9,7 +8,6 @@


@skipIfMissingDependencies(OASWingWeightBuilder)
@unittest.skipUnless(importlib.util.find_spec('ambiance'), "'ambiance' is not installed")
class TestStructures(av.TestSubsystemBuilder):
"""Test OAS structure builder."""

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ docs = [
dev = [
"pre-commit",
"testflo",
"ambiance",
"openaerostruct",
]
all = [
Expand Down
Loading