def configure_blade(): top = Assembly() configure_bladesurface(top, planform_nC=6) # load the planform file top.pf_splines.pfIn = read_blade_planform( os.path.join(PATH, 'data/DTU_10MW_RWT_blade_axis_prebend.dat')) top.blade_length = 86.366 top.span_ni = 5 b = top.blade_surface # distribute 200 points evenly along the airfoil sections b.chord_ni = 40 # load the airfoil shapes defining the blade for f in [ os.path.join(PATH, 'data/ffaw3241.dat'), os.path.join(PATH, 'data/ffaw3301.dat'), os.path.join(PATH, 'data/ffaw3360.dat'), os.path.join(PATH, 'data/ffaw3480.dat'), os.path.join(PATH, 'data/cylinder.dat') ]: b.base_airfoils.append(np.loadtxt(f)) b.blend_var = np.array([0.241, 0.301, 0.36, 0.48, 1.]) return top
def configure(cfg): pf = read_blade_planform(os.path.join(PATH, 'data/DTU_10MW_RWT_blade_axis_prebend.dat')) nsec = 8 s_new = np.linspace(0, 1, nsec) pf = redistribute_planform(pf, s=s_new) cfg['redistribute_flag'] = False cfg['blend_var'] = np.array([0.241, 0.301, 0.36, 1.0]) afs = [] for f in [os.path.join(PATH, 'data/ffaw3241.dat'), os.path.join(PATH, 'data/ffaw3301.dat'), os.path.join(PATH, 'data/ffaw3360.dat'), os.path.join(PATH, 'data/cylinder.dat')]: afs.append(np.loadtxt(f)) cfg['base_airfoils'] = afs d = PGLLoftedBladeSurface(cfg, size_in=nsec, size_out=(200, nsec, 3), suffix='_st') p = Problem(root=Group()) 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 return p
def configure(cfg): pf = read_blade_planform( os.path.join(PATH, 'data/DTU_10MW_RWT_blade_axis_prebend.dat')) nsec = 8 s_new = np.linspace(0, 1, nsec) pf = redistribute_planform(pf, s=s_new) cfg['redistribute_flag'] = False cfg['blend_var'] = np.array([0.241, 0.301, 0.36, 1.0]) afs = [] for f in [ os.path.join(PATH, 'data/ffaw3241.dat'), os.path.join(PATH, 'data/ffaw3301.dat'), os.path.join(PATH, 'data/ffaw3360.dat'), os.path.join(PATH, 'data/cylinder.dat') ]: afs.append(np.loadtxt(f)) cfg['base_airfoils'] = afs d = PGLLoftedBladeSurface(cfg, size_in=nsec, size_out=(200, nsec, 3), suffix='_st') p = Problem(root=Group()) 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 return p
def lofted_blade_shape_example(): top = Assembly() configure_bladesurface(top, planform_nC=6) # load the planform file top.pf_splines.pfIn = read_blade_planform('data/DTU_10MW_RWT_blade_axis_prebend.dat') top.blade_length = 86.366 top.span_ni = 50 print 'planform variables: ', top.pf_splines.pfOut.list_vars() b = top.blade_surface # distribute 200 points evenly along the airfoil sections b.chord_ni = 200 # load the airfoil shapes defining the blade for f in ['data/ffaw3241.dat', 'data/ffaw3301.dat', 'data/ffaw3360.dat', 'data/ffaw3480.dat' , 'data/tc72.dat' , 'data/cylinder.dat']: b.base_airfoils.append(np.loadtxt(f)) b.blend_var = np.array([0.241, 0.301, 0.36, 0.48, 0.72, 1.]) top.run() pf = top.pf_splines.pfOut plt.figure() plt.title('chord') plt.plot(pf.s, pf.chord) plt.savefig('chord.eps') plt.figure() plt.title('twist') plt.plot(pf.s, pf.rot_z) plt.savefig('twist.eps') plt.figure() plt.title('relative thickness') plt.plot(pf.s, pf.rthick) plt.savefig('rthick.eps') plt.figure() plt.title('pitch axis aft leading edge') plt.plot(pf.s, pf.p_le) plt.savefig('p_le.eps') plt.figure() plt.axis('equal') for i in range(b.span_ni): plt.plot(b.surfout.surface[:, i, 0], b.surfout.surface[:, i, 1]) plt.savefig('lofted_blade.eps') return top
def configure(spline_type): pf = read_blade_planform(os.path.join(PATH, 'data/DTU_10MW_RWT_blade_axis_prebend.dat')) pf = redistribute_planform(pf, s=np.linspace(0, 1, 20)) p = Problem(root=Group()) spl = p.root.add('pf_splines', SplinedBladePlanform(pf), promotes=['*']) for name in ['x', 'chord', 'rot_z', 'rthick']: spl.add_spline(name, np.array([0, 0.25, 0.75, 1.]), spline_type=spline_type) p.setup() return p
def configure_with_surface(): nsec = 8 st3d = read_bladestructure(os.path.join(PATH, 'data/DTU10MW')) st3dn = interpolate_bladestructure(st3d, np.linspace(0, 1, nsec)) p = Problem(root=Group()) pf = read_blade_planform( os.path.join(PATH, 'data/DTU_10MW_RWT_blade_axis_prebend.dat')) s_new = np.linspace(0, 1, nsec) pf = redistribute_planform(pf, s=s_new) cfg = {} cfg['redistribute_flag'] = False cfg['blend_var'] = np.array([0.241, 0.301, 0.36, 1.0]) afs = [] for f in [ os.path.join(PATH, 'data/ffaw3241.dat'), os.path.join(PATH, 'data/ffaw3301.dat'), os.path.join(PATH, 'data/ffaw3360.dat'), os.path.join(PATH, 'data/cylinder.dat') ]: afs.append(np.loadtxt(f)) cfg['base_airfoils'] = afs d = PGLLoftedBladeSurface(cfg, size_in=nsec, size_out=(200, nsec, 3), suffix='_st') r = p.root.add('blade_surf', d, promotes=['*']) spl = p.root.add('st_splines', SplinedBladeStructure(st3dn), promotes=['*']) spl.add_spline('DP04', np.linspace(0, 1, 4), spline_type='bezier') spl.add_spline(('r04uniax00T', 'r04uniax01T'), np.linspace(0, 1, 4), spline_type='bezier') spl.add_spline('w02biax00T', np.linspace(0, 1, 4), spline_type='bezier') p.root.add('st_props', BladeStructureProperties((200, nsec, 3), st3dn, [4, 5, 8, 9]), 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 return p
def configure(spline_type): pf = read_blade_planform('data/DTU_10MW_RWT_blade_axis_prebend.dat') pf = redistribute_planform(pf, s=np.linspace(0, 1, 20)) p = Problem(root=Group()) spl = p.root.add('pf_splines', SplinedBladePlanform(pf), promotes=['*']) for name in ['x', 'chord', 'rot_z', 'rthick']: spl.add_spline(name, np.array([0, 0.25, 0.75, 1.]), spline_type=spline_type) spl.configure() p.setup() return p
def configure_surface(): p = Problem(root=Group()) root = p.root pf = read_blade_planform('data/DTU_10MW_RWT_blade_axis_prebend.dat') nsec_ae = 30 nsec_st = 20 dist = np.array([[0., 1./nsec_ae, 1], [1., 1./nsec_ae/3., nsec_ae]]) s_ae = distfunc(dist) s_st = np.linspace(0, 1, nsec_st) pf = redistribute_planform(pf, s=s_ae) # --- 2 # add planform spline component spl_ae = root.add('pf_splines', SplinedBladePlanform(pf), promotes=['*']) # component for interpolating planform onto structural mesh redist = root.add('pf_st', PGLRedistributedPlanform('_st', nsec_ae, s_st), promotes=['*']) # --- 3 # configure blade surface cfg = {} cfg['redistribute_flag'] = False cfg['blend_var'] = np.array([0.241, 0.301, 0.36, 0.48, 1.0]) afs = [] for f in ['data/ffaw3241.dat', 'data/ffaw3301.dat', 'data/ffaw3360.dat', 'data/ffaw3480.dat', 'data/cylinder.dat']: afs.append(np.loadtxt(f)) cfg['base_airfoils'] = afs surf = root.add('blade_surf', PGLLoftedBladeSurface(cfg, size_in=nsec_st, size_out=(200, nsec_st, 3), suffix='_st'), promotes=['*']) # --- 4 # add splines to selected params for name in ['x', 'chord', 'rot_z', 'rthick']: spl_ae.add_spline(name, np.array([0, 0.25, 0.75, 1.]), spline_type='bezier') # configure spl_ae.configure() return p
def configure_with_surface(): nsec = 20 st3dn = read_bladestructure( os.path.join(PATH, 'data_version_2/Param2_10MW')) p = Problem(root=Group()) pf = read_blade_planform( os.path.join(PATH, 'data/DTU_10MW_RWT_blade_axis_prebend.dat')) s_new = np.linspace(0, 1, nsec) pf = redistribute_planform(pf, s=s_new) cfg = {} cfg['redistribute_flag'] = False cfg['blend_var'] = np.array([0.241, 0.301, 0.36, 1.0]) afs = [] for f in [ os.path.join(PATH, 'data/ffaw3241.dat'), os.path.join(PATH, 'data/ffaw3301.dat'), os.path.join(PATH, 'data/ffaw3360.dat'), os.path.join(PATH, 'data/cylinder.dat') ]: afs.append(np.loadtxt(f)) cfg['base_airfoils'] = afs d = PGLLoftedBladeSurface(cfg, size_in=nsec, size_out=(200, nsec, 3), suffix='_st') r = p.root.add('blade_surf', d, promotes=['*']) spl = p.root.add('st_splines', SplinedBladeStructureParam2(st3dn, (200, nsec, 3)), promotes=['*']) p.root.add('st_props', BladeStructureProperties((200, nsec, 3), st3dn, [4, 7, 10, 13]), promotes=['*']) spl.add_spline(('cap_width_ss', 'cap_width_ps'), np.array([0., 0.52631578947368418, 1.]), spline_type='linear') p.setup() for k, v in pf.iteritems(): if k + '_st' in p.root.blade_surf.params.keys(): p[k + '_st'] = v return p
def configure_with_surface(): nsec = 8 st3d = read_bladestructure('data/DTU10MW') st3dn = interpolate_bladestructure(st3d, np.linspace(0, 1, nsec)) p = Problem(root=Group()) pf = read_blade_planform('data/DTU_10MW_RWT_blade_axis_prebend.dat') s_new = np.linspace(0, 1, nsec) pf = redistribute_planform(pf, s=s_new) cfg = {} cfg['redistribute_flag'] = False cfg['blend_var'] = np.array([0.241, 0.301, 0.36, 1.0]) afs = [] for f in ['data/ffaw3241.dat', 'data/ffaw3301.dat', 'data/ffaw3360.dat', 'data/cylinder.dat']: afs.append(np.loadtxt(f)) cfg['base_airfoils'] = afs d = PGLLoftedBladeSurface(cfg, size_in=nsec, size_out=(200, nsec, 3), suffix='_st') r = p.root.add('blade_surf', d, promotes=['*']) spl = p.root.add('st_splines', SplinedBladeStructure(st3dn), promotes=['*']) spl.add_spline('DP04', np.linspace(0, 1, 4), spline_type='bezier') spl.add_spline(('r04uniaxT', 'r04uniax01T'), np.linspace(0, 1, 4), spline_type='bezier') spl.add_spline('w02biaxT', np.linspace(0, 1, 4), spline_type='bezier') spl.configure() p.root.add('st_props', BladeStructureProperties((200, nsec, 3), st3dn, [4,5,8,9]), 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 return p
def configure_with_surface(): nsec = 20 st3dn = read_bladestructure(os.path.join(PATH, 'data_version_2/Param2_10MW')) p = Problem(root=Group()) pf = read_blade_planform(os.path.join(PATH, 'data/DTU_10MW_RWT_blade_axis_prebend.dat')) s_new = np.linspace(0, 1, nsec) pf = redistribute_planform(pf, s=s_new) cfg = {} cfg['redistribute_flag'] = False cfg['blend_var'] = np.array([0.241, 0.301, 0.36, 1.0]) afs = [] for f in [os.path.join(PATH, 'data/ffaw3241.dat'), os.path.join(PATH, 'data/ffaw3301.dat'), os.path.join(PATH, 'data/ffaw3360.dat'), os.path.join(PATH, 'data/cylinder.dat')]: afs.append(np.loadtxt(f)) cfg['base_airfoils'] = afs d = PGLLoftedBladeSurface(cfg, size_in=nsec, size_out=(200, nsec, 3), suffix='_st') r = p.root.add('blade_surf', d, promotes=['*']) spl = p.root.add('st_splines', SplinedBladeStructureParam2(st3dn, (200, nsec, 3)), promotes=['*']) p.root.add('st_props', BladeStructureProperties((200, nsec, 3), st3dn, [4, 7, 10, 13]), promotes=['*']) spl.add_spline(('cap_width_ss', 'cap_width_ps'), np.array([0., 0.52631578947368418, 1.]), spline_type='linear') p.setup() for k, v in pf.iteritems(): if k+'_st' in p.root.blade_surf.params.keys(): p[k+'_st'] = v return p
def configure_planform(cls, file_base, planform_nC=6): """ method that adds a ``SplinedBladePlanform`` instance to the assembly Parameters ---------- cls: class instance Instance of an OpenMDAO Assembly that the analysis is run from filebase: planform_nC: int number of spline control points for the planform variables """ from fusedwind.turbine.geometry import SplinedBladePlanform, read_blade_planform cls.add('pf_splines', SplinedBladePlanform()) cls.driver.workflow.add('pf_splines') cls.pf_splines.nC = planform_nC cls.pf_splines.pfIn = read_blade_planform(file_base) cls.pf_splines.configure_splines() cls.create_passthrough('pf_splines.blade_length') cls.create_passthrough('pf_splines.span_ni')
# number of structural calculation points nsec_st = 8 # number of aerodynamic calculation points (not relevant for this example) nsec_ae = 30 # distribute structural and aerodynamic grid evenly s_ae = np.linspace(0, 1, nsec_ae) s_st = np.linspace(0, 1, nsec_st) # add an ExecComp defining blade length TODO: this shouldn't be necessary root.add('blade_length_c', ExecComp('blade_length = 86.366'), promotes=['*']) # read the blade planform into a simple dictionary format pf = read_blade_planform(os.path.join(PATH, 'data/DTU_10MW_RWT_blade_axis_prebend.dat')) # spline the planform and interpolate onto s_ae distribution pf = redistribute_planform(pf, s=s_ae) # add planform spline component defined in FUSED-Wind spl_ae = p.root.add('pf_splines', SplinedBladePlanform(pf), promotes=['*']) # this method adds IndepVarComp's for all pf quantities # in no splines are defined, see FUSED-Wind docs for more details spl_ae.configure() # component for interpolating planform onto structural mesh redist = root.add('pf_st', PGLRedistributedPlanform('_st', nsec_ae, s_st), promotes=['*'])
def configure_BECASBeamStructure(nsec, exec_mode, path_data, dry_run=False, FPM=False, with_sr=False): p = Problem(impl=impl, root=Group()) p.root.add('blade_length_c', IndepVarComp('blade_length', 86.366), promotes=['*']) pf = read_blade_planform( os.path.join(path_data, 'DTU_10MW_RWT_blade_axis_prebend.dat')) nsec_ae = 50 nsec_st = nsec s_ae = np.linspace(0, 1, nsec_ae) s_st = np.linspace(0, 1, nsec_st) pf = redistribute_planform(pf, s=s_ae) spl = p.root.add('pf_splines', SplinedBladePlanform(pf), promotes=['*']) spl.configure() redist = p.root.add('pf_st', PGLRedistributedPlanform('_st', nsec_ae, s_st), promotes=['*']) cfg = {} cfg['redistribute_flag'] = False cfg['blend_var'] = np.array([0.241, 0.301, 0.36, 1.0]) afs = [] for f in [ 'data/ffaw3241.dat', 'data/ffaw3301.dat', 'data/ffaw3360.dat', 'data/cylinder.dat' ]: afs.append(np.loadtxt(f)) cfg['base_airfoils'] = afs surf = p.root.add('blade_surf', PGLLoftedBladeSurface(cfg, size_in=nsec_st, size_out=(200, nsec_st, 3), suffix='_st'), promotes=['*']) # read the blade structure st3d = read_bladestructure(os.path.join(path_data, 'DTU10MW')) # and interpolate onto new distribution st3dn = interpolate_bladestructure(st3d, s_st) spl = p.root.add('st_splines', SplinedBladeStructure(st3dn), promotes=['*']) spl.add_spline('DP04', np.linspace(0, 1, 4), spline_type='bezier') spl.add_spline('r04uniax00T', np.linspace(0, 1, 4), spline_type='bezier') spl.add_spline('w02biax00T', np.linspace(0, 1, 4), spline_type='bezier') spl.configure() # inputs to CS2DtoBECAS and BECASWrapper config = {} cfg = {} cfg['dry_run'] = dry_run cfg['dominant_elsets'] = ['REGION04', 'REGION08'] cfg['max_layers'] = 0 config['CS2DtoBECAS'] = cfg cfg = {} cfg['exec_mode'] = exec_mode cfg['hawc2_FPM'] = FPM cfg['dry_run'] = dry_run cfg['exec_mode'] = exec_mode cfg['analysis_mode'] = 'stiffness' cfg['debug_mode'] = False config['BECASWrapper'] = cfg p.root.add('stiffness', BECASBeamStructure(p.root, config, st3dn, (200, nsec_st, 3)), promotes=['*']) p.root.add('stress_recovery', BECASStressRecovery(config, s_st, 2), promotes=['*']) p.setup() p['hub_radius'] = 2.8 for k, v in pf.iteritems(): if k in p.root.pf_splines.params.keys(): p.root.pf_splines.params[k] = v # set some arbitrary values in the load vectors used to compute strains for i, x in enumerate(s_st): try: p['load_cases_sec%03d' % i] = np.ones((2, 6)) except: pass return p
def configure(nsec_st, dry_run=False, FPM=False, with_sr=False): p = Problem(impl=impl, root=Group()) p.root.add('blade_length_c', IndepVarComp('blade_length', 86.366), promotes=['*']) pfo = read_blade_planform('data/DTU_10MW_RWT_blade_axis_prebend.dat') nsec_ae = 50 s_ae = np.linspace(0, 1, nsec_ae) s_st = np.linspace(0, 1, nsec_st) pf = {} pf['s'] = s_ae for k, v in pfo.iteritems(): if k in ['s', 'smax', 'blade_length']: continue pf[k] = np.interp(s_ae, pfo['s'], v) spl = p.root.add('pf_splines', SplinedBladePlanform(pf), promotes=['*']) spl.configure() redist = p.root.add('pf_st', PGLRedistributedPlanform('_st', nsec_ae, s_st), promotes=['*']) cfg = {} cfg['redistribute_flag'] = False cfg['blend_var'] = np.array([0.241, 0.301, 0.36, 1.0]) afs = [] for f in [ 'data/ffaw3241.dat', 'data/ffaw3301.dat', 'data/ffaw3360.dat', 'data/cylinder.dat' ]: afs.append(np.loadtxt(f)) cfg['base_airfoils'] = afs surf = p.root.add('blade_surf', PGLLoftedBladeSurface(cfg, size_in=nsec_st, size_out=(200, nsec_st, 3), suffix='_st'), promotes=['*']) surf._dry_run = True # read the blade structure st3d = read_bladestructure('data/DTU10MW') # and interpolate onto new distribution st3dn = interpolate_bladestructure(st3d, s_st) spl = p.root.add('st_splines', SplinedBladeStructure(st3dn), promotes=['*']) spl.add_spline('DP04', np.linspace(0, 1, 4), spline_type='pchip') spl.add_spline('DP05', np.linspace(0, 1, 4), spline_type='pchip') spl.add_spline('DP08', np.linspace(0, 1, 4), spline_type='pchip') spl.add_spline('DP09', np.linspace(0, 1, 4), spline_type='pchip') spl.add_spline('r04uniaxT', np.linspace(0, 1, 4), spline_type='pchip') spl.add_spline('r08uniaxT', np.linspace(0, 1, 4), spline_type='pchip') spl.configure() # inputs to CS2DtoBECAS and BECASWrapper config = {} cfg = {} cfg['dry_run'] = dry_run cfg['path_shellexpander'] = '/Users/frza/git/BECAS_stable/shellexpander/shellexpander' cfg['dominant_elsets'] = ['REGION04', 'REGION08'] cfg['max_layers'] = 0 config['CS2DtoBECAS'] = cfg cfg = {} cfg['path_becas'] = '/Users/frza/git/BECAS_stable/BECAS/src/matlab' cfg['hawc2_FPM'] = FPM cfg['dry_run'] = dry_run cfg['analysis_mode'] = 'stiffness' config['BECASWrapper'] = cfg p.root.add('stiffness', BECASBeamStructure(p.root, config, st3dn, (200, nsec_st, 3)), promotes=['*']) p.setup() for k, v in pf.iteritems(): if k in p.root.pf_splines.params.keys(): p.root.pf_splines.params[k] = v # p['hub_radius'] = 2.8 # p['blade_x'] = d.pf['x'] * 86.366 # p['blade_z'] = d.pf['y'] * 86.366 # p['blade_y'] = d.pf['z'] * 86.366 return p
def configure(nsec, dry_run=False, FPM=False, with_sr=False): p = Problem(impl=impl, root=Group()) p.root.add('blade_length_c', IndepVarComp('blade_length', 86.366), promotes=['*']) pf = read_blade_planform('data/DTU_10MW_RWT_blade_axis_prebend.dat') nsec_ae = 50 nsec_st = nsec s_ae = np.linspace(0, 1, nsec_ae) s_st = np.linspace(0, 1, nsec_st) pf = redistribute_planform(pf, s=s_ae) spl = p.root.add('pf_splines', SplinedBladePlanform(pf), promotes=['*']) spl.configure() redist = p.root.add('pf_st', PGLRedistributedPlanform('_st', nsec_ae, s_st), promotes=['*']) cfg = {} cfg['redistribute_flag'] = False cfg['blend_var'] = np.array([0.241, 0.301, 0.36, 1.0]) afs = [] for f in ['data/ffaw3241.dat', 'data/ffaw3301.dat', 'data/ffaw3360.dat', 'data/cylinder.dat']: afs.append(np.loadtxt(f)) cfg['base_airfoils'] = afs surf = p.root.add('blade_surf', PGLLoftedBladeSurface(cfg, size_in=nsec_st, size_out=(200, nsec_st, 3), suffix='_st'), promotes=['*']) # read the blade structure st3d = read_bladestructure('data/DTU10MW') # and interpolate onto new distribution st3dn = interpolate_bladestructure(st3d, s_st) spl = p.root.add('st_splines', SplinedBladeStructure(st3dn), promotes=['*']) spl.add_spline('DP04', np.linspace(0, 1, 4), spline_type='bezier') spl.add_spline('r04uniaxT', np.linspace(0, 1, 4), spline_type='bezier') spl.add_spline('w02biaxT', np.linspace(0, 1, 4), spline_type='bezier') spl.configure() # inputs to CS2DtoBECAS and BECASWrapper config = {} cfg = {} cfg['dry_run'] = dry_run cfg['path_shellexpander'] = os.path.join(user_home, 'git/BECAS_stable/shellexpander/src') cfg['dominant_elsets'] = ['REGION04', 'REGION08'] cfg['max_layers'] = 0 config['CS2DtoBECAS'] = cfg cfg = {} cfg['path_becas'] = os.path.join(user_home, 'git/BECAS_stable/BECAS/src/matlab') cfg['hawc2_FPM'] = FPM cfg['dry_run'] = dry_run cfg['analysis_mode'] = 'stiffness' config['BECASWrapper'] = cfg p.root.add('stiffness', BECASBeamStructure(p.root, config, st3dn, (200, nsec_st, 3)), promotes=['*']) p.root.add('stress_recovery', BECASStressRecovery(config, s_st, 2), promotes=['*']) p.setup() p['hub_radius'] = 2.8 for k, v in pf.iteritems(): if k in p.root.pf_splines.params.keys(): p.root.pf_splines.params[k] = v # set some arbitrary values in the load vectors used to compute strains for i, x in enumerate(s_st): try: p['load_cases_sec%03d' % i] = np.ones((2, 6)) except: pass return p
def configure(nsec_st, dry_run=False, FPM=False, with_sr=False): p = Problem(impl=impl, root=Group()) p.root.add('blade_length_c', IndepVarComp('blade_length', 86.366), promotes=['*']) pfo = read_blade_planform('data/DTU_10MW_RWT_blade_axis_prebend.dat') nsec_ae = 50 s_ae = np.linspace(0, 1, nsec_ae) s_st = np.linspace(0, 1, nsec_st) pf = {} pf['s'] = s_ae for k, v in pfo.iteritems(): if k in ['s', 'smax', 'blade_length']: continue pf[k] = np.interp(s_ae, pfo['s'], v) spl = p.root.add('pf_splines', SplinedBladePlanform(pf), promotes=['*']) spl.configure() redist = p.root.add('pf_st', PGLRedistributedPlanform('_st', nsec_ae, s_st), promotes=['*']) cfg = {} cfg['redistribute_flag'] = False cfg['blend_var'] = np.array([0.241, 0.301, 0.36, 1.0]) afs = [] for f in ['data/ffaw3241.dat', 'data/ffaw3301.dat', 'data/ffaw3360.dat', 'data/cylinder.dat']: afs.append(np.loadtxt(f)) cfg['base_airfoils'] = afs surf = p.root.add('blade_surf', PGLLoftedBladeSurface(cfg, size_in=nsec_st, size_out=(200, nsec_st, 3), suffix='_st'), promotes=['*']) surf._dry_run = True # read the blade structure st3d = read_bladestructure('data/DTU10MW') # and interpolate onto new distribution st3dn = interpolate_bladestructure(st3d, s_st) spl = p.root.add('st_splines', SplinedBladeStructure(st3dn), promotes=['*']) spl.add_spline('DP04', np.linspace(0, 1, 4), spline_type='pchip') spl.add_spline('DP05', np.linspace(0, 1, 4), spline_type='pchip') spl.add_spline('DP08', np.linspace(0, 1, 4), spline_type='pchip') spl.add_spline('DP09', np.linspace(0, 1, 4), spline_type='pchip') spl.add_spline('r04uniaxT', np.linspace(0, 1, 4), spline_type='pchip') spl.add_spline('r08uniaxT', np.linspace(0, 1, 4), spline_type='pchip') spl.configure() # inputs to CS2DtoBECAS and BECASWrapper config = {} cfg = {} cfg['dry_run'] = dry_run cfg['path_shellexpander'] = '/Users/frza/git/BECAS_stable/shellexpander/shellexpander' cfg['dominant_elsets'] = ['REGION04', 'REGION08'] cfg['max_layers'] = 0 config['CS2DtoBECAS'] = cfg cfg = {} cfg['path_becas'] = '/Users/frza/git/BECAS_stable/BECAS/src/matlab' cfg['hawc2_FPM'] = FPM cfg['dry_run'] = dry_run cfg['analysis_mode'] = 'stiffness' config['BECASWrapper'] = cfg p.root.add('stiffness', BECASBeamStructure(p.root, config, st3dn, (200, nsec_st, 3)), promotes=['*']) p.setup() for k, v in pf.iteritems(): if k in p.root.pf_splines.params.keys(): p.root.pf_splines.params[k] = v # p['hub_radius'] = 2.8 # p['blade_x'] = d.pf['x'] * 86.366 # p['blade_z'] = d.pf['y'] * 86.366 # p['blade_y'] = d.pf['z'] * 86.366 return p
print '' for i, cs in enumerate(self.cs2d): print 'processing cross section %i' % i # --- 2 --- top = Assembly() configure_bladestructure(top, 'data/DTU10MW', planform_nC=6, structure_nC=5) top.st_writer.filebase = 'st_test' top.blade_length = 86.366 top.pf_splines.pfIn = read_blade_planform( 'data/DTU_10MW_RWT_blade_axis_prebend.dat') top.blade_surface.chord_ni = 300 for f in [ 'data/ffaw3241.dat', 'data/ffaw3301.dat', 'data/ffaw3360.dat', 'data/ffaw3480.dat', 'data/tc72.dat', 'data/cylinder.dat' ]: top.blade_surface.base_airfoils.append(np.loadtxt(f)) top.blade_surface.blend_var = np.array([0.241, 0.301, 0.36, 0.48, 0.72, 1.]) # spanwise distribution of planform spline DVs top.pf_splines.Cx = [0, 0.2, 0.4, 0.6, 0.8, 1.] # spanwise distribution of sptructural spline DVs