Skip to content

Commit

Permalink
Oops, still missed a few more
Browse files Browse the repository at this point in the history
  • Loading branch information
eytanadler committed Mar 2, 2023
1 parent d62e50f commit 7c20b65
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ def test_defaults(self):
toverc = np.array([0.05, 0.1, 0.12])
t_skin = np.array([5, 13, 15]) # mm
t_spar = np.array([5, 13, 15]) # mm
p = om.Problem(
p = om.Problem()
p.model.add_subsystem(
"comp",
OASDataGen(
num_x=3,
num_y=7,
Expand All @@ -249,7 +251,8 @@ def test_defaults(self):
Mach_train=np.linspace(0.1, 0.85, 2),
alpha_train=np.linspace(-10, 15, 2),
alt_train=np.linspace(0, 15e3, 2),
)
),
promotes=["*"],
)
p.setup()
p.set_val("fltcond|TempIncrement", 0, units="degC")
Expand Down
25 changes: 17 additions & 8 deletions openconcept/aerodynamics/openaerostruct/tests/test_drag_polar.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,18 @@ def tearDown(self):
def test_defaults(self):
# Regression test
twist = np.array([-1, -0.5, 2])
p = om.Problem(
p = om.Problem()
p.model.add_subsystem(
"comp",
VLMDataGen(
num_x=3,
num_y=5,
num_twist=twist.size,
Mach_train=np.linspace(0.1, 0.85, 2),
alpha_train=np.linspace(-10, 15, 2),
alt_train=np.linspace(0, 15e3, 2),
)
),
promotes=["*"],
)
p.setup()
p.set_val("fltcond|TempIncrement", 0, units="degC")
Expand Down Expand Up @@ -375,7 +378,8 @@ class PlanformMeshTestCase(unittest.TestCase):
def test_easy(self):
nx = 3
ny = 5
p = om.Problem(PlanformMesh(num_x=nx, num_y=ny))
p = om.Problem()
p.model.add_subsystem("comp", PlanformMesh(num_x=nx, num_y=ny), promotes=["*"])
p.setup()
p.set_val("S", 2, units="m**2")
p.set_val("AR", 2)
Expand All @@ -394,7 +398,8 @@ def test_easy(self):
def test_S_AR(self):
nx = 3
ny = 5
p = om.Problem(PlanformMesh(num_x=nx, num_y=ny))
p = om.Problem()
p.model.add_subsystem("comp", PlanformMesh(num_x=nx, num_y=ny), promotes=["*"])
p.setup(force_alloc_complex=True)
p.set_val("S", 48, units="m**2")
p.set_val("AR", 3)
Expand All @@ -413,7 +418,8 @@ def test_S_AR(self):
def test_taper(self):
nx = 2
ny = 3
p = om.Problem(PlanformMesh(num_x=nx, num_y=ny))
p = om.Problem()
p.model.add_subsystem("comp", PlanformMesh(num_x=nx, num_y=ny), promotes=["*"])
p.setup()
p.set_val("S", 1.3, units="m**2")
p.set_val("AR", 4 / 1.3) # pick S and AR for half span and root chord of 1
Expand All @@ -433,7 +439,8 @@ def test_taper(self):
def test_sweep(self):
nx = 3
ny = 3
p = om.Problem(PlanformMesh(num_x=nx, num_y=ny))
p = om.Problem()
p.model.add_subsystem("comp", PlanformMesh(num_x=nx, num_y=ny), promotes=["*"])
p.setup()
p.set_val("S", 2, units="m**2")
p.set_val("AR", 2)
Expand All @@ -455,7 +462,8 @@ def test_sweep(self):
def test_taper_sweep(self):
nx = 2
ny = 3
p = om.Problem(PlanformMesh(num_x=nx, num_y=ny))
p = om.Problem()
p.model.add_subsystem("comp", PlanformMesh(num_x=nx, num_y=ny), promotes=["*"])
p.setup()
p.set_val("S", 1.3, units="m**2")
p.set_val("AR", 4 / 1.3) # pick S and AR for half span and root chord of 1
Expand All @@ -477,7 +485,8 @@ def test_taper_sweep(self):
def test_777ish_regression(self):
nx = 3
ny = 4
p = om.Problem(PlanformMesh(num_x=nx, num_y=ny))
p = om.Problem()
p.model.add_subsystem("comp", PlanformMesh(num_x=nx, num_y=ny), promotes=["*"])
p.setup()
p.set_val("S", 427.8, units="m**2")
p.set_val("AR", 9.82)
Expand Down
3 changes: 2 additions & 1 deletion openconcept/utilities/math/tests/test_min_max_comp.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def test_multiple_inputs(self):

def test_multiple_min(self):
nn = 5
p = Problem(MinComp(num_nodes=nn))
p = Problem()
p.model.add_subsystem("comp", MinComp(num_nodes=nn), promotes=["*"])
p.setup(check=True, force_alloc_complex=True)
p.set_val("array", np.array([42.0, 7.0, 30.0, 58.0, 7.0]))
p.run_model()
Expand Down

0 comments on commit 7c20b65

Please sign in to comment.