ross.HolePatternSeal#

class ross.HolePatternSeal(n, shaft_radius, radial_clearance, length, roughness, cell_length, cell_width, cell_depth, inlet_pressure, outlet_pressure, inlet_temperature, frequency, gas_composition=None, molar=None, gamma=None, b_suther=None, s_suther=None, preswirl=0.0, entr_coef=0.1, exit_coef=0.5, whirl_ratio=1.0, nz=80, max_iterations=180, tolerance=0.0001, first_step_size=0.01, rlx_factor=0.1, **kwargs)#

Hole-pattern annular seal - Bulk flow model with dynamic coefficients.

This class provides a comprehensive numerical model for annular seals with hole (pocket) patterns using bulk flow theory. The model solves 1D compressible flow equations with perturbation analysis to calculate leakage and rotordynamic force coefficients.

Theoretical Approach:

The model solves the 1D bulk flow problem using:

  1. Base State Calculation (equilibrium flow): - Compressible flow through annular clearance with hole patterns - Governing equations for axial Mach number, temperature, and tangential Mach number - Predictor-corrector integration (modified Euler method) - Friction effects from both stator and rotor surfaces - Inlet and exit loss modeling with adjustable coefficients - Reynolds number-dependent friction factors - Iterative solution to match outlet pressure using relaxation method

  2. Leakage Calculation: - Mass flow rate determined from pressure balance - Choke detection (critical Mach number checking) - Accounts for entrance losses, friction, and exit losses - Temperature-dependent viscosity using Sutherland’s law

  3. Perturbation Analysis (for dynamic coefficients): - Small harmonic perturbations in clearance (4 directions: ±X, ±Y) - Linearized perturbation equations for density, temperature, velocities - 4×4 system of equations solved at each axial station - Predictor-corrector integration for perturbed variables - Accounts for:

    • Temporal inertia effects (mass matrix)

    • Fluid inertia and convection

    • Compressibility effects

    • Friction perturbations

    • Pressure gradient perturbations

    • Preswirl and rotation effects

  4. Force Coefficients Extraction: - Stiffness (K): From static displacement perturbations - Damping (C): From velocity perturbations at whirl frequency - Mass (M): From acceleration perturbations (inertia effects) - Direct and cross-coupled terms - Integrated over seal length using trapezoidal rule

Parameters:
nint

Node in which the bearing will be located.

shaft_radiusfloat, pint.Quantity

Radius of the shaft (m).

radial_clearancefloat, pint.Quantity

Seal clearance (m).

lengthfloat, pint.Quantity

Length of the seal (m).

roughnessfloat

E / D (roughness / diameter) of the shaft.

cell_lengthfloat, pint.Quantity

Typical length of a cell in the axial direction (m).

cell_widthfloat, pint.Quantity

Typical length of a cell in the azimuthal direction (m).

cell_depthfloat, pint.Quantity

Depth of a cell (m).

inlet_pressurefloat

Inlet pressure (Pa).

outlet_pressurefloat

Outlet pressure (Pa).

inlet_temperaturefloat

Inlet temperature (deg K).

frequencylist, pint.Quantity

List with whirl frequency (rad/s).

gas_compositiondict, optional

Gas composition as a dictionary {component: molar_fraction}.

molarfloat, pint.Quantity, optional

Molecular mass (kg/kgmol). For Air: molar=28.97 kg/kgmol. Required if gas_composition is None. Default is None.

gammafloat, optional

Gas constant gamma (Cp/Cv). For Air: gamma=1.4. Required if gas_composition is None. Default is None.

b_sutherfloat, optional

b coefficient for the Sutherland viscosity model. Required if gas_composition is None. Default is None.

s_sutherfloat, optional

s coefficient for the Sutherland viscosity model. Required if gas_composition is None. Default is None.

preswirlfloat, optional

Ratio of the circumferential velocity of the gas to the surface velocity of the shaft. Default is 0.0.

entr_coeffloat, optional

Entrance loss coefficient. Default is 0.1.

exit_coeffloat, optional

Exit loss coefficient. Default is 0.5.

whirl_ratiofloat, optional

Ratio of whirl frequency to rotational speed. Default is 1.0.

nzint, optional

Number of discretization points in the axial direction. Default is 80.

max_iterationsint, optional

Maximum number of iterations for basic state calculation. Default is 180.

tolerancefloat, optional

Tolerance of the solution expressed as a percentage of the pressure differential across the seal. Default is 0.0001.

first_step_sizefloat, optional

Initial step for the solution method. It should not be more than 0.01. Default is 0.01.

rlx_factorfloat, optional

Relaxation factor. Should be smaller than 0.1. Default is 0.1.

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 “#77ACA2”.

Examples

>>> from ross.seals.holepattern_seal import HolePatternSeal
>>> from ross.units import Q_
>>> holepattern = HolePatternSeal(
...     n=0,
...     shaft_radius=0.0725,
...     radial_clearance=0.0003,
...     length=0.04699,
...     roughness=0.0001,
...     cell_length=0.003175,
...     cell_width=0.003175,
...     cell_depth=0.0025,
...     inlet_pressure=689000.0,
...     outlet_pressure=94300.0,
...     inlet_temperature=322.0,
...     frequency=Q_([8000], "RPM"),
...     gas_composition={"Nitrogen": 0.79, "Oxygen": 0.21},
...     preswirl=0.8,
...     entr_coef=0.5,
...     exit_coef=1.0,
...     nz=18
... )

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, shaft_radius, radial_clearance, length, roughness, cell_length, cell_width, cell_depth, inlet_pressure, outlet_pressure, inlet_temperature, frequency, gas_composition=None, molar=None, gamma=None, b_suther=None, s_suther=None, preswirl=0.0, entr_coef=0.1, exit_coef=0.5, whirl_ratio=1.0, nz=80, max_iterations=180, tolerance=0.0001, first_step_size=0.01, rlx_factor=0.1, **kwargs)#
calculate_forces(base_state_results)#
calculate_leakage()#
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}
exit_loss(msquared4, T4)#
form_rhs(mz2, T, mt)#
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()#

Get all subclasses of the Element class.

Returns:
subclasseslist

A list containing all subclasses of the Element class.

inlet_loss(p2)#
classmethod load(file)#

Load an element from a .toml or .json file.

Parameters:
filestr, pathlib.Path

The name of the file the element will be loaded from.

Returns:
The element object.
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.

plot_pressure_distribution(pressure_units='MPa', length_units='m', fig=None, **kwargs)#

Plot pressure distribution for the hole pattern seal.

Parameters:
pressure_unitsstr, optional

Pressure units for plotting. Default is “MPa”.

length_unitsstr, optional

Length units for axial position. Default is “m”.

figPlotly graph_objects.Figure(), optional

The figure object with the plot. If None, creates a new figure.

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 or .json file.

Overrides the base Element method to pass extra saved keys (e.g. pre-computed coefficients) as kwargs to the constructor. This allows subclasses to skip expensive computation when coefficients are already available from a saved file.

Parameters:
datadict

Dictionary obtained from toml.load() or json.load().

Returns:
The element object.
run(frequency)#
save(file)#

Save the element in a .toml or .json file.

This function will save the element to a .toml or .json 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. The format is determined by the file extension (.toml or .json).

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)
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([...