Exemple #1
0
 def execute(self):
     for name in self.case_files:
         fid = open(name, 'r')
         case_id = fid.readline().split()[1]
         data = np.loadtxt(fid)
         lc = LoadVectorArray()
         lc._fromarray(data)
         self.load_cases.cases.append(lc.copy())
Exemple #2
0
    def execute(self):

        for name in self.case_files:
            fid = open(name, 'r')
            case_id = fid.readline().split()[1]
            data = np.loadtxt(fid)
            lc = LoadVectorArray()
            lc._fromarray(data)
            self.load_cases.cases.append(lc.copy())
    def execute(self):

        
        self.lcs = []
        self.lc = []
        for j, lname in enumerate(self.blade_loads.loads_array):
            load = getattr(self.blade_loads, lname)
            lc = LoadVectorArray()
            for name in lc.list_vars():
                var = getattr(lc, name)
                if isinstance(var, np.ndarray):
                    setattr(lc, name, np.zeros(load.s.shape[0]))
            lc.s = load.s
            lc.case_id = lname
            lc.Fxm = np.zeros(load.s.shape[0])
            lc.Fym = np.zeros(load.s.shape[0])
            # rotate to local profile coordinate system
            pitch = self.oper.pitch[j] * np.pi / 180.
            vhub = self.oper.vhub
            theta = np.interp(load.s, self.pf.s, self.pf.rot_z) * np.pi / 180.
            Fx =  load.Ft * np.cos(theta + pitch) + load.Fn * np.sin(theta + pitch)
            Fy =  load.Fn * np.cos(theta + pitch) - load.Ft * np.sin(theta + pitch)

            # compute contribution from mass
            dm = np.interp(load.s, self.beam_structure.s, self.beam_structure.dm)
            # Fmass = np.array([np.trapz(dm[i:], load.s[i:]) for i in range(load.s.shape[0])]) * 9.81
            Fmass = dm * self.g
            Fxmass = Fmass * np.cos(theta + pitch)
            Fymass = Fmass * np.sin(theta + pitch)

            # centrifugal acceleration a = (omega * r)**2 / r + g
            acc = (self.oper.rpm[j] * 2 * np.pi / 60.)**2 * (load.s + self.hub_radius) + self.g
            lc.acc = acc
            if vhub > 25.:
                factor = 1.35
            else:
                factor = 1.1
            for i in range(load.s.shape[0]):
                lc.Fx[i] = (np.trapz(Fx[i:] + Fxmass[i:], load.s[i:])) * factor
                lc.Fy[i] = (np.trapz(Fy[i:] + Fymass[i:], load.s[i:])) * factor
                lc.Fz[i] = np.trapz(acc[i:] * dm[i:], load.s[i:]) * factor
                lc.Mx[i] = -np.trapz((Fy[i:] + Fxmass[i:]) * (load.s[i:] - load.s[i]), load.s[i:]) * factor
                lc.My[i] = np.trapz((Fx[i:] + Fymass[i:]) * (load.s[i:] - load.s[i]), load.s[i:]) * factor

            self.lcs.append(lc.copy())

        for j, x in enumerate(self.x):
            lc = LoadVectorCaseList()
            lc.s = x
            for name in ['Fx', 'Fy', 'Fz', 'Mx', 'My']:
                # positive components
                lv = LoadVector()
                for case in self.lcs:
                    c = case._interp_s(x  * self.pf.blade_length)
                    if getattr(c, name) > getattr(lv, name):
                        lv = c.copy()
                lc.cases.append(lv.copy())

                # negative components
                lv = LoadVector()
                for case in self.lcs:
                    c = case._interp_s(x  * self.pf.blade_length)
                    if getattr(c, name) < getattr(lv, name):
                        lv = c.copy()
                lc.cases.append(lv.copy())
            self.lc.append(lc.copy())