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( diff --git a/aviary/subsystems/geometry/flops_based/characteristic_lengths.py b/aviary/subsystems/geometry/flops_based/characteristic_lengths.py index ef9ce92dc..14396c9d8 100644 --- a/aviary/subsystems/geometry/flops_based/characteristic_lengths.py +++ b/aviary/subsystems/geometry/flops_based/characteristic_lengths.py @@ -21,66 +21,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() diff --git a/aviary/subsystems/geometry/flops_based/fuselage.py b/aviary/subsystems/geometry/flops_based/fuselage.py index 2b73da704..ca87a6266 100644 --- a/aviary/subsystems/geometry/flops_based/fuselage.py +++ b/aviary/subsystems/geometry/flops_based/fuselage.py @@ -16,12 +16,12 @@ class FuselagePrelim(om.ExplicitComponent): """ 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], diff --git a/aviary/subsystems/geometry/flops_based/nacelle.py b/aviary/subsystems/geometry/flops_based/nacelle.py index c8c9adf97..4b2c5fab7 100644 --- a/aviary/subsystems/geometry/flops_based/nacelle.py +++ b/aviary/subsystems/geometry/flops_based/nacelle.py @@ -18,16 +18,13 @@ def initialize(self): def setup(self): num_engine_type = len(self.options[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.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, - val=np.zeros(num_engine_type)) + shape=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_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 diff --git a/aviary/subsystems/geometry/flops_based/prep_geom.py b/aviary/subsystems/geometry/flops_based/prep_geom.py index 37cf27e1b..49ac2ed27 100644 --- a/aviary/subsystems/geometry/flops_based/prep_geom.py +++ b/aviary/subsystems/geometry/flops_based/prep_geom.py @@ -116,27 +116,25 @@ def initialize(self): add_aviary_option(self, Aircraft.Wing.SPAN_EFFICIENCY_REDUCTION) 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.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.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.Wing.AREA, 0.0) - add_aviary_input(self, Aircraft.Wing.GLOVE_AND_BAT, 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) + add_aviary_input(self, Aircraft.HorizontalTail.ASPECT_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) + 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) + 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') @@ -492,10 +490,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( @@ -567,19 +565,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( @@ -727,27 +723,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( diff --git a/aviary/subsystems/geometry/flops_based/wetted_area_total.py b/aviary/subsystems/geometry/flops_based/wetted_area_total.py index 63b2a4fab..f787fb4a6 100644 --- a/aviary/subsystems/geometry/flops_based/wetted_area_total.py +++ b/aviary/subsystems/geometry/flops_based/wetted_area_total.py @@ -11,14 +11,14 @@ class TotalWettedArea(om.ExplicitComponent): """ 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_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, 0.0) + add_aviary_output(self, Aircraft.Design.TOTAL_WETTED_AREA) def setup_partials(self): self.declare_partials('*', '*', val=1.0) diff --git a/aviary/subsystems/geometry/flops_based/wing.py b/aviary/subsystems/geometry/flops_based/wing.py index f6c7c09e2..4f945ff49 100644 --- a/aviary/subsystems/geometry/flops_based/wing.py +++ b/aviary/subsystems/geometry/flops_based/wing.py @@ -14,11 +14,11 @@ class WingPrelim(om.ExplicitComponent): """ 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('*', '*') diff --git a/aviary/subsystems/geometry/gasp_based/electric.py b/aviary/subsystems/geometry/gasp_based/electric.py index 07d423edd..ac58a4a0b 100644 --- a/aviary/subsystems/geometry/gasp_based/electric.py +++ b/aviary/subsystems/geometry/gasp_based/electric.py @@ -17,13 +17,11 @@ def setup(self): total_num_wing_engines = self.options[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, diff --git a/aviary/subsystems/geometry/gasp_based/empennage.py b/aviary/subsystems/geometry/gasp_based/empennage.py index 5cdb6aa03..c1446c86b 100644 --- a/aviary/subsystems/geometry/gasp_based/empennage.py +++ b/aviary/subsystems/geometry/gasp_based/empennage.py @@ -33,23 +33,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") @@ -90,37 +86,28 @@ class TailSize(om.ExplicitComponent): 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" - ) - - 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("vol_coef", 1.189, units="unitless", + 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.") + ) + self.add_input("ar", 0.0, units="unitless", + desc="ARHT | ARVT: Tail aspect ratio.") + 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") self.add_output("span", units="ft", desc="BHT | BVT: Tail span") @@ -307,11 +294,6 @@ 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) + self.set_input_defaults(Aircraft.VerticalTail.TAPER_RATIO, 0.0) diff --git a/aviary/subsystems/geometry/gasp_based/engine.py b/aviary/subsystems/geometry/gasp_based/engine.py index 545427ac7..2c9657ca0 100644 --- a/aviary/subsystems/geometry/gasp_based/engine.py +++ b/aviary/subsystems/geometry/gasp_based/engine.py @@ -18,18 +18,18 @@ def setup(self): num_engine_type = len(self.options[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 diff --git a/aviary/subsystems/geometry/gasp_based/fuselage.py b/aviary/subsystems/geometry/gasp_based/fuselage.py index f525118f1..ce1b1e241 100644 --- a/aviary/subsystems/geometry/gasp_based/fuselage.py +++ b/aviary/subsystems/geometry/gasp_based/fuselage.py @@ -34,10 +34,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") @@ -112,19 +112,17 @@ class FuselageSize(om.ExplicitComponent): """ 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, @@ -267,6 +265,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/non_dimensional_conversion.py b/aviary/subsystems/geometry/gasp_based/non_dimensional_conversion.py index c8da2494b..bdb03ae32 100644 --- a/aviary/subsystems/geometry/gasp_based/non_dimensional_conversion.py +++ b/aviary/subsystems/geometry/gasp_based/non_dimensional_conversion.py @@ -14,16 +14,16 @@ 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, 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): @@ -70,14 +70,14 @@ 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, 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): diff --git a/aviary/subsystems/geometry/gasp_based/strut.py b/aviary/subsystems/geometry/gasp_based/strut.py index 2c3fd83f0..8e80f290f 100644 --- a/aviary/subsystems/geometry/gasp_based/strut.py +++ b/aviary/subsystems/geometry/gasp_based/strut.py @@ -13,20 +13,17 @@ class StrutGeom(om.ExplicitComponent): """ 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): diff --git a/aviary/subsystems/geometry/gasp_based/test/test_empennage.py b/aviary/subsystems/geometry/gasp_based/test/test_empennage.py index aa77dbeab..6cb29add1 100644 --- a/aviary/subsystems/geometry/gasp_based/test/test_empennage.py +++ b/aviary/subsystems/geometry/gasp_based/test/test_empennage.py @@ -49,9 +49,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) @@ -75,7 +72,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") @@ -86,6 +82,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() @@ -101,7 +98,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_size_group.py b/aviary/subsystems/geometry/gasp_based/test/test_size_group.py index 90ad3170a..4c2849d73 100644 --- a/aviary/subsystems/geometry/gasp_based/test/test_size_group.py +++ b/aviary/subsystems/geometry/gasp_based/test/test_size_group.py @@ -242,6 +242,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( diff --git a/aviary/subsystems/geometry/gasp_based/test/test_wing.py b/aviary/subsystems/geometry/gasp_based/test/test_wing.py index 5cb91f101..dd2f74811 100644 --- a/aviary/subsystems/geometry/gasp_based/test/test_wing.py +++ b/aviary/subsystems/geometry/gasp_based/test/test_wing.py @@ -59,6 +59,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") @@ -580,6 +589,32 @@ 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.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" + ) setup_model_options(self.prob, options) diff --git a/aviary/subsystems/geometry/gasp_based/wing.py b/aviary/subsystems/geometry/gasp_based/wing.py index 85ce6cf1b..bd7e759ad 100644 --- a/aviary/subsystems/geometry/gasp_based/wing.py +++ b/aviary/subsystems/geometry/gasp_based/wing.py @@ -17,12 +17,12 @@ class WingSize(om.ExplicitComponent): 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] @@ -83,19 +83,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[Aircraft.Wing.HAS_FOLD]: - 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, @@ -111,12 +111,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, @@ -517,12 +516,8 @@ def initialize(self): def setup(self): if not self.options[Aircraft.Wing.CHOOSE_FOLD_LOCATION]: - self.add_input( - "strut_y", - val=25, - units="ft", - desc="YSTRUT: attachment location of strut", - ) + self.add_input("strut_y", val=25, units="ft", + desc="YSTRUT: attachment location of strut") self.declare_partials("nonfolded_taper_ratio", "strut_y") self.declare_partials(Aircraft.Wing.FOLDING_AREA, "strut_y") @@ -540,44 +535,32 @@ 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.Fuel.WING_FUEL_FRACTION, val=0.6) + 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) - self.add_output( - "nonfolded_taper_ratio", - val=0.1, - units="unitless", - desc="SLM_NF: taper ratio between wing root and fold location", - ) + 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) + 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", - ) - 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", - desc="AR_NF: aspect ratio of non-folding part of wing", - ) + 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", + 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", + ) - 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", @@ -1008,12 +991,3 @@ def setup(self): check_fold_location_definition(choose_fold_location, has_strut) 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" - ) diff --git a/aviary/subsystems/mass/flops_based/horizontal_tail.py b/aviary/subsystems/mass/flops_based/horizontal_tail.py index 0b2aa397d..91f7125db 100644 --- a/aviary/subsystems/mass/flops_based/horizontal_tail.py +++ b/aviary/subsystems/mass/flops_based/horizontal_tail.py @@ -13,7 +13,7 @@ class HorizontalTailMass(om.ExplicitComponent): def setup(self): add_aviary_input(self, Aircraft.HorizontalTail.AREA) - 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) add_aviary_input(self, Aircraft.HorizontalTail.MASS_SCALER) diff --git a/aviary/subsystems/mass/gasp_based/design_load.py b/aviary/subsystems/mass/gasp_based/design_load.py index 3312b5642..bdb90094a 100644 --- a/aviary/subsystems/mass/gasp_based/design_load.py +++ b/aviary/subsystems/mass/gasp_based/design_load.py @@ -39,25 +39,16 @@ 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", - ) - 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", - desc="EMLF: maximum maneuver load factor, units are in g`s", - ) + self.add_output("max_airspeed", val=0, units="kn", + 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", + ) + 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") self.declare_partials("*", "*") 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) diff --git a/aviary/subsystems/mass/gasp_based/fuel.py b/aviary/subsystems/mass/gasp_based/fuel.py index 8a202aece..4092e3bb3 100644 --- a/aviary/subsystems/mass/gasp_based/fuel.py +++ b/aviary/subsystems/mass/gasp_based/fuel.py @@ -55,12 +55,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, 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: diff --git a/aviary/variable_info/variable_meta_data.py b/aviary/variable_info/variable_meta_data.py index 8b8919fb4..b29b7e9a0 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, ) add_meta_data( @@ -434,6 +434,7 @@ }, units='ft', desc='Reynolds characteristic length for the canard', + default_value=0.0 ) add_meta_data( @@ -449,6 +450,7 @@ }, units='unitless', desc='canard fineness ratio', + default_value=0.0 ) add_meta_data( @@ -553,7 +555,7 @@ }, units='ft**2', desc='canard wetted area', - default_value=None, + default_value=0.0, ) add_meta_data( @@ -1714,6 +1716,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, ) add_meta_data( @@ -2885,6 +2888,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, ) add_meta_data( @@ -2967,6 +2971,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, ) add_meta_data( @@ -3079,6 +3084,7 @@ }, units='ft', desc='Reynolds characteristic length for the fuselage', + default_value=0.0, ) add_meta_data( @@ -3099,7 +3105,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, ) add_meta_data( @@ -3112,6 +3118,7 @@ }, units='unitless', desc='fuselage diameter to wing span ratio', + default_value=0.0, ) add_meta_data( @@ -3127,6 +3134,7 @@ }, units='unitless', desc='fuselage fineness ratio', + default_value=0.0, ) add_meta_data( @@ -3208,6 +3216,7 @@ }, units='unitless', desc='fuselage length to diameter ratio', + default_value=0.0, ) add_meta_data( @@ -3379,6 +3388,7 @@ historical_name={"GASP": 'INGASP.ELPC', "FLOPS": None, "LEAPS1": None}, units='ft', desc='length of the pilot compartment', + default_value=0.0, ) add_meta_data( @@ -3500,7 +3510,7 @@ }, units='unitless', desc='horizontal tail theoretical aspect ratio', - default_value=None, + default_value=0.0, ) add_meta_data( @@ -3524,6 +3534,7 @@ }, units='ft', desc='Reynolds characteristic length for the horizontal tail', + default_value=0.0, ) add_meta_data( @@ -3539,6 +3550,7 @@ }, units='unitless', desc='horizontal tail fineness ratio', + default_value=0.0, ) add_meta_data( @@ -3674,7 +3686,7 @@ }, units='unitless', desc='horizontal tail theoretical taper ratio', - default_value=None, + default_value=0.0, ) add_meta_data( @@ -3704,7 +3716,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, ) add_meta_data( @@ -4119,6 +4131,7 @@ }, units='ft', desc='Reynolds characteristic length for nacelle for each engine model', + default_value=0.0, ) add_meta_data( @@ -4152,6 +4165,7 @@ }, units='unitless', desc='nacelle fineness ratio', + default_value=0.0, ) add_meta_data( @@ -4249,6 +4263,7 @@ }, units='ft**2', desc='total nacelles wetted area', + default_value=0.0, ) add_meta_data( @@ -4264,6 +4279,7 @@ }, units='ft**2', desc='wetted area of a single nacelle for each engine model', + default_value=0.0, ) add_meta_data( @@ -4526,6 +4542,7 @@ historical_name={"GASP": 'INGASP.SSTQSW', "FLOPS": None, "LEAPS1": None}, units='unitless', desc='ratio of strut area to wing area', + default_value=0.0, ) add_meta_data( @@ -4538,6 +4555,7 @@ }, units='ft', desc='attachment location of strut the full attachment-to-attachment span', + default_value=0.0, ) # related to Aircraft.Strut.ATTACHMENT_LOCATION @@ -4547,6 +4565,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, ) add_meta_data( @@ -4555,6 +4574,7 @@ historical_name={"GASP": 'INGASP.STRTCHD', "FLOPS": None, "LEAPS1": None}, units='ft', desc='chord of the strut', + default_value=0.0, ) add_meta_data( @@ -4672,7 +4692,7 @@ }, units='unitless', desc='vertical tail theoretical aspect ratio', - default_value=None, + default_value=0.0, ) add_meta_data( @@ -4696,6 +4716,7 @@ }, units='ft', desc='Reynolds characteristic length for the vertical tail', + default_value=0.0, ) add_meta_data( @@ -4711,6 +4732,7 @@ }, units='unitless', desc='vertical tail fineness ratio', + default_value=0.0, ) add_meta_data( @@ -4904,7 +4926,7 @@ }, units='ft**2', desc='vertical tails wetted area', - default_value=None, + default_value=0.0, ) add_meta_data( @@ -5042,6 +5064,7 @@ historical_name={"GASP": 'INGASP.CBARW', "FLOPS": None, "LEAPS1": None}, units='ft', desc='mean aerodynamic chord of the wing', + default_value=0.0, ) add_meta_data( @@ -5120,6 +5143,7 @@ historical_name={"GASP": 'INGASP.CRCLW', "FLOPS": None, "LEAPS1": None}, units='ft', desc='wing chord at fuselage centerline', + default_value=0.0, ) add_meta_data( @@ -5144,6 +5168,7 @@ }, units='ft', desc='Reynolds characteristic length for the wing', + default_value=0.0, ) add_meta_data( @@ -5278,6 +5303,7 @@ }, units='unitless', desc='wing fineness ratio', + default_value=0.0, ) add_meta_data( @@ -5379,7 +5405,7 @@ historical_name={"GASP": 'INGASP.YWFOLD', "FLOPS": None, "LEAPS1": None}, units='ft', desc='folded wingspan', - default_value=118, + default_value=0, ) add_meta_data( @@ -5538,6 +5564,7 @@ historical_name={"GASP": 'INGASP.SWPLE', "FLOPS": None, "LEAPS1": None}, units='rad', desc='sweep angle at leading edge of wing', + default_value=0.0, ) add_meta_data( @@ -5592,6 +5619,7 @@ }, units='lbf/ft**2', desc='wing loading', + default_value=0.0, ) add_meta_data( @@ -5808,6 +5836,7 @@ }, units='ft', desc='wing chord length at wing root', + default_value=0.0, ) add_meta_data( @@ -5997,7 +6026,7 @@ }, units='deg', desc='quarter-chord sweep angle of the wing', - default_value=0.0, # TODO required + default_value=0.0, # TODO required. ) add_meta_data( @@ -6022,7 +6051,7 @@ }, units='unitless', desc='taper ratio of the wing', - default_value=0.0, # TODO required + default_value=0.0, # TODO required. ) add_meta_data( @@ -6083,6 +6112,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, ) add_meta_data( @@ -6091,6 +6121,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, ) add_meta_data( @@ -6099,6 +6130,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, ) add_meta_data( @@ -6146,7 +6178,7 @@ }, units='ft**2', desc='wing wetted area', - default_value=None, + default_value=0.0, ) add_meta_data(