Beispiel #1
0
    def execute(self):

        if self.interp_from_htc:
            c12axis = self.c12axis_init.copy()
        else:
            c12axis = self.calculate_c12axis()

        ds_root = 1. / self.blade_ni_span
        ds_tip = 1. / self.blade_ni_span / 3.
        dist = np.array([[0., ds_root, 1], [1., ds_tip, self.blade_ni_span]])

        x = distfunc(dist)
        self.c12axis = np.zeros((x.shape[0], 4))
        for i in range(4):
            tck = pchip(c12axis[:, 2], c12axis[:, i])
            self.c12axis[:, i] = tck(x)

        # scale main axis according to radius
        self.c12axis[:, :3] *= self.blade_length

        l = ((self.c12axis[1:, 0]-self.c12axis[:-1, 0])**2 +
             (self.c12axis[1:, 1]-self.c12axis[:-1, 1])**2 +
             (self.c12axis[1:, 2]-self.c12axis[:-1, 2])**2)**.5

        self.blade_ae.s = self.bladegeom.s * sum(l) / self.bladegeom.s[-1]
        self.blade_ae.rthick = self.bladegeom.rthick * 100.
        self.blade_ae.chord = self.bladegeom.chord * self.blade_length
        self.blade_ae.aeset = np.ones(len(self.blade_ae.s))
Beispiel #2
0
    def execute(self):

        if self.interp_from_htc:
            c12axis = self.c12axis_init.copy()
        else:
            c12axis = self.calculate_c12axis()

        ds_root = 1. / self.blade_ni_span
        ds_tip = 1. / self.blade_ni_span / 3.
        dist = np.array([[0., ds_root, 1], [1., ds_tip, self.blade_ni_span]])

        x = distfunc(dist)
        self.c12axis = np.zeros((x.shape[0], 4))
        for i in range(4):
            tck = pchip(c12axis[:, 2], c12axis[:, i])
            self.c12axis[:, i] = tck(x)

        # scale main axis according to radius
        self.c12axis[:, :3] *= self.blade_length

        l = ((self.c12axis[1:, 0] - self.c12axis[:-1, 0])**2 +
             (self.c12axis[1:, 1] - self.c12axis[:-1, 1])**2 +
             (self.c12axis[1:, 2] - self.c12axis[:-1, 2])**2)**.5

        self.blade_ae.s = self.bladegeom.s * sum(l) / self.bladegeom.s[-1]
        self.blade_ae.rthick = self.bladegeom.rthick * 100.
        self.blade_ae.chord = self.bladegeom.chord * self.blade_length
        self.blade_ae.aeset = np.ones(len(self.blade_ae.s))
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
                                       PGLRedistributedPlanform

PATH = pkg_resources.resource_filename('fusedwind', 'turbine/test')

# --- 1 ---

nsec = 20
st3dn = read_bladestructure(os.path.join(PATH, 'data_version_2/Param2_10MW'))
p = Problem(root=Group())
root = p.root
pf = read_blade_planform(os.path.join(PATH, '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)

# add planform spline component
spl_ae = root.add('pf_splines', SplinedBladePlanform(pf), promotes=['*'])

# --- 2 ---

# component for interpolating planform onto structural mesh
redist = 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 = []