From 459aa24269cf54122ee4cfb3edf173c79c880be9 Mon Sep 17 00:00:00 2001 From: Eytan Adler <63426601+eytanadler@users.noreply.github.com> Date: Tue, 8 Feb 2022 15:56:01 -0500 Subject: [PATCH] Small change to vectorization of OAS per discussion with OM team (#38) --- .../analysis/openaerostruct/aerostructural.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/openconcept/analysis/openaerostruct/aerostructural.py b/openconcept/analysis/openaerostruct/aerostructural.py index 72457e92..f048cb51 100644 --- a/openconcept/analysis/openaerostruct/aerostructural.py +++ b/openconcept/analysis/openaerostruct/aerostructural.py @@ -834,12 +834,6 @@ class Aerostruct(om.Group): the _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): @@ -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"]) @@ -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 @@ -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", @@ -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