Skip to content

Commit

Permalink
Merge branch 'main' into move_gasp_phases_to_builder
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjasa authored Jan 22, 2024
2 parents 6040f96 + 3718a0c commit 619e571
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
SCIPY: '1.6'
PYOPTSPARSE: 'v2.9.1'
SNOPT: '7.7'
OPENMDAO: '3.27'
OPENMDAO: 'dev'
DYMOS: '1.8.0'
MAKE_DOCS: 0

Expand All @@ -65,7 +65,7 @@ jobs:
SCIPY: 1
PYOPTSPARSE: 'v2.9.1'
SNOPT: '7.7'
OPENMDAO: 'latest'
OPENMDAO: 'dev'
DYMOS: 'latest'
MAKE_DOCS: 0

Expand All @@ -76,7 +76,7 @@ jobs:
SCIPY: 1
PYOPTSPARSE: 'v2.9.1'
SNOPT: '7.7'
OPENMDAO: 'latest'
OPENMDAO: 'dev'
DYMOS: 'latest'
MAKE_DOCS: 1

Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/test_workflow_no_dev_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ jobs:
python-version: ${{ matrix.PY }}
channels: conda-forge

- name: Install OpenMDAO Dev
shell: bash -l {0}
run: |
echo "============================================================="
echo "THIS STEP IS TEMPORARY"
echo "Please remove after the release of OpenMDAO 3.31."
echo "Install OpenMDAO"
echo "============================================================="
pip install git+https://github.com/OpenMDAO/OpenMDAO
- name: Checkout Aviary
uses: actions/checkout@v2

Expand Down Expand Up @@ -91,4 +101,4 @@ jobs:
echo "Run Tests (from directory other than repo root)"
echo "============================================================="
cd $HOME
testflo aviary -n 1 --show_skipped --timeout=240 --durations=20
testflo aviary -n 1 --show_skipped --timeout=240 --durations=20
20 changes: 10 additions & 10 deletions aviary/mission/flops_based/phases/detailed_takeoff_phases.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def build_phase(self, aviary_options=None):

phase.add_state(
Dynamic.Mission.MASS, fix_initial=True, fix_final=False,
lower=0.0, ref=5e4, defect_ref=5e4, units='kg',
lower=0.0, upper=1e9, ref=5e4, units='kg',
rate_source=Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL,
targets=Dynamic.Mission.MASS,
)
Expand Down Expand Up @@ -359,7 +359,7 @@ def build_phase(self, aviary_options=None):

phase.add_state(
Dynamic.Mission.MASS, fix_initial=False, fix_final=False,
lower=0.0, ref=5e4, defect_ref=5e4, units='kg',
lower=0.0, upper=1e9, ref=5e4, defect_ref=5e4, units='kg',
rate_source=Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL,
targets=Dynamic.Mission.MASS,
)
Expand Down Expand Up @@ -636,7 +636,7 @@ def build_phase(self, aviary_options=None):

phase.add_state(
Dynamic.Mission.MASS, fix_initial=False, fix_final=False,
lower=0.0, ref=5e4, defect_ref=5e4, units='kg',
lower=0.0, upper=1e9, ref=5e4, defect_ref=5e4, units='kg',
rate_source=Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL,
targets=Dynamic.Mission.MASS,
)
Expand Down Expand Up @@ -834,7 +834,7 @@ def build_phase(self, aviary_options: AviaryValues = None):

phase.add_state(
Dynamic.Mission.MASS, fix_initial=False, fix_final=False,
lower=0.0, ref=5e4, defect_ref=5e4, units='kg',
lower=0.0, upper=1e9, ref=5e4, defect_ref=5e4, units='kg',
rate_source=Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL,
targets=Dynamic.Mission.MASS,
)
Expand Down Expand Up @@ -1067,7 +1067,7 @@ def build_phase(self, aviary_options: AviaryValues = None):

phase.add_state(
Dynamic.Mission.MASS, fix_initial=False, fix_final=False,
lower=0.0, ref=5e4, defect_ref=5e4, units='kg',
lower=0.0, upper=1e9, ref=5e4, defect_ref=5e4, units='kg',
rate_source=Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL,
targets=Dynamic.Mission.MASS,
)
Expand Down Expand Up @@ -1296,7 +1296,7 @@ def build_phase(self, aviary_options: AviaryValues = None):

phase.add_state(
Dynamic.Mission.MASS, fix_initial=False, fix_final=False,
lower=0.0, ref=5e4, defect_ref=5e4, units='kg',
lower=0.0, upper=1e9, ref=5e4, defect_ref=5e4, units='kg',
rate_source=Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL,
targets=Dynamic.Mission.MASS,
)
Expand Down Expand Up @@ -1521,7 +1521,7 @@ def build_phase(self, aviary_options: AviaryValues = None):

phase.add_state(
Dynamic.Mission.MASS, fix_initial=False, fix_final=False,
lower=0.0, ref=5e4, defect_ref=5e4, units='kg',
lower=0.0, upper=1e9, ref=5e4, defect_ref=5e4, units='kg',
rate_source=Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL,
targets=Dynamic.Mission.MASS,
)
Expand Down Expand Up @@ -1734,7 +1734,7 @@ def build_phase(self, aviary_options: AviaryValues = None):

phase.add_state(
Dynamic.Mission.MASS, fix_initial=False, fix_final=False,
lower=0.0, ref=5e4, defect_ref=5e4, units='kg',
lower=0.0, upper=1e9, ref=5e4, defect_ref=5e4, units='kg',
rate_source=Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL,
targets=Dynamic.Mission.MASS,
)
Expand Down Expand Up @@ -1960,7 +1960,7 @@ def build_phase(self, aviary_options: AviaryValues = None):

phase.add_state(
Dynamic.Mission.MASS, fix_initial=False, fix_final=False,
lower=0.0, ref=5e4, defect_ref=5e4, units='kg',
lower=0.0, upper=1e9, ref=5e4, defect_ref=5e4, units='kg',
rate_source=Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL,
targets=Dynamic.Mission.MASS,
)
Expand Down Expand Up @@ -2163,7 +2163,7 @@ def build_phase(self, aviary_options=None):

phase.add_state(
Dynamic.Mission.MASS, fix_initial=False, fix_final=False,
lower=0.0, ref=5e4, defect_ref=5e4, units='kg',
lower=0.0, upper=1e9, ref=5e4, defect_ref=5e4, units='kg',
rate_source=Dynamic.Mission.FUEL_FLOW_RATE_NEGATIVE_TOTAL,
targets=Dynamic.Mission.MASS,
)
Expand Down
2 changes: 1 addition & 1 deletion aviary/models/test_aircraft/aircraft_for_bench_GwFm.csv
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ aircraft:crew_and_payload:num_flight_crew,2,unitless
aircraft:crew_and_payload:num_galley_crew,0,unitless
aircraft:crew_and_payload:num_non_flight_crew,3,unitless
aircraft:crew_and_payload:num_passengers,180,unitless
aircraft:crew_and_payload:num_tourist_class,158,unitless
aircraft:crew_and_payload:num_tourist_class,169,unitless
aircraft:crew_and_payload:passenger_mass_with_bags,200,lbm
aircraft:crew_and_payload:passenger_service_mass_scaler,1.0,unitless
aircraft:crew_and_payload:wing_cargo,0.0,lbm
Expand Down
26 changes: 13 additions & 13 deletions aviary/subsystems/aerodynamics/gasp_based/flaps_model/meta_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def setup(self):
# VDEL1
VDEL1_interp = self.add_subsystem(
"VDEL1_interp",
om.MetaModelStructuredComp(method="scipy_slinear", extrapolate=True),
om.MetaModelStructuredComp(method="1D-slinear", extrapolate=True),
promotes_inputs=[
"aircraft:*",
],
Expand Down Expand Up @@ -61,7 +61,7 @@ def setup(self):
# VDEL2
VDEL2_interp = self.add_subsystem(
"VDEL2_interp",
om.MetaModelStructuredComp(method="scipy_slinear", extrapolate=True),
om.MetaModelStructuredComp(method="1D-slinear", extrapolate=True),
promotes_inputs=[
"flap_defl_ratio",
],
Expand Down Expand Up @@ -149,7 +149,7 @@ def setup(self):
# VLAM1
VLAM1_interp = self.add_subsystem(
"VLAM1_interp",
om.MetaModelStructuredComp(method="scipy_slinear", extrapolate=True),
om.MetaModelStructuredComp(method="1D-slinear", extrapolate=True),
promotes_inputs=[
"aircraft:*",
],
Expand Down Expand Up @@ -215,7 +215,7 @@ def setup(self):
# VLAM2
VLAM2_interp = self.add_subsystem(
"VLAM2_interp",
om.MetaModelStructuredComp(method="scipy_slinear", extrapolate=True),
om.MetaModelStructuredComp(method="1D-slinear", extrapolate=True),
promotes_inputs=[
Aircraft.Wing.THICKNESS_TO_CHORD_UNWEIGHTED,
],
Expand Down Expand Up @@ -275,7 +275,7 @@ def setup(self):
# VLAM3
VLAM3_interp = self.add_subsystem(
"VLAM3_interp",
om.MetaModelStructuredComp(method="scipy_slinear", extrapolate=True),
om.MetaModelStructuredComp(method="1D-slinear", extrapolate=True),
promotes_inputs=[
"aircraft:*",
],
Expand Down Expand Up @@ -339,7 +339,7 @@ def setup(self):
# VLAM4
VLAM4_interp = self.add_subsystem(
"VLAM4_interp",
om.MetaModelStructuredComp(method="scipy_slinear", extrapolate=True),
om.MetaModelStructuredComp(method="1D-slinear", extrapolate=True),
promotes_inputs=[
Aircraft.Wing.THICKNESS_TO_CHORD_UNWEIGHTED,
],
Expand Down Expand Up @@ -430,7 +430,7 @@ def setup(self):
# VLAM5
VLAM5_interp = self.add_subsystem(
"VLAM5_intep",
om.MetaModelStructuredComp(method="scipy_slinear", extrapolate=True),
om.MetaModelStructuredComp(method="1D-slinear", extrapolate=True),
promotes_inputs=[
"aircraft:*",
],
Expand Down Expand Up @@ -482,7 +482,7 @@ def setup(self):
# VLAM6
VLAM6_interp = self.add_subsystem(
"VLAM6_interp",
om.MetaModelStructuredComp(method="scipy_slinear", extrapolate=True),
om.MetaModelStructuredComp(method="1D-slinear", extrapolate=True),
promotes_inputs=[
"flap_defl",
],
Expand Down Expand Up @@ -603,7 +603,7 @@ def setup(self):
# VLAM7
VLAM7_interp = self.add_subsystem(
"VLAM7_interp",
om.MetaModelStructuredComp(method="scipy_slinear", extrapolate=True),
om.MetaModelStructuredComp(method="1D-slinear", extrapolate=True),
promotes_inputs=[
Aircraft.Wing.FLAP_SPAN_RATIO,
],
Expand Down Expand Up @@ -631,7 +631,7 @@ def setup(self):
# VLAM10
VLAM10_interp = self.add_subsystem(
"VLAM10_interp",
om.MetaModelStructuredComp(method="scipy_slinear", extrapolate=True),
om.MetaModelStructuredComp(method="1D-slinear", extrapolate=True),
promotes_inputs=[
"slat_defl_ratio",
],
Expand Down Expand Up @@ -689,7 +689,7 @@ def setup(self):
# VLAM11
VLAM11_interp = self.add_subsystem(
"VLAM11_interp",
om.MetaModelStructuredComp(method="scipy_slinear", extrapolate=True),
om.MetaModelStructuredComp(method="1D-slinear", extrapolate=True),
promotes_inputs=[
Aircraft.Wing.SLAT_SPAN_RATIO,
],
Expand Down Expand Up @@ -717,7 +717,7 @@ def setup(self):
# VLAM13
VLAM13_interp = self.add_subsystem(
"VLAM13_interp",
om.MetaModelStructuredComp(method="scipy_slinear", extrapolate=True),
om.MetaModelStructuredComp(method="1D-slinear", extrapolate=True),
promotes_inputs=[
"reynolds",
],
Expand Down Expand Up @@ -775,7 +775,7 @@ def setup(self):
# VLAM14
VLAM14_interp = self.add_subsystem(
"VLAM14_interp",
om.MetaModelStructuredComp(method="scipy_slinear", extrapolate=True),
om.MetaModelStructuredComp(method="1D-slinear", extrapolate=True),
promotes_inputs=[
Dynamic.Mission.MACH,
],
Expand Down
2 changes: 1 addition & 1 deletion aviary/subsystems/aerodynamics/gasp_based/gaspaero.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ def setup(self):
self.add_subsystem("xlifts", Xlifts(num_nodes=nn), promotes=["*"])

# implements EAERO
interp = om.MetaModelStructuredComp(method="slinear")
interp = om.MetaModelStructuredComp(method="2D-slinear")
interp.add_input("bbar", 0.0, units="unitless", training_data=xbbar)
interp.add_input("hbar", 0.0, units="unitless", training_data=xhbar)
interp.add_output("sigma", 0.0, units="unitless", training_data=sig1)
Expand Down
7 changes: 4 additions & 3 deletions aviary/utils/preprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ def preprocess_crewpayload(aviary_options: AviaryValues):
passenger_check += aviary_options.get_val(
Aircraft.CrewPayload.NUM_BUSINESS_CLASS)
passenger_check += aviary_options.get_val(Aircraft.CrewPayload.NUM_TOURIST_CLASS)
# if passenger_count != passenger_check:
# raise om.AnalysisError(
# "ERROR: In preprocesssors.py: passenger_count does not equal the sum of firt class + business class + tourist class passengers.")
# only perform check if at least one passenger class is entered
if passenger_check > 0 and passenger_count != passenger_check:
raise om.AnalysisError(
f"ERROR: In preprocesssors.py: passenger_count ({passenger_count}) does not equal the sum of first class + business class + tourist class passengers (total of {passenger_check}).")

if Aircraft.CrewPayload.NUM_FLIGHT_ATTENDANTS not in aviary_options:
flight_attendants_count = 0 # assume no passengers
Expand Down
8 changes: 4 additions & 4 deletions aviary/validation_cases/benchmark_tests/test_bench_FwGm.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ def bench_test_swap_3_FwGm(self):

# There are no truth values for these.
assert_near_equal(prob.get_val(Mission.Design.GROSS_MASS),
184426., tolerance=rtol)
186418., tolerance=rtol)

assert_near_equal(prob.get_val(Aircraft.Design.OPERATING_MASS),
104215., tolerance=rtol)
104530., tolerance=rtol)

assert_near_equal(prob.get_val(Mission.Summary.TOTAL_FUEL_MASS),
42355., tolerance=rtol)
44032., tolerance=rtol)

assert_near_equal(prob.get_val('landing.' + Mission.Landing.GROUND_DISTANCE),
2544.3, tolerance=rtol)
2528., tolerance=rtol)

assert_near_equal(prob.get_val("traj.desc2.timeseries.states:distance")[-1],
3675.0, tolerance=rtol)
Expand Down

0 comments on commit 619e571

Please sign in to comment.