From 48f3db1fca41a247b5f842ef971750939ec1d0da Mon Sep 17 00:00:00 2001 From: fzahle Date: Wed, 2 Mar 2016 15:05:58 +0100 Subject: [PATCH] geometry varnames with prefixes, see #21 --- .../turbine/loftedsurface_with_cps_ex.py | 34 +-- fusedwind/turbine/geometry.py | 207 +++++++++--------- fusedwind/turbine/structure.py | 4 +- fusedwind/turbine/test/test_pglloftedblade.py | 6 +- fusedwind/turbine/test/test_planform.py | 4 +- .../turbine/test/test_splinedplanform.py | 15 +- .../turbine/test/test_splinedstructure.py | 4 +- 7 files changed, 138 insertions(+), 136 deletions(-) diff --git a/fusedwind/examples/turbine/loftedsurface_with_cps_ex.py b/fusedwind/examples/turbine/loftedsurface_with_cps_ex.py index fba647b..debf1a3 100644 --- a/fusedwind/examples/turbine/loftedsurface_with_cps_ex.py +++ b/fusedwind/examples/turbine/loftedsurface_with_cps_ex.py @@ -77,23 +77,23 @@ def configure_surface(): plt.figure() plt.axis('equal') - for i in range(p['blade_surface_st'].shape[1]): - plt.plot(p['blade_surface_st'][:,i, 2], p['blade_surface_st'][:,i, 0], 'r-') - plt.plot(p['blade_surface_st'][0, :, 2], p['blade_surface_st'][100, :, 0],'r-') - plt.plot(p['blade_surface_st'][0, :, 2], p['blade_surface_st'][0, :, 0],'r-') - plt.plot(p['z'], p['x'], 'r-', label='Original') + for i in range(p['blade_st:surface'].shape[1]): + plt.plot(p['blade_st:surface'][:,i, 2], p['blade_st:surface'][:,i, 0], 'r-') + plt.plot(p['blade_st:surface'][0, :, 2], p['blade_st:surface'][100, :, 0],'r-') + plt.plot(p['blade_st:surface'][0, :, 2], p['blade_st:surface'][0, :, 0],'r-') + plt.plot(p['blade_ae:z'], p['blade_ae:x'], 'r-', label='Original') # --- 6 # add sweep to the blade - p['x_C'][-1]=-.05 + p['blade_ae:x_C'][-1]=-.05 p.run() - for i in range(p['blade_surface_st'].shape[1]): - plt.plot(p['blade_surface_st'][:,i, 2], p['blade_surface_st'][:,i, 0], 'b-') - plt.plot(p['z'], p['x'], 'b-', label='Swept') - plt.plot(p['blade_surface_st'][0, :, 2], p['blade_surface_st'][100, :, 0],'b-') - plt.plot(p['blade_surface_st'][0, :, 2], p['blade_surface_st'][0, :, 0],'b-') - plt.plot(p.root.pf_splines.x_s.Cx, p['x_C'], 'g--o', label='Spline CPs') + for i in range(p['blade_st:surface'].shape[1]): + plt.plot(p['blade_st:surface'][:,i, 2], p['blade_st:surface'][:,i, 0], 'b-') + plt.plot(p['blade_ae:z'], p['blade_ae:x'], 'b-', label='Swept') + plt.plot(p['blade_st:surface'][0, :, 2], p['blade_st:surface'][100, :, 0],'b-') + plt.plot(p['blade_st:surface'][0, :, 2], p['blade_st:surface'][0, :, 0],'b-') + plt.plot(p.root.pf_splines.x_s.Cx, p['blade_ae:x_C'], 'g--o', label='Spline CPs') plt.legend(loc='best') plt.savefig('bladesurface_topview.png') plt.show() @@ -102,12 +102,12 @@ def configure_surface(): # modify chord plt.figure() - plt.plot(p['s'], p['chord'], 'r-', label='Original') - p['chord_C'][1]=.01 - p['chord_C'][2]=-.01 + plt.plot(p['blade_ae:s'], p['blade_ae:chord'], 'r-', label='Original') + p['blade_ae:chord_C'][1]=.01 + p['blade_ae:chord_C'][2]=-.01 p.run() - plt.plot(p['z'], p['chord'], 'b-', label='Modified') - plt.plot(p.root.pf_splines.chord_s.Cx, p['chord_C'], 'g--o', label='Spline CPs') + plt.plot(p['blade_ae:z'], p['blade_ae:chord'], 'b-', label='Modified') + plt.plot(p.root.pf_splines.chord_s.Cx, p['blade_ae:chord_C'], 'g--o', label='Spline CPs') plt.plot(p.root.pf_splines.chord_s.s, p.root.pf_splines.chord_s._P, 'm--o', label='') plt.legend(loc='best') plt.savefig('chord_ffd_spline.png') diff --git a/fusedwind/turbine/geometry.py b/fusedwind/turbine/geometry.py index ab6b56b..727d99e 100644 --- a/fusedwind/turbine/geometry.py +++ b/fusedwind/turbine/geometry.py @@ -244,15 +244,15 @@ def __init__(self, size_in, filebase='blade'): self.filebase = filebase + '%i' % self.__hash__() - self.add_param('x', np.zeros(size_in)) - self.add_param('y', np.zeros(size_in)) - self.add_param('z', np.zeros(size_in)) - self.add_param('chord', np.zeros(size_in)) - self.add_param('rthick', np.zeros(size_in)) - self.add_param('rot_x', np.zeros(size_in)) - self.add_param('rot_y', np.zeros(size_in)) - self.add_param('rot_z', np.zeros(size_in)) - self.add_param('p_le', np.zeros(size_in)) + self.add_param('blade_ae:x', np.zeros(size_in)) + self.add_param('blade_ae:y', np.zeros(size_in)) + self.add_param('blade_ae:z', np.zeros(size_in)) + self.add_param('blade_ae:chord', np.zeros(size_in)) + self.add_param('blade_ae:rthick', np.zeros(size_in)) + self.add_param('blade_ae:rot_x', np.zeros(size_in)) + self.add_param('blade_ae:rot_y', np.zeros(size_in)) + self.add_param('blade_ae:rot_z', np.zeros(size_in)) + self.add_param('blade_ae:p_le', np.zeros(size_in)) self._exec_count = 0 @@ -261,15 +261,15 @@ def solve_nonlinear(self, params, unknowns, resids): self._exec_count += 1 pf = {} - pf['x'] = params['x'] - pf['y'] = params['y'] - pf['z'] = params['z'] - pf['rot_x'] = params['rot_x'] - pf['rot_y'] = params['rot_y'] - pf['rot_z'] = params['rot_z'] - pf['chord'] = params['chord'] - pf['rthick'] = params['rthick'] - pf['p_le'] = params['p_le'] + pf['x'] = params['blade_ae:x'] + pf['y'] = params['blade_ae:y'] + pf['z'] = params['blade_ae:z'] + pf['rot_x'] = params['blade_ae:rot_x'] + pf['rot_y'] = params['blade_ae:rot_y'] + pf['rot_z'] = params['blade_ae:rot_z'] + pf['chord'] = params['blade_ae:chord'] + pf['rthick'] = params['blade_ae:rthick'] + pf['p_le'] = params['blade_ae:p_le'] write_blade_planform(pf, self.filebase + '_it%i.pfd'%self._exec_count) @@ -358,49 +358,46 @@ def __init__(self, name, size_in, s_new): # options are 'linear', 'ncubic', 'pchip', 'akima' self.spline_type = 'akima' - self.add_param('s', np.zeros(size_in)) - self.add_param('x', np.zeros(size_in)) - self.add_param('y', np.zeros(size_in)) - self.add_param('z', np.zeros(size_in)) - self.add_param('chord', np.zeros(size_in)) - self.add_param('rthick', np.zeros(size_in)) - self.add_param('rot_x', np.zeros(size_in)) - self.add_param('rot_y', np.zeros(size_in)) - self.add_param('rot_z', np.zeros(size_in)) - self.add_param('p_le', np.zeros(size_in)) + self.add_param('blade_ae:s', np.zeros(size_in)) + self.add_param('blade_ae:x', np.zeros(size_in)) + self.add_param('blade_ae:y', np.zeros(size_in)) + self.add_param('blade_ae:z', np.zeros(size_in)) + self.add_param('blade_ae:chord', np.zeros(size_in)) + self.add_param('blade_ae:rthick', np.zeros(size_in)) + self.add_param('blade_ae:rot_x', np.zeros(size_in)) + self.add_param('blade_ae:rot_y', np.zeros(size_in)) + self.add_param('blade_ae:rot_z', np.zeros(size_in)) + self.add_param('blade_ae:p_le', np.zeros(size_in)) self.s_new = s_new size_out = s_new.shape[0] self._suffix = name - self.add_output('s'+name, np.zeros(size_out)) - self.add_output('x'+name, np.zeros(size_out)) - self.add_output('y'+name, np.zeros(size_out)) - self.add_output('z'+name, np.zeros(size_out)) - self.add_output('chord'+name, np.zeros(size_out)) - self.add_output('rthick'+name, np.zeros(size_out)) - self.add_output('rot_x'+name, np.zeros(size_out)) - self.add_output('rot_y'+name, np.zeros(size_out)) - self.add_output('rot_z'+name, np.zeros(size_out)) - self.add_output('p_le'+name, np.zeros(size_out)) - self.add_output('athick'+name, np.zeros(size_out)) + self.add_output('blade%s:s' % name, np.zeros(size_out)) + self.add_output('blade%s:x' % name, np.zeros(size_out)) + self.add_output('blade%s:y' % name, np.zeros(size_out)) + self.add_output('blade%s:z' % name, np.zeros(size_out)) + self.add_output('blade%s:chord' % name, np.zeros(size_out)) + self.add_output('blade%s:rthick' % name, np.zeros(size_out)) + self.add_output('blade%s:rot_x' % name, np.zeros(size_out)) + self.add_output('blade%s:rot_y' % name, np.zeros(size_out)) + self.add_output('blade%s:rot_z' % name, np.zeros(size_out)) + self.add_output('blade%s:p_le' % name, np.zeros(size_out)) + self.add_output('blade%s:athick' % name, np.zeros(size_out)) def solve_nonlinear(self, params, unknowns, resids): - # we need to dig into the _ByObjWrapper val to get the array - # values out - # pf_in = {name: val['val'].val for name, val in params.iteritems()} pf_in = {} - pf_in['s'] = params['s'] - pf_in['x'] = params['x'] - pf_in['y'] = params['y'] - pf_in['z'] = params['z'] - pf_in['rot_x'] = params['rot_x'] - pf_in['rot_y'] = params['rot_y'] - pf_in['rot_z'] = params['rot_z'] - pf_in['chord'] = params['chord'] - pf_in['rthick'] = params['rthick'] - pf_in['p_le'] = params['p_le'] + pf_in['s'] = params['blade_ae:s'] + pf_in['x'] = params['blade_ae:x'] + pf_in['y'] = params['blade_ae:y'] + pf_in['z'] = params['blade_ae:z'] + pf_in['rot_x'] = params['blade_ae:rot_x'] + pf_in['rot_y'] = params['blade_ae:rot_y'] + pf_in['rot_z'] = params['blade_ae:rot_z'] + pf_in['chord'] = params['blade_ae:chord'] + pf_in['rthick'] = params['blade_ae:rthick'] + pf_in['p_le'] = params['blade_ae:p_le'] if _PGL_installed: pf = redistribute_planform(pf_in, s=self.s_new, spline_type=self.spline_type) @@ -411,8 +408,8 @@ def solve_nonlinear(self, params, unknowns, resids): pf[k] = spl(self.s_new) for k, v in pf.iteritems(): - unknowns[k+self._suffix] = v - unknowns['athick'+self._suffix] = pf['chord'] * pf['rthick'] + unknowns['blade%s:%s' % (self._suffix, k)] = v + unknowns['blade%s:athick' % self._suffix] = pf['chord'] * pf['rthick'] class FFDSpline(Component): @@ -476,13 +473,13 @@ def __init__(self, size, suffix=''): super(ScaleChord, self).__init__() self.add_param('blade_scale', 1.) - self.add_param('chord_in', np.zeros(size)) - self.add_output('chord' + suffix, np.zeros(size)) + self.add_param('blade_ae:chord_in', np.zeros(size)) + self.add_output('blade_ae:chord' + suffix, np.zeros(size)) self._suffix = suffix def solve_nonlinear(self, params, unknowns, resids): - unknowns['chord' + self._suffix] = params['chord_in'] / params['blade_scale'] + unknowns['blade_ae:chord' + self._suffix] = params['blade_ae:chord_in'] / params['blade_scale'] class ComputeAthick(Component): @@ -494,13 +491,13 @@ class ComputeAthick(Component): def __init__(self, size): super(ComputeAthick, self).__init__() - self.add_param('chord', np.zeros(size)) - self.add_param('rthick', np.zeros(size)) - self.add_output('athick', np.zeros(size)) + self.add_param('blade_ae:chord', np.zeros(size)) + self.add_param('blade_ae:rthick', np.zeros(size)) + self.add_output('blade_ae:athick', np.zeros(size)) def solve_nonlinear(self, params, unknowns, resids): - unknowns['athick'] = params['chord'] * params['rthick'] + unknowns['blade_ae:athick'] = params['blade_ae:chord'] * params['blade_ae:rthick'] class ComputeSmax(Component): @@ -508,16 +505,16 @@ class ComputeSmax(Component): def __init__(self, pf): super(ComputeSmax, self).__init__() - self.add_param('x', pf['x']) - self.add_param('y', pf['y']) - self.add_param('z', pf['z']) + self.add_param('blade_ae:x', pf['x']) + self.add_param('blade_ae:y', pf['y']) + self.add_param('blade_ae:z', pf['z']) self.add_output('blade_curve_length', 0.) def solve_nonlinear(self, params, unknowns, resids): - s = calculate_length(np.array([params['x'], - params['y'], - params['z']]).T) + s = calculate_length(np.array([params['blade_ae:x'], + params['blade_ae:y'], + params['blade_ae:z']]).T) unknowns['blade_curve_length'] = s[-1] @@ -585,42 +582,46 @@ def add_spline(self, name, Cx, spline_type='bezier', scaler=1.): # chord needs to be scaled according to blade scale parameter if name == 'chord': cname = name + '_c' - self.add(cname, IndepVarComp(name + '_C', np.zeros(len(Cx))), promotes=['*']) - c = self.add(name + '_s', FFDSpline('chord', + self.add(cname, IndepVarComp('blade_ae:'+name + '_C', np.zeros(len(Cx))), promotes=['*']) + c = self.add(name + '_s', FFDSpline('blade_ae:chord', s=self.pfinit['s'], P=self.pfinit['chord'], Cx=Cx, scaler=scaler), - promotes=['chord_C']) + promotes=['blade_ae:chord_C']) c.spline_options['spline_type'] = spline_type - self.add('chord_scaler', ScaleChord(self._size), promotes=['blade_scale', 'chord']) - self.connect('chord_s.chord', 'chord_scaler.chord_in') + self.add('chord_scaler', ScaleChord(self._size), promotes=['blade_scale', 'blade_ae:chord']) + self.connect('chord_s.blade_ae:chord', 'chord_scaler.blade_ae:chord_in') else: cname = name + '_c' - self.add(cname, IndepVarComp(name + '_C', np.zeros(len(Cx))), promotes=['*']) - c = self.add(name + '_s', FFDSpline(name, + self.add(cname, IndepVarComp('blade_ae:'+name + '_C', np.zeros(len(Cx))), promotes=['*']) + c = self.add(name + '_s', FFDSpline('blade_ae:' + name, s=self.pfinit['s'], P=self.pfinit[name], Cx=Cx, scaler=scaler), - promotes=[name, name + '_C']) + promotes=['blade_ae:' + name, + 'blade_ae:' + name + '_C']) c.spline_options['spline_type'] = spline_type def configure(self): """ add IndepVarComp's for all remaining planform variables """ - indeps = list(set(['s', 'x', 'y', 'z', 'rot_x', 'rot_y', 'rot_z', 'chord', 'rthick', 'p_le'])-set(self._vars)) + indeps = list(set(['s', 'x', 'y', 'z', + 'rot_x', 'rot_y', 'rot_z', + 'chord', 'rthick', 'p_le']) - + set(self._vars)) for name in indeps: - self.add(name+'_c', IndepVarComp(name, self.pfinit[name]), promotes=[name]) + self.add(name+'_c', IndepVarComp('blade_ae:'+name, self.pfinit[name]), promotes=['blade_ae:'+name]) c = self.add('smax_c', ComputeSmax(self.pfinit), promotes=['blade_curve_length']) - self.connect('x', 'smax_c.x') - self.connect('y', 'smax_c.y') - self.connect('z', 'smax_c.z') - self.add('athick_c', ComputeAthick(self._size), promotes=['athick']) - self.connect('rthick', 'athick_c.rthick') - self.connect('chord', 'athick_c.chord') + self.connect('blade_ae:x', 'smax_c.blade_ae:x') + self.connect('blade_ae:y', 'smax_c.blade_ae:y') + self.connect('blade_ae:z', 'smax_c.blade_ae:z') + self.add('athick_c', ComputeAthick(self._size), promotes=['blade_ae:athick']) + self.connect('blade_ae:rthick', 'athick_c.blade_ae:rthick') + self.connect('blade_ae:chord', 'athick_c.blade_ae:chord') class PGLLoftedBladeSurface(Component): @@ -645,11 +646,11 @@ def __init__(self, config, size_in=200, size_out=(200, 20, 3), suffix=''): 'rot_x', 'rot_y', 'rot_z', 'chord', 'rthick','p_le'] for name in names: - self.add_param(name+suffix, np.zeros(size_in)) + self.add_param('blade%s:%s' % (suffix, name), np.zeros(size_in)) self._suffix = suffix - self.add_output('blade_surface' + suffix, np.zeros(size_out)) - self.add_output('blade_surface_norm' + suffix, np.zeros(size_out)) + self.add_output('blade%s:surface' % suffix, np.zeros(size_out)) + self.add_output('blade%s:surface_norm' % suffix, np.zeros(size_out)) # for i in range(size_in[1]): # self.add_param('base_af%02d' % i, np.zeros(size_in[0], 2)) @@ -699,11 +700,11 @@ def _configure_interpolator(self): def solve_nonlinear(self, params, unknowns, resids): if self._dry_run: - ni = params['s' + self._suffix].shape[0] + ni = params['blade%s:s' % self._suffix].shape[0] surf = np.zeros([self.config['ni_chord'], ni, 3]) - surf[:, :, 2] = params['s' + self._suffix] - self.unknowns['blade_surface' + self._suffix] = surf - self.unknowns['blade_surface_norm' + self._suffix] = surf + surf[:, :, 2] = params['blade%s:s' % self._suffix] + self.unknowns['blade%s:surface' % self._suffix] = surf + self.unknowns['blade%s:surface_norm' % self._suffix] = surf return if not self._pgl_config_called: @@ -711,21 +712,23 @@ def solve_nonlinear(self, params, unknowns, resids): # we need to dig into the _ByObjWrapper val to get the array # values out pf = {} - pf['s'] = params['s' + self._suffix] - pf['x'] = params['x' + self._suffix] - pf['y'] = params['y' + self._suffix] - pf['z'] = params['z' + self._suffix] - pf['rot_x'] = params['rot_x' + self._suffix] - pf['rot_y'] = params['rot_y' + self._suffix] - pf['rot_z'] = params['rot_z' + self._suffix] - pf['chord'] = params['chord' + self._suffix] - pf['rthick'] = params['rthick' + self._suffix] - pf['p_le'] = params['p_le' + self._suffix] + pf['s'] = params['blade%s:s' % self._suffix] + pf['x'] = params['blade%s:x' % self._suffix] + pf['y'] = params['blade%s:y' % self._suffix] + pf['z'] = params['blade%s:z' % self._suffix] + pf['rot_x'] = params['blade%s:rot_x' % self._suffix] + pf['rot_y'] = params['blade%s:rot_y' % self._suffix] + pf['rot_z'] = params['blade%s:rot_z' % self._suffix] + pf['chord'] = params['blade%s:chord' % self._suffix] + pf['rthick'] = params['blade%s:rthick' % self._suffix] + pf['p_le'] = params['blade%s:p_le' % self._suffix] + + # call PGL to build lofted surface self.pgl_surf.pf = pf self.pgl_surf.build_blade() surf = self.pgl_surf.surface surfnorot = self.pgl_surf.surfnorot - self.unknowns['blade_surface' + self._suffix] = surf - self.unknowns['blade_surface_norm' + self._suffix] = surfnorot + self.unknowns['blade%s:surface' % self._suffix] = surf + self.unknowns['blade%s:surface_norm' % self._suffix] = surfnorot diff --git a/fusedwind/turbine/structure.py b/fusedwind/turbine/structure.py index 2e3e217..203a26f 100644 --- a/fusedwind/turbine/structure.py +++ b/fusedwind/turbine/structure.py @@ -563,7 +563,7 @@ def __init__(self, sdim, st3d, capDPs): self.capDPs.sort() self.add_param('blade_length', 1., units='m', desc='blade length') - self.add_param('blade_surface_st', np.zeros(sdim)) + self.add_param('blade_st:surface', np.zeros(sdim)) for i in range(self.nDP): self.add_param('DP%02d' % i, DPs[:, i]) @@ -604,7 +604,7 @@ def solve_nonlinear(self, params, unknowns, resids): smax = np.zeros(self.nsec) for i in range(self.nsec): - x = params['blade_surface_st'][:, i, :] + x = params['blade_st:surface'][:, i, :] af = AirfoilShape(points=x) smax[i] = af.smax for j in range(self.nDP): diff --git a/fusedwind/turbine/test/test_pglloftedblade.py b/fusedwind/turbine/test/test_pglloftedblade.py index 0ffdf42..c10bf3c 100644 --- a/fusedwind/turbine/test/test_pglloftedblade.py +++ b/fusedwind/turbine/test/test_pglloftedblade.py @@ -35,8 +35,8 @@ def configure(cfg): r = p.root.add('blade_surf', d, promotes=['*']) p.setup() for k, v in pf.iteritems(): - if k+'_st' in p.root.blade_surf.params.keys(): - p.root.blade_surf.params[k+'_st'] = v + if 'blade_st:'+k in p.root.blade_surf.params.keys(): + p.root.blade_surf.params['blade_st:' + k] = v return p @@ -48,7 +48,7 @@ def test_surf(self): p = configure(cfg) p.run() - self.assertAlmostEqual(np.sum(p['blade_surface_st']), 775.21809362184081, places=6) + self.assertAlmostEqual(np.sum(p['blade_st:surface']), 775.21809362184081, places=6) if __name__ == '__main__': diff --git a/fusedwind/turbine/test/test_planform.py b/fusedwind/turbine/test/test_planform.py index 12e0924..6f944a1 100644 --- a/fusedwind/turbine/test/test_planform.py +++ b/fusedwind/turbine/test/test_planform.py @@ -17,7 +17,7 @@ def configure(size_in=10, size_out=20): r = p.root.add('redist', PGLRedistributedPlanform('_st', size_in, s_new), promotes=['*']) p.setup() for k, v in pf.iteritems(): - r.params[k] = v + r.params['blade_ae:' + k] = v return p @@ -28,7 +28,7 @@ def test_redist(self): size_out = 20 p = configure(size_in, size_out) p.run() - self.assertEqual(np.testing.assert_array_almost_equal(p['x_st'], np.linspace(0, 1, size_out), decimal=4), None) + self.assertEqual(np.testing.assert_array_almost_equal(p['blade_st:x'], np.linspace(0, 1, size_out), decimal=4), None) if __name__ == '__main__': diff --git a/fusedwind/turbine/test/test_splinedplanform.py b/fusedwind/turbine/test/test_splinedplanform.py index 520397c..ebaf516 100644 --- a/fusedwind/turbine/test/test_splinedplanform.py +++ b/fusedwind/turbine/test/test_splinedplanform.py @@ -43,24 +43,23 @@ class TestSplinedPlanform(unittest.TestCase): def test_bezier(self): p = configure('bezier') - p['chord_C'][2] = 0.03 + p['blade_ae:chord_C'][2] = 0.03 p.run() - self.assertEqual(np.testing.assert_array_almost_equal(p['chord'], chord_bez, decimal=6), None) + self.assertEqual(np.testing.assert_array_almost_equal(p['blade_ae:chord'], chord_bez, decimal=6), None) def test_pchip(self): p = configure('pchip') - p['chord_C'][2] = 0.03 + p['blade_ae:chord_C'][2] = 0.03 p.run() - self.assertEqual(np.testing.assert_array_almost_equal(p['chord'], chord_pchip, decimal=6), None) - self.assertEqual(np.testing.assert_array_almost_equal(p['athick'], athick_pchip, decimal=6), None) + self.assertEqual(np.testing.assert_array_almost_equal(p['blade_ae:chord'], chord_pchip, decimal=6), None) + self.assertEqual(np.testing.assert_array_almost_equal(p['blade_ae:athick'], athick_pchip, decimal=6), None) self.assertAlmostEqual(p['blade_curve_length'], 1.0011587264848194, places=6) - def test_curve_length(self): p = configure('pchip') - p['x_C'][3] = 0.03 + p['blade_ae:x_C'][3] = 0.03 p.run() self.assertAlmostEqual(p['blade_curve_length'], 1.0032258904912261, places=6) @@ -77,7 +76,7 @@ def test_bladescale(self): p['blade_scale'] = 1.1 p.run() - self.assertEqual(np.testing.assert_array_almost_equal(p['chord'], chord, decimal=6), None) + self.assertEqual(np.testing.assert_array_almost_equal(p['blade_ae:chord'], chord, decimal=6), None) if __name__ == '__main__': diff --git a/fusedwind/turbine/test/test_splinedstructure.py b/fusedwind/turbine/test/test_splinedstructure.py index 67cbf6c..18d1101 100644 --- a/fusedwind/turbine/test/test_splinedstructure.py +++ b/fusedwind/turbine/test/test_splinedstructure.py @@ -68,8 +68,8 @@ def configure_with_surface(): p.setup() for k, v in pf.iteritems(): - if k+'_st' in p.root.blade_surf.params.keys(): - p.root.blade_surf.params[k+'_st'] = v + if 'blade_st:'+k in p.root.blade_surf.params.keys(): + p.root.blade_surf.params['blade_st:'+k] = v return p