Skip to content

Commit

Permalink
Small change to vectorization of OAS per discussion with OM team (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
eytanadler authored Feb 8, 2022
1 parent 171196e commit 459aa24
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions openconcept/analysis/openaerostruct/aerostructural.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,12 +834,6 @@ class Aerostruct(om.Group):
the <transformation>_cp options are not supported. The input ac|geom|wing|twist is the same
as modifying the twist_cp option in the surface dictionary. The mesh geometry modification
is limited to adjusting the input parameters to this component.
set_defaults : bool
If True, sets Mach number and alpha input defaults. This option should almost never need
to be set!! It is for the edge case where OASAerostructDragPolarExact vectorizes this
component directly. For some reason, setting the input defaults here (at least in
OpenMDAO 3.16.0) prevents the proper shape from being set in OASAerostructDragPolarExact.
(default, True)
"""

def __init__(self, **kwargs):
Expand All @@ -854,7 +848,6 @@ def initialize(self):
self.options.declare("num_skin", default=4, desc="Number of skin thickness spline control points")
self.options.declare("num_spar", default=4, desc="Number of spar thickness spline control points")
self.options.declare("surf_options", default=None, desc="Dictionary of OpenAeroStruct surface options")
self.options.declare("set_defaults", default=True, desc="Sets input defaults for Mach number and alpha")

def setup(self):
n_x = int(self.options["num_x"])
Expand Down Expand Up @@ -1284,9 +1277,8 @@ def setup(self):
self.connect("sound_speed.fltcond|a", "aerostruct_point.speed_of_sound")

# Set input defaults for inputs that go to multiple locations
if self.options["set_defaults"]:
self.set_input_defaults("fltcond|M", 0.1)
self.set_input_defaults("fltcond|alpha", 0.0)
self.set_input_defaults("fltcond|M", 0.1)
self.set_input_defaults("fltcond|alpha", 0.0)
self.set_input_defaults("load_factor", 1.0)
self.set_input_defaults("aerostruct_point.coupled.wing.nodes", np.zeros((n_y, 3)), units="m")
self.set_input_defaults("W0", 1.0, units="kg") # unused variable but must be set since promoted
Expand Down Expand Up @@ -1435,7 +1427,6 @@ def setup(self):
num_skin=self.options["num_skin"],
num_spar=self.options["num_spar"],
surf_options=self.options["surf_options"],
set_defaults=False,
),
promotes_inputs=[
"ac|geom|wing|S_ref",
Expand All @@ -1450,7 +1441,7 @@ def setup(self):
],
)
self.promotes(
comp_name, inputs=["fltcond|alpha", "fltcond|M", "fltcond|h"], src_indices=[node], flat_src_indices=True
comp_name, inputs=["fltcond|alpha", "fltcond|M", "fltcond|h"], src_indices=[node], flat_src_indices=True, src_shape=(nn,)
)

# Promote wing weight from one, doesn't really matter which
Expand Down

0 comments on commit 459aa24

Please sign in to comment.