#loading = PointLoading(blade, wind_table, None)
thrust_time  = [0, 1, 2,    10  ]
thrust_force = [0, 0, 10e3, 10e3]
thrust = np.c_[ thrust_force, np.zeros((4,2)) ].T
loadfunc = scipy.interpolate.interp1d(thrust_time, thrust)

# Modal element
base = RigidConnection('base', rotation=rotmat_y(-np.pi/2))
el = ModalElement('el', modes, distal=True, damping_freqs=[8.269, 10.248])
rna = RigidBody('rna', 24000, np.diag([6400003, 6400003, 4266667]), nodal_load=loadfunc)
base.add_leaf(el)
el.add_leaf(rna)
system = System(base)

integ = Integrator(system)
integ.add_output(el.output_deflections())
integ.add_output(el.output_rotations())
integ.add_output(dynamics.LoadOutput(rna.iprox))

linsys = LinearisedSystem(system)

def ani_xy(s,t,y):
    return dynvis.anim(s, t, y, (0,1), (-5,45), (-5,5), velocities=False)

def ani_xz(s,t,y):
    return dynvis.anim(s, t, y, (0,2), (-5,45), (-5,5), velocities=False)

def ani_yz(s,t,y):
    return dynvis.anim(s, t, y, (1,2), (-10,10), (-10,20), velocities=False, only_free=True)

class Rotor(object):
    def __init__(self, mode_source_file, root_length=0):
        # Modal element using data from Bladed model
        print "Loading modes from '%s'..." % mode_source_file
        self.blade = Blade(mode_source_file)
        self.modes = self.blade.modal_rep()

        Ry = rotmat_y(-pi / 2)
        Rhb1 = rotmat_x(0 * 2 * pi / 3)
        Rhb2 = rotmat_x(1 * 2 * pi / 3)
        Rhb3 = rotmat_x(2 * 2 * pi / 3)

        self.bearing = Hinge('bearing', [1, 0, 0])
        root1 = RigidConnection('root1', root_length * np.dot(Rhb1, [0, 0, 1]),
                                dot(Rhb1, Ry))
        root2 = RigidConnection('root2', root_length * np.dot(Rhb2, [0, 0, 1]),
                                dot(Rhb2, Ry))
        root3 = RigidConnection('root3', root_length * np.dot(Rhb3, [0, 0, 1]),
                                dot(Rhb3, Ry))
        self.blade1 = ModalElement('blade1', self.modes)
        self.blade2 = ModalElement('blade2', self.modes)
        self.blade3 = ModalElement('blade3', self.modes)

        self.bearing.add_leaf(root1)
        self.bearing.add_leaf(root2)
        self.bearing.add_leaf(root3)
        root1.add_leaf(self.blade1)
        root2.add_leaf(self.blade2)
        root3.add_leaf(self.blade3)
        self.system = System(self.bearing)

        # Prescribed DOF accelerations - constant rotor speed
        self.system.prescribe(self.bearing, acc=0.0)

        # setup integrator
        self.integ = Integrator(self.system, ('pos', 'vel'))
        self.integ.add_output(dynamics.LoadOutput(self.bearing.iprox))
        self.integ.add_output(
            dynamics.LoadOutput(self.blade1.iprox, local=True))
        self.integ.add_output(self.blade1.output_deflections())
        self.integ.add_output(self.blade1.output_positions())

    def simulate(self, qm0=None, spin=10.0, t1=1.5, dt=0.01):
        # reset
        self.system.q[:] = 0.0
        self.system.qd[:] = 0.0

        # initial conditions
        if qm0 is not None:  # initial modal amplitudes
            self.system.q[self.blade1.istrain] = qm0
            self.system.q[self.blade2.istrain] = qm0
            self.system.q[self.blade3.istrain] = qm0
        self.system.qd[self.bearing.istrain][0] = spin

        # simulate
        self.t, self.y = self.integ.integrate(t1, dt)
        for i, lab in enumerate(self.integ.labels()):
            print "%2d  %s" % (i, lab)
        return self.t, self.y

    def lin(self, qm0=None, spin=10.0):
        # reset
        self.system.q[:] = 0.0
        self.system.qd[:] = 0.0

        # initial conditions
        if qm0 is not None:  # initial modal amplitudes
            self.system.q[self.blade1.istrain] = qm0
            self.system.q[self.blade2.istrain] = qm0
            self.system.q[self.blade3.istrain] = qm0
        else:
            qm0 = np.zeros(self.blade1._nstrain * 3)
        self.system.prescribe(self.bearing, vel=spin, acc=0.0)
        self.system.qd[self.bearing.istrain][0] = spin

        linsys = linearisation.LinearisedSystem(self.system, qm0)
        return linsys

    def ani(self, t=None, y=None, planview=True):
        if t is None: t = self.t
        if y is None: y = self.y
        l = 40
        if planview:
            return dynvis.anim(self.system, t, y, (1, 2), (-l, l), (-l, l))
        else:
            return dynvis.anim(self.system, t, y, (0, 1), (-l, l), (-5, 5))
Beispiel #3
0
thrust = np.c_[thrust_force, np.zeros((4, 2))].T
loadfunc = scipy.interpolate.interp1d(thrust_time, thrust)

# Modal element
base = RigidConnection('base', rotation=rotmat_y(-np.pi / 2))
el = ModalElement('el', modes, distal=True, damping_freqs=[8.269, 10.248])
rna = RigidBody('rna',
                24000,
                np.diag([6400003, 6400003, 4266667]),
                nodal_load=loadfunc)
base.add_leaf(el)
el.add_leaf(rna)
system = System(base)

integ = Integrator(system)
integ.add_output(el.output_deflections())
integ.add_output(el.output_rotations())
integ.add_output(dynamics.LoadOutput(rna.iprox))

linsys = LinearisedSystem(system)


def ani_xy(s, t, y):
    return dynvis.anim(s, t, y, (0, 1), (-5, 45), (-5, 5), velocities=False)


def ani_xz(s, t, y):
    return dynvis.anim(s, t, y, (0, 2), (-5, 45), (-5, 5), velocities=False)


def ani_yz(s, t, y):
class Rotor(object):
    def __init__(self, mode_source_file, root_length=0):
        # Modal element using data from Bladed model
        print "Loading modes from '%s'..." % mode_source_file
        self.blade = Blade(mode_source_file)
        self.modes = self.blade.modal_rep()

        Ry = rotmat_y(-pi/2)
        Rhb1 = rotmat_x(0 * 2*pi/3)
        Rhb2 = rotmat_x(1 * 2*pi/3)
        Rhb3 = rotmat_x(2 * 2*pi/3)

        self.bearing = Hinge('bearing', [1,0,0])
        root1 = RigidConnection('root1', root_length*np.dot(Rhb1,[0,0,1]), dot(Rhb1,Ry))
        root2 = RigidConnection('root2', root_length*np.dot(Rhb2,[0,0,1]), dot(Rhb2,Ry))
        root3 = RigidConnection('root3', root_length*np.dot(Rhb3,[0,0,1]), dot(Rhb3,Ry))
        self.blade1 = ModalElement('blade1', self.modes)
        self.blade2 = ModalElement('blade2', self.modes)
        self.blade3 = ModalElement('blade3', self.modes)
        
        self.bearing.add_leaf(root1)
        self.bearing.add_leaf(root2)
        self.bearing.add_leaf(root3)
        root1.add_leaf(self.blade1)
        root2.add_leaf(self.blade2)
        root3.add_leaf(self.blade3)
        self.system = System(self.bearing)

        # Prescribed DOF accelerations - constant rotor speed
        self.system.prescribe(self.bearing, acc=0.0)
        
        # setup integrator
        self.integ = Integrator(self.system, ('pos','vel'))
        self.integ.add_output(dynamics.LoadOutput(self.bearing.iprox))
        self.integ.add_output(dynamics.LoadOutput(self.blade1.iprox, local=True))
        self.integ.add_output(self.blade1.output_deflections())
        self.integ.add_output(self.blade1.output_positions())
        
    def simulate(self, qm0=None, spin=10.0, t1=1.5, dt=0.01):
        # reset
        self.system.q [:] = 0.0
        self.system.qd[:] = 0.0

        # initial conditions
        if qm0 is not None:  # initial modal amplitudes
            self.system.q[self.blade1.istrain] = qm0
            self.system.q[self.blade2.istrain] = qm0
            self.system.q[self.blade3.istrain] = qm0
        self.system.qd[self.bearing.istrain][0] = spin
        
        # simulate
        self.t,self.y = self.integ.integrate(t1, dt)
        for i,lab in enumerate(self.integ.labels()):
            print "%2d  %s" % (i,lab)
        return self.t, self.y
    
    def lin(self, qm0=None, spin=10.0):
        # reset
        self.system.q [:] = 0.0
        self.system.qd[:] = 0.0

        # initial conditions
        if qm0 is not None:  # initial modal amplitudes
            self.system.q[self.blade1.istrain] = qm0
            self.system.q[self.blade2.istrain] = qm0
            self.system.q[self.blade3.istrain] = qm0
        else:
            qm0 = np.zeros(self.blade1._nstrain * 3)
        self.system.prescribe(self.bearing, vel=spin, acc=0.0)
        self.system.qd[self.bearing.istrain][0] = spin
        
        linsys = linearisation.LinearisedSystem(self.system, qm0)
        return linsys

    def ani(self, t=None, y=None, planview=True):
        if t is None: t = self.t
        if y is None: y = self.y
        l = 40
        if planview:
            return dynvis.anim(self.system, t, y, (1,2), (-l,l), (-l,l))
        else:
            return dynvis.anim(self.system, t, y, (0,1), (-l,l), (-5,5))
Beispiel #5
0
wind_table = np.array([
    [0, 1, 2,  10], # time
    [0, 0, 20, 20], # x
    [0, 0, 0,  0 ], # y
    [0, 0, 0,  0 ], # z
])
loading = BladeLoading(blade, wind_table, None)

# Modal element
base = RigidConnection('base', rotation=rotmat_y(-np.pi/2))
el = ModalElement('el', modes, loading)
base.add_leaf(el)
system = System(base)

integ = Integrator(system)
integ.add_output(el.output_deflections(stations=[8,16]))
integ.add_output(dynamics.CustomOutput(
    lambda s: el._get_loading()[8,:], 'loading'))
integ.add_output(dynamics.CustomOutput(
    lambda s: el.loading.relspeed, 'relspeed'))

# Load Bladed data for comparison
import pybladed.data
brun = pybladed.data.BladedRun(bladed_path)
bladed_defl = np.c_[
    brun.get('blade 1 x-deflection;1'),
    brun.get('blade 1 y-deflection;1'),
    brun.get('blade 1 x-deflection;2'),
    brun.get('blade 1 y-deflection;2'),
    brun.get('DFOUT1;1'),
    brun.get('DFIN1;1'),