Skip to content

Commit

Permalink
Merge branch 'OpenMDAO:main' into mount_location
Browse files Browse the repository at this point in the history
  • Loading branch information
xjjiang authored Jan 18, 2025
2 parents b4e1f6f + 0b319ff commit d617178
Show file tree
Hide file tree
Showing 23 changed files with 314 additions and 325 deletions.
8 changes: 4 additions & 4 deletions aviary/subsystems/geometry/flops_based/canard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
66 changes: 30 additions & 36 deletions aviary/subsystems/geometry/flops_based/characteristic_lengths.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 5 additions & 5 deletions aviary/subsystems/geometry/flops_based/fuselage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
13 changes: 5 additions & 8 deletions aviary/subsystems/geometry/flops_based/nacelle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
91 changes: 42 additions & 49 deletions aviary/subsystems/geometry/flops_based/prep_geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
14 changes: 7 additions & 7 deletions aviary/subsystems/geometry/flops_based/wetted_area_total.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions aviary/subsystems/geometry/flops_based/wing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('*', '*')
Expand Down
10 changes: 4 additions & 6 deletions aviary/subsystems/geometry/gasp_based/electric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit d617178

Please sign in to comment.