ross.LabyrinthSeal
Contents
ross.LabyrinthSeal#
- class ross.LabyrinthSeal(n=None, inlet_pressure=None, outlet_pressure=None, inlet_temperature=None, pre_swirl_ratio=None, frequency=None, n_teeth=None, shaft_radius=None, radial_clearance=None, pitch=None, tooth_height=None, tooth_width=None, seal_type=None, gas_composition=None, r=None, gamma=None, tz=None, muz=None, analz='FULL', nprt=1, iopt1=0, print_results=False, **kwargs)#
Labyrinth seal - Compressible flow model with rotordynamic coefficients.
This class provides a comprehensive analytical model for labyrinth seals based on compressible gas flow through multiple throttling stages (teeth). The model calculates leakage rates and dynamic coefficients for rotordynamic analysis.
Theoretical Approach:
The model solves the 1D compressible flow problem through a series of teeth using:
Mass Flow Calculation: - Iterative solution for mass flow rate through multiple throttling stages - Accounts for choked flow conditions at each tooth - Uses discharge coefficients based on tooth geometry - Isentropic relations for pressure drops across teeth - Carry-over factor (ν) for flow momentum between cavities
Pressure Distribution: - Solves for static pressure at each cavity using regula falsi method - Handles both choked and unchoked flow conditions - Critical pressure ratio check at each throttle - Pressure balance ensures outlet pressure match
Velocity Field (Swirl): - Tangential velocity calculated at each cavity - Accounts for inlet pre-swirl conditions - Rotor and stator shear stress effects (friction factors) - Reynolds number-dependent shear coefficients - Jenny and Kanki parameters for improved tangential momentum (optional)
Dynamic Coefficients (stiffness and damping): - Perturbation method applied to continuity and momentum equations - Small perturbations in radial displacement and clearance - Linearized system of equations solved using LU decomposition - Cross-coupled stiffness terms capture destabilizing forces - Frequency-dependent coefficients for each operating speed
- Parameters:
- nint
Node in which the seal will be located.
- frequencyfloat, pint.Quantity
Shaft rotational speed (rad/s).
- inlet_pressurefloat
Inlet pressure (Pa).
- outlet_pressurefloat
Outlet pressure (Pa).
- inlet_temperaturefloat
Inlet temperature (deg K).
- pre_swirl_ratiofloat
Inlet swirl velocity ratio. Positive values for swirl with shaft rotation and negative values for swirl against shaft rotations.
- n_teethint
Number of teeth (throttlings). Needs to be <= 30.
- shaft_radiusfloat, pint.Quantity
Radius of shaft (m).
- radial_clearancefloat, pint.Quantity
Nominal radial clearance (m)
- pitchfloat, pint.Quantity
Seal pitch (length of land) or axial cavity length (m).
- tooth_heightfloat, pint.Quantity
Height of seal strip (m).
- tooth_widthfloat, pint.Quantity
Thickness of throttle (tip-width) (m), used in mass flow calculation.
- seal_typestr
Indicates where labyrinth teeth are located. Specify ‘rotor’ if teeth are on rotor only. Specify ‘stator’ if teeth are on stator only. Specify ‘inter’ for interlocking type labyrinths.
- gas_compositiondict
Gas composition as a dictionary {component: molar_fraction}. If gas_composition is None, provide the following parameters: r: float
gas constant
- gamma: float
ratio of specific heats
- tz: list float
tz[0]: temperature at state 1 tz[1]: temperature at state 2
- muz: list float
muz[0]: dynamic viscoosity at state 1 muz[1]: dynamic viscoosity at state 2
- analz: string
analz indicates what will be analysed. Specify “FULL” for rotordynamic calculation and leakage analysis Specify “LEAKAGE” for leakage analysis only
- nprt: integer
Number of parameters to be printed in the output. 1 maximum 5 minimum
- iopt1: integer
Use or no use of tangential momentum parameters introduced by Jenny and Kanki Specify value 0 to not use parameters Specify value 1 to use parameters
- print_resultsbool
If True, print results to console. Default is False.
Examples
>>> from ross.seals.labyrinth_seal import LabyrinthSeal >>> from ross.units import Q_ >>> seal = LabyrinthSeal( ... n=0, ... inlet_pressure=308000, ... outlet_pressure=94300, ... inlet_temperature=283.15, ... pre_swirl_ratio=0.98, ... frequency=Q_([5000, 8000, 11000], "RPM"), ... n_teeth=16, ... shaft_radius=Q_(72.5, "mm"), ... radial_clearance=Q_(0.3, "mm"), ... pitch=Q_(3.175, "mm"), ... tooth_height=Q_(3.175, "mm"), ... tooth_width=Q_(0.1524, "mm"), ... seal_type="inter", ... gas_composition={"Nitrogen": 0.79, "Oxygen": 0.21}, ... )
Methods
- C(frequency)#
Damping matrix for an instance of a bearing element.
This method returns the damping matrix for an instance of a bearing element.
- Parameters:
- frequencyfloat
The excitation frequency (rad/s).
- Returns:
- Cnp.ndarray
A 3x3 matrix of floats containing the cxx, cxy, cyx, cyy, and czz values (N*s/m).
Examples
>>> bearing = bearing_example() >>> bearing.C(0) array([[200., 0., 0.], [ 0., 150., 0.], [ 0., 0., 50.]])
- G()#
Gyroscopic matrix for an instance of a bearing element.
This method returns the mass matrix for an instance of a bearing element.
- Returns:
- Gnp.ndarray
A 3x3 matrix of floats.
Examples
>>> bearing = bearing_example() >>> bearing.G() array([[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]])
- K(frequency)#
Stiffness matrix for an instance of a bearing element.
This method returns the stiffness matrix for an instance of a bearing element.
- Parameters:
- frequencyfloat
The excitation frequency (rad/s).
- Returns:
- Knp.ndarray
A 3x3 matrix of floats containing the kxx, kxy, kyx, kyy and kzz values (N/m).
Examples
>>> bearing = bearing_example() >>> bearing.K(0) array([[1000000., 0., 0.], [ 0., 800000., 0.], [ 0., 0., 100000.]])
- M(frequency)#
Mass matrix for an instance of a bearing element.
This method returns the mass matrix for an instance of a bearing element.
- Parameters:
- frequencyfloat
The excitation frequency (rad/s).
- Returns:
- Mnp.ndarray
Mass matrix (kg).
Examples
>>> bearing = bearing_example() >>> bearing.M(0) array([[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]])
- __init__(n=None, inlet_pressure=None, outlet_pressure=None, inlet_temperature=None, pre_swirl_ratio=None, frequency=None, n_teeth=None, shaft_radius=None, radial_clearance=None, pitch=None, tooth_height=None, tooth_width=None, seal_type=None, gas_composition=None, r=None, gamma=None, tz=None, muz=None, analz='FULL', nprt=1, iopt1=0, print_results=False, **kwargs)#
- derv()#
- 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, z_0=2)
- 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
>>> bearing = bearing_example() >>> bearing.dof_mapping() {'x_0': 0, 'y_0': 1, 'z_0': 2}
- format_table(frequency=None, coefficients=None, frequency_units='rad/s', stiffness_units='N/m', damping_units='N*s/m', mass_units='kg')#
Return frequency vs coefficients in table format.
- Parameters:
- frequencyarray, pint.Quantity, optional
Array with frequencies (rad/s). Default is 5 values from min to max frequency.
- coefficientslist, str, optional
List or str with the coefficients to include. Defaults is a list of stiffness and damping coefficients.
- frequency_unitsstr, optional
Frequency units. Default is rad/s.
- stiffness_unitsstr, optional
Stiffness units. Default is N/m.
- damping_unitsstr, optional
Damping units. Default is N*s/m.
- mass_unitsstr, optional
Mass units. Default is kg.
- Returns:
- tablePrettyTable object
Table object with bearing coefficients to be printed.
- classmethod from_table(n, file, sheet_name=0, tag=None, n_link=None, scale_factor=1, color='#355d7a')#
Instantiate a bearing 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:
- nint
The node in which the bearing will be located in the rotor.
- filestr
Path to the file containing the bearing parameters.
- 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.
- tagstr, optional
A tag to name the element. Default is None.
- n_linkint, optional
Node to which the bearing will connect. If None the bearing is connected to ground. Default is None.
- scale_factorfloat, optional
The scale factor is used to scale the bearing drawing. Default is 1.
- colorstr, optional
A color to be used when the element is represented. Default is ‘#355d7a’ (Cardinal).
- Returns:
- bearingrs.BearingElement
A bearing object.
Examples
>>> import os >>> file_path = os.path.dirname(os.path.realpath(__file__)) + '/tests/data/bearing_seal_si.xls' >>> BearingElement.from_table(0, file_path, n_link=1) BearingElement(n=0, n_link=1, kxx=[1.379...
- get_class_name_prefix(index=None)#
Extract prefix of the class name preceding ‘Element’, insert spaces before uppercase letters, and append an index number at the end.
- Parameters:
- indexint, optional
The index number to append at the end of the resulting string. Default is None.
- Returns:
- prefixstr
The processed class name prefix.
Examples
>>> # Example using BearingElement >>> from ross.bearing_seal_element import bearing_example >>> bearing = bearing_example() >>> bearing.get_class_name_prefix() 'Bearing'
- classmethod get_subclasses()#
- classmethod load(file)#
- pert()#
- plot(coefficients=None, frequency_units='rad/s', stiffness_units='N/m', damping_units='N*s/m', mass_units='kg', fig=None, **kwargs)#
Plot coefficient vs frequency.
- Parameters:
- coefficientslist, str
List or str with the coefficients to plot.
- frequency_unitsstr, optional
Frequency units. Default is rad/s.
- stiffness_unitsstr, optional
Stiffness units. Default is N/m.
- damping_unitsstr, optional
Damping units. Default is N*s/m.
- mass_unitsstr, optional
Mass units. Default is kg.
- **kwargsoptional
Additional key word arguments can be passed to change the plot layout only (e.g. width=1000, height=800, …). *See Plotly Python Figure Reference for more information.
- Returns:
- figPlotly graph_objects.Figure()
The figure object with the plot.
- 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
- run(frequency)#
- 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)
- setup()#
- 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...
- classmethod table_to_toml(n, file)#
Convert bearing parameters to toml.
Convert a table with parameters of a bearing element to a dictionary ready to save to a toml file that can be later loaded by ross.
- Parameters:
- nint
The node in which the bearing will be located in the rotor.
- filestr
Path to the file containing the bearing parameters.
- Returns:
- datadict
A dict that is ready to save to toml and readable by ross.
Examples
>>> import os >>> file_path = os.path.dirname(os.path.realpath(__file__)) + '/tests/data/bearing_seal_si.xls' >>> BearingElement.table_to_toml(0, file_path) {'n': 0, 'kxx': array([...
- vermes()#
- zpres()#
- zvel()#
- zvel_jen()#