ross.ShaftElement

class ross.ShaftElement(L, idl, odl, idr=None, odr=None, material=None, n=None, axial_force=0, torque=0, shear_effects=True, rotary_inertia=True, gyroscopic=True, shear_method_calc='cowper', tag=None)

A shaft element.

This class will create a shaft element that may take into account shear, rotary inertia an gyroscopic effects. The object can be cylindrical or conical and the formulation is based on [Genta and Gugliotta, 1988] The matrices will be defined considering the following local coordinate vector:

\[[x_0, y_0, \alpha_0, \beta_0, x_1, y_1, \alpha_1, \beta_1]^T\]

Where \(\alpha_0\) and \(\alpha_1\) are the bending on the yz plane and \(\beta_0\) and \(\beta_1\) are the bending on the xz plane.

Parameters
idlfloat, pint.Quantity

Inner diameter of the element at the left position (m).

odlfloat, pint.Quantity

Outer diameter of the element at the left position (m).

idrfloat, pint.Quantity, optional

Inner diameter of the element at the right position (m). Default is equal to idl value (cylindrical element).

odrfloat, pint.Quantity, optional

Outer diameter of the element at the right position (m). Default is equal to odl value (cylindrical element).

materialross.Material

Shaft material.

nint, optional

Element number (coincident with it’s first node). If not given, it will be set when the rotor is assembled according to the element’s position in the list supplied to the rotor constructor.

axial_forcefloat, optional

Axial force (N).

torquefloat, optional

Torque (N*m).

shear_effectsbool, optional

Determine if shear effects are taken into account. Default is True.

rotary_inertiabool, optional

Determine if rotary_inertia effects are taken into account. Default is True.

gyroscopicbool, optional

Determine if gyroscopic effects are taken into account. Default is True.

shear_method_calcstr, optional

Determines which shear calculation method the user will adopt Default is ‘cowper’

tagstr, optional

Element tag. Default is None.

Returns
shaft_elementross.ShaftElement

A shaft_element object.

References

Fri10

Michael I Friswell. Dynamics of rotating machines. Cambridge University Press, 2010.

GG88

Giancarlo Genta and Antonio Gugliotta. A conical element for finite element rotor dynamics. Journal of Sound and Vibration, 120:175–182, 01 1988. doi:10.1016/0022-460X(88)90342-2.

Examples

>>> from ross.materials import steel
>>> # Euler-Bernoulli conical element
>>> Euler_Bernoulli_Element = ShaftElement(
...                         material=steel, L=0.5, idl=0.05, odl=0.1,
...                         idr=0.05, odr=0.15,
...                         rotary_inertia=False,
...                         shear_effects=False)
>>> Euler_Bernoulli_Element.phi
0
>>> # Timoshenko cylindrical element. In this case idr and odr are omitted.
>>> Timoshenko_Element = ShaftElement(
...                         material=steel, L=0.5, idl=0.05, odl=0.1,
...                         rotary_inertia=True,
...                         shear_effects=True)
>>> Timoshenko_Element.phi
0.1571268472906404
Attributes
Poissonfloat

Poisson coefficient for the element.

Afloat

Element section area at half length (m**2).

A_lfloat

Element section area at left end (m**2).

A_rfloat

Element section area at right end (m**2).

beam_cgfloat

Element center of gravity local position (m).

axial_cg_posfloat

Element center of gravity global position (m). This should be used only after the rotor is built. Default is None.

Iefloat

Ie is the second moment of area of the cross section about the neutral plane (m**4).

phifloat

Constant that is used according to [Friswell, 2010] to consider rotary inertia and shear effects. If these are not considered \(\phi=0\).

kappafloat

Shear coefficient for the element.

Methods

C()

Stiffness matrix for an instance of a shaft element.

Returns
Cnp.array

Damping matrix for the shaft element.

Examples

>>> from ross.materials import steel
>>> Timoshenko_Element = ShaftElement(
...                         L=0.5, idl=0.05, idr=0.05, odl=0.1,
...                         odr=0.15, material=steel,
...                         rotary_inertia=True,
...                         shear_effects=True)
>>> Timoshenko_Element.C()[:4, :4]
array([[0., 0., 0., 0.],
       [0., 0., 0., 0.],
       [0., 0., 0., 0.],
       [0., 0., 0., 0.]])
G()

Gyroscopic matrix for an instance of a shaft element.

Returns
Gnp.ndarray

Gyroscopic matrix for the shaft element.

Examples

>>> from ross.materials import steel
>>> # Timoshenko is the default shaft element
>>> Timoshenko_Element = ShaftElement(
...                         L=0.5, idl=0.05, idr=0.05, odl=0.1,
...                         odr=0.15, material=steel,
...                         rotary_inertia=True,
...                         shear_effects=True)
>>> Timoshenko_Element.G()[:4, :4]
array([[ 0.        ,  0.30940809, -0.01085902,  0.        ],
       [-0.30940809,  0.        ,  0.        , -0.01085902],
       [ 0.01085902,  0.        ,  0.        ,  0.0067206 ],
       [ 0.        ,  0.01085902, -0.0067206 ,  0.        ]])
K()

Stiffness matrix for an instance of a shaft element.

Returns
Knp.ndarray

Stiffness matrix for the shaft element.

Examples

>>> from ross.materials import steel
>>> Timoshenko_Element = ShaftElement(
...                         L=0.5, idl=0.05, idr=0.05, odl=0.1,
...                         odr=0.15, material=steel,
...                         rotary_inertia=True,
...                         shear_effects=True)
>>> Timoshenko_Element.K()[:4, :4]/1e6
array([[219.96144416,   0.        ,   0.        ,  41.29754659],
       [  0.        , 219.96144416, -41.29754659,   0.        ],
       [  0.        , -41.29754659,  12.23526375,   0.        ],
       [ 41.29754659,   0.        ,   0.        ,  12.23526375]])
M()

Mass matrix for an instance of a shaft element.

Returns
Mnp.ndarray

Mass matrix for the shaft element.

Examples

>>> Timoshenko_Element = ShaftElement(
...                         L=0.5, idl=0.05, idr=0.05, odl=0.1,
...                         odr=0.15, material=steel,
...                         rotary_inertia=True,
...                         shear_effects=True)
>>> Timoshenko_Element.M()[:4, :4]
array([[11.36986417,  0.        ,  0.        ,  0.86197637],
       [ 0.        , 11.36986417, -0.86197637,  0.        ],
       [ 0.        , -0.86197637,  0.08667495,  0.        ],
       [ 0.86197637,  0.        ,  0.        ,  0.08667495]])
__init__(L, idl, odl, idr=None, odr=None, material=None, n=None, axial_force=0, torque=0, shear_effects=True, rotary_inertia=True, gyroscopic=True, shear_method_calc='cowper', tag=None)
dof_local_index()

Get the local index for a element specific degree of freedom.

Returns
local_index: namedtupple

A named tuple containing the local index.

Examples

>>> # Example using BearingElement
>>> from ross.bearing_seal_element import bearing_example
>>> bearing = bearing_example()
>>> bearing.dof_local_index()
LocalIndex(x_0=0, y_0=1)
dof_mapping()

Degrees of freedom mapping.

Returns a dictionary with a mapping between degree of freedom and its index.

Returns
dof_mappingdict

A dictionary containing the degrees of freedom and their indexes.

Examples

The numbering of the degrees of freedom for each node.

Being the following their ordering for a node:

x_0 - horizontal translation y_0 - vertical translation z_0 - axial translation alpha_0 - rotation around horizontal beta_0 - rotation around vertical theta_0 - torsion around axial

>>> sh = ShaftElement(L=0.5, idl=0.05, odl=0.1, material=steel,
...                   rotary_inertia=True, shear_effects=True)
>>> sh.dof_mapping()["x_0"]
0
classmethod from_table(file, sheet_type='Simple', sheet_name=0)

Instantiate one or more shafts using inputs from an Excel table.

A header with the names of the columns is required. These names should match the names expected by the routine (usually the names of the parameters, but also similar ones). The program will read every row bellow the header until they end or it reaches a NaN.

Parameters
filestr

Path to the file containing the shaft parameters.

sheet_typestr, optional
Describes the kind of sheet the function should expect:

Simple: The input table should specify only the number of the materials to be used. They must be saved prior to calling the method. Model: The materials parameters must be passed along with the shaft parameters. Each material must have an id number and each shaft must reference one of the materials ids.

sheet_nameint or str, optional

Position of the sheet in the file (starting from 0) or its name. If none is passed, it is assumed to be the first sheet in the file.

Returns
shaftlist

A list of shaft objects.

classmethod load(file)
classmethod read_toml_data(data)

Read and parse data stored in a .toml file.

The data passed to this method needs to be according to the format saved in the .toml file by the .save() method.

Parameters
datadict

Dictionary obtained from toml.load().

Returns
The element object.

Examples

>>> # Example using BearingElement
>>> from tempfile import tempdir
>>> from pathlib import Path
>>> from ross.bearing_seal_element import bearing_example
>>> from ross.bearing_seal_element import BearingElement
>>> # create path for a temporary file
>>> file = Path(tempdir) / 'bearing1.toml'
>>> bearing1 = bearing_example()
>>> bearing1.save(file)
>>> bearing1_loaded = BearingElement.load(file)
>>> bearing1 == bearing1_loaded
True
save(file)

Save the element in a .toml file.

This function will save the element to a .toml file. The file will have all the argument’s names and values that are needed to reinstantiate the element.

Parameters
filestr, pathlib.Path

The name of the file the element will be saved in.

Examples

>>> # Example using DiskElement
>>> from tempfile import tempdir
>>> from pathlib import Path
>>> from ross.disk_element import disk_example
>>> # create path for a temporary file
>>> file = Path(tempdir) / 'disk.toml'
>>> disk = disk_example()
>>> disk.save(file)
classmethod section(L, ne, s_idl, s_odl, s_idr=None, s_odr=None, material=None, n=None, shear_effects=True, rotary_inertia=True, gyroscopic=True)

Shaft section constructor.

This method will create a shaft section with length ‘L’ divided into ‘ne’ elements.

Parameters
i_dfloat

Inner diameter of the section.

o_dfloat

Outer diameter of the section.

Efloat

Young’s modulus.

G_sfloat

Shear modulus.

materialross.material

Shaft material.

nint, optional

Element number (coincident with it’s first node). If not given, it will be set when the rotor is assembled according to the element’s position in the list supplied to the rotor constructor.

axial_forcefloat

Axial force.

torquefloat

Torque.

shear_effectsbool

Determine if shear effects are taken into account. Default is False.

rotary_inertiabool

Determine if rotary_inertia effects are taken into account. Default is False.

gyroscopicbool

Determine if gyroscopic effects are taken into account. Default is False.

Returns
elementslist

List with the ‘ne’ shaft elements.

Examples

>>> # shaft material
>>> from ross.materials import steel
>>> # shaft inner and outer diameters
>>> s_idl = 0
>>> s_odl = 0.01585
>>> sec = ShaftElement.section(247.65e-3, 4, 0, 15.8e-3, material=steel)
>>> len(sec)
4
>>> sec[0].i_d
0.0
summary()

Present a summary for the element.

A pandas series with the element properties as variables.

Returns
A pandas series.

Examples

>>> # Example using DiskElement
>>> from ross.disk_element import disk_example
>>> disk = disk_example()
>>> disk.summary() 
n                             0
n_l                           0
n_r                           0...

Attributes

n

Set the element number as property.