diff --git a/openaerostruct/__init__.py b/openaerostruct/__init__.py index 7a2056f56..667b52f95 100644 --- a/openaerostruct/__init__.py +++ b/openaerostruct/__init__.py @@ -1 +1 @@ -__version__ = "2.5.1" +__version__ = "2.5.2" diff --git a/openaerostruct/aerodynamics/aero_groups.py b/openaerostruct/aerodynamics/aero_groups.py index d663f4986..961e32fa2 100644 --- a/openaerostruct/aerodynamics/aero_groups.py +++ b/openaerostruct/aerodynamics/aero_groups.py @@ -44,7 +44,7 @@ def setup(self): self.connect(name + ".widths", name + "_perf.widths") self.connect(name + ".chords", name + "_perf.chords") self.connect(name + ".lengths", name + "_perf.lengths") - self.connect(name + ".cos_sweep", name + "_perf.cos_sweep") + self.connect(name + ".lengths_spanwise", name + "_perf.lengths_spanwise") # Connect S_ref for performance calcs self.connect(name + ".S_ref", "total_perf." + name + "_S_ref") diff --git a/openaerostruct/aerodynamics/functionals.py b/openaerostruct/aerodynamics/functionals.py index f78625cef..98ff29048 100644 --- a/openaerostruct/aerodynamics/functionals.py +++ b/openaerostruct/aerodynamics/functionals.py @@ -45,14 +45,14 @@ def setup(self): self.add_subsystem( "viscousdrag", ViscousDrag(surface=surface), - promotes_inputs=["Mach_number", "re", "widths", "cos_sweep", "lengths", "S_ref", "t_over_c"], + promotes_inputs=["Mach_number", "re", "widths", "lengths_spanwise", "lengths", "S_ref", "t_over_c"], promotes_outputs=["CDv"], ) self.add_subsystem( "wavedrag", WaveDrag(surface=surface), - promotes_inputs=["Mach_number", "cos_sweep", "widths", "CL", "chords", "t_over_c"], + promotes_inputs=["Mach_number", "lengths_spanwise", "widths", "CL", "chords", "t_over_c"], promotes_outputs=["CDw"], ) diff --git a/openaerostruct/aerodynamics/geometry.py b/openaerostruct/aerodynamics/geometry.py index fd003f80d..1cb2e0ca9 100644 --- a/openaerostruct/aerodynamics/geometry.py +++ b/openaerostruct/aerodynamics/geometry.py @@ -21,7 +21,11 @@ class VLMGeometry(om.ExplicitComponent): b_pts[nx-1, ny, 3] : numpy array Bound points for the horseshoe vortices, found along the 1/4 chord. widths[ny-1] : numpy array - The spanwise widths of each individual panel. + The widths of each individual panel along y-axis (spanwise direction with zero sweep). + lengths_spanwise[ny-1] : numpy array + The the length of the quarter-chord line of each panels. + This is identical to `widths` if sweep angle is 0. + When wing is swept, `lengths_spanwise` is longer than `widths`. lengths[ny] : numpy array The chordwise length of the entire airfoil following the camber line. chords[ny] : numpy array @@ -49,7 +53,7 @@ def setup(self): rng = np.random.default_rng(314) self.add_output("b_pts", val=rng.random((nx - 1, ny, 3)), units="m") self.add_output("widths", val=np.ones((ny - 1)), units="m") - self.add_output("cos_sweep", val=np.zeros((ny - 1)), units="m") + self.add_output("lengths_spanwise", val=np.ones((ny - 1)), units="m") self.add_output("lengths", val=np.zeros((ny)), units="m") self.add_output("chords", val=np.zeros((ny)), units="m") self.add_output("normals", val=np.zeros((nx - 1, ny - 1, 3))) @@ -68,19 +72,19 @@ def setup(self): val[size:] = 0.25 self.declare_partials("b_pts", "def_mesh", rows=rows, cols=cols, val=val) - # widths + # width size = ny - 1 base = np.arange(size) - rows = np.tile(base, 12) - col = np.tile(3 * base, 6) + np.repeat(np.arange(6), len(base)) + rows = np.tile(base, 8) + col = np.tile(3 * base, 4) + np.repeat([1, 2, 4, 5], len(base)) cols = np.tile(col, 2) + np.repeat([0, (nx - 1) * ny * 3], len(col)) self.declare_partials("widths", "def_mesh", rows=rows, cols=cols) - # cos_sweep - rows = np.tile(base, 8) - col = np.tile(3 * base, 4) + np.repeat([1, 2, 4, 5], len(base)) + # length of panel in spanwise direction with sweep + rows = np.tile(base, 12) + col = np.tile(3 * base, 6) + np.repeat(np.arange(6), len(base)) cols = np.tile(col, 2) + np.repeat([0, (nx - 1) * ny * 3], len(col)) - self.declare_partials("cos_sweep", "def_mesh", rows=rows, cols=cols) + self.declare_partials("lengths_spanwise", "def_mesh", rows=rows, cols=cols) # lengths size = ny @@ -116,16 +120,13 @@ def compute(self, inputs, outputs): # Compute the bound points at quarter-chord b_pts = mesh[:-1, :, :] * 0.75 + mesh[1:, :, :] * 0.25 - # Compute the widths of each panel at the quarter-chord line + # Compute the length of the quarter-chord line of each panels quarter_chord = 0.25 * mesh[-1] + 0.75 * mesh[0] - widths = np.linalg.norm(quarter_chord[1:, :] - quarter_chord[:-1, :], axis=1) + lengths_spanwise = np.linalg.norm(quarter_chord[1:, :] - quarter_chord[:-1, :], axis=1) - # Compute the numerator of the cosine of the sweep angle of each panel - # (we need this for the viscous drag dependence on sweep, and we only compute - # the numerator because the denominator of the cosine fraction is the width, - # which we have already computed. They are combined in the viscous drag - # calculation.) - cos_sweep = np.linalg.norm(quarter_chord[1:, [1, 2]] - quarter_chord[:-1, [1, 2]], axis=1) + # Compute the widths of each panel. + # This is a projection of `lengths_spanwise` to the spanwise axis (y-axis) + widths = np.linalg.norm(quarter_chord[1:, [1, 2]] - quarter_chord[:-1, [1, 2]], axis=1) # Compute the length of each chordwise set of mesh points through the camber line. dx = mesh[1:, :, 0] - mesh[:-1, :, 0] @@ -171,7 +172,7 @@ def compute(self, inputs, outputs): # Store each array in the outputs dict outputs["b_pts"] = b_pts outputs["widths"] = widths - outputs["cos_sweep"] = cos_sweep + outputs["lengths_spanwise"] = lengths_spanwise outputs["lengths"] = lengths outputs["normals"] = normals outputs["S_ref"] = S_ref @@ -184,18 +185,18 @@ def compute_partials(self, inputs, partials): ny = self.ny mesh = inputs["def_mesh"] - # Compute the widths of each panel at the quarter-chord line + # Compute the length of the quarter-chord line of each panels quarter_chord = 0.25 * mesh[-1] + 0.75 * mesh[0] - widths = np.linalg.norm(quarter_chord[1:, :] - quarter_chord[:-1, :], axis=1) + lengths_spanwise = np.linalg.norm(quarter_chord[1:, :] - quarter_chord[:-1, :], axis=1) - # Compute the cosine of the sweep angle of each panel - cos_sweep_array = np.linalg.norm(quarter_chord[1:, [1, 2]] - quarter_chord[:-1, [1, 2]], axis=1) + # Compute the widths of each panel. + widths = np.linalg.norm(quarter_chord[1:, [1, 2]] - quarter_chord[:-1, [1, 2]], axis=1) delta = np.diff(quarter_chord, axis=0).T - d1 = delta / widths + d1 = delta / lengths_spanwise + partials["lengths_spanwise", "def_mesh"] = np.outer([-0.75, 0.75, -0.25, 0.25], d1.flatten()).flatten() + d1 = delta[1:, :] / widths partials["widths", "def_mesh"] = np.outer([-0.75, 0.75, -0.25, 0.25], d1.flatten()).flatten() - d1 = delta[1:, :] / cos_sweep_array - partials["cos_sweep", "def_mesh"] = np.outer([-0.75, 0.75, -0.25, 0.25], d1.flatten()).flatten() partials["lengths", "def_mesh"][:] = 0.0 dmesh = np.diff(mesh, axis=0) diff --git a/openaerostruct/aerodynamics/lift_coeff_2D.py b/openaerostruct/aerodynamics/lift_coeff_2D.py index cd054a73e..0b959e52e 100644 --- a/openaerostruct/aerodynamics/lift_coeff_2D.py +++ b/openaerostruct/aerodynamics/lift_coeff_2D.py @@ -45,7 +45,7 @@ def setup(self): # Inputs self.add_input("alpha", val=3.0, units="deg") self.add_input("sec_forces", val=np.ones((self.nx - 1, self.ny - 1, 3)), units="N") - self.add_input("widths", val=np.arange((self.ny - 1)) + 1.0, units="m") + self.add_input("widths", val=np.ones((self.ny - 1)) * 0.2, units="m") self.add_input("chords", val=np.ones((self.ny)), units="m") self.add_input("v", val=1.0, units="m/s") self.add_input("rho", val=1.0, units="kg/m**3") diff --git a/openaerostruct/aerodynamics/tests/test_geometry.py b/openaerostruct/aerodynamics/tests/test_geometry.py index fbe03a4b0..76864222b 100644 --- a/openaerostruct/aerodynamics/tests/test_geometry.py +++ b/openaerostruct/aerodynamics/tests/test_geometry.py @@ -191,8 +191,8 @@ def test_outputs(self): prob.setup() prob.run_model() - assert_near_equal(prob["widths"], np.array([11.95624787, 11.90425878, 11.44086572]), 1e-6) - assert_near_equal(prob["cos_sweep"], np.array([9.7938336, 9.79384207, 9.79385053]), 1e-6) + assert_near_equal(prob["lengths_spanwise"], np.array([11.95624787, 11.90425878, 11.44086572]), 1e-6) + assert_near_equal(prob["widths"], np.array([9.7938336, 9.79384207, 9.79385053]), 1e-6) assert_near_equal(prob["S_ref"], np.array([415.02211208]), 1e-6) assert_near_equal(prob["chords"], np.array([2.72796, 5.1252628, 7.8891638, 13.6189974]), 1e-6) assert_near_equal(prob["lengths"], np.array([2.72796, 5.1252628, 7.8891638, 13.6189974]), 1e-6) diff --git a/openaerostruct/aerodynamics/tests/test_wave_drag.py b/openaerostruct/aerodynamics/tests/test_wave_drag.py index d9e6d3593..9d1ca33e6 100644 --- a/openaerostruct/aerodynamics/tests/test_wave_drag.py +++ b/openaerostruct/aerodynamics/tests/test_wave_drag.py @@ -20,8 +20,8 @@ def test(self): indep_var_comp.add_output("t_over_c_cp", val=surface["t_over_c_cp"]) indep_var_comp.add_output("Mach_number", val=0.95) indep_var_comp.add_output("CL", val=0.7) - indep_var_comp.add_output("widths", val=np.array([12.14757848, 11.91832712, 11.43730892]), units="m") - indep_var_comp.add_output("cos_sweep", val=np.array([10.01555924, 9.80832351, 9.79003729]), units="m") + indep_var_comp.add_output("lengths_spanwise", val=np.array([12.14757848, 11.91832712, 11.43730892]), units="m") + indep_var_comp.add_output("widths", val=np.array([10.01555924, 9.80832351, 9.79003729]), units="m") indep_var_comp.add_output("chords", val=np.array([2.72835132, 5.12528179, 7.88916016, 13.6189974]), units="m") group.add_subsystem("indep_var_comp", indep_var_comp, promotes=["*"]) diff --git a/openaerostruct/aerodynamics/viscous_drag.py b/openaerostruct/aerodynamics/viscous_drag.py index 6557d2bd6..4b617c19a 100644 --- a/openaerostruct/aerodynamics/viscous_drag.py +++ b/openaerostruct/aerodynamics/viscous_drag.py @@ -55,8 +55,8 @@ def setup(self): self.add_input("re", val=5.0e6, units="1/m") self.add_input("Mach_number", val=1.6) self.add_input("S_ref", val=1.0, units="m**2") - self.add_input("cos_sweep", val=np.ones((ny - 1)) * 0.2, units="m") - self.add_input("widths", val=np.arange((ny - 1)) + 1.0, units="m") + self.add_input("widths", val=np.ones((ny - 1)) * 0.2, units="m") + self.add_input("lengths_spanwise", val=np.arange((ny - 1)) + 1.0, units="m") self.add_input("lengths", val=np.ones((ny)), units="m") self.add_input("t_over_c", val=np.arange((ny - 1))) self.add_output("CDv", val=0.0) @@ -72,7 +72,7 @@ def compute(self, inputs, outputs): S_ref = inputs["S_ref"] widths = inputs["widths"] lengths = inputs["lengths"] - cos_sweep = inputs["cos_sweep"] / widths + cos_sweep = inputs["widths"] / inputs["lengths_spanwise"] t_over_c = inputs["t_over_c"] # Take panel chord length to be average of its edge lengths @@ -124,10 +124,9 @@ def compute_partials(self, inputs, partials): M = inputs["Mach_number"] S_ref = inputs["S_ref"] - widths = inputs["widths"] lengths = inputs["lengths"] - cos_sweep = inputs["cos_sweep"] / widths + cos_sweep = widths / inputs["lengths_spanwise"] # Take panel chord length to be average of its edge lengths chords = (lengths[1:] + lengths[:-1]) / 2.0 @@ -186,9 +185,9 @@ def compute_partials(self, inputs, partials): partials["CDv", "lengths"][0, 1:] += CDv_lengths partials["CDv", "lengths"][0, :-1] += CDv_lengths - partials["CDv", "widths"][0, :] = d_over_q * FF / S_ref * 0.72 + partials["CDv", "lengths_spanwise"][0, :] = d_over_q / S_ref * (-0.28 * k_FF * cos_sweep**1.28) partials["CDv", "S_ref"] = -D_over_q / S_ref**2 - partials["CDv", "cos_sweep"][0, :] = 0.28 * k_FF * d_over_q / S_ref / cos_sweep**0.72 + partials["CDv", "widths"][0, :] = d_over_q / S_ref * (FF + 0.28 * k_FF * cos_sweep**0.28) partials["CDv", "t_over_c"] = ( d_over_q * widths * 1.34 * M**0.18 * (0.6 / self.c_max_t + 400 * t_over_c**3) * cos_sweep**0.28 ) / S_ref @@ -239,9 +238,9 @@ def compute_partials(self, inputs, partials): if self.surface["symmetry"]: partials["CDv", "lengths"][0, :] *= 2 - partials["CDv", "widths"][0, :] *= 2 + partials["CDv", "lengths_spanwise"][0, :] *= 2 partials["CDv", "S_ref"] *= 2 - partials["CDv", "cos_sweep"][0, :] *= 2 + partials["CDv", "widths"][0, :] *= 2 partials["CDv", "Mach_number"][0, :] *= 2 partials["CDv", "re"][0, :] *= 2 partials["CDv", "t_over_c"][0, :] *= 2 diff --git a/openaerostruct/aerodynamics/wave_drag.py b/openaerostruct/aerodynamics/wave_drag.py index bcc4a84ae..345218b16 100644 --- a/openaerostruct/aerodynamics/wave_drag.py +++ b/openaerostruct/aerodynamics/wave_drag.py @@ -12,10 +12,10 @@ class WaveDrag(om.ExplicitComponent): ---------- Mach_number : float Mach number. - cos_sweep[ny-1] : numpy array - The width in the spanwise direction of each VLM panel. This is the numerator of cos(sweep). widths[ny-1] : numpy array - The actual width of each VLM panel, rotated by the sweep angle. This is the denominator + The width in the spanwise direction of each VLM panel. This is the numerator of cos(sweep). + lengths_spanwise[ny-1] : numpy array + The spanwise length of each VLM panel at 1/4 chord, rotated by the sweep angle. This is the denominator of cos(sweep) CL : float The CL of the lifting surface used for wave drag estimation. @@ -46,9 +46,9 @@ def setup(self): ny = surface["mesh"].shape[1] self.add_input("Mach_number", val=1.6) - self.add_input("cos_sweep", val=np.ones((ny - 1)) * 0.2, units="m") + self.add_input("widths", val=np.ones((ny - 1)) * 0.2, units="m") self.add_input( - "widths", val=np.arange((ny - 1)) + 1.0, units="m" + "lengths_spanwise", val=np.arange((ny - 1)) + 1.0, units="m" ) # set to np.arange so that d_CDw_d_chords is nonzero self.add_input("CL", val=0.33) self.add_input("chords", val=np.ones((ny)), units="m") @@ -62,16 +62,14 @@ def compute(self, inputs, outputs): if self.with_wave: t_over_c = inputs["t_over_c"] widths = inputs["widths"] - actual_cos_sweep = inputs["cos_sweep"] / widths + cos_sweep = widths / inputs["lengths_spanwise"] M = inputs["Mach_number"] chords = inputs["chords"] CL = inputs["CL"] mean_chords = (chords[:-1] + chords[1:]) / 2.0 - panel_areas = mean_chords * inputs["cos_sweep"] - avg_cos_sweep = np.sum(actual_cos_sweep * panel_areas) / np.sum( - panel_areas - ) # weighted average of 1/4 chord sweep + panel_areas = mean_chords * widths + avg_cos_sweep = np.sum(cos_sweep * panel_areas) / np.sum(panel_areas) # weighted average of 1/4 chord sweep avg_t_over_c = np.sum(t_over_c * panel_areas) / np.sum(panel_areas) # weighted average of streamwise t/c MDD = self.ka / avg_cos_sweep - avg_t_over_c / avg_cos_sweep**2 - CL / (10 * avg_cos_sweep**3) Mcrit = MDD - (0.1 / 80.0) ** (1.0 / 3.0) @@ -92,16 +90,16 @@ def compute_partials(self, inputs, partials): ny = self.surface["mesh"].shape[1] t_over_c = inputs["t_over_c"] widths = inputs["widths"] - cos_sweep = inputs["cos_sweep"] - actual_cos_sweep = cos_sweep / widths + lengths_spanwise = inputs["lengths_spanwise"] + cos_sweep = widths / lengths_spanwise M = inputs["Mach_number"] chords = inputs["chords"] CL = inputs["CL"] chords = (chords[:-1] + chords[1:]) / 2.0 - panel_areas = chords * inputs["cos_sweep"] + panel_areas = chords * widths sum_panel_areas = np.sum(panel_areas) - avg_cos_sweep = np.sum(actual_cos_sweep * panel_areas) / sum_panel_areas + avg_cos_sweep = np.sum(cos_sweep * panel_areas) / sum_panel_areas avg_t_over_c = np.sum(t_over_c * panel_areas) / sum_panel_areas MDD = 0.95 / avg_cos_sweep - avg_t_over_c / avg_cos_sweep**2 - CL / (10 * avg_cos_sweep**3) @@ -116,14 +114,14 @@ def compute_partials(self, inputs, partials): dMDDdtoc = -1.0 / (avg_cos_sweep**2) dtocavgdtoc = panel_areas / sum_panel_areas - ccos = np.sum(cos_sweep * chords) - ccos2w = np.sum(chords * cos_sweep**2 / widths) + ccos = np.sum(widths * chords) + ccos2w = np.sum(chords * widths**2 / lengths_spanwise) - davgdcos = 2 * chords * cos_sweep / widths / ccos - chords * ccos2w / ccos**2 - dtocdcos = chords * t_over_c / ccos - chords * np.sum(chords * cos_sweep * t_over_c) / ccos**2 - davgdw = -1 * chords * cos_sweep**2 / widths**2 / ccos - davgdc = cos_sweep**2 / widths / ccos - cos_sweep * ccos2w / ccos**2 - dtocdc = t_over_c * cos_sweep / ccos - cos_sweep * np.sum(chords * cos_sweep * t_over_c) / ccos**2 + davgdcos = 2 * chords * widths / lengths_spanwise / ccos - chords * ccos2w / ccos**2 + dtocdcos = chords * t_over_c / ccos - chords * np.sum(chords * widths * t_over_c) / ccos**2 + davgdw = -1 * chords * widths**2 / lengths_spanwise**2 / ccos + davgdc = widths**2 / lengths_spanwise / ccos - widths * ccos2w / ccos**2 + dtocdc = t_over_c * widths / ccos - widths * np.sum(chords * widths * t_over_c) / ccos**2 dcdchords = np.zeros((ny - 1, ny)) i, j = np.indices(dcdchords.shape) @@ -132,8 +130,8 @@ def compute_partials(self, inputs, partials): partials["CDw", "Mach_number"] = -1 * dCDwdMDD partials["CDw", "CL"] = dCDwdMDD * dMDDdCL - partials["CDw", "widths"] = dCDwdMDD * dMDDdavg * davgdw - partials["CDw", "cos_sweep"] = dCDwdMDD * dMDDdavg * davgdcos + dCDwdMDD * dMDDdtoc * dtocdcos + partials["CDw", "lengths_spanwise"] = dCDwdMDD * dMDDdavg * davgdw + partials["CDw", "widths"] = dCDwdMDD * dMDDdavg * davgdcos + dCDwdMDD * dMDDdtoc * dtocdcos partials["CDw", "chords"] = dCDwdMDD * dMDDdavg * np.matmul( davgdc, dcdchords ) + dCDwdMDD * dMDDdtoc * np.matmul(dtocdc, dcdchords) @@ -141,8 +139,8 @@ def compute_partials(self, inputs, partials): if self.surface["symmetry"]: partials["CDw", "CL"][0, :] *= 2 + partials["CDw", "lengths_spanwise"][0, :] *= 2 partials["CDw", "widths"][0, :] *= 2 - partials["CDw", "cos_sweep"][0, :] *= 2 partials["CDw", "Mach_number"][0, :] *= 2 partials["CDw", "chords"][0, :] *= 2 partials["CDw", "t_over_c"][0, :] *= 2 diff --git a/openaerostruct/integration/aerostruct_groups.py b/openaerostruct/integration/aerostruct_groups.py index 88c82b2c6..247b95937 100644 --- a/openaerostruct/integration/aerostruct_groups.py +++ b/openaerostruct/integration/aerostruct_groups.py @@ -134,7 +134,7 @@ def setup(self): "aero_geom", VLMGeometry(surface=surface), promotes_inputs=["def_mesh"], - promotes_outputs=["b_pts", "widths", "cos_sweep", "lengths", "chords", "normals", "S_ref"], + promotes_outputs=["b_pts", "widths", "lengths_spanwise", "lengths", "chords", "normals", "S_ref"], ) self.linear_solver = om.LinearRunOnce() @@ -158,7 +158,7 @@ def setup(self): "re", "rho", "widths", - "cos_sweep", + "lengths_spanwise", "lengths", "S_ref", "sec_forces", @@ -252,7 +252,7 @@ def setup(self): self.connect("coupled." + name + ".widths", name + "_perf.widths") # self.connect('coupled.' + name + '.chords', name + '_perf.chords') self.connect("coupled." + name + ".lengths", name + "_perf.lengths") - self.connect("coupled." + name + ".cos_sweep", name + "_perf.cos_sweep") + self.connect("coupled." + name + ".lengths_spanwise", name + "_perf.lengths_spanwise") # Connect parameters from the 'coupled' group to the total performance group. self.connect("coupled." + name + ".S_ref", "total_perf." + name + "_S_ref") diff --git a/openaerostruct/tests/test_aero.py b/openaerostruct/tests/test_aero.py index 7a9de942e..a9adee557 100644 --- a/openaerostruct/tests/test_aero.py +++ b/openaerostruct/tests/test_aero.py @@ -105,9 +105,9 @@ def test(self): prob.run_driver() # docs checkpoint 1 - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.033389699871650073, 1e-6) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.0315758055069556, 1e-6) assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.5, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -1.7885550372372376, 1e-6) + assert_near_equal(prob["aero_point_0.CM"][1], -2.118283205505452, 1e-6) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aero_all_geom.py b/openaerostruct/tests/test_aero_all_geom.py index a4d9dd629..0711babb6 100644 --- a/openaerostruct/tests/test_aero_all_geom.py +++ b/openaerostruct/tests/test_aero_all_geom.py @@ -111,9 +111,9 @@ def test(self): prob.run_driver() - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.03092736603125073, 1e-6) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.02891508386825118, 1e-6) assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.5, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -3.682129774559734, 1e-6) + assert_near_equal(prob["aero_point_0.CM"][1], -4.281635590978787, 1e-6) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aero_analysis.py b/openaerostruct/tests/test_aero_analysis.py index fa724d7d8..b6d49ad5c 100644 --- a/openaerostruct/tests/test_aero_analysis.py +++ b/openaerostruct/tests/test_aero_analysis.py @@ -105,9 +105,9 @@ def test(self): prob.run_driver() - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.038041969673747206, 1e-6) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.03622960296386912, 1e-6) assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.5112640267782032, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -1.735548800386354, 1e-6) + assert_near_equal(prob["aero_point_0.CM"][1], -2.055585393364566, 1e-6) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aero_analysis_Sref.py b/openaerostruct/tests/test_aero_analysis_Sref.py index 561c3834e..9ee7ba8ec 100644 --- a/openaerostruct/tests/test_aero_analysis_Sref.py +++ b/openaerostruct/tests/test_aero_analysis_Sref.py @@ -109,9 +109,9 @@ def test(self): prob.run_driver() - assert_near_equal(prob["aero_point_0.CD"][0], 0.10534816690971655, 1e-6) + assert_near_equal(prob["aero_point_0.CD"][0], 0.10032924932234433, 1e-6) assert_near_equal(prob["aero_point_0.CL"][0], 1.4158238516533308, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -4.806188698195504, 1e-6) + assert_near_equal(prob["aero_point_0.CM"][1], -5.69245375501123, 1e-6) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aero_analysis_compressible.py b/openaerostruct/tests/test_aero_analysis_compressible.py index 64a67322b..f714e618d 100644 --- a/openaerostruct/tests/test_aero_analysis_compressible.py +++ b/openaerostruct/tests/test_aero_analysis_compressible.py @@ -105,9 +105,9 @@ def test(self): prob.run_model() - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.042640338981881076, 1e-6) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.0408276181072298, 1e-6) assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.7007529249715114, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -2.403067220302201, 1e-6) + assert_near_equal(prob["aero_point_0.CM"][1], -2.846194746138373, 1e-6) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aero_analysis_no_symmetry.py b/openaerostruct/tests/test_aero_analysis_no_symmetry.py index 034ac4c13..fedfb66bf 100644 --- a/openaerostruct/tests/test_aero_analysis_no_symmetry.py +++ b/openaerostruct/tests/test_aero_analysis_no_symmetry.py @@ -105,8 +105,8 @@ def test(self): prob.run_driver() assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.4641915422309865, 1e-6) - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.019503986624201042, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -1.5717101821556665, 1e-6) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.017695390209861946, 1e-6) + assert_near_equal(prob["aero_point_0.CM"][1], -1.859570880469676, 1e-6) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aero_analysis_no_symmetry_wavedrag.py b/openaerostruct/tests/test_aero_analysis_no_symmetry_wavedrag.py index 23d5869cf..f7f069f10 100644 --- a/openaerostruct/tests/test_aero_analysis_no_symmetry_wavedrag.py +++ b/openaerostruct/tests/test_aero_analysis_no_symmetry_wavedrag.py @@ -105,8 +105,8 @@ def test(self): prob.run_driver() assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.464191542231, 1e-6) - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.0222413119687, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -1.5717101821556665, 1e-6) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.020417875291205534, 1e-6) + assert_near_equal(prob["aero_point_0.CM"][1], -1.859570880469676, 1e-6) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aero_atmos.py b/openaerostruct/tests/test_aero_atmos.py index 5f2220bd8..f2b88834b 100644 --- a/openaerostruct/tests/test_aero_atmos.py +++ b/openaerostruct/tests/test_aero_atmos.py @@ -106,9 +106,9 @@ def test(self): prob.run_driver() - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.030471796067577953, 1e-6) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.02913259586447903, 1e-6) assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.5, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -1.7331840488188963, 1e-6) + assert_near_equal(prob["aero_point_0.CM"][1], -2.052380195237546, 1e-6) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aero_ffd.py b/openaerostruct/tests/test_aero_ffd.py index b08ef11d0..0f617d957 100644 --- a/openaerostruct/tests/test_aero_ffd.py +++ b/openaerostruct/tests/test_aero_ffd.py @@ -137,9 +137,9 @@ def test(self): prob.run_driver() - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.03398038, 1e-6) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.03217543959727766, 1e-6) assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.5, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -1.773632, 1e-5) + assert_near_equal(prob["aero_point_0.CM"][1], -2.1128954575656356, 1e-5) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aero_ground_effect.py b/openaerostruct/tests/test_aero_ground_effect.py index 3c7425196..2d5dd145a 100644 --- a/openaerostruct/tests/test_aero_ground_effect.py +++ b/openaerostruct/tests/test_aero_ground_effect.py @@ -108,15 +108,15 @@ def test(self): prob.run_driver() - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.033389699871650073, 1e-6) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.03157578980832382, 1e-6) assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.5, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -1.7885550372372376, 1e-6) + assert_near_equal(prob["aero_point_0.CM"][1], -2.118283199819371, 1e-6) prob["height_agl"] = 10.0 prob.run_driver() - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.029145613948518813, 1e-6) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.02733130765201773, 1e-6) assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.5, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -1.7719184423417516, 1e-6) + assert_near_equal(prob["aero_point_0.CM"][1], -2.0985700705109607, 1e-6) totals = prob.check_totals( of=["aero_point_0.wing_perf.CD", "aero_point_0.wing_perf.CL"], diff --git a/openaerostruct/tests/test_aero_morphing_multipoint.py b/openaerostruct/tests/test_aero_morphing_multipoint.py index e7a76eb9c..2e748a6ac 100644 --- a/openaerostruct/tests/test_aero_morphing_multipoint.py +++ b/openaerostruct/tests/test_aero_morphing_multipoint.py @@ -157,6 +157,10 @@ def test(self): assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.45, 1e-6) assert_near_equal(prob["aero_point_1.wing_perf.CL"][0], 0.5, 1e-6) - assert_near_equal(prob["twist_cp_0"], np.array([8.0, -1.21207749, -2.42415497, -1.21207749, -1.0821358]), 1e-6) - assert_near_equal(prob["twist_cp_1"], np.array([8.0, -0.02049115, -0.0409823, -0.02049115, 0.77903674]), 1e-6) + assert_near_equal(prob["twist_cp_0"], np.array([8.0, -1.28899415, -2.57798831, -1.28899415, -0.96161429]), 1e-6) + assert_near_equal(prob["twist_cp_1"], np.array([8.0, -0.02636487, -0.05272973, -0.02636487, 0.7889681]), 1e-6) assert_near_equal(prob["aero_point_1.wing_perf.CL"][0], 0.5, 1e-6) + + +if __name__ == "__main__": + unittest.main() diff --git a/openaerostruct/tests/test_aero_opt_no_symmetry.py b/openaerostruct/tests/test_aero_opt_no_symmetry.py index f1b9202e2..f596c9ebb 100644 --- a/openaerostruct/tests/test_aero_opt_no_symmetry.py +++ b/openaerostruct/tests/test_aero_opt_no_symmetry.py @@ -104,9 +104,9 @@ def test(self): prob.run_driver() - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.03339013029042684, 1e-5) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.03157639089274714, 1e-5) assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.5, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -1.7886135541410009, 1e-4) + assert_near_equal(prob["aero_point_0.CM"][1], -2.1184353479558586, 1e-4) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aero_opt_wavedrag.py b/openaerostruct/tests/test_aero_opt_wavedrag.py index 64d67126f..05cb946a4 100644 --- a/openaerostruct/tests/test_aero_opt_wavedrag.py +++ b/openaerostruct/tests/test_aero_opt_wavedrag.py @@ -113,8 +113,8 @@ def test(self): prob.run_driver() assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.5, 1e-6) - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.022662637, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -1.7597016215887864, 1e-6) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.020838936785019083, 1e-6) + assert_near_equal(prob["aero_point_0.CM"][1], -2.081989092575424, 1e-6) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aerostruct.py b/openaerostruct/tests/test_aerostruct.py index bd49653e8..2ef5e2086 100644 --- a/openaerostruct/tests/test_aerostruct.py +++ b/openaerostruct/tests/test_aerostruct.py @@ -146,7 +146,7 @@ def test(self): prob.run_driver() - assert_near_equal(prob["AS_point_0.fuelburn"][0], 97696.33252514644, 1e-8) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 92369.79279575823, 1e-8) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aerostruct_analysis.py b/openaerostruct/tests/test_aerostruct_analysis.py index 2cee374c9..9f687405c 100644 --- a/openaerostruct/tests/test_aerostruct_analysis.py +++ b/openaerostruct/tests/test_aerostruct_analysis.py @@ -140,8 +140,8 @@ def test(self): prob.run_model() - assert_near_equal(prob["AS_point_0.fuelburn"][0], 266779.31928094657, 1e-4) - assert_near_equal(prob["AS_point_0.CM"][1], -0.5921107171641, 1e-5) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 251362.24734663023, 1e-4) + assert_near_equal(prob["AS_point_0.CM"][1], -0.7033677364356814, 1e-5) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aerostruct_analysis_Sref.py b/openaerostruct/tests/test_aerostruct_analysis_Sref.py index 4cb89f18e..879d46ab4 100644 --- a/openaerostruct/tests/test_aerostruct_analysis_Sref.py +++ b/openaerostruct/tests/test_aerostruct_analysis_Sref.py @@ -143,7 +143,7 @@ def test(self): prob.run_model() assert_near_equal(prob["AS_point_0.CL"][0], 1.6217443031469607, 1e-6) - assert_near_equal(prob["AS_point_0.CM"][1], -1.682700295091543, 1e-5) + assert_near_equal(prob["AS_point_0.CM"][1], -1.9988780195141023, 1e-5) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aerostruct_analysis_compressible.py b/openaerostruct/tests/test_aerostruct_analysis_compressible.py index 44fb1a491..c62671b01 100644 --- a/openaerostruct/tests/test_aerostruct_analysis_compressible.py +++ b/openaerostruct/tests/test_aerostruct_analysis_compressible.py @@ -142,8 +142,8 @@ def test(self): prob.run_model() - assert_near_equal(prob["AS_point_0.fuelburn"][0], 224407.92673401345, 1e-4) - assert_near_equal(prob["AS_point_0.CM"][1], -0.8308573193422, 1e-5) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 213840.78859689648, 1e-4) + assert_near_equal(prob["AS_point_0.CM"][1], -0.9866929184880228, 1e-5) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aerostruct_engine_thrusts.py b/openaerostruct/tests/test_aerostruct_engine_thrusts.py index aa546eeda..46e146c85 100644 --- a/openaerostruct/tests/test_aerostruct_engine_thrusts.py +++ b/openaerostruct/tests/test_aerostruct_engine_thrusts.py @@ -159,8 +159,8 @@ def test(self): print(prob["AS_point_0.fuelburn"][0]) print(prob["AS_point_0.CM"][1]) - assert_near_equal(prob["AS_point_0.fuelburn"][0], 267385.8819288796, 1e-4) - assert_near_equal(prob["AS_point_0.CM"][1], -0.590064260544, 1e-5) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 251929.9085951508, 1e-4) + assert_near_equal(prob["AS_point_0.CM"][1], -0.7008367976235399, 1e-5) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aerostruct_ffd.py b/openaerostruct/tests/test_aerostruct_ffd.py index 105e53ebf..98bc6f86c 100644 --- a/openaerostruct/tests/test_aerostruct_ffd.py +++ b/openaerostruct/tests/test_aerostruct_ffd.py @@ -170,7 +170,7 @@ def test(self): # prob.run_model() prob.run_driver() - assert_near_equal(prob["AS_point_0.fuelburn"][0], 97680.8964568375, 1e-3) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 92343.61493294379, 1e-3) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aerostruct_groundeffect.py b/openaerostruct/tests/test_aerostruct_groundeffect.py index 60d98ea43..5c2a8c70a 100644 --- a/openaerostruct/tests/test_aerostruct_groundeffect.py +++ b/openaerostruct/tests/test_aerostruct_groundeffect.py @@ -145,11 +145,11 @@ def test(self): prob.setup(check=True) prob.run_driver() - assert_near_equal(prob["AS_point_0.fuelburn"][0], 97696.33252514644, 1e-6) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 92369.74980979414, 1e-6) prob["height_agl"] = 20.0 prob.run_driver() # the fuel burn should be less in ground effect - assert_near_equal(prob["AS_point_0.fuelburn"][0], 91994.52652058695, 1e-6) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 86910.5549671242, 1e-6) totals = prob.check_totals( of=["AS_point_0.L_equals_W", "AS_point_0.fuelburn", "AS_point_0.wing_perf.failure"], wrt=["wing.twist_cp", "alpha", "height_agl"], diff --git a/openaerostruct/tests/test_aerostruct_point_loads.py b/openaerostruct/tests/test_aerostruct_point_loads.py index 068ae17b4..fea8dae62 100644 --- a/openaerostruct/tests/test_aerostruct_point_loads.py +++ b/openaerostruct/tests/test_aerostruct_point_loads.py @@ -153,8 +153,8 @@ def test(self): prob.run_model() - assert_near_equal(prob["AS_point_0.fuelburn"][0], 267518.2837095164, 1e-4) - assert_near_equal(prob["AS_point_0.CM"][1], -0.58977996718612, 1e-5) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 252038.66600566648, 1e-4) + assert_near_equal(prob["AS_point_0.CM"][1], -0.7006002684582702, 1e-5) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aerostruct_wingbox_+weight_analysis.py b/openaerostruct/tests/test_aerostruct_wingbox_+weight_analysis.py index cc5a10e96..17aafaf71 100644 --- a/openaerostruct/tests/test_aerostruct_wingbox_+weight_analysis.py +++ b/openaerostruct/tests/test_aerostruct_wingbox_+weight_analysis.py @@ -403,7 +403,7 @@ def test(self): prob.run_model() - assert_near_equal(prob["AS_point_0.fuelburn"][0], 89003.902195, 1e-5) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 84598.60636387265, 1e-5) assert_near_equal(prob["wing.structural_mass"][0] / 1.25, 24009.5230566, 1e-5) diff --git a/openaerostruct/tests/test_aerostruct_wingbox_analysis.py b/openaerostruct/tests/test_aerostruct_wingbox_analysis.py index f27b8e3cd..f05f60033 100644 --- a/openaerostruct/tests/test_aerostruct_wingbox_analysis.py +++ b/openaerostruct/tests/test_aerostruct_wingbox_analysis.py @@ -404,7 +404,7 @@ def test(self): print(prob["wing.structural_mass"][0] / 1.25) print(prob["AS_point_0.wing_perf.failure"][0]) - assert_near_equal(prob["AS_point_0.fuelburn"][0], 89411.50246542075, 1e-5) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 84999.8396153129, 1e-5) assert_near_equal(prob["wing.structural_mass"][0] / 1.25, 24009.5230566, 1e-5) assert_near_equal(prob["AS_point_0.wing_perf.failure"][0], 1.6254327137382174, 1e-5) diff --git a/openaerostruct/tests/test_aerostruct_wingbox_fuel_vol_constraint_opt.py b/openaerostruct/tests/test_aerostruct_wingbox_fuel_vol_constraint_opt.py index 509591448..892f3a152 100644 --- a/openaerostruct/tests/test_aerostruct_wingbox_fuel_vol_constraint_opt.py +++ b/openaerostruct/tests/test_aerostruct_wingbox_fuel_vol_constraint_opt.py @@ -435,9 +435,9 @@ def test(self): print(prob["wing.structural_mass"][0] / 1.25) print(prob["fuel_vol_delta.fuel_vol_delta"][0]) - assert_near_equal(prob["AS_point_0.fuelburn"][0], 82019.934119, 1e-5) - assert_near_equal(prob["wing.structural_mass"][0] / 1.25, 12211.382514, 1e-4) - assert_near_equal(prob["fuel_vol_delta.fuel_vol_delta"][0], 35.3020703438527, 1e-4) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 76869.38586654868, 1e-5) + assert_near_equal(prob["wing.structural_mass"][0] / 1.25, 11619.131535449487, 1e-4) + assert_near_equal(prob["fuel_vol_delta.fuel_vol_delta"][0], 42.98939210455205, 1e-4) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_aerostruct_wingbox_opt.py b/openaerostruct/tests/test_aerostruct_wingbox_opt.py index 36236dcb8..909e7b5b3 100644 --- a/openaerostruct/tests/test_aerostruct_wingbox_opt.py +++ b/openaerostruct/tests/test_aerostruct_wingbox_opt.py @@ -411,8 +411,8 @@ def test(self): prob.setup() prob.run_driver() - assert_near_equal(prob["AS_point_0.fuelburn"][0], 84387.962001, 1e-5) - assert_near_equal(prob["wing.structural_mass"][0] / 1.25, 13974.684240, 1e-5) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 79151.03928720397, 1e-5) + assert_near_equal(prob["wing.structural_mass"][0] / 1.25, 13387.705394088985, 1e-5) assert_near_equal(prob["wing.geometry.span"][0], 60.0, 1e-5) diff --git a/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py b/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py index a63ccec18..83e64ca91 100644 --- a/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py +++ b/openaerostruct/tests/test_aerostruct_wingbox_wave_fuel_vol_constraint_opt.py @@ -432,8 +432,8 @@ def test(self): prob.run_driver() - assert_near_equal(prob["AS_point_0.fuelburn"][0], 83383.555232, 1e-5) - assert_near_equal(prob["wing.structural_mass"][0] / 1.25, 16219.119311, 1e-5) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 78292.730861421, 1e-5) + assert_near_equal(prob["wing.structural_mass"][0] / 1.25, 16168.330307591294, 1e-5) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_multiple_aero_analysis.py b/openaerostruct/tests/test_multiple_aero_analysis.py index 17e66324c..701d90e67 100644 --- a/openaerostruct/tests/test_multiple_aero_analysis.py +++ b/openaerostruct/tests/test_multiple_aero_analysis.py @@ -138,9 +138,9 @@ def test(self): prob.run_model() - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.037210478659832125, 1e-6) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.03539775778518085, 1e-6) assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.5124736932248048, 1e-6) - assert_near_equal(prob["aero_point_0.CM"][1], -1.7028233361964462, 1e-6) + assert_near_equal(prob["aero_point_0.CM"][1], -2.016825327289286, 1e-6) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_multipoint_aero.py b/openaerostruct/tests/test_multipoint_aero.py index 25e9e99d1..90f875dfa 100644 --- a/openaerostruct/tests/test_multipoint_aero.py +++ b/openaerostruct/tests/test_multipoint_aero.py @@ -129,9 +129,9 @@ def test(self): prob.run_driver() assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.45, 1e-6) - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.0323165143, 1e-6) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.030502881726099183, 1e-6) assert_near_equal(prob["aero_point_1.wing_perf.CL"][0], 0.5, 1e-6) - assert_near_equal(prob["aero_point_1.wing_perf.CD"][0], 0.0337665178, 1e-6) + assert_near_equal(prob["aero_point_1.wing_perf.CD"][0], 0.03195303546890328, 1e-6) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_multipoint_wingbox_aerostruct.py b/openaerostruct/tests/test_multipoint_wingbox_aerostruct.py index 861af2a6e..a5b322af9 100644 --- a/openaerostruct/tests/test_multipoint_wingbox_aerostruct.py +++ b/openaerostruct/tests/test_multipoint_wingbox_aerostruct.py @@ -462,8 +462,8 @@ def test(self): print(prob["AS_point_0.fuelburn"][0]) print(prob["wing.structural_mass"][0] / 1.25) - assert_near_equal(prob["AS_point_0.fuelburn"][0], 93177.833744, 1e-5) - assert_near_equal(prob["wing.structural_mass"][0] / 1.25, 26640.125856, 1e-5) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 87313.4177585217, 1e-5) + assert_near_equal(prob["wing.structural_mass"][0] / 1.25, 26352.1600542036, 1e-5) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_scaneagle.py b/openaerostruct/tests/test_scaneagle.py index af69f3c08..ca7215abe 100644 --- a/openaerostruct/tests/test_scaneagle.py +++ b/openaerostruct/tests/test_scaneagle.py @@ -204,10 +204,10 @@ def test(self): # Actually run the optimization problem prob.run_driver() - assert_near_equal(prob["AS_point_0.fuelburn"][0], 4.734596439931736, 1e-6) - assert_near_equal(prob["wing.twist_cp"], np.array([2.52737808, 10.62041433, 5.0]), 1e-6) - assert_near_equal(prob["wing.sweep"][0], 18.84598985, 1e-6) - assert_near_equal(prob["alpha"][0], 1.97414017, 1e-6) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 4.6365011384888275, 1e-5) + assert_near_equal(prob["wing.twist_cp"], np.array([2.25819837, 10.39881572, 5.0]), 1e-5) + assert_near_equal(prob["wing.sweep"][0], 18.964409030629632, 1e-5) + assert_near_equal(prob["alpha"][0], 2.0366563718492547, 1e-5) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_simple_rect_AS.py b/openaerostruct/tests/test_simple_rect_AS.py index 5deed4fee..15bee3109 100644 --- a/openaerostruct/tests/test_simple_rect_AS.py +++ b/openaerostruct/tests/test_simple_rect_AS.py @@ -14,7 +14,7 @@ class Test(unittest.TestCase): def test(self): # Create a dictionary to store options about the surface # OM: vary 'num_y' and 'num_x' to change the size of the mesh - mesh_dict = {"num_y": 5, "num_x": 2, "wing_type": "rect", "symmetry": True} + mesh_dict = {"num_y": 5, "num_x": 2, "wing_type": "rect", "symmetry": True, "span": 40.0, "root_chord": 4.0} mesh = generate_mesh(mesh_dict) @@ -137,7 +137,7 @@ def test(self): prob.model.connect(name + ".t_over_c", com_name + ".t_over_c") prob.driver = om.ScipyOptimizeDriver() - prob.driver.options["tol"] = 1e-9 + prob.driver.options["tol"] = 1e-7 # Setup problem and add design variables, constraint, and objective prob.model.add_design_var("wing.twist_cp", lower=-10.0, upper=15.0) @@ -155,7 +155,7 @@ def test(self): prob.run_driver() - assert_near_equal(prob["AS_point_0.fuelburn"][0], 68345.6633812, 1e-5) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 73196.44377669816, 1e-5) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_v1_aero_viscous_opt.py b/openaerostruct/tests/test_v1_aero_viscous_opt.py index 3fb13824c..c05f77a08 100644 --- a/openaerostruct/tests/test_v1_aero_viscous_opt.py +++ b/openaerostruct/tests/test_v1_aero_viscous_opt.py @@ -126,7 +126,7 @@ def test(self): prob.run_driver() assert_near_equal(prob["aero_point_0.wing_perf.CL"][0], 0.5, 1e-5) - assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.019234984422361764, 1e-3) + assert_near_equal(prob["aero_point_0.wing_perf.CD"][0], 0.01781794275068793, 1e-3) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_v1_aerostruct_analysis.py b/openaerostruct/tests/test_v1_aerostruct_analysis.py index 48ff33f27..312a8c4eb 100644 --- a/openaerostruct/tests/test_v1_aerostruct_analysis.py +++ b/openaerostruct/tests/test_v1_aerostruct_analysis.py @@ -152,7 +152,7 @@ def test(self): assert_near_equal(prob["AS_point_0.wing_perf.CL"][0], 0.510849206378, 1e-6) assert_near_equal(prob["AS_point_0.wing_perf.failure"][0], -0.483587598753, 1e-6) assert_near_equal(prob["AS_point_0.fuelburn"][0], 68894.2100988, 1e-4) - assert_near_equal(prob["AS_point_0.CM"][1], -1.301925362641, 1e-5) + assert_near_equal(prob["AS_point_0.CM"][1], -1.539189058161678, 1e-5) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_v1_aerostruct_opt.py b/openaerostruct/tests/test_v1_aerostruct_opt.py index dfa43d23d..0dfec327a 100644 --- a/openaerostruct/tests/test_v1_aerostruct_opt.py +++ b/openaerostruct/tests/test_v1_aerostruct_opt.py @@ -163,10 +163,10 @@ def test(self): prob.run_driver() - assert_near_equal(prob["AS_point_0.wing_perf.CL"][0], 0.443870671238, 1e-6) - assert_near_equal(prob["AS_point_0.fuelburn"][0], 92145.07464246, 1.5e-6) + assert_near_equal(prob["AS_point_0.wing_perf.CL"][0], 0.4339794291648379, 1e-6) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 87393.27347123597, 1.5e-6) assert_near_equal(prob["AS_point_0.wing_perf.failure"][0], 0.0, 1e-6) - assert_near_equal(prob["AS_point_0.CM"][1], -1.3438534437120, 1e-4) + assert_near_equal(prob["AS_point_0.CM"][1], -1.5690618184395095, 1e-4) if __name__ == "__main__": diff --git a/openaerostruct/tests/test_vsp_aero_analysis.py b/openaerostruct/tests/test_vsp_aero_analysis.py index 01368d742..aa04d056a 100644 --- a/openaerostruct/tests/test_vsp_aero_analysis.py +++ b/openaerostruct/tests/test_vsp_aero_analysis.py @@ -34,7 +34,7 @@ def test(self): assert_near_equal(symm_prob["flight_condition_0.Wing_perf.CD"][0], 0.010722632534543076, 1e-6) assert_near_equal(symm_prob["flight_condition_0.Wing_perf.CL"][0], 0.5246182619241868, 1e-6) - assert_near_equal(symm_prob["flight_condition_0.CM"][1], -0.5304298364679864, 1e-6) + assert_near_equal(symm_prob["flight_condition_0.CM"][1], -0.591626120207946, 1e-6) assert_near_equal( symm_prob["flight_condition_0.Wing_perf.CD"][0], full_prob["flight_condition_0.Wing_perf.CD"][0], 1e-6 diff --git a/openaerostruct/tests/test_wingbox_distributed_fuel.py b/openaerostruct/tests/test_wingbox_distributed_fuel.py index 5423ac252..81a41ef05 100644 --- a/openaerostruct/tests/test_wingbox_distributed_fuel.py +++ b/openaerostruct/tests/test_wingbox_distributed_fuel.py @@ -417,7 +417,7 @@ def test(self): # ======================================================================================= prob.driver = om.ScipyOptimizeDriver() - prob.driver.options["tol"] = 1e-9 + prob.driver.options["tol"] = 1e-7 prob.model.add_objective("AS_point_0.fuelburn", scaler=1e-5) @@ -446,8 +446,8 @@ def test(self): print(prob["AS_point_0.fuelburn"][0]) print(prob["wing.structural_mass"][0] / 1.25) - assert_near_equal(prob["AS_point_0.fuelburn"][0], 80758.28839215, 1e-5) - assert_near_equal(prob["wing.structural_mass"][0] / 1.25, 12330.193521430, 1e-5) + assert_near_equal(prob["AS_point_0.fuelburn"][0], 75973.2666251404, 1e-5) + assert_near_equal(prob["wing.structural_mass"][0] / 1.25, 12486.89671978072, 1e-4) if __name__ == "__main__":