Skip to content

Commit

Permalink
Merge branch 'main' into regional_turboprop
Browse files Browse the repository at this point in the history
  • Loading branch information
jkirk5 committed Jan 31, 2025
2 parents 0c83cf7 + 7472c64 commit 6917e75
Show file tree
Hide file tree
Showing 101 changed files with 2,677 additions and 1,018 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.9.7-dev
current_version = 0.9.9-dev
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ body:
attributes:
label: Aviary Version
description: What version of Aviary is being used.
placeholder: "0.9.7-dev"
placeholder: "0.9.9-dev"
validations:
required: true
- type: textarea
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/prepare_environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ runs:
conda env export --file ${{ inputs.NAME }}_environment.yml
- name: 'Upload environment artifact'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.NAME }}_environment
path: ${{ inputs.NAME }}_environment.yml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ jobs:

# latest versions of openmdao/dymos
- NAME: latest
PY: '3.10'
PY: '3.12'
NUMPY: 1
SCIPY: 1
PYOPTSPARSE: 'v2.9.1'
PYOPTSPARSE: 'v2.12.0'
SNOPT: '7.7'
OPENMDAO: 'latest'
DYMOS: 'latest'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_workflow_no_dev_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
conda env export --file ${{ matrix.NAME }}_environment.yml
- name: 'Upload environment artifact'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.NAME }}_environment
path: ${{ matrix.NAME }}_environment.yml
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ target/

# Jupyter Notebook
.ipynb_checkpoints
.db-journal

# IPython
profile_default/
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ identifiers:
repository-code: 'https://github.com/OpenMDAO/Aviary'
repository: 'https://github.com/OpenMDAO/Aviary_Community'
license: Apache-2.0
version: 0.9.7
version: 0.9.8
2 changes: 1 addition & 1 deletion aviary/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.9.7-dev"
__version__ = "0.9.9-dev"
4 changes: 2 additions & 2 deletions aviary/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
from aviary.interface.methods_for_level2 import AviaryProblem
from aviary.interface.utils.check_phase_info import check_phase_info
from aviary.utils.engine_deck_conversion import EngineDeckConverter
from aviary.utils.fortran_to_aviary import create_aviary_deck
from aviary.utils.functions import set_aviary_input_defaults, set_aviary_initial_values, get_path
from aviary.utils.fortran_to_aviary import fortran_to_aviary
from aviary.utils.functions import set_aviary_input_defaults, set_aviary_initial_values, get_path, top_dir
from aviary.utils.options import list_options
from aviary.constants import GRAV_METRIC_GASP, GRAV_ENGLISH_GASP, GRAV_METRIC_FLOPS, GRAV_ENGLISH_FLOPS, GRAV_ENGLISH_LBM, RHO_SEA_LEVEL_ENGLISH, RHO_SEA_LEVEL_METRIC, MU_TAKEOFF, MU_LANDING, PSLS_PSF, TSLS_DEGR, RADIUS_EARTH_METRIC
from aviary.subsystems.test.subsystem_tester import TestSubsystemBuilderBase, skipIfMissingDependencies
Expand Down
2 changes: 1 addition & 1 deletion aviary/docs/developer_guide/doctape_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"If you want to glue the name of a variable, instead of the value that variable holds, you can use the {glue:md}`get_variable_name` to extract it.\n",
"If you want to glue the name of a variable, instead of the value that variable holds, you can use the {glue:md}`get_variable_name` function to extract it.\n",
"\n",
"For example:\n",
"Using {glue:md}`var_value_code` will result in {glue:md}`value`, whereas using {glue:md}`var_name_code` will result in {glue:md}`Aircraft.Design.EMPTY_MASS`\n",
Expand Down
23 changes: 21 additions & 2 deletions aviary/docs/examples/outputted_phase_info.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
phase_info = {'pre_mission': {'include_takeoff': True, 'optimize_mass': True}, 'climb_1': {'subsystem_options': {'core_aerodynamics': {'method': 'computed'}}, 'user_options': {'optimize_mach': True, 'optimize_altitude': True, 'polynomial_control_order': [1, 2], 'use_polynomial_control': True, 'num_segments': [1], 'order': 1, 'solve_for_distance': True, 'initial_mach': (1, None), 'final_mach': (2, None), 'mach_bounds': (
(0.98, 2.02), None), 'initial_altitude': (1, None), 'final_altitude': (2, None), 'altitude_bounds': ((0.0, 502), None), 'throttle_enforcement': 'path_constraint', 'fix_initial': True, 'constrain_final': True, 'fix_duration': False, 'initial_bounds': ((0.0, 0.0), None), 'duration_bounds': ((0.5, 1.5), None)}, 'initial_guesses': {'time': ([1, 1], None)}}, 'post_mission': {'include_landing': True, 'constrain_range': True, 'target_range': (514.5, None)}}
phase_info = {
'pre_mission': {
'include_takeoff': True, 'optimize_mass': True}, 'climb_1': {
'subsystem_options': {
'core_aerodynamics': {
'method': 'computed'}}, 'user_options': {
'optimize_mach': True, 'optimize_altitude': True, 'polynomial_control_order': [
1, 2], 'use_polynomial_control': True, 'num_segments': [1], 'order': 1, 'solve_for_distance': True, 'initial_mach': (
1, None), 'final_mach': (
2, None), 'mach_bounds': (
(0.98, 2.02), None), 'initial_altitude': (
1, None), 'final_altitude': (
2, None), 'altitude_bounds': (
(0.0, 502), None), 'throttle_enforcement': 'path_constraint', 'fix_initial': True, 'constrain_final': True, 'fix_duration': False, 'initial_bounds': (
(0.0, 0.0), None), 'duration_bounds': (
(0.5, 1.5), None)}, 'initial_guesses': {
'time': (
[
1, 1], None)}}, 'post_mission': {
'include_landing': True, 'constrain_range': True, 'target_range': (
514.5, None)}}
4 changes: 2 additions & 2 deletions aviary/docs/examples/reserve_missions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "latest_env",
"display_name": "aviary",
"language": "python",
"name": "python3"
},
Expand All @@ -200,7 +200,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
6 changes: 2 additions & 4 deletions aviary/docs/getting_started/onboarding_level1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@
"source": [
"Let us discuss these in more detail:\n",
"\n",
"- `-o ––outdir`: Use specified directory to write output. The default is the current directory.\n",
"\n",
"- `--optimizer`: Name of optimizer. Choices are: `SNOPT`, `IPOPT`, `SLSQP`, and `None`. The default is `SNOPT`. If optimizer is `None`, it will be set to `IPOPT` or `SNOPT` depending on the analysis scheme. The optimization objective is fuel burn for level 1 runs. The objective is\n",
" - `mission:objectives:fuel` if `mission_method` is `GASP` \n",
" - `fuel_burned` if `mission_method` is `FLOPS`.\n",
Expand Down Expand Up @@ -764,7 +762,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "aviary",
"language": "python",
"name": "python3"
},
Expand All @@ -778,7 +776,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
6 changes: 4 additions & 2 deletions aviary/docs/getting_started/onboarding_level3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@
"\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",
"param_vars = [av.Aircraft.Engine.SCALE_FACTOR,\n",
" av.Aircraft.Nacelle.CHARACTERISTIC_LENGTH,\n",
" av.Aircraft.Nacelle.FINENESS,\n",
" av.Aircraft.Nacelle.LAMINAR_FLOW_LOWER,\n",
" av.Aircraft.Nacelle.LAMINAR_FLOW_UPPER,\n",
Expand Down Expand Up @@ -451,6 +452,7 @@
"\n",
"# Set initial default values for all LEAPS aircraft variables.\n",
"varnames = [\n",
" av.Aircraft.Engine.SCALE_FACTOR,\n",
" av.Aircraft.Wing.MAX_CAMBER_AT_70_SEMISPAN,\n",
" av.Aircraft.Wing.SWEEP,\n",
" av.Aircraft.Wing.TAPER_RATIO,\n",
Expand Down Expand Up @@ -698,7 +700,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "aviary",
"language": "python",
"name": "python3"
},
Expand Down
76 changes: 33 additions & 43 deletions aviary/docs/user_guide/aviary_commands.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"\n",
"`run_mission` is a command line interface that will run an analysis on a given csv input file.\n",
"\n",
"To use small_single_aisle_GwGm.csv run the command `aviary run_mission models/small_single_aisle/small_single_aisle_GwGm.csv`<br>\n",
"To use small_single_aisle_GASP.csv run the command `aviary run_mission models/small_single_aisle/small_single_aisle_GASP.csv`<br>\n",
"\n",
"SNOPT is the default optimizer, but IPOPT is available as well."
]
Expand All @@ -105,7 +105,7 @@
"source": [
"# Testing Cell\n",
"import subprocess\n",
"command = 'aviary run_mission models/small_single_aisle/small_single_aisle_GwGm.csv'\n",
"command = 'aviary run_mission models/small_single_aisle/small_single_aisle_GASP.csv'\n",
"command += ' --max_iter 0 --optimizer IPOPT' # max_iter to limit build time, IPOPT to run on CI\n",
"subprocess.run(command.split()).check_returncode();\n"
]
Expand Down Expand Up @@ -141,10 +141,10 @@
"`-o` or `--outdir` is the directory to write outputs. The default is current directory.\n",
"`--optimizer` is the name of the optimizer. The default is `SNOPT`.\n",
"`--shooting` indicates that the integration method is shooting method instead of collocation scheme. The default is collocation.\n",
"`--phase_info` is the path to phase info file. If it is missing, it depends on the integration method (collocation or shooting) and on the mission method (settings:equations+of_motion with value of `2DOF` or `height_energy`) which is defined in the .csv input file.\n",
"`--phase_info` is the path to phase info file. If it is missing, it depends on the integration method (collocation or shooting) and on the mission method (`settings:equations_of_motion` with value of `2DOF` or `height_energy`) which is defined in the .csv input file.\n",
"`--max_iter` is the maximum number of iterations. The default is 50.\n",
"\n",
"More detailed discussions can be found in [onboarding_level1](../getting_started/onboarding_level1.ipynb)."
"More detailed information and examples can be found in the [Level 1 interface](../getting_started/onboarding_level1.ipynb)."
]
},
{
Expand All @@ -157,37 +157,31 @@
"\n",
"The `aviary fortran_to_aviary` command will convert a Fortran input deck to an Aviary csv.\n",
"\n",
"The only two required inputs are `-l` (for `--legacy_code` with options `FLOPS` and `GASP`) and the filepath to the input deck. \n",
"Optionally, a deck of default values can be specified via the option `-d` (for `--defaults_deck`) and a default deck file, this is useful if an input deck assumes certain values for any unspecified variables.\n",
"When this command is run, a brief message is printed. To print more messages, one can set verbosity level higher. For example, `-v 3` will result in debug messages being printed. See [Controlling Display Levels](../developer_guide/coding_standards.ipynb) for more details.\n",
"The only two required inputs are the filepath to the input deck and `-l` (for `--legacy_code` with options `FLOPS` and `GASP`). When this command is run, a brief message is printed. To print more messages, one can set verbosity level higher. For example, `-v 3` will result in debug messages being printed. See [Controlling Display Levels](../developer_guide/coding_standards.ipynb) for more details.\n",
"If an invalid filepath is given, pre-packaged resources will be checked for input decks with a matching name.\n",
"If the output file name is not specified, a detault name is assumed to be the trunk of the input file name with `csv` as file extension. For example, an input file `sample.dat` will result in `sample_converted.csv`.\n",
"If the output file exists, the command will not run unless the user specifies `--force` to force the overwritten action.\n",
"\n",
"Here, pre-packaged resources are absolute path, relative path, and Aviary based path.\n",
"\n",
"Notes for input decks:\n",
"- FLOPS, GASP, or Aviary names can be used for variables (Ex WG or Mission:Design:GROSS_MASS)\n",
"- When specifying variables from FORTRAN, they should be in the appropriate NAMELIST.\n",
"- Aviary variable names should be specified outside any NAMELISTS.\n",
"- Names are not case-sensitive.\n",
"- Units can be specified using any of the openMDAO valid units.\n",
"- Comments can be added using !\n",
"- Lists can be entered by separating values with commas.\n",
"- Individual list elements can be specified by adding an index after the variable name.\n",
"- (NOTE: 1 indexing is used inside NAMELISTS, while 0 indexing is used outside NAMELISTS)\n",
"\n",
"Example inputs:\n",
"- When specifying variables from FORTRAN, they should be in the appropriate NAMELIST\n",
"- Names are not case-sensitive\n",
"- Comments can be added using \"!\"\n",
"- Lists can be entered by separating values with commas on the same line\n",
"- For GASP variables where required, individual list elements can be specified by adding an index after the variable name\n",
" - (NOTE: 1 indexing is used inside NAMELISTS, while 0 indexing is used outside NAMELISTS)\n",
"\n",
"Example inputs (GASP-style file):\n",
"```\n",
"aircraft:fuselage:pressure_differential = .5, atm !DELP in GASP, but using atmospheres instead of psi\n",
"ARNGE(1) = 3600 !target range in nautical miles\n",
"pyc_phases = taxi, groundroll, rotation, landing\n",
"$INGASP\n",
"DELP = 7.34797 ! typical GASP input\n",
"ARNGE(1) = 3600 ! variable with specified index\n",
"ACLS = 0.0,0.40,0.60,0.80,1.00,1.20, 1.40,1.60,1.80, ! values given as array\n",
"```\n",
"\n",
"Example usage:\n",
"```\n",
"`aviary fortran_to_aviary --legacy_code GASP --force GASP_test.dat` Convert the GASP input deck to Aviary (even if an output exists).\n",
"```\n"
"`aviary fortran_to_aviary --legacy_code GASP --force GASP_test.dat` Convert the GASP input deck to Aviary (even if a file with the name GASP_test.dat already exists)."
]
},
{
Expand Down Expand Up @@ -254,7 +248,7 @@
"import os\n",
"commands = [\n",
" 'engines','turbofan_22k.txt','N3CC/N3CC_data.py',\n",
" 'small_single_aisle_GwGm.dat small_single_aisle_GwGm.csv',\n",
" 'small_single_aisle_GASP.dat small_single_aisle_GASP.csv',\n",
" 'turbofan_22k.txt -o ~/example_files']\n",
"with tempfile.TemporaryDirectory() as tempdir:\n",
" os.chdir(tempdir)\n",
Expand Down Expand Up @@ -311,11 +305,12 @@
"\n",
"\n",
"Example usage:\n",
"```\n",
"\n",
"`aviary convert_engine turbofan_23k_1.eng turbofan_23k_1_lbm_s.deck -f GASP` Convert a GASP based turbofan\n",
"`aviary convert_engine -f FLOPS turbofan_22k.eng turbofan_22k.txt` Convert a FLOPS based turbofan\n",
"`aviary convert_engine turboshaft_4465hp.eng turboshaft_4465hp.deck --data_format GASP_TS` Convert a GASP based turboshaft\n",
"```\n"
"\n",
"`aviary convert_engine turbofan_22k.eng turbofan_22k.txt -f FLOPS` Convert a FLOPS based turbofan\n",
"\n",
"`aviary convert_engine turboshaft_4465hp.eng turboshaft_4465hp.deck --data_format GASP_TS` Convert a GASP based turboshaft"
]
},
{
Expand Down Expand Up @@ -384,16 +379,10 @@
"\n",
"\n",
"Example usage:\n",
"```\n",
"`aviary convert_aero_table -f GASP subsystems/aerodynamics/gasp_based/data/GASP_aero_free.txt large_single_aisle_1_aero_flaps.txt` Convert a GASP based aero table\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"`aviary convert_aero_table -f FLOPS utils/test/flops_test_polar.txt aviary_flops_polar.txt` Convert a FLOPS based aero table\n",
"```\n"
"\n",
"`aviary convert_aero_table -f GASP subsystems/aerodynamics/gasp_based/data/GASP_aero_free.txt large_single_aisle_1_aero_flaps.txt` Convert a GASP based aero table\n",
"\n",
"`aviary convert_aero_table -f FLOPS utils/test/flops_test_polar.txt aviary_flops_polar.txt` Convert a FLOPS based aero table\n"
]
},
{
Expand Down Expand Up @@ -456,11 +445,12 @@
"\n",
"\n",
"Example usage:\n",
"```\n",
"\n",
"`aviary convert_prop_table -f GASP PropFan.map PropFan.prop` Convert a GASP based propeller map\n",
"\n",
"`aviary convert_prop_table -f GASP general_aviation.map general_aviation.prop` Convert a GASP based propeller map\n",
"\n",
"`aviary convert_prop_table general_aviation.map` Convert a GASP based propeller map\n",
"```\n",
"\n",
"The first example uses Mach number and the second example uses helical Mach number. \n",
"Note that the output file name can be skipped as demonstrated in the third example. Since there is only one input data format that is supported at this time, it defaults to GASP if not provided. This is shown in the third example as well."
Expand Down Expand Up @@ -558,7 +548,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "latest_env",
"display_name": "aviary",
"language": "python",
"name": "python3"
},
Expand All @@ -572,7 +562,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@
"# Set initial default values for any variables that have\n",
"# different defaults in premission and mission.\n",
"varnames = [\n",
" av.Aircraft.Engine.SCALE_FACTOR,\n",
" av.Aircraft.Wing.AREA,\n",
" av.Aircraft.Wing.MAX_CAMBER_AT_70_SEMISPAN,\n",
" av.Aircraft.Wing.SWEEP,\n",
Expand Down
2 changes: 1 addition & 1 deletion aviary/examples/level2_shooting_traj.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ def custom_run_aviary(aircraft_filename, optimizer=None,


if __name__ == "__main__":
input_deck = 'models/large_single_aisle_1/large_single_aisle_1_GwGm.csv'
input_deck = 'models/large_single_aisle_1/large_single_aisle_1_GASP.csv'
custom_run_aviary(
input_deck, analysis_scheme=AnalysisScheme.SHOOTING, run_driver=False)
2 changes: 1 addition & 1 deletion aviary/examples/test/test_level2_shooting_traj.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CustomTrajTestCase(unittest.TestCase):

@require_pyoptsparse(optimizer='IPOPT')
def test_run_aviary(self):
input_deck = 'models/large_single_aisle_1/large_single_aisle_1_GwGm.csv'
input_deck = 'models/large_single_aisle_1/large_single_aisle_1_GASP.csv'
custom_run_aviary(
input_deck, analysis_scheme=AnalysisScheme.SHOOTING, run_driver=False)

Expand Down
Loading

0 comments on commit 6917e75

Please sign in to comment.