Example #1
0
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():

    st3d = read_bladestructure(os.path.join(PATH, 'data/DTU10MW'))
    st3dn = interpolate_bladestructure(st3d, np.linspace(0, 1, 8))

    p = Problem(root=Group())
    spl = p.root.add('st_splines', SplinedBladeStructure(st3dn), promotes=['*'])
    spl.add_spline('DP08', np.linspace(0, 1, 4), spline_type='bezier')
    spl.add_spline('DP09', np.linspace(0, 1, 4), spline_type='bezier')
    spl.add_spline(('DP04', 'DP05'), 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.setup()
    return p
Example #3
0
def configure():

    st3d = read_bladestructure(os.path.join(PATH, 'data/DTU10MW'))
    st3dn = interpolate_bladestructure(st3d, np.linspace(0, 1, 8))

    p = Problem(root=Group())
    spl = p.root.add('st_splines',
                     SplinedBladeStructure(st3dn),
                     promotes=['*'])
    spl.add_spline('DP08', np.linspace(0, 1, 4), spline_type='bezier')
    spl.add_spline('DP09', np.linspace(0, 1, 4), spline_type='bezier')
    spl.add_spline(('DP04', 'DP05'),
                   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.setup()
    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
Example #5
0
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, 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
# this array contains the interpolator for the lofted surface
# in this case the relative thicknesses of the airfoils loaded above
cfg['blend_var'] = np.array([0.241, 0.301, 0.36, 1.0])

surf = root.add('blade_surf', PGLLoftedBladeSurface(cfg, size_in=nsec_st,
                size_out=(200, nsec_st, 3), suffix='_st'),
                promotes=['*'])

# --- 3 -----

# read the blade structure
st3d = read_bladestructure(os.path.join(PATH, 'data/DTU10MW'))

# and interpolate onto new distribution
st3dn = interpolate_bladestructure(st3d, s_st)

# add component for generating the splined blade structure
# defined in FUSED-Wind
spl_st = root.add('st_splines', SplinedBladeStructure(st3dn),
                  promotes=['*'])
spl_st.configure()

# --- 4 -----

# inputs to CS2DtoBECAS and BECASWrapper
config = {}
cfg = {}
cfg['dry_run'] = False
cfg['dominant_elsets'] = ['REGION04', 'REGION08']
cfg['max_layers'] = 10
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
Example #9
0
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
# this array contains the interpolator for the lofted surface
# in this case the relative thicknesses of the airfoils loaded above
cfg['blend_var'] = np.array([0.241, 0.301, 0.36, 1.0])

surf = root.add('blade_surf', PGLLoftedBladeSurface(cfg, size_in=nsec_st,
                size_out=(200, nsec_st, 3), suffix='_st'),
                promotes=['*'])

# --- 3 -----

# read the blade structure
st3d = read_bladestructure(os.path.join(PATH, 'data/DTU10MW'))

# and interpolate onto new distribution
st3dn = interpolate_bladestructure(st3d, s_st)

# add component for generating the splined blade structure
# defined in FUSED-Wind
spl_st = root.add('st_splines', SplinedBladeStructure(st3dn),
                  promotes=['*'])
spl_st.configure()

# --- 4 -----

# inputs to CS2DtoBECAS and BECASWrapper
config = {}
cfg = {}
cfg['dry_run'] = False
cfg['dominant_elsets'] = ['REGION04', 'REGION08']
cfg['max_layers'] = 10