Skip to content

Commit

Permalink
Merge branch 'main' into off_des_payload3
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbenne3 authored Jan 13, 2025
2 parents 777df7b + 394fb52 commit 82c134f
Show file tree
Hide file tree
Showing 385 changed files with 14,197 additions and 11,940 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/test_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
jobs:

latest_benchmarks:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 90

steps:
Expand All @@ -38,8 +38,7 @@ jobs:
SCIPY: 1
PYOPTSPARSE: 'v2.9.1'
SNOPT: '7.7'
#OPENMDAO: 'latest'
OPENMDAO: '3.34.2'
OPENMDAO: 'latest'
DYMOS: 'latest'
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
jobs:

latest_docs:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 90

steps:
Expand All @@ -38,8 +38,7 @@ jobs:
SCIPY: 1
PYOPTSPARSE: 'v2.9.1'
SNOPT: '7.7'
#OPENMDAO: 'latest'
OPENMDAO: '3.34.2'
OPENMDAO: 'latest'
DYMOS: 'latest'
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

pre_commit:
# run pre-commit checks
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
Expand All @@ -28,19 +28,20 @@ jobs:
- uses: pre-commit/action@v3.0.1

test_ubuntu:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
# oldest versions of openmdao/dymos
# Note: bugfixes sometimes require incrementing the minimal version of openmdao or dymos.
- NAME: oldest
PY: '3.9'
NUMPY: '1.20'
SCIPY: '1.6'
PYOPTSPARSE: 'v2.9.1'
SNOPT: '7.7'
OPENMDAO: '3.33.0'
OPENMDAO: '3.35.0'
DYMOS: '1.8.0'

# latest versions of openmdao/dymos
Expand All @@ -50,8 +51,7 @@ jobs:
SCIPY: 1
PYOPTSPARSE: 'v2.9.1'
SNOPT: '7.7'
#OPENMDAO: 'latest'
OPENMDAO: '3.34.2'
OPENMDAO: 'latest'
DYMOS: 'latest'

steps:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test_workflow_dev_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:

test_ubuntu:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand All @@ -27,8 +27,7 @@ jobs:
SCIPY: 1
PYOPTSPARSE: 'latest'
SNOPT: '7.7'
#OPENMDAO: 'dev'
OPENMDAO: '3.34.2'
OPENMDAO: 'dev'
DYMOS: 'dev'

steps:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test_workflow_no_dev_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:

test_ubuntu_no_dev_install:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

timeout-minutes: 90

Expand Down Expand Up @@ -70,7 +70,6 @@ jobs:
echo ""
echo "Temporarily install specific versions for now."
pip install "numpy<2"
pip install "openmdao==3.34.2"
pip install packaging
pip install .[all]
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,9 @@ coloring_files/
# OpenMDAO N2 diagrams
n2.html

# Input and output lists
input_list.txt
output_list.txt

# Windows downloads
*:Zone.Identifier
2 changes: 1 addition & 1 deletion aviary/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from aviary.variable_info.options import get_option_defaults, is_option
from aviary.utils.develop_metadata import add_meta_data, update_meta_data
from aviary.variable_info.variable_meta_data import CoreMetaData
from aviary.variable_info.functions import add_aviary_input, add_aviary_output, get_units, override_aviary_vars, setup_trajectory_params
from aviary.variable_info.functions import add_aviary_input, add_aviary_output, get_units, override_aviary_vars, setup_trajectory_params, setup_model_options
from aviary.utils.merge_hierarchies import merge_hierarchies
from aviary.utils.merge_variable_metadata import merge_meta_data
from aviary.utils.named_values import NamedValues, get_keys, get_items, get_values
Expand Down
2 changes: 1 addition & 1 deletion aviary/docs/developer_guide/codebase_overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
" 'interface':'is where most code that users interact with is located',\n",
" 'mission':'contains OpenMDAO components and groups for modeling the aircraft mission',\n",
" 'models':'contains aircraft and propulsion models for use in Aviary examples and tests',\n",
" 'subsystems':'is where the aerodynamic, propulsion, mass, and geometry core subsystems are located',\n",
" 'subsystems':'is where the aerodynamic, atmosphere, energy, propulsion, mass, and geometry core subsystems are located',\n",
" 'utils':'contains utility functions for use in Aviary code, examples, and tests',\n",
" 'validation_cases':'contains validation cases for testing and benchmarking Aviary',\n",
" 'variable_info':'contains the variable meta data as well as several variable classes that are used in Aviary',\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"aircraft_filename = 'models/test_aircraft/aircraft_for_bench_FwFm.csv'\n",
"optimizer = \"IPOPT\"\n",
"make_plots = True\n",
"max_iter = 200\n",
"max_iter = 100\n",
"\n",
"prob = av.run_aviary(aircraft_filename, phase_info, optimizer=optimizer,\n",
" make_plots=make_plots, max_iter=max_iter)"
Expand Down
10 changes: 5 additions & 5 deletions aviary/docs/examples/modified_aircraft.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ aircraft:canard:aspect_ratio,0.0,unitless
aircraft:canard:thickness_to_chord,0.0,unitless
aircraft:crew_and_payload:baggage_mass_per_passenger,45.0,lbm
aircraft:crew_and_payload:cargo_container_mass_scaler,1.0,unitless
aircraft:crew_and_payload:design:num_business_class,0,unitless
aircraft:crew_and_payload:design:num_first_class,11,unitless
aircraft:crew_and_payload:design:num_passengers,169,unitless
aircraft:crew_and_payload:design:num_tourist_class,158,unitless
aircraft:crew_and_payload:flight_crew_mass_scaler,1.0,unitless
aircraft:crew_and_payload:mass_per_passenger,180.0,lbm
aircraft:crew_and_payload:misc_cargo,0.0,lbm
aircraft:crew_and_payload:non_flight_crew_mass_scaler,1.0,unitless
aircraft:crew_and_payload:num_business_class,0,unitless
aircraft:crew_and_payload:num_first_class,11,unitless
aircraft:crew_and_payload:num_flight_attendants,3,unitless
aircraft:crew_and_payload:num_flight_crew,2,unitless
aircraft:crew_and_payload:num_galley_crew,0,unitless
aircraft:crew_and_payload:num_passengers,169,unitless
aircraft:crew_and_payload:num_tourist_class,158,unitless
aircraft:crew_and_payload:passenger_service_mass_scaler,1.0,unitless
aircraft:crew_and_payload:wing_cargo,0.0,lbm
aircraft:design:base_area,0.0,ft**2
Expand Down Expand Up @@ -114,7 +114,7 @@ aircraft:wing:aeroelastic_tailoring_factor,0.0,unitless
aircraft:wing:airfoil_technology,1.92669766647637,unitless
aircraft:wing:area,1370.0,ft**2
aircraft:wing:aspect_ratio,11.02091,unitless
aircraft:wing:bending_mass_scaler,1.0,unitless
aircraft:wing:BENDING_MATERIAL_MASS_SCALER,1.0,unitless
aircraft:wing:chord_per_semispan,0.31,0.23,0.084,unitless
aircraft:wing:composite_fraction,0.2,unitless
aircraft:wing:control_surface_area,137,ft**2
Expand Down
6 changes: 3 additions & 3 deletions aviary/docs/getting_started/onboarding_ext_subsystem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
"\n",
"The steps in bold are related specifically to subsystems. So, almost all of the steps involve subsystems. As long as your external subsystem is built based on the guidelines, Aviary will take care of your subsystem.\n",
"\n",
"The next example is the [battery subsystem](https://github.com/OpenMDAO/Aviary/blob/main/aviary/docs/user_guide/battery_subsystem_example). The battery subsystem provides methods to define the battery subsystem's states, design variables, fixed values, initial guesses, and mass names. It also provides methods to build OpenMDAO systems for the pre-mission and mission computations of the subsystem, to get the constraints for the subsystem, and to preprocess the inputs for the subsystem. This subsystem has its own set of variables. We will build an Aviary model with full phases (namely, `climb`, `cruise` and `descent`) and maximize the final total mass: `Dynamic.Mission.MASS`."
"The next example is the [battery subsystem](https://github.com/OpenMDAO/Aviary/blob/main/aviary/docs/user_guide/battery_subsystem_example). The battery subsystem provides methods to define the battery subsystem's states, design variables, fixed values, initial guesses, and mass names. It also provides methods to build OpenMDAO systems for the pre-mission and mission computations of the subsystem, to get the constraints for the subsystem, and to preprocess the inputs for the subsystem. This subsystem has its own set of variables. We will build an Aviary model with full phases (namely, `climb`, `cruise` and `descent`) and maximize the final total mass: `Dynamic.Vehicle.MASS`."
]
},
{
Expand All @@ -233,7 +233,7 @@
"source": [
"# Testing Cell\n",
"from aviary.api import Dynamic\n",
"Dynamic.Mission.MASS;"
"Dynamic.Vehicle.MASS;"
]
},
{
Expand Down Expand Up @@ -399,7 +399,7 @@
"id": "ed8c764a",
"metadata": {},
"source": [
"Since our objective is `mass`, we want to print the value of `Dynamic.Mission.Mass`. Remember, we have imported Dynamic from aviary.variable_info.variables for this purpose.\n",
"Since our objective is `mass`, we want to print the value of `Dynamic.Vehicle.MASS`. Remember, we have imported Dynamic from aviary.variable_info.variables for this purpose.\n",
"\n",
"So, we have to print the final mass in a different way. Keep in mind that we have three phases in the mission and that final mass is our objective. So, we can get the final mass of the descent phase instead. Let us try this approach. Let us comment out the print statement of final mass (and the import of Dynamic), then add the following lines:"
]
Expand Down
2 changes: 1 addition & 1 deletion aviary/docs/getting_started/onboarding_level1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
"\n",
"In ground roll phase, throttle setting is set to maximum (1.0). Aviary sets a phase parameter:\n",
"```\n",
"Dynamic.Mission.THROTTLE = 1.0\n",
"Dynamic.Vehicle.Propulsion.THROTTLE = 1.0\n",
"```\n",
"For the [`COLLOCATION`](https://openmdao.github.io/dymos/getting_started/collocation.html) setting, there is one [segment](https://openmdao.github.io/dymos/getting_started/intro_to_dymos/intro_segments.html) (`'num_segments': 1`) and polynomial interpolation degree is 3 (`'order': 3`). Increasing the number of segments and/or increasing the degree of polynomial will improve accuracy but will also increase the complexity of computation. For groundroll, it is unnecessary.\n",
"\n",
Expand Down
8 changes: 4 additions & 4 deletions aviary/docs/getting_started/onboarding_level2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -629,12 +629,12 @@
"\n",
"| objective_type | objective |\n",
"| -------------- | --------- |\n",
"| mass | `Dynamic.Mission.MASS` |\n",
"| mass | `Dynamic.Vehicle.MASS` |\n",
"| hybrid_objective | `-final_mass / {takeoff_mass} + final_time / 5.` |\n",
"| fuel_burned | `initial_mass - mass_final` (for `FLOPS` mission only)|\n",
"| fuel | `Mission.Objectives.FUEL` |\n",
"\n",
"As listed in the above, if `objective_type=\"mass\"`, the objective is the final value of `Dynamic.Mission.MASS` at the end of the mission.\n",
"As listed in the above, if `objective_type=\"mass\"`, the objective is the final value of `Dynamic.Vehicle.MASS` at the end of the mission.\n",
"If `objective_type=\"fuel\"`, the objective is the `Mission.Objectives.FUEL`.\n",
"There is a special objective type: `hybrid_objective`. When `objective_type=\"hybrid_objective\"`, the objective is a mix of minimizing fuel burn and minimizing the mission duration:"
]
Expand All @@ -659,7 +659,7 @@
"from aviary.utils.doctape import check_contains\n",
"\n",
"mo = Mission.Objectives\n",
"dm = Dynamic.Mission\n",
"dm = Dynamic.Vehicle\n",
"expected_objective = {'mass':dm.MASS, 'hybrid_objective':'obj_comp.obj',\n",
" 'fuel_burned':Mission.Summary.FUEL_BURNED, 'fuel':mo.FUEL}\n",
"\n",
Expand Down Expand Up @@ -1020,7 +1020,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
19 changes: 11 additions & 8 deletions aviary/docs/getting_started/onboarding_level3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"\n",
"import aviary.api as av\n",
"from aviary.validation_cases.validation_tests import get_flops_inputs\n",
"from aviary.variable_info.functions import setup_model_options\n",
"\n",
"\n",
"prob = om.Problem(model=om.Group())\n",
Expand Down Expand Up @@ -334,7 +335,7 @@
"# link phases #\n",
"###############\n",
"\n",
"traj.link_phases([\"climb\", \"cruise\", \"descent\"], [\"time\", av.Dynamic.Mission.MASS, av.Dynamic.Mission.DISTANCE], connected=strong_couple)\n",
"traj.link_phases([\"climb\", \"cruise\", \"descent\"], [\"time\", av.Dynamic.Vehicle.MASS, av.Dynamic.Mission.DISTANCE], connected=strong_couple)\n",
"\n",
"param_vars = [av.Aircraft.Nacelle.CHARACTERISTIC_LENGTH,\n",
" av.Aircraft.Nacelle.FINENESS,\n",
Expand Down Expand Up @@ -459,6 +460,8 @@
"]\n",
"av.set_aviary_input_defaults(prob.model, varnames, aviary_inputs)\n",
"\n",
"av.setup_model_options(prob, aviary_inputs)\n",
"\n",
"prob.setup(force_alloc_complex=True)\n",
"\n",
"av.set_aviary_initial_values(prob, aviary_inputs)\n",
Expand All @@ -474,9 +477,9 @@
" av.Dynamic.Mission.ALTITUDE, ys=[alt_i_climb, alt_f_climb]), units='m')\n",
"prob.set_val(\n",
" 'traj.climb.controls:mach', climb.interp(\n",
" av.Dynamic.Mission.MACH, ys=[mach_i_climb, mach_f_climb]), units='unitless')\n",
" av.Dynamic.Atmosphere.MACH, ys=[mach_i_climb, mach_f_climb]), units='unitless')\n",
"prob.set_val('traj.climb.states:mass', climb.interp(\n",
" av.Dynamic.Mission.MASS, ys=[mass_i_climb, mass_f_climb]), units='kg')\n",
" av.Dynamic.Vehicle.MASS, ys=[mass_i_climb, mass_f_climb]), units='kg')\n",
"prob.set_val('traj.climb.states:distance', climb.interp(\n",
" av.Dynamic.Mission.DISTANCE, ys=[range_i_climb, range_f_climb]), units='m')\n",
"\n",
Expand All @@ -487,9 +490,9 @@
" av.Dynamic.Mission.ALTITUDE, ys=[alt_i_cruise, alt_f_cruise]), units='m')\n",
"prob.set_val(\n",
" 'traj.cruise.controls:mach', cruise.interp(\n",
" av.Dynamic.Mission.MACH, ys=[cruise_mach, cruise_mach]), units='unitless')\n",
" av.Dynamic.Atmosphere.MACH, ys=[cruise_mach, cruise_mach]), units='unitless')\n",
"prob.set_val('traj.cruise.states:mass', cruise.interp(\n",
" av.Dynamic.Mission.MASS, ys=[mass_i_cruise, mass_f_cruise]), units='kg')\n",
" av.Dynamic.Vehicle.MASS, ys=[mass_i_cruise, mass_f_cruise]), units='kg')\n",
"prob.set_val('traj.cruise.states:distance', cruise.interp(\n",
" av.Dynamic.Mission.DISTANCE, ys=[range_i_cruise, range_f_cruise]), units='m')\n",
"\n",
Expand All @@ -500,9 +503,9 @@
" av.Dynamic.Mission.ALTITUDE, ys=[alt_i_descent, alt_f_descent]), units='m')\n",
"prob.set_val(\n",
" 'traj.descent.controls:mach', descent.interp(\n",
" av.Dynamic.Mission.MACH, ys=[mach_i_descent, mach_f_descent]), units='unitless')\n",
" av.Dynamic.Atmosphere.MACH, ys=[mach_i_descent, mach_f_descent]), units='unitless')\n",
"prob.set_val('traj.descent.states:mass', descent.interp(\n",
" av.Dynamic.Mission.MASS, ys=[mass_i_descent, mass_f_descent]), units='kg')\n",
" av.Dynamic.Vehicle.MASS, ys=[mass_i_descent, mass_f_descent]), units='kg')\n",
"prob.set_val('traj.descent.states:distance', descent.interp(\n",
" av.Dynamic.Mission.DISTANCE, ys=[distance_i_descent, distance_f_descent]), units='m')\n",
"\n",
Expand Down Expand Up @@ -709,7 +712,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
16 changes: 8 additions & 8 deletions aviary/docs/user_guide/SGM_capabilities.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@
" problem_name=phase_name,\n",
" outputs=[\"normal_force\", \"alpha\"],\n",
" states=[\n",
" Dynamic.Mission.MASS,\n",
" Dynamic.Vehicle.MASS,\n",
" Dynamic.Mission.DISTANCE,\n",
" Dynamic.Mission.ALTITUDE,\n",
" Dynamic.Mission.VELOCITY,\n",
" ],\n",
" # state_units=['lbm','nmi','ft'],\n",
" alternate_state_rate_names={\n",
" Dynamic.Mission.MASS: Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL},\n",
" Dynamic.Vehicle.MASS: Dynamic.Vehicle.Propulsion.FUEL_FLOW_RATE_NEGATIVE_TOTAL},\n",
" **simupy_args,\n",
" )\n",
"\n",
Expand Down Expand Up @@ -196,11 +196,11 @@
"full_traj = FlexibleTraj(\n",
" Phases=phase_info,\n",
" traj_final_state_output=[\n",
" Dynamic.Mission.MASS,\n",
" Dynamic.Vehicle.MASS,\n",
" Dynamic.Mission.DISTANCE,\n",
" ],\n",
" traj_initial_state_input=[\n",
" Dynamic.Mission.MASS,\n",
" Dynamic.Vehicle.MASS,\n",
" Dynamic.Mission.DISTANCE,\n",
" Dynamic.Mission.ALTITUDE,\n",
" ],\n",
Expand All @@ -210,11 +210,11 @@
" # third key is event_idx associated with input\n",
" ('groundroll', Dynamic.Mission.VELOCITY, 0,),\n",
" ('climb3', Dynamic.Mission.ALTITUDE, 0,),\n",
" ('cruise', Dynamic.Mission.MASS, 0,),\n",
" ('cruise', Dynamic.Vehicle.MASS, 0,),\n",
" ],\n",
" traj_intermediate_state_output=[\n",
" ('cruise', Dynamic.Mission.DISTANCE),\n",
" ('cruise', Dynamic.Mission.MASS),\n",
" ('cruise', Dynamic.Vehicle.MASS),\n",
" ]\n",
")"
]
Expand Down Expand Up @@ -278,7 +278,7 @@
"from aviary.utils.doctape import check_value\n",
"\n",
"for phase_name, phase in descent_phases.items():\n",
" check_value(phase['user_options'][Dynamic.Mission.THROTTLE],(0, 'unitless'))"
" check_value(phase['user_options'][Dynamic.Vehicle.Propulsion.THROTTLE],(0, 'unitless'))"
]
}
],
Expand All @@ -298,7 +298,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 82c134f

Please sign in to comment.