From 18d9819cf74f7a77c7ee2875405b48986e2e74c8 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 09:12:42 -0800 Subject: [PATCH 01/54] inputs Aircraft.Canard.AREA, Aircraft.Canard.THICKNESS_TO_CHORD, Aircraft.Canard.WETTED_AREA_SCALER to default in metadata. output Aircraft.Canard.WETTED_AREA to default in metadata. --- aviary/subsystems/geometry/flops_based/canard.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aviary/subsystems/geometry/flops_based/canard.py b/aviary/subsystems/geometry/flops_based/canard.py index b9ca8d92a..0542dc5fa 100644 --- a/aviary/subsystems/geometry/flops_based/canard.py +++ b/aviary/subsystems/geometry/flops_based/canard.py @@ -18,11 +18,11 @@ def initialize(self): desc='collection of Aircraft/Mission specific options') def setup(self): - add_aviary_input(self, Aircraft.Canard.AREA, 0.0) - add_aviary_input(self, Aircraft.Canard.THICKNESS_TO_CHORD, 0.0) - add_aviary_input(self, Aircraft.Canard.WETTED_AREA_SCALER, 1.0) + add_aviary_input(self, Aircraft.Canard.AREA) + add_aviary_input(self, Aircraft.Canard.THICKNESS_TO_CHORD) + add_aviary_input(self, Aircraft.Canard.WETTED_AREA_SCALER) - add_aviary_output(self, Aircraft.Canard.WETTED_AREA, 0.0) + add_aviary_output(self, Aircraft.Canard.WETTED_AREA) def setup_partials(self): self.declare_partials( From b5397ab9a214a69c5ea57fc190bed46d6fde6876 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 09:29:04 -0800 Subject: [PATCH 02/54] Set inputs Aircraft.Canard.AREA, Aircraft.Canard.ASPECT_RATIO, Aircraft.Canard.THICKNESS_TO_CHORD, Aircraft.Fuselage.AVG_DIAMETER, Aircraft.Fuselage.LENGTH, Aircraft.HorizontalTail.AREA, Aircraft.HorizontalTail.THICKNESS_TO_CHORD, Aircraft.VerticalTail.AREA, Aircraft.VerticalTail.ASPECT_RATIO, Aircraft.VerticalTail.THICKNESS_TO_CHORD, Aircraft.Wing.AREA, Aircraft.Wing.ASPECT_RATIO, Aircraft.Wing.GLOVE_AND_BAT, Aircraft.Wing.TAPER_RATIO, Aircraft.Wing.THICKNESS_TO_CHORD, Aircraft.Canard.CHARACTERISTIC_LENGTH, Aircraft.Canard.FINENESS, Aircraft.Fuselage.CHARACTERISTIC_LENGTH, Aircraft.Fuselage.FINENESS, Aircraft.HorizontalTail.CHARACTERISTIC_LENGTH, Aircraft.HorizontalTail.FINENESS to metadata values (0.0). Set inputs Aircraft.Nacelle.AVG_DIAMETER, Aircraft.Nacelle.AVG_LENGTH to metadata values ([0.0]) with shape (num_engine_type). Set input Aircraft.HorizontalTail.ASPECT_RATIO to to metadata values (4.75) for now. Set outputs Aircraft.VerticalTail.CHARACTERISTIC_LENGTH, Aircraft.Nacelle.FINENESS to metadata values ([0.0]) with shape (num_engine_type). Set outputs Aircraft.VerticalTail.CHARACTERISTIC_LENGTH, Aircraft.Wing.CHARACTERISTIC_LENGTH, Aircraft.Wing.FINENESS to metadata values (0.0). --- .../flops_based/characteristic_lengths.py | 66 +++++++++---------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/aviary/subsystems/geometry/flops_based/characteristic_lengths.py b/aviary/subsystems/geometry/flops_based/characteristic_lengths.py index 474fa7381..dfe6c68f4 100644 --- a/aviary/subsystems/geometry/flops_based/characteristic_lengths.py +++ b/aviary/subsystems/geometry/flops_based/characteristic_lengths.py @@ -24,66 +24,60 @@ def setup(self): self.add_input(Names.CROOT, 0.0, units='unitless') - add_aviary_input(self, Aircraft.Canard.AREA, 0.0) - add_aviary_input(self, Aircraft.Canard.ASPECT_RATIO, 0.0) + add_aviary_input(self, Aircraft.Canard.AREA) + add_aviary_input(self, Aircraft.Canard.ASPECT_RATIO) # add_aviary_input(self, Aircraft.Canard.LAMINAR_FLOW_LOWER, 0.0) # add_aviary_input(self, Aircraft.Canard.LAMINAR_FLOW_UPPER, 0.0) - add_aviary_input(self, Aircraft.Canard.THICKNESS_TO_CHORD, 0.0) + add_aviary_input(self, Aircraft.Canard.THICKNESS_TO_CHORD) - add_aviary_input(self, Aircraft.Fuselage.AVG_DIAMETER, 0.0) + add_aviary_input(self, Aircraft.Fuselage.AVG_DIAMETER) # add_aviary_input(self, Aircraft.Fuselage.LAMINAR_FLOW_LOWER, 0.0) # add_aviary_input(self, Aircraft.Fuselage.LAMINAR_FLOW_UPPER, 0.0) - add_aviary_input(self, Aircraft.Fuselage.LENGTH, 0.0) + add_aviary_input(self, Aircraft.Fuselage.LENGTH) - add_aviary_input(self, Aircraft.HorizontalTail.AREA, 0.0) - add_aviary_input(self, Aircraft.HorizontalTail.ASPECT_RATIO, 4.75) + add_aviary_input(self, Aircraft.HorizontalTail.AREA) + add_aviary_input(self, Aircraft.HorizontalTail.ASPECT_RATIO) # add_aviary_input(self, Aircraft.HorizontalTail.LAMINAR_FLOW_LOWER, 0.0) # add_aviary_input(self, Aircraft.HorizontalTail.LAMINAR_FLOW_UPPER, 0.0) - add_aviary_input(self, Aircraft.HorizontalTail.THICKNESS_TO_CHORD, 0.0) + add_aviary_input(self, Aircraft.HorizontalTail.THICKNESS_TO_CHORD) - add_aviary_input(self, Aircraft.Nacelle.AVG_DIAMETER, np.zeros(num_engine_type)) - add_aviary_input(self, Aircraft.Nacelle.AVG_LENGTH, np.zeros(num_engine_type)) + add_aviary_input(self, Aircraft.Nacelle.AVG_DIAMETER, shape=num_engine_type) + add_aviary_input(self, Aircraft.Nacelle.AVG_LENGTH, shape=num_engine_type) # add_aviary_input(self, Aircraft.Nacelle.LAMINAR_FLOW_LOWER, 0.0) # add_aviary_input(self, Aircraft.Nacelle.LAMINAR_FLOW_UPPER, 0.0) - add_aviary_input(self, Aircraft.VerticalTail.AREA, 0.0) - add_aviary_input(self, Aircraft.VerticalTail.ASPECT_RATIO, 0.0) + add_aviary_input(self, Aircraft.VerticalTail.AREA) + add_aviary_input(self, Aircraft.VerticalTail.ASPECT_RATIO) # add_aviary_input(self, Aircraft.VerticalTail.LAMINAR_FLOW_LOWER, 0.0) # add_aviary_input(self, Aircraft.VerticalTail.LAMINAR_FLOW_UPPER, 0.0) - add_aviary_input(self, Aircraft.VerticalTail.THICKNESS_TO_CHORD, 0.0) + add_aviary_input(self, Aircraft.VerticalTail.THICKNESS_TO_CHORD) - add_aviary_input(self, Aircraft.Wing.AREA, 0.0) - add_aviary_input(self, Aircraft.Wing.ASPECT_RATIO, 0.0) - add_aviary_input(self, Aircraft.Wing.GLOVE_AND_BAT, 0.0) - add_aviary_input(self, Aircraft.Wing.TAPER_RATIO, 0.0) - add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD, 0.0) + add_aviary_input(self, Aircraft.Wing.AREA) + add_aviary_input(self, Aircraft.Wing.ASPECT_RATIO) + add_aviary_input(self, Aircraft.Wing.GLOVE_AND_BAT) + add_aviary_input(self, Aircraft.Wing.TAPER_RATIO) + add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD) # add_aviary_input(self, Aircraft.Wing.LAMINAR_FLOW_LOWER, 0.0) # add_aviary_input(self, Aircraft.Wing.LAMINAR_FLOW_UPPER, 0.0) - add_aviary_output(self, Aircraft.Canard.CHARACTERISTIC_LENGTH, 0.0) - add_aviary_output(self, Aircraft.Canard.FINENESS, 0.0) + add_aviary_output(self, Aircraft.Canard.CHARACTERISTIC_LENGTH) + add_aviary_output(self, Aircraft.Canard.FINENESS) - add_aviary_output(self, Aircraft.Fuselage.CHARACTERISTIC_LENGTH, 0.0) - add_aviary_output(self, Aircraft.Fuselage.FINENESS, 0.0) + add_aviary_output(self, Aircraft.Fuselage.CHARACTERISTIC_LENGTH) + add_aviary_output(self, Aircraft.Fuselage.FINENESS) - add_aviary_output( - self, Aircraft.HorizontalTail.CHARACTERISTIC_LENGTH, 0.0 - ) - - add_aviary_output(self, Aircraft.HorizontalTail.FINENESS, 0.0) + add_aviary_output(self, Aircraft.HorizontalTail.CHARACTERISTIC_LENGTH) + add_aviary_output(self, Aircraft.HorizontalTail.FINENESS) add_aviary_output(self, Aircraft.Nacelle.CHARACTERISTIC_LENGTH, - np.zeros(num_engine_type)) - add_aviary_output(self, Aircraft.Nacelle.FINENESS, np.zeros(num_engine_type)) - - add_aviary_output( - self, Aircraft.VerticalTail.CHARACTERISTIC_LENGTH, 0.0 - ) + shape=num_engine_type) + add_aviary_output(self, Aircraft.Nacelle.FINENESS, shape=num_engine_type) - add_aviary_output(self, Aircraft.VerticalTail.FINENESS, 0.0) + add_aviary_output(self, Aircraft.VerticalTail.CHARACTERISTIC_LENGTH) + add_aviary_output(self, Aircraft.VerticalTail.FINENESS) - add_aviary_output(self, Aircraft.Wing.CHARACTERISTIC_LENGTH, 0.0) - add_aviary_output(self, Aircraft.Wing.FINENESS, 0.0) + add_aviary_output(self, Aircraft.Wing.CHARACTERISTIC_LENGTH) + add_aviary_output(self, Aircraft.Wing.FINENESS) def setup_partials(self): self._setup_partials_wing() From d87ca643822289d00232e96f579df5032ba43772 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 09:31:50 -0800 Subject: [PATCH 03/54] set inputs Aircraft.Fuselage.LENGTH, Aircraft.Fuselage.MAX_HEIGHT, Aircraft.Fuselage.MAX_WIDTH to metadata value (0.0). Set outputs Aircraft.Fuselage.AVG_DIAMETER, Aircraft.Fuselage.PLANFORM_AREA to metadata value (0.0). --- aviary/subsystems/geometry/flops_based/fuselage.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/aviary/subsystems/geometry/flops_based/fuselage.py b/aviary/subsystems/geometry/flops_based/fuselage.py index ff2f87c48..86cc4d807 100644 --- a/aviary/subsystems/geometry/flops_based/fuselage.py +++ b/aviary/subsystems/geometry/flops_based/fuselage.py @@ -22,12 +22,12 @@ def initialize(self): desc='collection of Aircraft/Mission specific options') def setup(self): - add_aviary_input(self, Aircraft.Fuselage.LENGTH, val=0.0) - add_aviary_input(self, Aircraft.Fuselage.MAX_HEIGHT, val=0.0) - add_aviary_input(self, Aircraft.Fuselage.MAX_WIDTH, val=0.0) + add_aviary_input(self, Aircraft.Fuselage.LENGTH) + add_aviary_input(self, Aircraft.Fuselage.MAX_HEIGHT) + add_aviary_input(self, Aircraft.Fuselage.MAX_WIDTH) - add_aviary_output(self, Aircraft.Fuselage.AVG_DIAMETER, val=0.0) - add_aviary_output(self, Aircraft.Fuselage.PLANFORM_AREA, val=0.0) + add_aviary_output(self, Aircraft.Fuselage.AVG_DIAMETER) + add_aviary_output(self, Aircraft.Fuselage.PLANFORM_AREA) def setup_partials(self): self.declare_partials(of=[Aircraft.Fuselage.AVG_DIAMETER], From 88aa347df758df831ac143cc15dc7e0f4e4ae0ee Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 09:45:15 -0800 Subject: [PATCH 04/54] Set inputs Aircraft.Nacelle.AVG_DIAMETER, Aircraft.Nacelle.AVG_LENGTH, Aircraft.Nacelle.WETTED_AREA_SCALER to metadata values ([0.0]) with shape (num_engine_type). Set Aircraft.Nacelle.TOTAL_WETTED_AREA to metadata values (0.0). Set Aircraft.Nacelle.WETTED_AREA to metadata values ([0.0]) with shape (num_engine_type). --- .../subsystems/geometry/flops_based/nacelle.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/aviary/subsystems/geometry/flops_based/nacelle.py b/aviary/subsystems/geometry/flops_based/nacelle.py index a2f0d58ba..e40fe74e6 100644 --- a/aviary/subsystems/geometry/flops_based/nacelle.py +++ b/aviary/subsystems/geometry/flops_based/nacelle.py @@ -22,16 +22,12 @@ def initialize(self): def setup(self): num_engine_type = len(self.options['aviary_options'].get_val( Aircraft.Engine.NUM_ENGINES)) - add_aviary_input(self, Aircraft.Nacelle.AVG_DIAMETER, - val=np.zeros(num_engine_type)) - add_aviary_input(self, Aircraft.Nacelle.AVG_LENGTH, - val=np.zeros(num_engine_type)) - add_aviary_input(self, Aircraft.Nacelle.WETTED_AREA_SCALER, - val=np.zeros(num_engine_type)) - - add_aviary_output(self, Aircraft.Nacelle.TOTAL_WETTED_AREA, 0.0) - add_aviary_output(self, Aircraft.Nacelle.WETTED_AREA, - val=np.zeros(num_engine_type)) + add_aviary_input(self, Aircraft.Nacelle.AVG_DIAMETER, shape=num_engine_type) + add_aviary_input(self, Aircraft.Nacelle.AVG_LENGTH, shape=num_engine_type) + add_aviary_input(self, Aircraft.Nacelle.WETTED_AREA_SCALER, shape=num_engine_type) + + add_aviary_output(self, Aircraft.Nacelle.TOTAL_WETTED_AREA) + add_aviary_output(self, Aircraft.Nacelle.WETTED_AREA, shape=num_engine_type) def setup_partials(self): # derivatives w.r.t vectorized engine inputs have known sparsity pattern From 53dd6dd048767a55d248d4b9197c57ee9e3a3347 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 10:30:14 -0800 Subject: [PATCH 05/54] set inputs Aircraft.Fuselage.AVG_DIAMETER, Aircraft.Fuselage.MAX_WIDTH, Aircraft.HorizontalTail.AREA, Aircraft.HorizontalTail.ASPECT_RATIO, Aircraft.HorizontalTail.THICKNESS_TO_CHORD, Aircraft.VerticalTail.AREA, Aircraft.VerticalTail.ASPECT_RATIO, Aircraft.VerticalTail.THICKNESS_TO_CHORD, Aircraft.Wing.AREA, Aircraft.Wing.GLOVE_AND_BAT, Aircraft.Wing.SPAN, Aircraft.Wing.TAPER_RATIO, Aircraft.Wing.THICKNESS_TO_CHORD to metadata values (0.0). Keep input Aircraft.HorizontalTail.TAPER_RATIO to 0.352 for now because in gasp based empennage, 'tr' is set to 0.352. --- .../geometry/flops_based/prep_geom.py | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/aviary/subsystems/geometry/flops_based/prep_geom.py b/aviary/subsystems/geometry/flops_based/prep_geom.py index 2d54dab22..896ac70b7 100644 --- a/aviary/subsystems/geometry/flops_based/prep_geom.py +++ b/aviary/subsystems/geometry/flops_based/prep_geom.py @@ -124,27 +124,25 @@ def initialize(self): desc='collection of Aircraft/Mission specific options') def setup(self): - add_aviary_input(self, Aircraft.Fuselage.AVG_DIAMETER, 0.0) - add_aviary_input(self, Aircraft.Fuselage.MAX_WIDTH, 0.0) + add_aviary_input(self, Aircraft.Fuselage.AVG_DIAMETER) + add_aviary_input(self, Aircraft.Fuselage.MAX_WIDTH) - add_aviary_input(self, Aircraft.HorizontalTail.AREA, 0.0) - add_aviary_input(self, Aircraft.HorizontalTail.ASPECT_RATIO, - 4.75, units="unitless") - add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO, - 0.352, units="unitless") - add_aviary_input(self, Aircraft.HorizontalTail.THICKNESS_TO_CHORD, 0.0) + add_aviary_input(self, Aircraft.HorizontalTail.AREA) + add_aviary_input(self, Aircraft.HorizontalTail.ASPECT_RATIO) + add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO, 0.352) + add_aviary_input(self, Aircraft.HorizontalTail.THICKNESS_TO_CHORD) - add_aviary_input(self, Aircraft.VerticalTail.AREA, 0.0) - add_aviary_input(self, Aircraft.VerticalTail.ASPECT_RATIO, 0.0) - add_aviary_input(self, Aircraft.VerticalTail.TAPER_RATIO, 0.0) - add_aviary_input(self, Aircraft.VerticalTail.THICKNESS_TO_CHORD, 0.0) + add_aviary_input(self, Aircraft.VerticalTail.AREA) + add_aviary_input(self, Aircraft.VerticalTail.ASPECT_RATIO) + add_aviary_input(self, Aircraft.VerticalTail.TAPER_RATIO) + add_aviary_input(self, Aircraft.VerticalTail.THICKNESS_TO_CHORD) - add_aviary_input(self, Aircraft.Wing.AREA, 0.0) - add_aviary_input(self, Aircraft.Wing.GLOVE_AND_BAT, 0.0) + add_aviary_input(self, Aircraft.Wing.AREA) + add_aviary_input(self, Aircraft.Wing.GLOVE_AND_BAT) # NOTE: FLOPS/aviary1 calculate span locally - add_aviary_input(self, Aircraft.Wing.SPAN, 0.0) - add_aviary_input(self, Aircraft.Wing.TAPER_RATIO, 0.0) - add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD, 0.0) + add_aviary_input(self, Aircraft.Wing.SPAN) + add_aviary_input(self, Aircraft.Wing.TAPER_RATIO) + add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD) self.add_output(Names.CROOT, 1.0, units='unitless') self.add_output(Names.CROOTB, 1.0, units='unitless') From 1dc89deb5a7b39468b3a291d5ad262d0ebbb63ad Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 10:32:23 -0800 Subject: [PATCH 06/54] set inputs Aircraft.Canard.WETTED_AREA, Aircraft.Fuselage.WETTED_AREA, Aircraft.HorizontalTail.WETTED_AREA, Aircraft.Nacelle.TOTAL_WETTED_AREA, Aircraft.VerticalTail.WETTED_AREA, Aircraft.Wing.WETTED_AREA to metadata values (0.0). Set output Aircraft.Design.TOTAL_WETTED_AREA to to metadata values (0.0). --- .../geometry/flops_based/wetted_area_total.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/aviary/subsystems/geometry/flops_based/wetted_area_total.py b/aviary/subsystems/geometry/flops_based/wetted_area_total.py index 4bb08d3e8..82e27a2ac 100644 --- a/aviary/subsystems/geometry/flops_based/wetted_area_total.py +++ b/aviary/subsystems/geometry/flops_based/wetted_area_total.py @@ -17,14 +17,14 @@ def initialize(self): desc='collection of Aircraft/Mission specific options') def setup(self): - add_aviary_input(self, Aircraft.Canard.WETTED_AREA, 0.0) - add_aviary_input(self, Aircraft.Fuselage.WETTED_AREA, 0.0) - add_aviary_input(self, Aircraft.HorizontalTail.WETTED_AREA, 0.0) - add_aviary_input(self, Aircraft.Nacelle.TOTAL_WETTED_AREA, 0.0) - add_aviary_input(self, Aircraft.VerticalTail.WETTED_AREA, 0.0) - add_aviary_input(self, Aircraft.Wing.WETTED_AREA, 0.0) - - add_aviary_output(self, Aircraft.Design.TOTAL_WETTED_AREA, 0.0) + add_aviary_input(self, Aircraft.Canard.WETTED_AREA) + add_aviary_input(self, Aircraft.Fuselage.WETTED_AREA) + add_aviary_input(self, Aircraft.HorizontalTail.WETTED_AREA) + add_aviary_input(self, Aircraft.Nacelle.TOTAL_WETTED_AREA) + add_aviary_input(self, Aircraft.VerticalTail.WETTED_AREA) + add_aviary_input(self, Aircraft.Wing.WETTED_AREA) + + add_aviary_output(self, Aircraft.Design.TOTAL_WETTED_AREA) def setup_partials(self): self.declare_partials('*', '*', val=1.0) From 5041a5816191c308e0cbacdcbccca7cf4929f7b2 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 10:34:01 -0800 Subject: [PATCH 07/54] set inputs Aircraft.Wing.AREA, Aircraft.Wing.GLOVE_AND_BAT, Aircraft.Wing.SPAN to metadata values (0.0). Set output Aircraft.Wing.ASPECT_RATIO to metadata values (0.0). --- aviary/subsystems/geometry/flops_based/wing.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aviary/subsystems/geometry/flops_based/wing.py b/aviary/subsystems/geometry/flops_based/wing.py index 7eb02513c..8aa06e325 100644 --- a/aviary/subsystems/geometry/flops_based/wing.py +++ b/aviary/subsystems/geometry/flops_based/wing.py @@ -20,11 +20,11 @@ def initialize(self): desc='collection of Aircraft/Mission specific options') def setup(self): - add_aviary_input(self, Aircraft.Wing.AREA, val=0.0) - add_aviary_input(self, Aircraft.Wing.GLOVE_AND_BAT, val=0.0) - add_aviary_input(self, Aircraft.Wing.SPAN, val=0.0) + add_aviary_input(self, Aircraft.Wing.AREA) + add_aviary_input(self, Aircraft.Wing.GLOVE_AND_BAT) + add_aviary_input(self, Aircraft.Wing.SPAN) - add_aviary_output(self, Aircraft.Wing.ASPECT_RATIO, val=0.0) + add_aviary_output(self, Aircraft.Wing.ASPECT_RATIO) def setup_partials(self): self.declare_partials('*', '*') From 7765e5c3e7f6d3831c73bed44cf641cad4f647c8 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 11:13:18 -0800 Subject: [PATCH 08/54] Set input Aircraft.Engine.WING_LOCATIONS to metadata values [0.0] (was [0.35]) with shape total_num_wing_engines/2. Set input Aircraft.Wing.SPAN to metadata values (0.0) (was 128). Set input Fuselage.AVG_DIAMETER to metadata values (0.0) (was 10). Set output Aircraft.Electrical.HYBRID_CABLE_LENGTH to metadata values (0.0). --- aviary/subsystems/geometry/gasp_based/electric.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/electric.py b/aviary/subsystems/geometry/gasp_based/electric.py index 3196bb92b..8fc5a6409 100644 --- a/aviary/subsystems/geometry/gasp_based/electric.py +++ b/aviary/subsystems/geometry/gasp_based/electric.py @@ -24,13 +24,11 @@ def setup(self): Aircraft.Propulsion.TOTAL_NUM_WING_ENGINES) add_aviary_input(self, Aircraft.Engine.WING_LOCATIONS, - val=np.full(int(total_num_wing_engines/2), 0.35)) + shape=int(total_num_wing_engines/2)) + add_aviary_input(self, Aircraft.Wing.SPAN) + add_aviary_input(self, Aircraft.Fuselage.AVG_DIAMETER) - add_aviary_input(self, Aircraft.Wing.SPAN, val=128) - - add_aviary_input(self, Aircraft.Fuselage.AVG_DIAMETER, val=10) - - add_aviary_output(self, Aircraft.Electrical.HYBRID_CABLE_LENGTH, val=0) + add_aviary_output(self, Aircraft.Electrical.HYBRID_CABLE_LENGTH) self.declare_partials( Aircraft.Electrical.HYBRID_CABLE_LENGTH, From 6dab166bf12e4dbb8f9dc00d6cd8d5c847f6ba2f Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 11:29:53 -0800 Subject: [PATCH 09/54] set input Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION to metadata values (0.0). Set Aircraft.Fuselage.LENGTH to metadata values (0.0) (was 129.4). Set Aircraft.Wing.AREA to metadata values (0.0) (was 1370). --- aviary/subsystems/geometry/gasp_based/empennage.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index c0133bc54..71a5d5f1e 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -38,13 +38,13 @@ def setup(self): else: self.k = [0.43, 0.38, 0.85] - add_aviary_input(self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION, val=0) + add_aviary_input(self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION) - add_aviary_input(self, Aircraft.Fuselage.LENGTH, val=129.4) + add_aviary_input(self, Aircraft.Fuselage.LENGTH) self.add_input("cab_w", 13.1, units="ft", desc="SWF: Cabin width") - add_aviary_input(self, Aircraft.Wing.AREA, val=1370) + add_aviary_input(self, Aircraft.Wing.AREA) self.add_input( "wing_ref", @@ -107,7 +107,7 @@ def setup(self): desc="VBARH | VBARV: Horizontal tail volume coefficient" ) - add_aviary_input(self, Aircraft.Wing.AREA, val=1370) + add_aviary_input(self, Aircraft.Wing.AREA) self.add_input( "r_arm", From e6674ca28544732a8f5b911b805edf3026053b93 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 11:46:45 -0800 Subject: [PATCH 10/54] set input Aircraft.Engine.REFERENCE_DIAMETER to metadata values ([0.0]) (was 5.8) with shape (num_engine_type). Set input Aircraft.Engine.SCALE_FACTOR to metadata values ([0.0]) with shape (num_engine_type). Set input Aircraft.Nacelle.CORE_DIAMETER_RATIO to metadata values ([0.0]) (was 1.25) with shape (num_engine_type). Set input Aircraft.Nacelle.FINENESS to metadata values ([0.0]) (was 2) with shape (num_engine_type). Set ouputs Aircraft.Nacelle.AVG_DIAMETER, Aircraft.Nacelle.AVG_LENGTH, and Aircraft.Nacelle.SURFACE_AREA with shape (num_engine_type). --- aviary/subsystems/geometry/gasp_based/engine.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/engine.py b/aviary/subsystems/geometry/gasp_based/engine.py index b39c7f836..9ff20403b 100644 --- a/aviary/subsystems/geometry/gasp_based/engine.py +++ b/aviary/subsystems/geometry/gasp_based/engine.py @@ -24,18 +24,18 @@ def setup(self): Aircraft.Engine.NUM_ENGINES)) add_aviary_input(self, Aircraft.Engine.REFERENCE_DIAMETER, - np.full(num_engine_type, 5.8)) - add_aviary_input(self, Aircraft.Engine.SCALE_FACTOR, np.ones(num_engine_type)) + shape=num_engine_type) + add_aviary_input(self, Aircraft.Engine.SCALE_FACTOR, shape=num_engine_type) add_aviary_input(self, Aircraft.Nacelle.CORE_DIAMETER_RATIO, - np.full(num_engine_type, 1.25)) - add_aviary_input(self, Aircraft.Nacelle.FINENESS, np.full(num_engine_type, 2)) + shape=num_engine_type) + add_aviary_input(self, Aircraft.Nacelle.FINENESS, shape=num_engine_type) add_aviary_output(self, Aircraft.Nacelle.AVG_DIAMETER, - val=np.zeros(num_engine_type)) + shape=num_engine_type) add_aviary_output(self, Aircraft.Nacelle.AVG_LENGTH, - val=np.zeros(num_engine_type)) + shape=num_engine_type) add_aviary_output(self, Aircraft.Nacelle.SURFACE_AREA, - val=np.zeros(num_engine_type)) + shape=num_engine_type) def setup_partials(self): # derivatives w.r.t vectorized engine inputs have known sparsity pattern From 4cf0b21a1ed5746db73197e9b0ec2be1542709aa Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 12:38:13 -0800 Subject: [PATCH 11/54] set input Aircraft.Fuselage.DELTA_DIAMETER to metadata values (0.0) (was 4.5). Set input Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH to metadata values (0.0) (was 9.5). Set output Aircraft.Fuselage.AVG_DIAMETER to default 0.0 with units='inch' for now. --- aviary/subsystems/geometry/gasp_based/fuselage.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/fuselage.py b/aviary/subsystems/geometry/gasp_based/fuselage.py index 9e6c3ffd0..051099bba 100644 --- a/aviary/subsystems/geometry/gasp_based/fuselage.py +++ b/aviary/subsystems/geometry/gasp_based/fuselage.py @@ -33,10 +33,10 @@ def initialize(self): def setup(self): - add_aviary_input(self, Aircraft.Fuselage.DELTA_DIAMETER, val=4.5) - add_aviary_input(self, Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH, val=9.5) + add_aviary_input(self, Aircraft.Fuselage.DELTA_DIAMETER) + add_aviary_input(self, Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH) - add_aviary_output(self, Aircraft.Fuselage.AVG_DIAMETER, val=0, units='inch') + add_aviary_output(self, Aircraft.Fuselage.AVG_DIAMETER, units='inch') self.add_output("cabin_height", val=0, units="ft", desc="HC: height of cabin") self.add_output("cabin_len", val=0, units="ft", desc="LC: length of cabin") self.add_output("nose_height", val=0, units="ft", desc="HN: height of nose") From 7703e4b3303153d0529d98244fdf512ef8de711d Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 12:49:05 -0800 Subject: [PATCH 12/54] set input/output Aircraft.Strut.ATTACHMENT_LOCATION, Aircraft.Strut.ATTACHMENT_LOCATION_DIMENSIONLESS to metadata values (0.0). Set input Aircraft.Wing.FOLDED_SPAN to metadata values (0.0) (was 25). Set input add_aviary_input(self, Aircraft.Wing.FOLDED_SPAN_DIMENSIONLESS to metadata values (0.0). --- .../gasp_based/non_dimensional_conversion.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/non_dimensional_conversion.py b/aviary/subsystems/geometry/gasp_based/non_dimensional_conversion.py index 0fd18fdc9..a9edf63cd 100644 --- a/aviary/subsystems/geometry/gasp_based/non_dimensional_conversion.py +++ b/aviary/subsystems/geometry/gasp_based/non_dimensional_conversion.py @@ -20,13 +20,13 @@ def setup(self): add_aviary_input(self, Aircraft.Wing.SPAN, val=0) if self.options["aviary_options"].get_val(Aircraft.Strut.DIMENSIONAL_LOCATION_SPECIFIED, units='unitless'): - add_aviary_input(self, Aircraft.Strut.ATTACHMENT_LOCATION, val=0) + add_aviary_input(self, Aircraft.Strut.ATTACHMENT_LOCATION) add_aviary_output( - self, Aircraft.Strut.ATTACHMENT_LOCATION_DIMENSIONLESS, val=0) + self, Aircraft.Strut.ATTACHMENT_LOCATION_DIMENSIONLESS) else: add_aviary_input( - self, Aircraft.Strut.ATTACHMENT_LOCATION_DIMENSIONLESS, val=0) - add_aviary_output(self, Aircraft.Strut.ATTACHMENT_LOCATION, val=0) + self, Aircraft.Strut.ATTACHMENT_LOCATION_DIMENSIONLESS) + add_aviary_output(self, Aircraft.Strut.ATTACHMENT_LOCATION) def setup_partials(self): @@ -79,11 +79,11 @@ def setup(self): add_aviary_input(self, Aircraft.Wing.SPAN, val=0) if self.options["aviary_options"].get_val(Aircraft.Wing.FOLD_DIMENSIONAL_LOCATION_SPECIFIED, units='unitless'): - add_aviary_input(self, Aircraft.Wing.FOLDED_SPAN, val=25) - add_aviary_output(self, Aircraft.Wing.FOLDED_SPAN_DIMENSIONLESS, val=0) + add_aviary_input(self, Aircraft.Wing.FOLDED_SPAN) + add_aviary_output(self, Aircraft.Wing.FOLDED_SPAN_DIMENSIONLESS) else: - add_aviary_input(self, Aircraft.Wing.FOLDED_SPAN_DIMENSIONLESS, val=0) - add_aviary_output(self, Aircraft.Wing.FOLDED_SPAN, val=0) + add_aviary_input(self, Aircraft.Wing.FOLDED_SPAN_DIMENSIONLESS) + add_aviary_output(self, Aircraft.Wing.FOLDED_SPAN) def setup_partials(self): From 34bbcd8db535ff737e8be21b9c191b17551170f3 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 12:52:44 -0800 Subject: [PATCH 13/54] update unit tests --- .../gasp_based/test/test_empennage.py | 6 +---- .../geometry/gasp_based/test/test_wing.py | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/test/test_empennage.py b/aviary/subsystems/geometry/gasp_based/test/test_empennage.py index d5eb4e813..0d40b291e 100644 --- a/aviary/subsystems/geometry/gasp_based/test/test_empennage.py +++ b/aviary/subsystems/geometry/gasp_based/test/test_empennage.py @@ -48,9 +48,6 @@ def setUp(self): Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION, val=0, units="unitless" ) self.prob.model.set_input_defaults("vvc.cab_w", val=13.1, units="ft") - self.prob.model.set_input_defaults( - Aircraft.Wing.AREA, val=1370.3, units="ft**2" - ) self.prob.model.set_input_defaults("vvc.wing_ref", 117.8054, units="ft") self.prob.setup(check=False, force_alloc_complex=True) @@ -74,7 +71,6 @@ class TestTailComp( def setUp(self): self.prob = om.Problem() self.prob.model.add_subsystem("tail", TailSize(), promotes=["*"]) - self.prob.setup(check=False, force_alloc_complex=True) # values for horizontal tail self.prob.model.set_input_defaults("vol_coef", val=1.189, units="unitless") @@ -85,6 +81,7 @@ def setUp(self): self.prob.model.set_input_defaults("wing_ref", val=12.615, units="ft") self.prob.model.set_input_defaults("ar", val=4.75, units="unitless") self.prob.model.set_input_defaults("tr", val=0.352, units="unitless") + self.prob.setup(check=False, force_alloc_complex=True) def test_large_sinle_aisle_1_htail(self): self.prob.run_model() @@ -100,7 +97,6 @@ def test_large_sinle_aisle_1_htail(self): def test_large_sinle_aisle_1_vtail(self): # override horizontal tail defaults for vertical tail self.prob.set_val("vol_coef", 0.145, units="unitless") - self.prob.set_val(Aircraft.Wing.AREA, 1370.3, units="ft**2") self.prob.set_val("r_arm", 2.362, units="unitless") self.prob.set_val("wing_ref", 117.8, units="ft") self.prob.set_val("ar", 1.67, units="unitless") diff --git a/aviary/subsystems/geometry/gasp_based/test/test_wing.py b/aviary/subsystems/geometry/gasp_based/test/test_wing.py index 0bbd89fbc..64bb9d789 100644 --- a/aviary/subsystems/geometry/gasp_based/test/test_wing.py +++ b/aviary/subsystems/geometry/gasp_based/test/test_wing.py @@ -58,6 +58,15 @@ def tearDown(self): def test_case1(self): self.prob = om.Problem() self.prob.model.add_subsystem("size", WingSize(), promotes=["*"]) + self.prob.model.set_input_defaults( + Mission.Design.GROSS_MASS, 175400, units="lbm" + ) + self.prob.model.set_input_defaults( + Aircraft.Wing.LOADING, 128, units="lbf/ft**2" + ) + self.prob.model.set_input_defaults( + Aircraft.Wing.ASPECT_RATIO, 10.13, units="unitless" + ) self.prob.setup(check=False, force_alloc_complex=True) partial_data = self.prob.check_partials(out_stream=None, method="cs") @@ -579,6 +588,21 @@ def setUp(self): self.prob.model.set_input_defaults( Aircraft.Strut.ATTACHMENT_LOCATION, val=0, units="ft" ) + self.prob.model.set_input_defaults( + Aircraft.Strut.AREA_RATIO, val=.2, units='unitless' + ) + self.prob.model.set_input_defaults( + Aircraft.Fuselage.AVG_DIAMETER, val=10.0, units='ft' + ) + self.prob.model.set_input_defaults( + Mission.Design.GROSS_MASS, val=152000.0, units='lbm' + ) + self.prob.model.set_input_defaults( + Aircraft.Wing.LOADING, 128, units="lbf/ft**2" + ) + self.prob.model.set_input_defaults( + Aircraft.Fuel.WING_FUEL_FRACTION, val=.6, units='unitless' + ) self.prob.setup(check=False, force_alloc_complex=True) From f04b4dc1e036e601727ffac52ea93065651b9bb6 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 13:04:55 -0800 Subject: [PATCH 14/54] set input Aircraft.Wing.AREA to metadata values (0.0) (was 150). Set input Aircraft.Strut.AREA_RATIO to metadata values (0.0) (was .2). Set input to metadata values (0.0). Set input Aircraft.Fuselage.AVG_DIAMETER to metadata values (0.0) (was 10.0). Set outputs Aircraft.Strut.LENGTH, Aircraft.Strut.AREA, and Aircraft.Strut.CHORD to metadata values (0.0). --- aviary/subsystems/geometry/gasp_based/strut.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/strut.py b/aviary/subsystems/geometry/gasp_based/strut.py index c6443cc4d..3fc58043f 100644 --- a/aviary/subsystems/geometry/gasp_based/strut.py +++ b/aviary/subsystems/geometry/gasp_based/strut.py @@ -21,19 +21,17 @@ def initialize(self): def setup(self): - add_aviary_input(self, Aircraft.Wing.AREA, val=150) - add_aviary_input(self, Aircraft.Strut.AREA_RATIO, val=.2) - - add_aviary_input(self, Aircraft.Strut.ATTACHMENT_LOCATION, val=0, units="ft") - - add_aviary_input(self, Aircraft.Fuselage.AVG_DIAMETER, val=10.0) + add_aviary_input(self, Aircraft.Wing.AREA) + add_aviary_input(self, Aircraft.Strut.AREA_RATIO) + add_aviary_input(self, Aircraft.Strut.ATTACHMENT_LOCATION) + add_aviary_input(self, Aircraft.Fuselage.AVG_DIAMETER) self.add_output( "strut_y", val=30, units="ft", desc="YSTRUT: attachment location of strut" ) - add_aviary_output(self, Aircraft.Strut.LENGTH, val=1.0) - add_aviary_output(self, Aircraft.Strut.AREA, val=30) - add_aviary_output(self, Aircraft.Strut.CHORD, val=1.0) + add_aviary_output(self, Aircraft.Strut.LENGTH) + add_aviary_output(self, Aircraft.Strut.AREA) + add_aviary_output(self, Aircraft.Strut.CHORD) def setup_partials(self): From c623bd3d30222b699bb279c4c55f6ba0f9d0302a Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 13:33:25 -0800 Subject: [PATCH 15/54] set input Mission.Design.GROSS_MASS to metadata values (0.0) (was 152000). Set input Aircraft.Wing.LOADING to metadata values (0.0) (was 128). Set input Aircraft.Wing.ASPECT_RATIO to metadata values (0.0) (was 10.13). Set input Aircraft.Wing.AREA to metadata values (0.0) (was 2). Set input Aircraft.Wing.SPAN to metadata values (0.0) (was 2). Set input Aircraft.Wing.TAPER_RATIO to metadata values (0.0) (was 0.33). Set input Aircraft.Wing.SWEEP to metadata values (0.0) (was 25). Set input Aircraft.Wing.THICKNESS_TO_CHORD_ROOT to metadata values (0.0) (was 0.11). Set input Aircraft.Fuselage.AVG_DIAMETER to metadata values (0.0) (was 10). Set input Aircraft.Wing.THICKNESS_TO_CHORD_TIP to metadata values (0.0) (was 0.1). Set input Aircraft.Fuel.WING_FUEL_FRACTION to metadata values (0.0) (was 0.6). Set input Aircraft.Fuel.WING_VOLUME_GEOMETRIC_MAX to metadata values (0.0). Set input Aircraft.Wing.FOLDED_SPAN to metadata values (0.0) (was 25). Set input Aircraft.Wing.AREA to metadata values (0.0) (was 200). Set input Aircraft.Wing.SPAN to metadata values (0.0) (was 118). Set outputs to metadata values (0.0). --- aviary/subsystems/geometry/gasp_based/wing.py | 53 +++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/wing.py b/aviary/subsystems/geometry/gasp_based/wing.py index 122938c2d..809051474 100644 --- a/aviary/subsystems/geometry/gasp_based/wing.py +++ b/aviary/subsystems/geometry/gasp_based/wing.py @@ -24,12 +24,12 @@ def initialize(self): def setup(self): - add_aviary_input(self, Mission.Design.GROSS_MASS, val=152000) - add_aviary_input(self, Aircraft.Wing.LOADING, val=128) - add_aviary_input(self, Aircraft.Wing.ASPECT_RATIO, val=10.13) + add_aviary_input(self, Mission.Design.GROSS_MASS) + add_aviary_input(self, Aircraft.Wing.LOADING) + add_aviary_input(self, Aircraft.Wing.ASPECT_RATIO) - add_aviary_output(self, Aircraft.Wing.AREA, val=0) - add_aviary_output(self, Aircraft.Wing.SPAN, val=0) + add_aviary_output(self, Aircraft.Wing.AREA) + add_aviary_output(self, Aircraft.Wing.SPAN) self.declare_partials( Aircraft.Wing.AREA, [Mission.Design.GROSS_MASS, Aircraft.Wing.LOADING] @@ -94,19 +94,19 @@ def initialize(self): def setup(self): - add_aviary_input(self, Aircraft.Wing.AREA, val=2) - add_aviary_input(self, Aircraft.Wing.SPAN, val=2) - add_aviary_input(self, Aircraft.Wing.ASPECT_RATIO, val=10.13) - add_aviary_input(self, Aircraft.Wing.TAPER_RATIO, val=0.33) - add_aviary_input(self, Aircraft.Wing.SWEEP, val=25) - add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD_ROOT, val=0.11) - add_aviary_input(self, Aircraft.Fuselage.AVG_DIAMETER, val=10) - add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD_TIP, val=0.1) + add_aviary_input(self, Aircraft.Wing.AREA) + add_aviary_input(self, Aircraft.Wing.SPAN) + add_aviary_input(self, Aircraft.Wing.ASPECT_RATIO) + add_aviary_input(self, Aircraft.Wing.TAPER_RATIO) + add_aviary_input(self, Aircraft.Wing.SWEEP) + add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD_ROOT) + add_aviary_input(self, Aircraft.Fuselage.AVG_DIAMETER) + add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD_TIP) if not self.options["aviary_options"].get_val(Aircraft.Wing.HAS_FOLD, units='unitless'): - add_aviary_input(self, Aircraft.Fuel.WING_FUEL_FRACTION, val=0.6) - add_aviary_output(self, Aircraft.Fuel.WING_VOLUME_GEOMETRIC_MAX, val=0) + add_aviary_input(self, Aircraft.Fuel.WING_FUEL_FRACTION) + add_aviary_output(self, Aircraft.Fuel.WING_VOLUME_GEOMETRIC_MAX) self.declare_partials( Aircraft.Fuel.WING_VOLUME_GEOMETRIC_MAX, @@ -122,12 +122,11 @@ def setup(self): ], ) - add_aviary_output(self, Aircraft.Wing.CENTER_CHORD, val=0) - add_aviary_output(self, Aircraft.Wing.AVERAGE_CHORD, val=0) - add_aviary_output(self, Aircraft.Wing.ROOT_CHORD, val=0) - add_aviary_output(self, Aircraft.Wing.THICKNESS_TO_CHORD_UNWEIGHTED, val=0) - add_aviary_output(self, Aircraft.Wing.LEADING_EDGE_SWEEP, - val=0.4763948, units="rad") + add_aviary_output(self, Aircraft.Wing.CENTER_CHORD) + add_aviary_output(self, Aircraft.Wing.AVERAGE_CHORD) + add_aviary_output(self, Aircraft.Wing.ROOT_CHORD) + add_aviary_output(self, Aircraft.Wing.THICKNESS_TO_CHORD_UNWEIGHTED) + add_aviary_output(self, Aircraft.Wing.LEADING_EDGE_SWEEP) self.declare_partials( Aircraft.Wing.CENTER_CHORD, @@ -555,13 +554,13 @@ def setup(self): self.declare_partials(Aircraft.Fuel.WING_VOLUME_GEOMETRIC_MAX, Aircraft.Wing.FOLDED_SPAN) - add_aviary_input(self, Aircraft.Wing.FOLDED_SPAN, val=25, units='ft') + add_aviary_input(self, Aircraft.Wing.FOLDED_SPAN) - add_aviary_input(self, Aircraft.Wing.AREA, val=200) - add_aviary_input(self, Aircraft.Wing.SPAN, val=118) - add_aviary_input(self, Aircraft.Wing.TAPER_RATIO, val=0.33) - add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD_ROOT, val=0.11) - add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD_TIP, val=0.1) + add_aviary_input(self, Aircraft.Wing.AREA) + add_aviary_input(self, Aircraft.Wing.SPAN) + add_aviary_input(self, Aircraft.Wing.TAPER_RATIO) + add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD_ROOT) + add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD_TIP) add_aviary_input(self, Aircraft.Fuel.WING_FUEL_FRACTION, val=0.6) self.add_output( From 414bb7a7d24416fdac85305369bf2cc595a34102 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 14:27:41 -0800 Subject: [PATCH 16/54] set values when val is None in add_aviary_input/add_aviary_output. --- aviary/variable_info/functions.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/aviary/variable_info/functions.py b/aviary/variable_info/functions.py index 8c28147a0..a214a2e13 100644 --- a/aviary/variable_info/functions.py +++ b/aviary/variable_info/functions.py @@ -1,4 +1,5 @@ import dymos as dm +import numpy as np import openmdao.api as om from dymos.utils.misc import _unspecified from openmdao.core.component import Component @@ -33,12 +34,21 @@ def add_aviary_input(comp, varname, val=None, units=None, desc=None, shape_by_co else: input_desc = meta['desc'] if val is None: - val = meta['default_value'] + if shape is None: + val = meta['default_value'] + if val is None: + val = 0.0 + else: + val = meta['default_value'] + if val is None: + val = np.zeros(shape) + else: + val = np.ones(shape) * val comp.add_input(varname, val=val, units=input_units, desc=input_desc, shape_by_conn=shape_by_conn, shape=shape) -def add_aviary_output(comp, varname, val, units=None, desc=None, shape_by_conn=False, meta_data=_MetaData): +def add_aviary_output(comp, varname, val=None, units=None, desc=None, shape_by_conn=False, meta_data=_MetaData, shape=None): ''' This function provides a clean way to add variables from the variable hierarchy into components as Aviary outputs. It takes @@ -58,6 +68,17 @@ def add_aviary_output(comp, varname, val, units=None, desc=None, shape_by_conn=F output_desc = desc else: output_desc = meta['desc'] + if val is None: + if shape is None: + val = meta['default_value'] + if val is None: + val = 0.0 + else: + val = meta['default_value'] + if val is None: + val = np.zeros(shape) + else: + val = np.ones(shape) * val comp.add_output(varname, val=val, units=output_units, desc=output_desc, shape_by_conn=shape_by_conn) From f8f9b46594a8782b4d1c0f4959c89f4aa8390d42 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 14:31:56 -0800 Subject: [PATCH 17/54] set default_values for geometry subsystem. --- aviary/variable_info/variable_meta_data.py | 82 ++++++++++++++++------ 1 file changed, 59 insertions(+), 23 deletions(-) diff --git a/aviary/variable_info/variable_meta_data.py b/aviary/variable_info/variable_meta_data.py index 6ef0e83de..8acf45fe1 100644 --- a/aviary/variable_info/variable_meta_data.py +++ b/aviary/variable_info/variable_meta_data.py @@ -418,7 +418,7 @@ }, units='unitless', desc='canard theoretical aspect ratio', - default_value=None, + default_value=0.0, # changed from None ) add_meta_data( @@ -434,6 +434,7 @@ }, units='ft', desc='Reynolds characteristic length for the canard', + default_value=0.0, # added ) add_meta_data( @@ -449,6 +450,7 @@ }, units='unitless', desc='canard fineness ratio', + default_value=0.0, # added ) add_meta_data( @@ -553,7 +555,7 @@ }, units='ft**2', desc='canard wetted area', - default_value=None, + default_value=0.0, # changed from None ) add_meta_data( @@ -1574,6 +1576,7 @@ }, units='ft**2', desc='total aircraft wetted area', + default_value=0.0, # added ) add_meta_data( @@ -1697,6 +1700,7 @@ historical_name={"GASP": 'INGASP.LCABLE', "FLOPS": None, "LEAPS1": None}, units='ft', desc='length of cable for hybrid electric augmented system', + default_value=0.0, # added ) add_meta_data( @@ -2127,7 +2131,7 @@ historical_name={"GASP": 'INGASP.DIAM_REF', "FLOPS": None, "LEAPS1": None}, units='ft', desc='engine reference diameter', - default_value=0.0, + default_value=0.0, # In geometry/gasp_based/engine.py, it was 5.8 ) # NOTE This unscaled turbine (engine) weight is an input provided by the user, and is not @@ -2331,7 +2335,7 @@ units='unitless', desc='Engine wing mount locations as fractions of semispan; (NUM_WING_ENGINES)/2 values ' 'are input', - default_value=np.array([0.0]), + default_value=np.array([0.0]), # In mass/gasp_based/fixed.py and geometry/gasp_based/electric.py, default was [0.35] ) # ___ _ @@ -2848,6 +2852,7 @@ historical_name={"GASP": 'INGASP.SKWF', "FLOPS": None, "LEAPS1": None}, units='unitless', desc='fraction of total theoretical wing volume used for wing fuel', + default_value=0.0, # added. In geometry/gasp_based/wing.py, it was 0.6. In /mass/gasp_based/equipment_and_useful_load.py, it was 0.5. ) add_meta_data( @@ -2930,6 +2935,7 @@ historical_name={"GASP": 'INGASP.FVOLW_GEOM', "FLOPS": None, "LEAPS1": None}, units='ft**3', desc='wing tank fuel volume based on geometry', + default_value=0.0, # added ) add_meta_data( @@ -3025,6 +3031,7 @@ }, units='ft', desc='average fuselage diameter', + default_value=0.0, # added. In several components, it was set to 10 or 13.1. ) add_meta_data( @@ -3040,6 +3047,7 @@ }, units='ft', desc='Reynolds characteristic length for the fuselage', + default_value=0.0, # added ) add_meta_data( @@ -3060,7 +3068,7 @@ historical_name={"GASP": 'INGASP.HCK', "FLOPS": None, "LEAPS1": None}, units='ft', desc='mean fuselage cabin diameter minus mean fuselage nose diameter', - default_value=4.5, + default_value=0.0, # In geometry/gasp_based/fuselage.py, it was 4.5. ) add_meta_data( @@ -3088,6 +3096,7 @@ }, units='unitless', desc='fuselage fineness ratio', + default_value=0.0, # added ) add_meta_data( @@ -3156,7 +3165,7 @@ desc='Define the Fuselage total length. If total_length is not input for a ' 'passenger transport, LEAPS will calculate the fuselage length, width and ' 'depth and the length of the passenger compartment.', - default_value=0.0, + default_value=0.0, # in several components, it was set to 129.4 or 200. ) add_meta_data( @@ -3222,6 +3231,7 @@ }, units='ft', desc='maximum fuselage height', + default_value=0.0, # added ) add_meta_data( @@ -3339,6 +3349,7 @@ historical_name={"GASP": 'INGASP.ELPC', "FLOPS": None, "LEAPS1": None}, units='ft', desc='length of the pilot compartment', + default_value=0.0, # added. # In geometry/gasp_based/fuselage.py, it was 9.5 ) add_meta_data( @@ -3351,6 +3362,7 @@ }, units='ft**2', desc='fuselage planform area', + default_value=0.0, # added ) add_meta_data( @@ -3408,7 +3420,7 @@ }, units='ft**2', desc='fuselage wetted area', - default_value=None, + default_value=0.0, # changed from None ) add_meta_data( @@ -3459,7 +3471,7 @@ }, units='unitless', desc='horizontal tail theoretical aspect ratio', - default_value=None, + default_value=4.75, # changed from None ) add_meta_data( @@ -3483,6 +3495,7 @@ }, units='ft', desc='Reynolds characteristic length for the horizontal tail', + default_value=0.0, # added ) add_meta_data( @@ -3498,6 +3511,7 @@ }, units='unitless', desc='horizontal tail fineness ratio', + default_value=0.0, # added ) add_meta_data( @@ -3633,7 +3647,7 @@ }, units='unitless', desc='horizontal tail theoretical taper ratio', - default_value=None, + default_value=0.0, # changed from None ) add_meta_data( @@ -3663,7 +3677,7 @@ 'tail is mounted. Defaults: 0.0 == for body mounted (default for ' 'transport with all engines on wing); 1.0 == for T tail ' '(default for transport with multiple engines on fuselage)', - default_value=None, + default_value=0.0, # added ) add_meta_data( @@ -3691,7 +3705,7 @@ }, units='ft**2', desc='horizontal tail wetted area', - default_value=None, + default_value=0.0, # changed from None ) add_meta_data( @@ -4046,6 +4060,7 @@ }, units='ft', desc='Average diameter of engine nacelles for each engine model', + default_value=0.0, # added ) add_meta_data( @@ -4060,6 +4075,7 @@ }, units='ft', desc='Average length of nacelles for each engine model', + default_value=0.0, # added ) add_meta_data( @@ -4075,6 +4091,7 @@ }, units='ft', desc='Reynolds characteristic length for nacelle for each engine model', + default_value=0.0, # added ) add_meta_data( @@ -4092,7 +4109,7 @@ historical_name={"GASP": 'INGASP.DNQDE', "FLOPS": None, "LEAPS1": None}, units="unitless", desc='ratio of nacelle diameter to engine core diameter', - default_value=1.25, + default_value=1.25, # In geometry/gasp_based/engine.py, it was 1.25 ) add_meta_data( @@ -4108,6 +4125,7 @@ }, units='unitless', desc='nacelle fineness ratio', + default_value=0.0, # added. # In geometry/gasp_based/engine.py, it was 2. ) add_meta_data( @@ -4205,6 +4223,7 @@ }, units='ft**2', desc='total nacelles wetted area', + default_value=0.0, # added ) add_meta_data( @@ -4220,6 +4239,7 @@ }, units='ft**2', desc='wetted area of a single nacelle for each engine model', + default_value=0.0, # added ) add_meta_data( @@ -4478,6 +4498,7 @@ historical_name={"GASP": 'INGASP.SSTQSW', "FLOPS": None, "LEAPS1": None}, units='unitless', desc='ratio of strut area to wing area', + default_value=0.0, # added. In geometry/gasp_based/strut.py, it was set to .2. ) add_meta_data( @@ -4490,6 +4511,7 @@ }, units='ft', desc='attachment location of strut the full attachment-to-attachment span', + default_value=0.0, # added ) # related to Aircraft.Strut.ATTACHMENT_LOCATION @@ -4499,6 +4521,7 @@ historical_name={"GASP": None, "FLOPS": None, "LEAPS1": None}, units='unitless', desc='attachment location of strut as fraction of the half-span', + default_value=0.0, # added ) add_meta_data( @@ -4507,6 +4530,7 @@ historical_name={"GASP": 'INGASP.STRTCHD', "FLOPS": None, "LEAPS1": None}, units='ft', desc='chord of the strut', + default_value=0.0, # added ) add_meta_data( @@ -4624,7 +4648,7 @@ }, units='unitless', desc='vertical tail theoretical aspect ratio', - default_value=None, + default_value=0.0, # changed from None ) add_meta_data( @@ -4648,6 +4672,7 @@ }, units='ft', desc='Reynolds characteristic length for the vertical tail', + default_value=0.0, # added ) add_meta_data( @@ -4663,6 +4688,7 @@ }, units='unitless', desc='vertical tail fineness ratio', + default_value=0.0, # added ) add_meta_data( @@ -4813,7 +4839,7 @@ }, units='unitless', desc='vertical tail theoretical taper ratio', - default_value=None, + default_value=0.0, # changed from None ) add_meta_data( @@ -4856,7 +4882,7 @@ }, units='ft**2', desc='vertical tails wetted area', - default_value=None, + default_value=0.0, # changed from None ) add_meta_data( @@ -4945,7 +4971,7 @@ }, units='ft**2', desc='reference wing area', - default_value=0.0, + default_value=0.0, # In several components, it was set to 100, 150, 200, 1370.3 or other values. ) add_meta_data( @@ -4971,7 +4997,7 @@ }, units='unitless', desc='ratio of the wing span to its mean chord', - default_value=0.0, + default_value=0.0, # in several components, it was 1 or 10.13. ) add_meta_data( @@ -4992,6 +5018,7 @@ historical_name={"GASP": 'INGASP.CBARW', "FLOPS": None, "LEAPS1": None}, units='ft', desc='mean aerodynamic chord of the wing', + default_value=0.0, # added ) add_meta_data( @@ -5068,6 +5095,7 @@ historical_name={"GASP": 'INGASP.CRCLW', "FLOPS": None, "LEAPS1": None}, units='ft', desc='wing chord at fuselage centerline', + default_value=0.0, # added ) add_meta_data( @@ -5092,6 +5120,7 @@ }, units='ft', desc='Reynolds characteristic length for the wing', + default_value=0.0, # added ) add_meta_data( @@ -5223,6 +5252,7 @@ }, units='unitless', desc='wing fineness ratio', + default_value=0.0, # added ) add_meta_data( @@ -5323,7 +5353,7 @@ historical_name={"GASP": 'INGASP.YWFOLD', "FLOPS": None, "LEAPS1": None}, units='ft', desc='folded wingspan', - default_value=118, + default_value=0, # In geometry/gasp_based/non_dimensional_conversion.py and geometry/gasp_based/wing.py, it was 25. ) add_meta_data( @@ -5482,6 +5512,7 @@ historical_name={"GASP": 'INGASP.SWPLE', "FLOPS": None, "LEAPS1": None}, units='rad', desc='sweep angle at leading edge of wing', + default_value=0.0, # added ) add_meta_data( @@ -5536,6 +5567,7 @@ }, units='lbf/ft**2', desc='wing loading', + default_value=0.0, # added. In several components, it was 128. ) add_meta_data( @@ -5752,6 +5784,7 @@ }, units='ft', desc='wing chord length at wing root', + default_value=0.0, # added ) add_meta_data( @@ -5827,7 +5860,7 @@ }, units='ft', desc='span of main wing', - default_value=0.0, + default_value=0.0, # in several components, it was set to 128, or 117.8 but there are other values. ) add_meta_data( @@ -5941,7 +5974,7 @@ }, units='deg', desc='quarter-chord sweep angle of the wing', - default_value=0.0, # TODO required + default_value=0.0, # TODO required. In several components, it was 0.436 (rad) or 25 (deg). ) add_meta_data( @@ -5966,7 +5999,7 @@ }, units='unitless', desc='taper ratio of the wing', - default_value=0.0, # TODO required + default_value=0.0, # TODO required. In several components, it was .33. ) add_meta_data( @@ -6027,6 +6060,7 @@ historical_name={"GASP": 'INGASP.TCR', "FLOPS": None, "LEAPS1": None}, units='unitless', desc='thickness-to-chord ratio at the root of the wing', + default_value=0.0, # added. In several components, it was 0.11 or 0.15. ) add_meta_data( @@ -6035,6 +6069,7 @@ historical_name={"GASP": 'INGASP.TCT', "FLOPS": None, "LEAPS1": None}, units='unitless', desc='thickness-to-chord ratio at the tip of the wing', + default_value=0.0, # added. In geometry/gasp_based/wing.py, it was 0.1 ) add_meta_data( @@ -6043,6 +6078,7 @@ historical_name={"GASP": 'INGASP.TC', "FLOPS": None, "LEAPS1": None}, units='unitless', desc='wing thickness-chord ratio at the wing station of the mean aerodynamic chord', + default_value=0.0, # added. In geometry/gasp_based/wing.py, it was 0.1. ) add_meta_data( @@ -6090,7 +6126,7 @@ }, units='ft**2', desc='wing wetted area', - default_value=None, + default_value=0.0, # changed from None ) add_meta_data( @@ -6733,7 +6769,7 @@ }, units='lbm', desc='design gross mass of the aircraft', - default_value=None, + default_value=0.0, # changed form None. In several components, it was set to 20000, 152000 or 175400. ) add_meta_data( From 25268f049c81868859be7f62db0c9792215dd545 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 14:46:00 -0800 Subject: [PATCH 18/54] autopep8 --- aviary/variable_info/variable_meta_data.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/aviary/variable_info/variable_meta_data.py b/aviary/variable_info/variable_meta_data.py index 8acf45fe1..5f15937c6 100644 --- a/aviary/variable_info/variable_meta_data.py +++ b/aviary/variable_info/variable_meta_data.py @@ -2335,7 +2335,8 @@ units='unitless', desc='Engine wing mount locations as fractions of semispan; (NUM_WING_ENGINES)/2 values ' 'are input', - default_value=np.array([0.0]), # In mass/gasp_based/fixed.py and geometry/gasp_based/electric.py, default was [0.35] + # In mass/gasp_based/fixed.py and geometry/gasp_based/electric.py, default was [0.35] + default_value=np.array([0.0]), ) # ___ _ @@ -2852,7 +2853,8 @@ historical_name={"GASP": 'INGASP.SKWF', "FLOPS": None, "LEAPS1": None}, units='unitless', desc='fraction of total theoretical wing volume used for wing fuel', - default_value=0.0, # added. In geometry/gasp_based/wing.py, it was 0.6. In /mass/gasp_based/equipment_and_useful_load.py, it was 0.5. + # added. In geometry/gasp_based/wing.py, it was 0.6. In /mass/gasp_based/equipment_and_useful_load.py, it was 0.5. + default_value=0.0, ) add_meta_data( @@ -3068,7 +3070,7 @@ historical_name={"GASP": 'INGASP.HCK', "FLOPS": None, "LEAPS1": None}, units='ft', desc='mean fuselage cabin diameter minus mean fuselage nose diameter', - default_value=0.0, # In geometry/gasp_based/fuselage.py, it was 4.5. + default_value=0.0, # In geometry/gasp_based/fuselage.py, it was 4.5. ) add_meta_data( @@ -4971,7 +4973,7 @@ }, units='ft**2', desc='reference wing area', - default_value=0.0, # In several components, it was set to 100, 150, 200, 1370.3 or other values. + default_value=0.0, # In several components, it was set to 100, 150, 200, 1370.3 etc. ) add_meta_data( @@ -5353,7 +5355,8 @@ historical_name={"GASP": 'INGASP.YWFOLD', "FLOPS": None, "LEAPS1": None}, units='ft', desc='folded wingspan', - default_value=0, # In geometry/gasp_based/non_dimensional_conversion.py and geometry/gasp_based/wing.py, it was 25. + # In geometry/gasp_based/non_dimensional_conversion.py and geometry/gasp_based/wing.py, it was 25. + default_value=0, ) add_meta_data( @@ -5860,7 +5863,8 @@ }, units='ft', desc='span of main wing', - default_value=0.0, # in several components, it was set to 128, or 117.8 but there are other values. + # in several components, it was set to 128, or 117.8 but there are other values. + default_value=0.0, ) add_meta_data( @@ -5974,7 +5978,8 @@ }, units='deg', desc='quarter-chord sweep angle of the wing', - default_value=0.0, # TODO required. In several components, it was 0.436 (rad) or 25 (deg). + # In several components, it was 0.436 (rad) or 25 (deg). + default_value=0.0, # TODO required. ) add_meta_data( @@ -6769,7 +6774,8 @@ }, units='lbm', desc='design gross mass of the aircraft', - default_value=0.0, # changed form None. In several components, it was set to 20000, 152000 or 175400. + # changed form None. In several components, it was set to 20000, 152000 or 175400. + default_value=0.0, ) add_meta_data( From 9e79199ebd3edbf396b0122cad817270049f1ab2 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 14:46:56 -0800 Subject: [PATCH 19/54] autopep8 --- aviary/subsystems/geometry/flops_based/nacelle.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aviary/subsystems/geometry/flops_based/nacelle.py b/aviary/subsystems/geometry/flops_based/nacelle.py index e40fe74e6..010949f9d 100644 --- a/aviary/subsystems/geometry/flops_based/nacelle.py +++ b/aviary/subsystems/geometry/flops_based/nacelle.py @@ -24,7 +24,8 @@ def setup(self): Aircraft.Engine.NUM_ENGINES)) add_aviary_input(self, Aircraft.Nacelle.AVG_DIAMETER, shape=num_engine_type) add_aviary_input(self, Aircraft.Nacelle.AVG_LENGTH, shape=num_engine_type) - add_aviary_input(self, Aircraft.Nacelle.WETTED_AREA_SCALER, shape=num_engine_type) + add_aviary_input(self, Aircraft.Nacelle.WETTED_AREA_SCALER, + shape=num_engine_type) add_aviary_output(self, Aircraft.Nacelle.TOTAL_WETTED_AREA) add_aviary_output(self, Aircraft.Nacelle.WETTED_AREA, shape=num_engine_type) From faaa1bab991c617c6d7e17190c5bd2dc66833930 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 30 Dec 2024 17:15:26 -0800 Subject: [PATCH 20/54] minor updates --- .../geometry/gasp_based/empennage.py | 16 +++--------- .../geometry/gasp_based/fuselage.py | 1 - .../subsystems/geometry/gasp_based/strut.py | 1 - aviary/subsystems/geometry/gasp_based/wing.py | 26 ++++--------------- .../subsystems/mass/gasp_based/design_load.py | 15 +++-------- 5 files changed, 11 insertions(+), 48 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index 71a5d5f1e..6fd2b9d11 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -46,11 +46,7 @@ def setup(self): add_aviary_input(self, Aircraft.Wing.AREA) - self.add_input( - "wing_ref", - 12.615, - units="ft", - desc=( + self.add_input("wing_ref", 12.615, units="ft", desc=( "CBARW | B: Wing reference parameter. Wing chord for a " "horizontal tail. Wing span for a vertical tail." ), @@ -109,20 +105,14 @@ def setup(self): add_aviary_input(self, Aircraft.Wing.AREA) - self.add_input( - "r_arm", - 0.2307, - units="unitless", + self.add_input("r_arm", 0.2307, units="unitless", desc=( "COELTH | BOELTV: For a horizontal tail, the ratio of " "wing chord to tail moment arm. For a vertical tail, the " "ratio of wing span to vertical tail moment arm." ), ) - self.add_input( - "wing_ref", - 12.615, - units="ft", + self.add_input("wing_ref", 12.615, units="ft", desc=( "CBARW | B: Reference wing parameter for tail moment arm. " "For a horizontal tail, the mean wing chord. For a " diff --git a/aviary/subsystems/geometry/gasp_based/fuselage.py b/aviary/subsystems/geometry/gasp_based/fuselage.py index 051099bba..1239b431c 100644 --- a/aviary/subsystems/geometry/gasp_based/fuselage.py +++ b/aviary/subsystems/geometry/gasp_based/fuselage.py @@ -117,7 +117,6 @@ def initialize(self): ) def setup(self): - add_aviary_input(self, Aircraft.Fuselage.NOSE_FINENESS, val=1) self.add_input("nose_height", val=0, units="ft", desc="HN: height of nose") add_aviary_input(self, Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH, val=9.5) diff --git a/aviary/subsystems/geometry/gasp_based/strut.py b/aviary/subsystems/geometry/gasp_based/strut.py index 3fc58043f..5fac67f92 100644 --- a/aviary/subsystems/geometry/gasp_based/strut.py +++ b/aviary/subsystems/geometry/gasp_based/strut.py @@ -20,7 +20,6 @@ def initialize(self): ) def setup(self): - add_aviary_input(self, Aircraft.Wing.AREA) add_aviary_input(self, Aircraft.Strut.AREA_RATIO) add_aviary_input(self, Aircraft.Strut.ATTACHMENT_LOCATION) diff --git a/aviary/subsystems/geometry/gasp_based/wing.py b/aviary/subsystems/geometry/gasp_based/wing.py index 809051474..cb79f2755 100644 --- a/aviary/subsystems/geometry/gasp_based/wing.py +++ b/aviary/subsystems/geometry/gasp_based/wing.py @@ -529,12 +529,8 @@ def initialize(self): ) def setup(self): - if not self.options["aviary_options"].get_val(Aircraft.Wing.CHOOSE_FOLD_LOCATION, units='unitless'): - self.add_input( - "strut_y", - val=25, - units="ft", + self.add_input("strut_y", val=25, units="ft", desc="YSTRUT: attachment location of strut", ) @@ -563,31 +559,19 @@ def setup(self): add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD_TIP) add_aviary_input(self, Aircraft.Fuel.WING_FUEL_FRACTION, val=0.6) - self.add_output( - "nonfolded_taper_ratio", - val=0.1, - units="unitless", + self.add_output("nonfolded_taper_ratio", val=0.1, units="unitless", desc="SLM_NF: taper ratio between wing root and fold location", ) add_aviary_output(self, Aircraft.Wing.FOLDING_AREA, val=50) - self.add_output( - "nonfolded_wing_area", - val=150, - units="ft**2", + self.add_output("nonfolded_wing_area", val=150, units="ft**2", desc="SW_NF: wing area of part of wings that does not fold", ) - self.add_output( - "tc_ratio_mean_folded", - val=0.12, - units="unitless", + self.add_output("tc_ratio_mean_folded", val=0.12, units="unitless", desc="TCM: mean value of thickess to chord ratio between root and fold", ) - self.add_output( - "nonfolded_AR", - val=10, - units="unitless", + self.add_output("nonfolded_AR", val=10, units="unitless", desc="AR_NF: aspect ratio of non-folding part of wing", ) diff --git a/aviary/subsystems/mass/gasp_based/design_load.py b/aviary/subsystems/mass/gasp_based/design_load.py index d88a41ea2..a80e482f1 100644 --- a/aviary/subsystems/mass/gasp_based/design_load.py +++ b/aviary/subsystems/mass/gasp_based/design_load.py @@ -41,23 +41,14 @@ def setup(self): add_aviary_input(self, Aircraft.Wing.LOADING, val=128) - self.add_output( - "max_airspeed", - val=0, - units="kn", + self.add_output("max_airspeed", val=0, units="kn", desc="VM0: maximum operating equivalent airspeed", ) - self.add_output( - "vel_c", - val=0, - units="kn", + self.add_output("vel_c", val=0, units="kn", desc="VGC: Velocity used in Gust Load Factor calculation at cruise conditions.\ This is Minimum Design Cruise Speed for Part 23 aircraft and VM0 for Part 25 aircraft", ) - self.add_output( - "max_maneuver_factor", - val=0, - units="unitless", + self.add_output("max_maneuver_factor", val=0, units="unitless", desc="EMLF: maximum maneuver load factor, units are in g`s", ) self.add_output("min_dive_vel", val=0, units="kn", desc="VDMIN: dive velocity") From eac7d8a48d0a0f0058827426c9022c74e5112438 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 08:32:01 -0800 Subject: [PATCH 21/54] Replace self.add_output(Aircraft.Fuel.AUXILIARY_FUEL_CAPACITY) by add_aviary_output(self, Aircraft.Fuel.AUXILIARY_FUEL_CAPACITY) --- aviary/subsystems/mass/gasp_based/fuel.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aviary/subsystems/mass/gasp_based/fuel.py b/aviary/subsystems/mass/gasp_based/fuel.py index b9b973fc9..2b1a94708 100644 --- a/aviary/subsystems/mass/gasp_based/fuel.py +++ b/aviary/subsystems/mass/gasp_based/fuel.py @@ -58,12 +58,12 @@ def setup(self): add_aviary_input(self, Mission.Design.FUEL_MASS, val=3000) add_aviary_input(self, Aircraft.Design.OPERATING_MASS, val=94417) - self.add_output( - Aircraft.Fuel.AUXILIARY_FUEL_CAPACITY, - val=0, - units="lbm", - desc="WFXTRA: extra amount of fuel that is required but does not fit in wings", - ) + add_aviary_output(self, Aircraft.Fuel.AUXILIARY_FUEL_CAPACITY, val=0, + desc="WFXTRA: extra amount of fuel that is required but does not fit in wings") + # self.add_output( + # Aircraft.Fuel.AUXILIARY_FUEL_CAPACITY, val=0, units="lbm", + # desc="WFXTRA: extra amount of fuel that is required but does not fit in wings", + # ) self.add_output( "extra_fuel_volume", val=0, From 0b36676e3bb25bcd22aca9a6ab59932740b38a78 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 08:37:47 -0800 Subject: [PATCH 22/54] autopep8 --- aviary/subsystems/mass/gasp_based/design_load.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/aviary/subsystems/mass/gasp_based/design_load.py b/aviary/subsystems/mass/gasp_based/design_load.py index a80e482f1..b18353c21 100644 --- a/aviary/subsystems/mass/gasp_based/design_load.py +++ b/aviary/subsystems/mass/gasp_based/design_load.py @@ -42,15 +42,15 @@ def setup(self): add_aviary_input(self, Aircraft.Wing.LOADING, val=128) self.add_output("max_airspeed", val=0, units="kn", - desc="VM0: maximum operating equivalent airspeed", - ) + desc="VM0: maximum operating equivalent airspeed", + ) self.add_output("vel_c", val=0, units="kn", - desc="VGC: Velocity used in Gust Load Factor calculation at cruise conditions.\ - This is Minimum Design Cruise Speed for Part 23 aircraft and VM0 for Part 25 aircraft", - ) + desc="VGC: Velocity used in Gust Load Factor calculation at cruise conditions.\ + This is Minimum Design Cruise Speed for Part 23 aircraft and VM0 for Part 25 aircraft", + ) self.add_output("max_maneuver_factor", val=0, units="unitless", - desc="EMLF: maximum maneuver load factor, units are in g`s", - ) + desc="EMLF: maximum maneuver load factor, units are in g`s", + ) self.add_output("min_dive_vel", val=0, units="kn", desc="VDMIN: dive velocity") self.declare_partials("*", "*") From 2fda6d7a4a6aaa42e5293931b3f6eacf0cabd514 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 08:46:49 -0800 Subject: [PATCH 23/54] autopep8 --- .../geometry/gasp_based/empennage.py | 27 ++++++++----------- aviary/subsystems/geometry/gasp_based/wing.py | 20 +++++++------- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index 6fd2b9d11..b8f68746e 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -47,10 +47,9 @@ def setup(self): add_aviary_input(self, Aircraft.Wing.AREA) self.add_input("wing_ref", 12.615, units="ft", desc=( - "CBARW | B: Wing reference parameter. Wing chord for a " - "horizontal tail. Wing span for a vertical tail." - ), - ) + "CBARW | B: Wing reference parameter. Wing chord for a " + "horizontal tail. Wing span for a vertical tail."), + ) self.add_output( "vol_coef", units="unitless", desc="VBARH | VBARV: Tail volume coefficient") @@ -106,19 +105,15 @@ def setup(self): add_aviary_input(self, Aircraft.Wing.AREA) self.add_input("r_arm", 0.2307, units="unitless", - desc=( - "COELTH | BOELTV: For a horizontal tail, the ratio of " - "wing chord to tail moment arm. For a vertical tail, the " - "ratio of wing span to vertical tail moment arm." - ), - ) + desc=("COELTH | BOELTV: For a horizontal tail, the ratio of " + "wing chord to tail moment arm. For a vertical tail, the " + "ratio of wing span to vertical tail moment arm."), + ) self.add_input("wing_ref", 12.615, units="ft", - desc=( - "CBARW | B: Reference wing parameter for tail moment arm. " - "For a horizontal tail, the mean wing chord. For a " - "vertical tail, the wing span." - ), - ) + desc=("CBARW | B: Reference wing parameter for tail moment arm. " + "For a horizontal tail, the mean wing chord. For a " + "vertical tail, the wing span."), + ) self.add_input( "ar", 4.75, units="unitless", desc="ARHT | ARVT: Tail aspect ratio.") self.add_input( diff --git a/aviary/subsystems/geometry/gasp_based/wing.py b/aviary/subsystems/geometry/gasp_based/wing.py index cb79f2755..5b0058c79 100644 --- a/aviary/subsystems/geometry/gasp_based/wing.py +++ b/aviary/subsystems/geometry/gasp_based/wing.py @@ -531,8 +531,8 @@ def initialize(self): def setup(self): if not self.options["aviary_options"].get_val(Aircraft.Wing.CHOOSE_FOLD_LOCATION, units='unitless'): self.add_input("strut_y", val=25, units="ft", - desc="YSTRUT: attachment location of strut", - ) + desc="YSTRUT: attachment location of strut", + ) self.declare_partials("nonfolded_taper_ratio", "strut_y") self.declare_partials(Aircraft.Wing.FOLDING_AREA, "strut_y") @@ -560,20 +560,20 @@ def setup(self): add_aviary_input(self, Aircraft.Fuel.WING_FUEL_FRACTION, val=0.6) self.add_output("nonfolded_taper_ratio", val=0.1, units="unitless", - desc="SLM_NF: taper ratio between wing root and fold location", - ) + desc="SLM_NF: taper ratio between wing root and fold location", + ) add_aviary_output(self, Aircraft.Wing.FOLDING_AREA, val=50) self.add_output("nonfolded_wing_area", val=150, units="ft**2", - desc="SW_NF: wing area of part of wings that does not fold", - ) + desc="SW_NF: wing area of part of wings that does not fold", + ) self.add_output("tc_ratio_mean_folded", val=0.12, units="unitless", - desc="TCM: mean value of thickess to chord ratio between root and fold", - ) + desc="TCM: mean value of thickess to chord ratio between root and fold", + ) self.add_output("nonfolded_AR", val=10, units="unitless", - desc="AR_NF: aspect ratio of non-folding part of wing", - ) + desc="AR_NF: aspect ratio of non-folding part of wing", + ) add_aviary_output(self, Aircraft.Fuel.WING_VOLUME_GEOMETRIC_MAX, val=0) From f44f6c348f126916a08554a8711c056080f69813 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 09:18:57 -0800 Subject: [PATCH 24/54] set Aircraft.HorizontalTail.TAPER_RATIO = 0 in prep_geom.py and set tr = 0 in empennage.py --- aviary/subsystems/geometry/flops_based/prep_geom.py | 2 +- aviary/subsystems/geometry/gasp_based/empennage.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aviary/subsystems/geometry/flops_based/prep_geom.py b/aviary/subsystems/geometry/flops_based/prep_geom.py index 896ac70b7..260ba3aeb 100644 --- a/aviary/subsystems/geometry/flops_based/prep_geom.py +++ b/aviary/subsystems/geometry/flops_based/prep_geom.py @@ -129,7 +129,7 @@ def setup(self): add_aviary_input(self, Aircraft.HorizontalTail.AREA) add_aviary_input(self, Aircraft.HorizontalTail.ASPECT_RATIO) - add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO, 0.352) + add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO) add_aviary_input(self, Aircraft.HorizontalTail.THICKNESS_TO_CHORD) add_aviary_input(self, Aircraft.VerticalTail.AREA) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index b8f68746e..36470e3bf 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -117,7 +117,7 @@ def setup(self): self.add_input( "ar", 4.75, units="unitless", desc="ARHT | ARVT: Tail aspect ratio.") self.add_input( - "tr", 0.352, units="unitless", desc="SLMH | SLMV: Tail taper ratio.") + "tr", 0.0, units="unitless", desc="SLMH | SLMV: Tail taper ratio.") self.add_output("area", units="ft**2", desc="SHT | SVT: Tail area") self.add_output("span", units="ft", desc="BHT | BVT: Tail span") From 638318c13f2c72bc61703148e49227c9c8479ac0 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 09:20:44 -0800 Subject: [PATCH 25/54] autopep8 --- aviary/subsystems/geometry/flops_based/prep_geom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aviary/subsystems/geometry/flops_based/prep_geom.py b/aviary/subsystems/geometry/flops_based/prep_geom.py index 260ba3aeb..d06e33c33 100644 --- a/aviary/subsystems/geometry/flops_based/prep_geom.py +++ b/aviary/subsystems/geometry/flops_based/prep_geom.py @@ -129,7 +129,7 @@ def setup(self): add_aviary_input(self, Aircraft.HorizontalTail.AREA) add_aviary_input(self, Aircraft.HorizontalTail.ASPECT_RATIO) - add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO) + add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO) add_aviary_input(self, Aircraft.HorizontalTail.THICKNESS_TO_CHORD) add_aviary_input(self, Aircraft.VerticalTail.AREA) From 37f846388e0d632dec94b852c19300b38850c855 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 10:54:42 -0800 Subject: [PATCH 26/54] update a comment. --- aviary/variable_info/variable_meta_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aviary/variable_info/variable_meta_data.py b/aviary/variable_info/variable_meta_data.py index 5f15937c6..ee8de1af7 100644 --- a/aviary/variable_info/variable_meta_data.py +++ b/aviary/variable_info/variable_meta_data.py @@ -3649,7 +3649,7 @@ }, units='unitless', desc='horizontal tail theoretical taper ratio', - default_value=0.0, # changed from None + default_value=0.0, # changed from None. In geometry/flops_based/prep_geom.py and mass/gasp_based/empennage.py, it was 0.352. ) add_meta_data( From 38fd95e2862863b19dfa002b37a2418e9a37431b Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 10:55:30 -0800 Subject: [PATCH 27/54] set Aircraft.HorizontalTail.TAPER_RATIO = 0.352 in unit test. --- aviary/subsystems/geometry/gasp_based/test/test_size_group.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aviary/subsystems/geometry/gasp_based/test/test_size_group.py b/aviary/subsystems/geometry/gasp_based/test/test_size_group.py index dc7c1bb1f..2d6aaa732 100644 --- a/aviary/subsystems/geometry/gasp_based/test/test_size_group.py +++ b/aviary/subsystems/geometry/gasp_based/test/test_size_group.py @@ -243,6 +243,9 @@ def setUp(self): self.prob.model.set_input_defaults( Aircraft.HorizontalTail.MOMENT_RATIO, val=0.2307, units="unitless" ) + self.prob.model.set_input_defaults( + Aircraft.HorizontalTail.TAPER_RATIO, val=0.352, units="unitless" + ) self.prob.model.set_input_defaults( Aircraft.VerticalTail.MOMENT_RATIO, 2.362, units="unitless") self.prob.model.set_input_defaults( From f5955fcd74545cd04110b711b18459ce6ccc00dc Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 10:57:02 -0800 Subject: [PATCH 28/54] roll back Aircraft.HorizontalTail.TAPER_RATIO = 0.352 for now. --- aviary/subsystems/geometry/flops_based/prep_geom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aviary/subsystems/geometry/flops_based/prep_geom.py b/aviary/subsystems/geometry/flops_based/prep_geom.py index d06e33c33..896ac70b7 100644 --- a/aviary/subsystems/geometry/flops_based/prep_geom.py +++ b/aviary/subsystems/geometry/flops_based/prep_geom.py @@ -129,7 +129,7 @@ def setup(self): add_aviary_input(self, Aircraft.HorizontalTail.AREA) add_aviary_input(self, Aircraft.HorizontalTail.ASPECT_RATIO) - add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO) + add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO, 0.352) add_aviary_input(self, Aircraft.HorizontalTail.THICKNESS_TO_CHORD) add_aviary_input(self, Aircraft.VerticalTail.AREA) From 65e81497f18c175f845ac48147236b652feebe81 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 10:58:14 -0800 Subject: [PATCH 29/54] roll back tr = 0.352 in empennage.py --- aviary/subsystems/geometry/gasp_based/empennage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index 36470e3bf..b8f68746e 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -117,7 +117,7 @@ def setup(self): self.add_input( "ar", 4.75, units="unitless", desc="ARHT | ARVT: Tail aspect ratio.") self.add_input( - "tr", 0.0, units="unitless", desc="SLMH | SLMV: Tail taper ratio.") + "tr", 0.352, units="unitless", desc="SLMH | SLMV: Tail taper ratio.") self.add_output("area", units="ft**2", desc="SHT | SVT: Tail area") self.add_output("span", units="ft", desc="BHT | BVT: Tail span") From 3f70dc09781b42e2ad0eb4005366ca391a5e0bb4 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 11:14:13 -0800 Subject: [PATCH 30/54] autopep8 --- aviary/variable_info/variable_meta_data.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aviary/variable_info/variable_meta_data.py b/aviary/variable_info/variable_meta_data.py index ee8de1af7..222ec9e3a 100644 --- a/aviary/variable_info/variable_meta_data.py +++ b/aviary/variable_info/variable_meta_data.py @@ -3649,7 +3649,8 @@ }, units='unitless', desc='horizontal tail theoretical taper ratio', - default_value=0.0, # changed from None. In geometry/flops_based/prep_geom.py and mass/gasp_based/empennage.py, it was 0.352. + # In geometry/flops_based/prep_geom.py and mass/gasp_based/empennage.py, it was 0.352. + default_value=0.0, # changed from None. ) add_meta_data( From b35ef64f61dbf1702c9860c9923d608d6b12f401 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 13:52:37 -0800 Subject: [PATCH 31/54] replace 'tr' by Aircraft.HorizontalTail.TAPER_RATIO --- .../geometry/gasp_based/empennage.py | 67 ++++++++++++------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index b8f68746e..be5c6de1c 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -38,18 +38,23 @@ def setup(self): else: self.k = [0.43, 0.38, 0.85] - add_aviary_input(self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION) + add_aviary_input(self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION, val=0) - add_aviary_input(self, Aircraft.Fuselage.LENGTH) + add_aviary_input(self, Aircraft.Fuselage.LENGTH, val=129.4) self.add_input("cab_w", 13.1, units="ft", desc="SWF: Cabin width") - add_aviary_input(self, Aircraft.Wing.AREA) + add_aviary_input(self, Aircraft.Wing.AREA, val=1370) - self.add_input("wing_ref", 12.615, units="ft", desc=( - "CBARW | B: Wing reference parameter. Wing chord for a " - "horizontal tail. Wing span for a vertical tail."), - ) + self.add_input( + "wing_ref", + 12.615, + units="ft", + desc=( + "CBARW | B: Wing reference parameter. Wing chord for a " + "horizontal tail. Wing span for a vertical tail." + ), + ) self.add_output( "vol_coef", units="unitless", desc="VBARH | VBARV: Tail volume coefficient") @@ -102,22 +107,32 @@ def setup(self): desc="VBARH | VBARV: Horizontal tail volume coefficient" ) - add_aviary_input(self, Aircraft.Wing.AREA) - - self.add_input("r_arm", 0.2307, units="unitless", - desc=("COELTH | BOELTV: For a horizontal tail, the ratio of " - "wing chord to tail moment arm. For a vertical tail, the " - "ratio of wing span to vertical tail moment arm."), - ) - self.add_input("wing_ref", 12.615, units="ft", - desc=("CBARW | B: Reference wing parameter for tail moment arm. " - "For a horizontal tail, the mean wing chord. For a " - "vertical tail, the wing span."), - ) + add_aviary_input(self, Aircraft.Wing.AREA, val=1370) + + self.add_input( + "r_arm", + 0.2307, + units="unitless", + desc=( + "COELTH | BOELTV: For a horizontal tail, the ratio of " + "wing chord to tail moment arm. For a vertical tail, the " + "ratio of wing span to vertical tail moment arm." + ), + ) + self.add_input( + "wing_ref", + 12.615, + units="ft", + desc=( + "CBARW | B: Reference wing parameter for tail moment arm. " + "For a horizontal tail, the mean wing chord. For a " + "vertical tail, the wing span." + ), + ) self.add_input( "ar", 4.75, units="unitless", desc="ARHT | ARVT: Tail aspect ratio.") self.add_input( - "tr", 0.352, units="unitless", desc="SLMH | SLMV: Tail taper ratio.") + Aircraft.HorizontalTail.TAPER_RATIO, 0.352, units="unitless", desc="SLMH | SLMV: Tail taper ratio.") self.add_output("area", units="ft**2", desc="SHT | SVT: Tail area") self.add_output("span", units="ft", desc="BHT | BVT: Tail span") @@ -131,10 +146,10 @@ def setup_partials(self): self.declare_partials("area", ["vol_coef", Aircraft.Wing.AREA, "r_arm"]) self.declare_partials("span", ["vol_coef", Aircraft.Wing.AREA, "r_arm", "ar"]) self.declare_partials( - "rchord", ["vol_coef", Aircraft.Wing.AREA, "r_arm", "ar", "tr"] + "rchord", ["vol_coef", Aircraft.Wing.AREA, "r_arm", "ar", Aircraft.HorizontalTail.TAPER_RATIO] ) self.declare_partials( - "chord", ["vol_coef", Aircraft.Wing.AREA, "r_arm", "ar", "tr"] + "chord", ["vol_coef", Aircraft.Wing.AREA, "r_arm", "ar", Aircraft.HorizontalTail.TAPER_RATIO] ) self.declare_partials("arm", ["r_arm", "wing_ref"]) @@ -171,14 +186,14 @@ def compute_partials(self, inputs, J): J["rchord", Aircraft.Wing.AREA] = vol_coef * r_arm / cse2 J["rchord", "r_arm"] = wing_area * vol_coef / cse2 J["rchord", "ar"] = -vol_coef * wing_area * r_arm / (ar * cse2) - J["rchord", "tr"] = -2 * vol_coef * wing_area * r_arm / (cse2 * (tr + 1)) + J["rchord", Aircraft.HorizontalTail.TAPER_RATIO] = -2 * vol_coef * wing_area * r_arm / (cse2 * (tr + 1)) cse3 = tr - (tr / (tr + 1)) + 1 J["chord", "vol_coef"] = 2 / 3.0 * wing_area * r_arm * cse3 / cse2 J["chord", Aircraft.Wing.AREA] = 2 / 3.0 * vol_coef * r_arm * cse3 / cse2 J["chord", "r_arm"] = 2 / 3.0 * vol_coef * wing_area * cse3 / cse2 J["chord", "ar"] = -2 / 3.0 * vol_coef * wing_area * r_arm * cse3 / (ar * cse2) - J["chord", "tr"] = 4 / 3.0 * cse1 * (tr - 1) / (ar * (tr + 1) ** 3) + J["chord", Aircraft.HorizontalTail.TAPER_RATIO] = 4 / 3.0 * cse1 * (tr - 1) / (ar * (tr + 1) ** 3) J["arm", "r_arm"] = -wing_ref / r_arm**2 J["arm", "wing_ref"] = 1.0 / r_arm @@ -218,7 +233,7 @@ def setup(self): ] higher_level_inputs_htail = [ ("wing_ref", Aircraft.Wing.AVERAGE_CHORD), - ("tr", Aircraft.HorizontalTail.TAPER_RATIO), + # ("tr", Aircraft.HorizontalTail.TAPER_RATIO), ] higher_level_inputs_vtail = [ ("wing_ref", Aircraft.Wing.SPAN), @@ -232,7 +247,7 @@ def setup(self): ] rename_inputs_vtail = [ ("r_arm", Aircraft.VerticalTail.MOMENT_RATIO), - ("tr", Aircraft.VerticalTail.TAPER_RATIO), + # ("tr", Aircraft.VerticalTail.TAPER_RATIO), ] # outputs that are used in groups other than this one From 71dcb326958b4cfdb69b28df0e0d3388e65b7913 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 14:00:51 -0800 Subject: [PATCH 32/54] autopep8 --- aviary/subsystems/geometry/gasp_based/empennage.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index be5c6de1c..57c8210a8 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -146,10 +146,12 @@ def setup_partials(self): self.declare_partials("area", ["vol_coef", Aircraft.Wing.AREA, "r_arm"]) self.declare_partials("span", ["vol_coef", Aircraft.Wing.AREA, "r_arm", "ar"]) self.declare_partials( - "rchord", ["vol_coef", Aircraft.Wing.AREA, "r_arm", "ar", Aircraft.HorizontalTail.TAPER_RATIO] + "rchord", ["vol_coef", Aircraft.Wing.AREA, "r_arm", + "ar", Aircraft.HorizontalTail.TAPER_RATIO] ) self.declare_partials( - "chord", ["vol_coef", Aircraft.Wing.AREA, "r_arm", "ar", Aircraft.HorizontalTail.TAPER_RATIO] + "chord", ["vol_coef", Aircraft.Wing.AREA, "r_arm", + "ar", Aircraft.HorizontalTail.TAPER_RATIO] ) self.declare_partials("arm", ["r_arm", "wing_ref"]) @@ -186,14 +188,16 @@ def compute_partials(self, inputs, J): J["rchord", Aircraft.Wing.AREA] = vol_coef * r_arm / cse2 J["rchord", "r_arm"] = wing_area * vol_coef / cse2 J["rchord", "ar"] = -vol_coef * wing_area * r_arm / (ar * cse2) - J["rchord", Aircraft.HorizontalTail.TAPER_RATIO] = -2 * vol_coef * wing_area * r_arm / (cse2 * (tr + 1)) + J["rchord", Aircraft.HorizontalTail.TAPER_RATIO] = - \ + 2 * vol_coef * wing_area * r_arm / (cse2 * (tr + 1)) cse3 = tr - (tr / (tr + 1)) + 1 J["chord", "vol_coef"] = 2 / 3.0 * wing_area * r_arm * cse3 / cse2 J["chord", Aircraft.Wing.AREA] = 2 / 3.0 * vol_coef * r_arm * cse3 / cse2 J["chord", "r_arm"] = 2 / 3.0 * vol_coef * wing_area * cse3 / cse2 J["chord", "ar"] = -2 / 3.0 * vol_coef * wing_area * r_arm * cse3 / (ar * cse2) - J["chord", Aircraft.HorizontalTail.TAPER_RATIO] = 4 / 3.0 * cse1 * (tr - 1) / (ar * (tr + 1) ** 3) + J["chord", Aircraft.HorizontalTail.TAPER_RATIO] = 4 / \ + 3.0 * cse1 * (tr - 1) / (ar * (tr + 1) ** 3) J["arm", "r_arm"] = -wing_ref / r_arm**2 J["arm", "wing_ref"] = 1.0 / r_arm From 6ecc24c73848fb4cb8422e77ea1a061adc702122 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 14:55:39 -0800 Subject: [PATCH 33/54] try again: replace 'tr' by Aircraft.HorizontalTail.TAPER_RATIO in empennage.py --- .../geometry/gasp_based/empennage.py | 58 ++++++++----------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index 57c8210a8..f0f607ee8 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -38,23 +38,18 @@ def setup(self): else: self.k = [0.43, 0.38, 0.85] - add_aviary_input(self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION, val=0) + add_aviary_input(self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION) - add_aviary_input(self, Aircraft.Fuselage.LENGTH, val=129.4) + add_aviary_input(self, Aircraft.Fuselage.LENGTH) self.add_input("cab_w", 13.1, units="ft", desc="SWF: Cabin width") - add_aviary_input(self, Aircraft.Wing.AREA, val=1370) + add_aviary_input(self, Aircraft.Wing.AREA) - self.add_input( - "wing_ref", - 12.615, - units="ft", - desc=( - "CBARW | B: Wing reference parameter. Wing chord for a " - "horizontal tail. Wing span for a vertical tail." - ), - ) + self.add_input("wing_ref", 12.615, units="ft", desc=( + "CBARW | B: Wing reference parameter. Wing chord for a " + "horizontal tail. Wing span for a vertical tail."), + ) self.add_output( "vol_coef", units="unitless", desc="VBARH | VBARV: Tail volume coefficient") @@ -107,32 +102,23 @@ def setup(self): desc="VBARH | VBARV: Horizontal tail volume coefficient" ) - add_aviary_input(self, Aircraft.Wing.AREA, val=1370) - - self.add_input( - "r_arm", - 0.2307, - units="unitless", - desc=( - "COELTH | BOELTV: For a horizontal tail, the ratio of " - "wing chord to tail moment arm. For a vertical tail, the " - "ratio of wing span to vertical tail moment arm." - ), - ) - self.add_input( - "wing_ref", - 12.615, - units="ft", - desc=( - "CBARW | B: Reference wing parameter for tail moment arm. " - "For a horizontal tail, the mean wing chord. For a " - "vertical tail, the wing span." - ), - ) + add_aviary_input(self, Aircraft.Wing.AREA) + + self.add_input("r_arm", 0.2307, units="unitless", + desc=("COELTH | BOELTV: For a horizontal tail, the ratio of " + "wing chord to tail moment arm. For a vertical tail, the " + "ratio of wing span to vertical tail moment arm."), + ) + self.add_input("wing_ref", 12.615, units="ft", + desc=("CBARW | B: Reference wing parameter for tail moment arm. " + "For a horizontal tail, the mean wing chord. For a " + "vertical tail, the wing span."), + ) self.add_input( "ar", 4.75, units="unitless", desc="ARHT | ARVT: Tail aspect ratio.") self.add_input( - Aircraft.HorizontalTail.TAPER_RATIO, 0.352, units="unitless", desc="SLMH | SLMV: Tail taper ratio.") + Aircraft.HorizontalTail.TAPER_RATIO, 0.352, units="unitless", + desc="SLMH | SLMV: Tail taper ratio.") self.add_output("area", units="ft**2", desc="SHT | SVT: Tail area") self.add_output("span", units="ft", desc="BHT | BVT: Tail span") @@ -238,6 +224,7 @@ def setup(self): higher_level_inputs_htail = [ ("wing_ref", Aircraft.Wing.AVERAGE_CHORD), # ("tr", Aircraft.HorizontalTail.TAPER_RATIO), + Aircraft.HorizontalTail.TAPER_RATIO, ] higher_level_inputs_vtail = [ ("wing_ref", Aircraft.Wing.SPAN), @@ -252,6 +239,7 @@ def setup(self): rename_inputs_vtail = [ ("r_arm", Aircraft.VerticalTail.MOMENT_RATIO), # ("tr", Aircraft.VerticalTail.TAPER_RATIO), + Aircraft.HorizontalTail.TAPER_RATIO, ] # outputs that are used in groups other than this one From c6e41a5b32d1d784808ae47dc248e31544e37006 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 14:57:11 -0800 Subject: [PATCH 34/54] autopep8 --- aviary/subsystems/geometry/gasp_based/empennage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index f0f607ee8..fbcb6f080 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -117,7 +117,7 @@ def setup(self): self.add_input( "ar", 4.75, units="unitless", desc="ARHT | ARVT: Tail aspect ratio.") self.add_input( - Aircraft.HorizontalTail.TAPER_RATIO, 0.352, units="unitless", + Aircraft.HorizontalTail.TAPER_RATIO, 0.352, units="unitless", desc="SLMH | SLMV: Tail taper ratio.") self.add_output("area", units="ft**2", desc="SHT | SVT: Tail area") From a28ed810aeb12321d5c22c85a5c5886587cb8e12 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 31 Dec 2024 15:20:25 -0800 Subject: [PATCH 35/54] roll back empennage.py --- .../geometry/gasp_based/empennage.py | 74 ++++++++++--------- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index fbcb6f080..c0133bc54 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -38,18 +38,23 @@ def setup(self): else: self.k = [0.43, 0.38, 0.85] - add_aviary_input(self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION) + add_aviary_input(self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION, val=0) - add_aviary_input(self, Aircraft.Fuselage.LENGTH) + add_aviary_input(self, Aircraft.Fuselage.LENGTH, val=129.4) self.add_input("cab_w", 13.1, units="ft", desc="SWF: Cabin width") - add_aviary_input(self, Aircraft.Wing.AREA) + add_aviary_input(self, Aircraft.Wing.AREA, val=1370) - self.add_input("wing_ref", 12.615, units="ft", desc=( - "CBARW | B: Wing reference parameter. Wing chord for a " - "horizontal tail. Wing span for a vertical tail."), - ) + self.add_input( + "wing_ref", + 12.615, + units="ft", + desc=( + "CBARW | B: Wing reference parameter. Wing chord for a " + "horizontal tail. Wing span for a vertical tail." + ), + ) self.add_output( "vol_coef", units="unitless", desc="VBARH | VBARV: Tail volume coefficient") @@ -102,23 +107,32 @@ def setup(self): desc="VBARH | VBARV: Horizontal tail volume coefficient" ) - add_aviary_input(self, Aircraft.Wing.AREA) - - self.add_input("r_arm", 0.2307, units="unitless", - desc=("COELTH | BOELTV: For a horizontal tail, the ratio of " - "wing chord to tail moment arm. For a vertical tail, the " - "ratio of wing span to vertical tail moment arm."), - ) - self.add_input("wing_ref", 12.615, units="ft", - desc=("CBARW | B: Reference wing parameter for tail moment arm. " - "For a horizontal tail, the mean wing chord. For a " - "vertical tail, the wing span."), - ) + add_aviary_input(self, Aircraft.Wing.AREA, val=1370) + + self.add_input( + "r_arm", + 0.2307, + units="unitless", + desc=( + "COELTH | BOELTV: For a horizontal tail, the ratio of " + "wing chord to tail moment arm. For a vertical tail, the " + "ratio of wing span to vertical tail moment arm." + ), + ) + self.add_input( + "wing_ref", + 12.615, + units="ft", + desc=( + "CBARW | B: Reference wing parameter for tail moment arm. " + "For a horizontal tail, the mean wing chord. For a " + "vertical tail, the wing span." + ), + ) self.add_input( "ar", 4.75, units="unitless", desc="ARHT | ARVT: Tail aspect ratio.") self.add_input( - Aircraft.HorizontalTail.TAPER_RATIO, 0.352, units="unitless", - desc="SLMH | SLMV: Tail taper ratio.") + "tr", 0.352, units="unitless", desc="SLMH | SLMV: Tail taper ratio.") self.add_output("area", units="ft**2", desc="SHT | SVT: Tail area") self.add_output("span", units="ft", desc="BHT | BVT: Tail span") @@ -132,12 +146,10 @@ def setup_partials(self): self.declare_partials("area", ["vol_coef", Aircraft.Wing.AREA, "r_arm"]) self.declare_partials("span", ["vol_coef", Aircraft.Wing.AREA, "r_arm", "ar"]) self.declare_partials( - "rchord", ["vol_coef", Aircraft.Wing.AREA, "r_arm", - "ar", Aircraft.HorizontalTail.TAPER_RATIO] + "rchord", ["vol_coef", Aircraft.Wing.AREA, "r_arm", "ar", "tr"] ) self.declare_partials( - "chord", ["vol_coef", Aircraft.Wing.AREA, "r_arm", - "ar", Aircraft.HorizontalTail.TAPER_RATIO] + "chord", ["vol_coef", Aircraft.Wing.AREA, "r_arm", "ar", "tr"] ) self.declare_partials("arm", ["r_arm", "wing_ref"]) @@ -174,16 +186,14 @@ def compute_partials(self, inputs, J): J["rchord", Aircraft.Wing.AREA] = vol_coef * r_arm / cse2 J["rchord", "r_arm"] = wing_area * vol_coef / cse2 J["rchord", "ar"] = -vol_coef * wing_area * r_arm / (ar * cse2) - J["rchord", Aircraft.HorizontalTail.TAPER_RATIO] = - \ - 2 * vol_coef * wing_area * r_arm / (cse2 * (tr + 1)) + J["rchord", "tr"] = -2 * vol_coef * wing_area * r_arm / (cse2 * (tr + 1)) cse3 = tr - (tr / (tr + 1)) + 1 J["chord", "vol_coef"] = 2 / 3.0 * wing_area * r_arm * cse3 / cse2 J["chord", Aircraft.Wing.AREA] = 2 / 3.0 * vol_coef * r_arm * cse3 / cse2 J["chord", "r_arm"] = 2 / 3.0 * vol_coef * wing_area * cse3 / cse2 J["chord", "ar"] = -2 / 3.0 * vol_coef * wing_area * r_arm * cse3 / (ar * cse2) - J["chord", Aircraft.HorizontalTail.TAPER_RATIO] = 4 / \ - 3.0 * cse1 * (tr - 1) / (ar * (tr + 1) ** 3) + J["chord", "tr"] = 4 / 3.0 * cse1 * (tr - 1) / (ar * (tr + 1) ** 3) J["arm", "r_arm"] = -wing_ref / r_arm**2 J["arm", "wing_ref"] = 1.0 / r_arm @@ -223,8 +233,7 @@ def setup(self): ] higher_level_inputs_htail = [ ("wing_ref", Aircraft.Wing.AVERAGE_CHORD), - # ("tr", Aircraft.HorizontalTail.TAPER_RATIO), - Aircraft.HorizontalTail.TAPER_RATIO, + ("tr", Aircraft.HorizontalTail.TAPER_RATIO), ] higher_level_inputs_vtail = [ ("wing_ref", Aircraft.Wing.SPAN), @@ -238,8 +247,7 @@ def setup(self): ] rename_inputs_vtail = [ ("r_arm", Aircraft.VerticalTail.MOMENT_RATIO), - # ("tr", Aircraft.VerticalTail.TAPER_RATIO), - Aircraft.HorizontalTail.TAPER_RATIO, + ("tr", Aircraft.VerticalTail.TAPER_RATIO), ] # outputs that are used in groups other than this one From 4534b1fb18987f87fcffc2f8d713029b1588e37e Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Thu, 2 Jan 2025 11:23:09 -0800 Subject: [PATCH 36/54] set more variables to defaults in prep_geom.py --- .../geometry/flops_based/prep_geom.py | 53 +++++++++---------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/aviary/subsystems/geometry/flops_based/prep_geom.py b/aviary/subsystems/geometry/flops_based/prep_geom.py index 896ac70b7..5e2520f46 100644 --- a/aviary/subsystems/geometry/flops_based/prep_geom.py +++ b/aviary/subsystems/geometry/flops_based/prep_geom.py @@ -501,10 +501,10 @@ def setup(self): self.add_input(Names.XDX, 0.0, units='unitless') self.add_input(Names.XMULT, 0.0, units='unitless') - add_aviary_input(self, Aircraft.Wing.AREA, 0.0) - add_aviary_input(self, Aircraft.Wing.WETTED_AREA_SCALER, 1.0) + add_aviary_input(self, Aircraft.Wing.AREA) + add_aviary_input(self, Aircraft.Wing.WETTED_AREA_SCALER) - add_aviary_output(self, Aircraft.Wing.WETTED_AREA, 0.0) + add_aviary_output(self, Aircraft.Wing.WETTED_AREA) def setup_partials(self): self.declare_partials( @@ -579,19 +579,17 @@ def setup(self): self.add_input(Names.XMULTH, 0.0, units='unitless') self.add_input(Names.XMULTV, 0.0, units='unitless') - add_aviary_input(self, Aircraft.HorizontalTail.AREA, 0.0) + add_aviary_input(self, Aircraft.HorizontalTail.AREA) - add_aviary_input( - self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION, 0.0 - ) + add_aviary_input(self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION) - add_aviary_input(self, Aircraft.HorizontalTail.WETTED_AREA_SCALER, 1.0) + add_aviary_input(self, Aircraft.HorizontalTail.WETTED_AREA_SCALER) - add_aviary_input(self, Aircraft.VerticalTail.AREA, 0.0) - add_aviary_input(self, Aircraft.VerticalTail.WETTED_AREA_SCALER, 1.0) + add_aviary_input(self, Aircraft.VerticalTail.AREA) + add_aviary_input(self, Aircraft.VerticalTail.WETTED_AREA_SCALER) - add_aviary_output(self, Aircraft.HorizontalTail.WETTED_AREA, 0.0) - add_aviary_output(self, Aircraft.VerticalTail.WETTED_AREA, 0.0) + add_aviary_output(self, Aircraft.HorizontalTail.WETTED_AREA) + add_aviary_output(self, Aircraft.VerticalTail.WETTED_AREA) def setup_partials(self): self.declare_partials( @@ -743,27 +741,24 @@ def setup(self): self.add_input(Names.CROTVT, 0.0, units='unitless') self.add_input(Names.CRTHTB, 0.0, units='unitless') - add_aviary_input(self, Aircraft.Fuselage.AVG_DIAMETER, 0.0) - add_aviary_input(self, Aircraft.Fuselage.LENGTH, 0.0) - add_aviary_input(self, Aircraft.Fuselage.WETTED_AREA_SCALER, 1.0) - - add_aviary_input(self, Aircraft.HorizontalTail.THICKNESS_TO_CHORD, 0.0) + add_aviary_input(self, Aircraft.Fuselage.AVG_DIAMETER) + add_aviary_input(self, Aircraft.Fuselage.LENGTH) + add_aviary_input(self, Aircraft.Fuselage.WETTED_AREA_SCALER) - add_aviary_input( - self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION, 0.0 - ) + add_aviary_input(self, Aircraft.HorizontalTail.THICKNESS_TO_CHORD) + add_aviary_input(self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION) - add_aviary_input(self, Aircraft.VerticalTail.THICKNESS_TO_CHORD, 0.0) + add_aviary_input(self, Aircraft.VerticalTail.THICKNESS_TO_CHORD) - add_aviary_input(self, Aircraft.Wing.AREA, 0.0) - add_aviary_input(self, Aircraft.Wing.ASPECT_RATIO, 0.0) - add_aviary_input(self, Aircraft.Wing.GLOVE_AND_BAT, 0.0) - add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD, 0.0) + add_aviary_input(self, Aircraft.Wing.AREA) + add_aviary_input(self, Aircraft.Wing.ASPECT_RATIO) + add_aviary_input(self, Aircraft.Wing.GLOVE_AND_BAT) + add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD) - add_aviary_output(self, Aircraft.Fuselage.CROSS_SECTION, 0.0) - add_aviary_output(self, Aircraft.Fuselage.DIAMETER_TO_WING_SPAN, 0.0) - add_aviary_output(self, Aircraft.Fuselage.LENGTH_TO_DIAMETER, 0.0) - add_aviary_output(self, Aircraft.Fuselage.WETTED_AREA, 0.0) + add_aviary_output(self, Aircraft.Fuselage.CROSS_SECTION) + add_aviary_output(self, Aircraft.Fuselage.DIAMETER_TO_WING_SPAN) + add_aviary_output(self, Aircraft.Fuselage.LENGTH_TO_DIAMETER) + add_aviary_output(self, Aircraft.Fuselage.WETTED_AREA) def setup_partials(self): self.declare_partials( From 944930ef4d6c86dab5870567faf10eacdcbb7f64 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Thu, 2 Jan 2025 11:25:19 -0800 Subject: [PATCH 37/54] Changed Aircraft.Fuselage.LENGTH from 129.4 to 0.0. Changed Aircraft.Wing.AREA from 1370 to 0.0. --- .../geometry/gasp_based/empennage.py | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index c0133bc54..db9bdd0a5 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -38,23 +38,19 @@ def setup(self): else: self.k = [0.43, 0.38, 0.85] - add_aviary_input(self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION, val=0) + add_aviary_input(self, Aircraft.HorizontalTail.VERTICAL_TAIL_FRACTION) - add_aviary_input(self, Aircraft.Fuselage.LENGTH, val=129.4) + add_aviary_input(self, Aircraft.Fuselage.LENGTH) self.add_input("cab_w", 13.1, units="ft", desc="SWF: Cabin width") - add_aviary_input(self, Aircraft.Wing.AREA, val=1370) + add_aviary_input(self, Aircraft.Wing.AREA) - self.add_input( - "wing_ref", - 12.615, - units="ft", - desc=( - "CBARW | B: Wing reference parameter. Wing chord for a " - "horizontal tail. Wing span for a vertical tail." - ), - ) + self.add_input("wing_ref", 12.615, units="ft", + desc=( + "CBARW | B: Wing reference parameter. Wing chord for a " + "horizontal tail. Wing span for a vertical tail.") + ) self.add_output( "vol_coef", units="unitless", desc="VBARH | VBARV: Tail volume coefficient") From 15fd751c67d2b2a52f7e25618cb59398bb11bf83 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Thu, 2 Jan 2025 11:32:00 -0800 Subject: [PATCH 38/54] Changed Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH from 9.5 to 0.0. Changed Aircraft.Fuselage.TAIL_FINENESS from 3 to default(1). --- aviary/subsystems/geometry/gasp_based/fuselage.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/fuselage.py b/aviary/subsystems/geometry/gasp_based/fuselage.py index 1239b431c..bd9527d79 100644 --- a/aviary/subsystems/geometry/gasp_based/fuselage.py +++ b/aviary/subsystems/geometry/gasp_based/fuselage.py @@ -117,18 +117,17 @@ def initialize(self): ) def setup(self): - add_aviary_input(self, Aircraft.Fuselage.NOSE_FINENESS, val=1) + add_aviary_input(self, Aircraft.Fuselage.NOSE_FINENESS) self.add_input("nose_height", val=0, units="ft", desc="HN: height of nose") - add_aviary_input(self, Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH, val=9.5) + add_aviary_input(self, Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH) self.add_input("cabin_len", val=0, units="ft", desc="LC: length of cabin") - add_aviary_input(self, Aircraft.Fuselage.TAIL_FINENESS, val=3) + add_aviary_input(self, Aircraft.Fuselage.TAIL_FINENESS) self.add_input("cabin_height", val=0, units="ft", desc="HC: height of cabin") - add_aviary_input(self, Aircraft.Fuselage.WETTED_AREA_SCALER, - val=1, units="unitless") + add_aviary_input(self, Aircraft.Fuselage.WETTED_AREA_SCALER) - add_aviary_output(self, Aircraft.Fuselage.LENGTH, val=0) - add_aviary_output(self, Aircraft.Fuselage.WETTED_AREA, val=0) - add_aviary_output(self, Aircraft.TailBoom.LENGTH, val=0) + add_aviary_output(self, Aircraft.Fuselage.LENGTH) + add_aviary_output(self, Aircraft.Fuselage.WETTED_AREA) + add_aviary_output(self, Aircraft.TailBoom.LENGTH) self.declare_partials( Aircraft.Fuselage.LENGTH, From 2502fec980730a4d666c30a470e56d023234e906 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Thu, 2 Jan 2025 11:32:57 -0800 Subject: [PATCH 39/54] added a couple of default_value=0.0 --- aviary/variable_info/variable_meta_data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aviary/variable_info/variable_meta_data.py b/aviary/variable_info/variable_meta_data.py index 24b47761c..bbc6a88b4 100644 --- a/aviary/variable_info/variable_meta_data.py +++ b/aviary/variable_info/variable_meta_data.py @@ -3097,6 +3097,7 @@ }, units='unitless', desc='fuselage diameter to wing span ratio', + default_value=0.0, # added ) add_meta_data( @@ -3194,6 +3195,7 @@ }, units='unitless', desc='fuselage length to diameter ratio', + default_value=0.0, # added ) add_meta_data( From 1edb4ec2b47b75888abe94c26b5c395ccfb48ccf Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Thu, 2 Jan 2025 12:00:53 -0800 Subject: [PATCH 40/54] commented out set_input_defaults(Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH, val=9.5) for testing --- aviary/subsystems/geometry/gasp_based/fuselage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/fuselage.py b/aviary/subsystems/geometry/gasp_based/fuselage.py index bd9527d79..7968ebeb4 100644 --- a/aviary/subsystems/geometry/gasp_based/fuselage.py +++ b/aviary/subsystems/geometry/gasp_based/fuselage.py @@ -282,5 +282,5 @@ def setup(self): promotes_outputs=["aircraft:*"], ) - self.set_input_defaults( - Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH, val=9.5, units="ft") + # self.set_input_defaults( + # Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH, val=9.5, units="ft") From ace57d227d0b49db57d295261791290b0897a73b Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Thu, 2 Jan 2025 12:18:30 -0800 Subject: [PATCH 41/54] commented out four set_input_defaults() lines for testing. --- aviary/subsystems/geometry/gasp_based/wing.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/wing.py b/aviary/subsystems/geometry/gasp_based/wing.py index 5b0058c79..65d14771b 100644 --- a/aviary/subsystems/geometry/gasp_based/wing.py +++ b/aviary/subsystems/geometry/gasp_based/wing.py @@ -1011,11 +1011,11 @@ def setup(self): self.promotes("strut", outputs=["strut_y"]) self.promotes("fold", inputs=["strut_y"]) - self.set_input_defaults(Aircraft.Wing.ASPECT_RATIO, val=10.13, units="unitless") - self.set_input_defaults(Aircraft.Wing.TAPER_RATIO, val=0.33, units="unitless") - self.set_input_defaults( - Aircraft.Wing.THICKNESS_TO_CHORD_ROOT, val=0.11, units="unitless" - ) - self.set_input_defaults( - Aircraft.Wing.THICKNESS_TO_CHORD_TIP, val=0.1, units="unitless" - ) + # self.set_input_defaults(Aircraft.Wing.ASPECT_RATIO, val=10.13, units="unitless") + # self.set_input_defaults(Aircraft.Wing.TAPER_RATIO, val=0.33, units="unitless") + # self.set_input_defaults( + # Aircraft.Wing.THICKNESS_TO_CHORD_ROOT, val=0.11, units="unitless" + # ) + # self.set_input_defaults( + # Aircraft.Wing.THICKNESS_TO_CHORD_TIP, val=0.1, units="unitless" + # ) From fd4fa9f70cc3c66839ecb8ea201c6dc28189d452 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Thu, 2 Jan 2025 13:28:53 -0800 Subject: [PATCH 42/54] moved set_input_defaults to unit test (WingGroupTestCase4). --- aviary/subsystems/geometry/gasp_based/test/test_wing.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aviary/subsystems/geometry/gasp_based/test/test_wing.py b/aviary/subsystems/geometry/gasp_based/test/test_wing.py index 64bb9d789..5fc5028c4 100644 --- a/aviary/subsystems/geometry/gasp_based/test/test_wing.py +++ b/aviary/subsystems/geometry/gasp_based/test/test_wing.py @@ -604,6 +604,15 @@ def setUp(self): Aircraft.Fuel.WING_FUEL_FRACTION, val=.6, units='unitless' ) + self.prob.model.set_input_defaults(Aircraft.Wing.ASPECT_RATIO, val=10.13, units="unitless") + self.prob.model.set_input_defaults(Aircraft.Wing.TAPER_RATIO, val=0.33, units="unitless") + self.prob.model.set_input_defaults( + Aircraft.Wing.THICKNESS_TO_CHORD_ROOT, val=0.11, units="unitless" + ) + self.prob.model.set_input_defaults( + Aircraft.Wing.THICKNESS_TO_CHORD_TIP, val=0.1, units="unitless" + ) + self.prob.setup(check=False, force_alloc_complex=True) def test_case1(self): From a67e11cfb442b75181ff0b31b4e2ed867acfcd35 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Thu, 2 Jan 2025 13:35:59 -0800 Subject: [PATCH 43/54] commented out set_input_defaults() lines in EmpennageSize. --- aviary/subsystems/geometry/gasp_based/empennage.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index db9bdd0a5..85ca5f502 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -319,11 +319,11 @@ def setup(self): promotes_outputs=higher_level_outputs_vtail + rename_outputs_vtail, ) - self.set_input_defaults(Aircraft.Wing.AVERAGE_CHORD, 12.615, units="ft") - self.set_input_defaults(Aircraft.Wing.SPAN, 117.8054, units="ft") + # self.set_input_defaults(Aircraft.Wing.AVERAGE_CHORD, 12.615, units="ft") + # self.set_input_defaults(Aircraft.Wing.SPAN, 117.8054, units="ft") # override horizontal tail defaults - self.set_input_defaults(Aircraft.VerticalTail.VOLUME_COEFFICIENT, 0.145) - self.set_input_defaults(Aircraft.VerticalTail.MOMENT_RATIO, 2.362) - self.set_input_defaults(Aircraft.VerticalTail.ASPECT_RATIO, 1.67) - self.set_input_defaults(Aircraft.VerticalTail.TAPER_RATIO, 0.801) + # self.set_input_defaults(Aircraft.VerticalTail.VOLUME_COEFFICIENT, 0.145) + # self.set_input_defaults(Aircraft.VerticalTail.MOMENT_RATIO, 2.362) + # self.set_input_defaults(Aircraft.VerticalTail.ASPECT_RATIO, 1.67) + # self.set_input_defaults(Aircraft.VerticalTail.TAPER_RATIO, 0.801) From 82496efd99bc2968fac35cc87660c79ec23a8a18 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Thu, 2 Jan 2025 13:38:52 -0800 Subject: [PATCH 44/54] autopep8 --- aviary/subsystems/geometry/gasp_based/test/test_wing.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/test/test_wing.py b/aviary/subsystems/geometry/gasp_based/test/test_wing.py index 5fc5028c4..b1af68a1f 100644 --- a/aviary/subsystems/geometry/gasp_based/test/test_wing.py +++ b/aviary/subsystems/geometry/gasp_based/test/test_wing.py @@ -604,8 +604,10 @@ def setUp(self): Aircraft.Fuel.WING_FUEL_FRACTION, val=.6, units='unitless' ) - self.prob.model.set_input_defaults(Aircraft.Wing.ASPECT_RATIO, val=10.13, units="unitless") - self.prob.model.set_input_defaults(Aircraft.Wing.TAPER_RATIO, val=0.33, units="unitless") + self.prob.model.set_input_defaults( + Aircraft.Wing.ASPECT_RATIO, val=10.13, units="unitless") + self.prob.model.set_input_defaults( + Aircraft.Wing.TAPER_RATIO, val=0.33, units="unitless") self.prob.model.set_input_defaults( Aircraft.Wing.THICKNESS_TO_CHORD_ROOT, val=0.11, units="unitless" ) From 61bacadeae8dc91c4157b3a64c1295291f5d79fe Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Thu, 2 Jan 2025 15:09:33 -0800 Subject: [PATCH 45/54] set_input_defaults(Aircraft.VerticalTail.ASPECT_RATIO, 0.0) and set_input_defaults(Aircraft.VerticalTail.TAPER_RATIO, 0.0) --- aviary/subsystems/geometry/gasp_based/empennage.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index 85ca5f502..d73efa5c0 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -319,11 +319,7 @@ def setup(self): promotes_outputs=higher_level_outputs_vtail + rename_outputs_vtail, ) - # self.set_input_defaults(Aircraft.Wing.AVERAGE_CHORD, 12.615, units="ft") - # self.set_input_defaults(Aircraft.Wing.SPAN, 117.8054, units="ft") - - # override horizontal tail defaults - # self.set_input_defaults(Aircraft.VerticalTail.VOLUME_COEFFICIENT, 0.145) - # self.set_input_defaults(Aircraft.VerticalTail.MOMENT_RATIO, 2.362) - # self.set_input_defaults(Aircraft.VerticalTail.ASPECT_RATIO, 1.67) - # self.set_input_defaults(Aircraft.VerticalTail.TAPER_RATIO, 0.801) + + # override vertical tail defaults + self.set_input_defaults(Aircraft.VerticalTail.ASPECT_RATIO, 0.0) # 1.67 + self.set_input_defaults(Aircraft.VerticalTail.TAPER_RATIO, 0.0) # 0.801 From 43b6a4c884860700a518ddf9817da1d13824ff80 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Thu, 2 Jan 2025 15:11:58 -0800 Subject: [PATCH 46/54] autopep8 --- aviary/subsystems/geometry/gasp_based/empennage.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index d73efa5c0..994ed25ec 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -319,7 +319,6 @@ def setup(self): promotes_outputs=higher_level_outputs_vtail + rename_outputs_vtail, ) - # override vertical tail defaults self.set_input_defaults(Aircraft.VerticalTail.ASPECT_RATIO, 0.0) # 1.67 self.set_input_defaults(Aircraft.VerticalTail.TAPER_RATIO, 0.0) # 0.801 From f4c2e6b00c81b3a6a7fbbf6ac7aed21776a5e472 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Thu, 2 Jan 2025 15:47:38 -0800 Subject: [PATCH 47/54] minor updates --- .../geometry/gasp_based/empennage.py | 47 ++++++++----------- .../geometry/gasp_based/fuselage.py | 3 -- aviary/subsystems/geometry/gasp_based/wing.py | 9 ---- 3 files changed, 19 insertions(+), 40 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index 994ed25ec..e6f75250b 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -98,37 +98,28 @@ def initialize(self): def setup(self): # defaults here for Large Single Aisle 1 horizontal tail - self.add_input( - "vol_coef", 1.189, units="unitless", - desc="VBARH | VBARV: Horizontal tail volume coefficient" - ) + self.add_input("vol_coef", 1.189, units="unitless", + desc="VBARH | VBARV: Horizontal tail volume coefficient" + ) add_aviary_input(self, Aircraft.Wing.AREA, val=1370) - self.add_input( - "r_arm", - 0.2307, - units="unitless", - desc=( - "COELTH | BOELTV: For a horizontal tail, the ratio of " - "wing chord to tail moment arm. For a vertical tail, the " - "ratio of wing span to vertical tail moment arm." - ), - ) - self.add_input( - "wing_ref", - 12.615, - units="ft", - desc=( - "CBARW | B: Reference wing parameter for tail moment arm. " - "For a horizontal tail, the mean wing chord. For a " - "vertical tail, the wing span." - ), - ) - self.add_input( - "ar", 4.75, units="unitless", desc="ARHT | ARVT: Tail aspect ratio.") - self.add_input( - "tr", 0.352, units="unitless", desc="SLMH | SLMV: Tail taper ratio.") + self.add_input("r_arm", 0.2307, units="unitless", + desc=( + "COELTH | BOELTV: For a horizontal tail, the ratio of " + "wing chord to tail moment arm. For a vertical tail, the " + "ratio of wing span to vertical tail moment arm.") + ) + self.add_input("wing_ref", 12.615, units="ft", + desc=( + "CBARW | B: Reference wing parameter for tail moment arm. " + "For a horizontal tail, the mean wing chord. For a " + "vertical tail, the wing span.") + ) + self.add_input("ar", 4.75, units="unitless", + desc="ARHT | ARVT: Tail aspect ratio.") + self.add_input("tr", 0.352, units="unitless", + desc="SLMH | SLMV: Tail taper ratio.") self.add_output("area", units="ft**2", desc="SHT | SVT: Tail area") self.add_output("span", units="ft", desc="BHT | BVT: Tail span") diff --git a/aviary/subsystems/geometry/gasp_based/fuselage.py b/aviary/subsystems/geometry/gasp_based/fuselage.py index 7968ebeb4..17a6d2c89 100644 --- a/aviary/subsystems/geometry/gasp_based/fuselage.py +++ b/aviary/subsystems/geometry/gasp_based/fuselage.py @@ -281,6 +281,3 @@ def setup(self): promotes_inputs=connected_input_outputs + ["aircraft:*"], promotes_outputs=["aircraft:*"], ) - - # self.set_input_defaults( - # Aircraft.Fuselage.PILOT_COMPARTMENT_LENGTH, val=9.5, units="ft") diff --git a/aviary/subsystems/geometry/gasp_based/wing.py b/aviary/subsystems/geometry/gasp_based/wing.py index 65d14771b..5ea9be16d 100644 --- a/aviary/subsystems/geometry/gasp_based/wing.py +++ b/aviary/subsystems/geometry/gasp_based/wing.py @@ -1010,12 +1010,3 @@ def setup(self): check_fold_location_definition(None, aviary_options) self.promotes("strut", outputs=["strut_y"]) self.promotes("fold", inputs=["strut_y"]) - - # self.set_input_defaults(Aircraft.Wing.ASPECT_RATIO, val=10.13, units="unitless") - # self.set_input_defaults(Aircraft.Wing.TAPER_RATIO, val=0.33, units="unitless") - # self.set_input_defaults( - # Aircraft.Wing.THICKNESS_TO_CHORD_ROOT, val=0.11, units="unitless" - # ) - # self.set_input_defaults( - # Aircraft.Wing.THICKNESS_TO_CHORD_TIP, val=0.1, units="unitless" - # ) From 89c3424041ac87a89a2100ba7e00f8c0410c1023 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Thu, 9 Jan 2025 14:21:39 -0800 Subject: [PATCH 48/54] minor update --- aviary/variable_info/functions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aviary/variable_info/functions.py b/aviary/variable_info/functions.py index fbdd77a53..fa385de2a 100644 --- a/aviary/variable_info/functions.py +++ b/aviary/variable_info/functions.py @@ -100,6 +100,8 @@ def add_aviary_output(comp, varname, val=None, units=None, desc=None, shape_by_c meta_data: dict (Optional) Aviary metadata dictionary. If unspecified, the built-in metadata will be used. + shape: tuple + (Optional) shape for this input. """ meta = meta_data[varname] if units: From f613fdf5103c18103bc89f44f88c29168710b85e Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Fri, 10 Jan 2025 11:54:51 -0800 Subject: [PATCH 49/54] remove temperary comments. --- aviary/variable_info/variable_meta_data.py | 117 ++++++++++----------- 1 file changed, 55 insertions(+), 62 deletions(-) diff --git a/aviary/variable_info/variable_meta_data.py b/aviary/variable_info/variable_meta_data.py index a71ba424b..34be30a99 100644 --- a/aviary/variable_info/variable_meta_data.py +++ b/aviary/variable_info/variable_meta_data.py @@ -418,7 +418,7 @@ }, units='unitless', desc='canard theoretical aspect ratio', - default_value=0.0, # changed from None + default_value=0.0, ) add_meta_data( @@ -434,7 +434,7 @@ }, units='ft', desc='Reynolds characteristic length for the canard', - default_value=0.0, # added + default_value=0.0 ) add_meta_data( @@ -450,7 +450,7 @@ }, units='unitless', desc='canard fineness ratio', - default_value=0.0, # added + default_value=0.0 ) add_meta_data( @@ -555,7 +555,7 @@ }, units='ft**2', desc='canard wetted area', - default_value=0.0, # changed from None + default_value=0.0, ) add_meta_data( @@ -1582,7 +1582,7 @@ }, units='ft**2', desc='total aircraft wetted area', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -1706,7 +1706,7 @@ historical_name={"GASP": 'INGASP.LCABLE', "FLOPS": None, "LEAPS1": None}, units='ft', desc='length of cable for hybrid electric augmented system', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -2151,7 +2151,7 @@ historical_name={"GASP": 'INGASP.DIAM_REF', "FLOPS": None, "LEAPS1": None}, units='ft', desc='engine reference diameter', - default_value=0.0, # In geometry/gasp_based/engine.py, it was 5.8 + default_value=0.0, ) # NOTE This unscaled turbine (engine) weight is an input provided by the user, and is not @@ -2358,7 +2358,6 @@ units='unitless', desc='Engine wing mount locations as fractions of semispan; (NUM_WING_ENGINES)/2 values ' 'are input', - # In mass/gasp_based/fixed.py and geometry/gasp_based/electric.py, default was [0.35] default_value=np.array([0.0]), ) @@ -2878,7 +2877,6 @@ historical_name={"GASP": 'INGASP.SKWF', "FLOPS": None, "LEAPS1": None}, units='unitless', desc='fraction of total theoretical wing volume used for wing fuel', - # added. In geometry/gasp_based/wing.py, it was 0.6. In /mass/gasp_based/equipment_and_useful_load.py, it was 0.5. default_value=0.0, ) @@ -2962,7 +2960,7 @@ historical_name={"GASP": 'INGASP.FVOLW_GEOM', "FLOPS": None, "LEAPS1": None}, units='ft**3', desc='wing tank fuel volume based on geometry', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -3058,7 +3056,7 @@ }, units='ft', desc='average fuselage diameter', - default_value=0.0, # added. In several components, it was set to 10 or 13.1. + default_value=0.0, ) add_meta_data( @@ -3074,7 +3072,7 @@ }, units='ft', desc='Reynolds characteristic length for the fuselage', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -3095,7 +3093,7 @@ historical_name={"GASP": 'INGASP.HCK', "FLOPS": None, "LEAPS1": None}, units='ft', desc='mean fuselage cabin diameter minus mean fuselage nose diameter', - default_value=0.0, # In geometry/gasp_based/fuselage.py, it was 4.5. + default_value=0.0, ) add_meta_data( @@ -3108,7 +3106,7 @@ }, units='unitless', desc='fuselage diameter to wing span ratio', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -3124,7 +3122,7 @@ }, units='unitless', desc='fuselage fineness ratio', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -3193,7 +3191,7 @@ desc='Define the Fuselage total length. If total_length is not input for a ' 'passenger transport, LEAPS will calculate the fuselage length, width and ' 'depth and the length of the passenger compartment.', - default_value=0.0, # in several components, it was set to 129.4 or 200. + default_value=0.0, ) add_meta_data( @@ -3206,7 +3204,7 @@ }, units='unitless', desc='fuselage length to diameter ratio', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -3260,7 +3258,7 @@ }, units='ft', desc='maximum fuselage height', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -3378,7 +3376,7 @@ historical_name={"GASP": 'INGASP.ELPC', "FLOPS": None, "LEAPS1": None}, units='ft', desc='length of the pilot compartment', - default_value=0.0, # added. # In geometry/gasp_based/fuselage.py, it was 9.5 + default_value=0.0, ) add_meta_data( @@ -3391,7 +3389,7 @@ }, units='ft**2', desc='fuselage planform area', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -3449,7 +3447,7 @@ }, units='ft**2', desc='fuselage wetted area', - default_value=0.0, # changed from None + default_value=0.0, ) add_meta_data( @@ -3500,7 +3498,7 @@ }, units='unitless', desc='horizontal tail theoretical aspect ratio', - default_value=4.75, # changed from None + default_value=4.75, ) add_meta_data( @@ -3524,7 +3522,7 @@ }, units='ft', desc='Reynolds characteristic length for the horizontal tail', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -3540,7 +3538,7 @@ }, units='unitless', desc='horizontal tail fineness ratio', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -3676,8 +3674,7 @@ }, units='unitless', desc='horizontal tail theoretical taper ratio', - # In geometry/flops_based/prep_geom.py and mass/gasp_based/empennage.py, it was 0.352. - default_value=0.0, # changed from None. + default_value=0.0, ) add_meta_data( @@ -3707,7 +3704,7 @@ 'tail is mounted. Defaults: 0.0 == for body mounted (default for ' 'transport with all engines on wing); 1.0 == for T tail ' '(default for transport with multiple engines on fuselage)', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -3735,7 +3732,7 @@ }, units='ft**2', desc='horizontal tail wetted area', - default_value=0.0, # changed from None + default_value=0.0, ) add_meta_data( @@ -4090,7 +4087,7 @@ }, units='ft', desc='Average diameter of engine nacelles for each engine model', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -4105,7 +4102,7 @@ }, units='ft', desc='Average length of nacelles for each engine model', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -4121,7 +4118,7 @@ }, units='ft', desc='Reynolds characteristic length for nacelle for each engine model', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -4139,7 +4136,7 @@ historical_name={"GASP": 'INGASP.DNQDE', "FLOPS": None, "LEAPS1": None}, units="unitless", desc='ratio of nacelle diameter to engine core diameter', - default_value=1.25, # In geometry/gasp_based/engine.py, it was 1.25 + default_value=1.25, ) add_meta_data( @@ -4155,7 +4152,7 @@ }, units='unitless', desc='nacelle fineness ratio', - default_value=0.0, # added. # In geometry/gasp_based/engine.py, it was 2. + default_value=0.0, ) add_meta_data( @@ -4253,7 +4250,7 @@ }, units='ft**2', desc='total nacelles wetted area', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -4269,7 +4266,7 @@ }, units='ft**2', desc='wetted area of a single nacelle for each engine model', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -4528,7 +4525,7 @@ historical_name={"GASP": 'INGASP.SSTQSW', "FLOPS": None, "LEAPS1": None}, units='unitless', desc='ratio of strut area to wing area', - default_value=0.0, # added. In geometry/gasp_based/strut.py, it was set to .2. + default_value=0.0, ) add_meta_data( @@ -4541,7 +4538,7 @@ }, units='ft', desc='attachment location of strut the full attachment-to-attachment span', - default_value=0.0, # added + default_value=0.0, ) # related to Aircraft.Strut.ATTACHMENT_LOCATION @@ -4551,7 +4548,7 @@ historical_name={"GASP": None, "FLOPS": None, "LEAPS1": None}, units='unitless', desc='attachment location of strut as fraction of the half-span', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -4560,7 +4557,7 @@ historical_name={"GASP": 'INGASP.STRTCHD', "FLOPS": None, "LEAPS1": None}, units='ft', desc='chord of the strut', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -4678,7 +4675,7 @@ }, units='unitless', desc='vertical tail theoretical aspect ratio', - default_value=0.0, # changed from None + default_value=0.0, ) add_meta_data( @@ -4702,7 +4699,7 @@ }, units='ft', desc='Reynolds characteristic length for the vertical tail', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -4718,7 +4715,7 @@ }, units='unitless', desc='vertical tail fineness ratio', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -4869,7 +4866,7 @@ }, units='unitless', desc='vertical tail theoretical taper ratio', - default_value=0.0, # changed from None + default_value=0.0, ) add_meta_data( @@ -4912,7 +4909,7 @@ }, units='ft**2', desc='vertical tails wetted area', - default_value=0.0, # changed from None + default_value=0.0, ) add_meta_data( @@ -5002,7 +4999,7 @@ }, units='ft**2', desc='reference wing area', - default_value=0.0, # In several components, it was set to 100, 150, 200, 1370.3 etc. + default_value=0.0, ) add_meta_data( @@ -5028,7 +5025,7 @@ }, units='unitless', desc='ratio of the wing span to its mean chord', - default_value=0.0, # in several components, it was 1 or 10.13. + default_value=0.0, ) add_meta_data( @@ -5049,7 +5046,7 @@ historical_name={"GASP": 'INGASP.CBARW', "FLOPS": None, "LEAPS1": None}, units='ft', desc='mean aerodynamic chord of the wing', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -5127,7 +5124,7 @@ historical_name={"GASP": 'INGASP.CRCLW', "FLOPS": None, "LEAPS1": None}, units='ft', desc='wing chord at fuselage centerline', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -5152,7 +5149,7 @@ }, units='ft', desc='Reynolds characteristic length for the wing', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -5285,7 +5282,7 @@ }, units='unitless', desc='wing fineness ratio', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -5387,7 +5384,6 @@ historical_name={"GASP": 'INGASP.YWFOLD', "FLOPS": None, "LEAPS1": None}, units='ft', desc='folded wingspan', - # In geometry/gasp_based/non_dimensional_conversion.py and geometry/gasp_based/wing.py, it was 25. default_value=0, ) @@ -5547,7 +5543,7 @@ historical_name={"GASP": 'INGASP.SWPLE', "FLOPS": None, "LEAPS1": None}, units='rad', desc='sweep angle at leading edge of wing', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -5602,7 +5598,7 @@ }, units='lbf/ft**2', desc='wing loading', - default_value=0.0, # added. In several components, it was 128. + default_value=0.0, ) add_meta_data( @@ -5819,7 +5815,7 @@ }, units='ft', desc='wing chord length at wing root', - default_value=0.0, # added + default_value=0.0, ) add_meta_data( @@ -5895,7 +5891,6 @@ }, units='ft', desc='span of main wing', - # in several components, it was set to 128, or 117.8 but there are other values. default_value=0.0, ) @@ -6010,7 +6005,6 @@ }, units='deg', desc='quarter-chord sweep angle of the wing', - # In several components, it was 0.436 (rad) or 25 (deg). default_value=0.0, # TODO required. ) @@ -6036,7 +6030,7 @@ }, units='unitless', desc='taper ratio of the wing', - default_value=0.0, # TODO required. In several components, it was .33. + default_value=0.0, # TODO required. ) add_meta_data( @@ -6097,7 +6091,7 @@ historical_name={"GASP": 'INGASP.TCR', "FLOPS": None, "LEAPS1": None}, units='unitless', desc='thickness-to-chord ratio at the root of the wing', - default_value=0.0, # added. In several components, it was 0.11 or 0.15. + default_value=0.0, ) add_meta_data( @@ -6106,7 +6100,7 @@ historical_name={"GASP": 'INGASP.TCT', "FLOPS": None, "LEAPS1": None}, units='unitless', desc='thickness-to-chord ratio at the tip of the wing', - default_value=0.0, # added. In geometry/gasp_based/wing.py, it was 0.1 + default_value=0.0, ) add_meta_data( @@ -6115,7 +6109,7 @@ historical_name={"GASP": 'INGASP.TC', "FLOPS": None, "LEAPS1": None}, units='unitless', desc='wing thickness-chord ratio at the wing station of the mean aerodynamic chord', - default_value=0.0, # added. In geometry/gasp_based/wing.py, it was 0.1. + default_value=0.0, ) add_meta_data( @@ -6163,7 +6157,7 @@ }, units='ft**2', desc='wing wetted area', - default_value=0.0, # changed from None + default_value=0.0, ) add_meta_data( @@ -6797,7 +6791,6 @@ }, units='lbm', desc='design gross mass of the aircraft', - # changed form None. In several components, it was set to 20000, 152000 or 175400. default_value=0.0, ) From 97f19bbb1035eef35f1ac9e8f917c145c6a621b6 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Fri, 10 Jan 2025 13:33:24 -0800 Subject: [PATCH 50/54] remove two comments --- aviary/subsystems/geometry/gasp_based/empennage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index dddcc35ee..1b6b922ab 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -295,5 +295,5 @@ def setup(self): ) # override vertical tail defaults - self.set_input_defaults(Aircraft.VerticalTail.ASPECT_RATIO, 0.0) # 1.67 - self.set_input_defaults(Aircraft.VerticalTail.TAPER_RATIO, 0.0) # 0.801 + self.set_input_defaults(Aircraft.VerticalTail.ASPECT_RATIO, 0.0) + self.set_input_defaults(Aircraft.VerticalTail.TAPER_RATIO, 0.0) From 159b81c1300b77f931168b663c4f1bbc684cbeaa Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Fri, 10 Jan 2025 15:23:10 -0800 Subject: [PATCH 51/54] remove val= from individual components --- aviary/subsystems/geometry/gasp_based/empennage.py | 2 +- .../geometry/gasp_based/non_dimensional_conversion.py | 4 ++-- aviary/subsystems/geometry/gasp_based/wing.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index 1b6b922ab..336b369dc 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -90,7 +90,7 @@ def setup(self): desc="VBARH | VBARV: Horizontal tail volume coefficient" ) - add_aviary_input(self, Aircraft.Wing.AREA, val=1370) + add_aviary_input(self, Aircraft.Wing.AREA) self.add_input("r_arm", 0.2307, units="unitless", desc=( diff --git a/aviary/subsystems/geometry/gasp_based/non_dimensional_conversion.py b/aviary/subsystems/geometry/gasp_based/non_dimensional_conversion.py index 9d905d987..bdb03ae32 100644 --- a/aviary/subsystems/geometry/gasp_based/non_dimensional_conversion.py +++ b/aviary/subsystems/geometry/gasp_based/non_dimensional_conversion.py @@ -14,7 +14,7 @@ def initialize(self): add_aviary_option(self, Aircraft.Wing.HAS_STRUT) def setup(self): - add_aviary_input(self, Aircraft.Wing.SPAN, val=0) + add_aviary_input(self, Aircraft.Wing.SPAN) if self.options[Aircraft.Strut.DIMENSIONAL_LOCATION_SPECIFIED]: add_aviary_input(self, Aircraft.Strut.ATTACHMENT_LOCATION) @@ -70,7 +70,7 @@ def initialize(self): add_aviary_option(self, Aircraft.Wing.FOLD_DIMENSIONAL_LOCATION_SPECIFIED) def setup(self): - add_aviary_input(self, Aircraft.Wing.SPAN, val=0) + add_aviary_input(self, Aircraft.Wing.SPAN) if self.options[Aircraft.Wing.FOLD_DIMENSIONAL_LOCATION_SPECIFIED]: add_aviary_input(self, Aircraft.Wing.FOLDED_SPAN) diff --git a/aviary/subsystems/geometry/gasp_based/wing.py b/aviary/subsystems/geometry/gasp_based/wing.py index c2fd11e27..ed960ba01 100644 --- a/aviary/subsystems/geometry/gasp_based/wing.py +++ b/aviary/subsystems/geometry/gasp_based/wing.py @@ -548,7 +548,7 @@ def setup(self): desc="SLM_NF: taper ratio between wing root and fold location", ) - add_aviary_output(self, Aircraft.Wing.FOLDING_AREA, val=50) + add_aviary_output(self, Aircraft.Wing.FOLDING_AREA) self.add_output("nonfolded_wing_area", val=150, units="ft**2", desc="SW_NF: wing area of part of wings that does not fold", @@ -560,7 +560,7 @@ def setup(self): desc="AR_NF: aspect ratio of non-folding part of wing", ) - add_aviary_output(self, Aircraft.Fuel.WING_VOLUME_GEOMETRIC_MAX, val=0) + add_aviary_output(self, Aircraft.Fuel.WING_VOLUME_GEOMETRIC_MAX) self.declare_partials( "nonfolded_taper_ratio", From 3b083fbc50774c76961aef07fcaefc0ac5b77c73 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Fri, 10 Jan 2025 16:35:59 -0800 Subject: [PATCH 52/54] set val in two places --- aviary/subsystems/geometry/gasp_based/empennage.py | 2 +- aviary/subsystems/geometry/gasp_based/wing.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index 336b369dc..4e2dc3894 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -104,7 +104,7 @@ def setup(self): "For a horizontal tail, the mean wing chord. For a " "vertical tail, the wing span.") ) - self.add_input("ar", 4.75, units="unitless", + self.add_input("ar", 0.0, units="unitless", desc="ARHT | ARVT: Tail aspect ratio.") self.add_input("tr", 0.352, units="unitless", desc="SLMH | SLMV: Tail taper ratio.") diff --git a/aviary/subsystems/geometry/gasp_based/wing.py b/aviary/subsystems/geometry/gasp_based/wing.py index ed960ba01..bd7e759ad 100644 --- a/aviary/subsystems/geometry/gasp_based/wing.py +++ b/aviary/subsystems/geometry/gasp_based/wing.py @@ -542,7 +542,7 @@ def setup(self): add_aviary_input(self, Aircraft.Wing.TAPER_RATIO) add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD_ROOT) add_aviary_input(self, Aircraft.Wing.THICKNESS_TO_CHORD_TIP) - add_aviary_input(self, Aircraft.Fuel.WING_FUEL_FRACTION, val=0.6) + add_aviary_input(self, Aircraft.Fuel.WING_FUEL_FRACTION) self.add_output("nonfolded_taper_ratio", val=0.1, units="unitless", desc="SLM_NF: taper ratio between wing root and fold location", From f871e3a5adee939c66d79b6f788249f193ca64a9 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Fri, 10 Jan 2025 16:36:49 -0800 Subject: [PATCH 53/54] set a few default values to 0.0. --- aviary/variable_info/variable_meta_data.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aviary/variable_info/variable_meta_data.py b/aviary/variable_info/variable_meta_data.py index 34be30a99..6ea264d43 100644 --- a/aviary/variable_info/variable_meta_data.py +++ b/aviary/variable_info/variable_meta_data.py @@ -521,7 +521,7 @@ }, units='unitless', desc='canard theoretical taper ratio', - default_value=None, + default_value=0.0, ) add_meta_data( @@ -2628,7 +2628,7 @@ }, units='unitless', desc='vertical fin theoretical taper ratio', - default_value=None, + default_value=0.0, ) # ______ _ @@ -3498,7 +3498,7 @@ }, units='unitless', desc='horizontal tail theoretical aspect ratio', - default_value=4.75, + default_value=0.0, ) add_meta_data( From ccef2a80b9862f61370196c075cfa8f8936d1f84 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Mon, 13 Jan 2025 09:03:58 -0800 Subject: [PATCH 54/54] set Aircraft.HorizontalTail.TAPER_RATIO = 0.0 --- aviary/subsystems/geometry/flops_based/prep_geom.py | 2 +- aviary/subsystems/geometry/gasp_based/empennage.py | 2 +- aviary/subsystems/mass/flops_based/horizontal_tail.py | 2 +- aviary/subsystems/mass/gasp_based/fixed.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aviary/subsystems/geometry/flops_based/prep_geom.py b/aviary/subsystems/geometry/flops_based/prep_geom.py index dfabcfa13..49ac2ed27 100644 --- a/aviary/subsystems/geometry/flops_based/prep_geom.py +++ b/aviary/subsystems/geometry/flops_based/prep_geom.py @@ -121,7 +121,7 @@ def setup(self): add_aviary_input(self, Aircraft.HorizontalTail.AREA) add_aviary_input(self, Aircraft.HorizontalTail.ASPECT_RATIO) - add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO, 0.352) + add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO) add_aviary_input(self, Aircraft.HorizontalTail.THICKNESS_TO_CHORD) add_aviary_input(self, Aircraft.VerticalTail.AREA) diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index 4e2dc3894..c1446c86b 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -106,7 +106,7 @@ def setup(self): ) self.add_input("ar", 0.0, units="unitless", desc="ARHT | ARVT: Tail aspect ratio.") - self.add_input("tr", 0.352, units="unitless", + self.add_input("tr", 0.0, units="unitless", desc="SLMH | SLMV: Tail taper ratio.") self.add_output("area", units="ft**2", desc="SHT | SVT: Tail area") diff --git a/aviary/subsystems/mass/flops_based/horizontal_tail.py b/aviary/subsystems/mass/flops_based/horizontal_tail.py index a647ebd8f..e67cd313f 100644 --- a/aviary/subsystems/mass/flops_based/horizontal_tail.py +++ b/aviary/subsystems/mass/flops_based/horizontal_tail.py @@ -14,7 +14,7 @@ class HorizontalTailMass(om.ExplicitComponent): def setup(self): add_aviary_input(self, Aircraft.HorizontalTail.AREA, val=0.0) - add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO, val=0.352) + add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO) add_aviary_input(self, Mission.Design.GROSS_MASS, val=0.0) diff --git a/aviary/subsystems/mass/gasp_based/fixed.py b/aviary/subsystems/mass/gasp_based/fixed.py index 84fd865a0..5c46b3680 100644 --- a/aviary/subsystems/mass/gasp_based/fixed.py +++ b/aviary/subsystems/mass/gasp_based/fixed.py @@ -957,7 +957,7 @@ def setup(self): add_aviary_input(self, Aircraft.Fuselage.LENGTH, val=200) add_aviary_input(self, Aircraft.HorizontalTail.SPAN, val=7) add_aviary_input(self, Aircraft.LandingGear.TAIL_HOOK_MASS_SCALER, val=1) - add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO, val=0.352) + add_aviary_input(self, Aircraft.HorizontalTail.TAPER_RATIO) add_aviary_input(self, Aircraft.VerticalTail.MASS_COEFFICIENT, val=0.289) add_aviary_input(self, Aircraft.Wing.SPAN, val=118) add_aviary_input(self, Aircraft.HorizontalTail.AREA, val=15)