ross.HybridSeal
Contents
ross.HybridSeal#
- class ross.HybridSeal(n, shaft_radius, inlet_pressure, outlet_pressure, inlet_temperature, frequency, hole_pattern_parameters, labyrinth_parameters, gas_composition=None, molar=None, gamma=None, tolerance=1e-06, max_iterations=1e+20, color='#787FF6', scale_factor=0.75, **kwargs)#
Hybrid seal - Compressible flow model with rotordynamic coefficients.
This class provides a model for hybrid seals that combine a hole-pattern seal (damping section) with a labyrinth seal (throttling section). The model iteratively determines the interface pressure between the two seal stages by matching their leakage rates, then combines their rotordynamic coefficients.
Theoretical Approach:
Iterative Pressure Matching: - Uses bisection method to find intermediate pressure between seal stages - Ensures mass conservation: leakage into hole-pattern = leakage from labyrinth - Convergence criterion based on relative leakage difference
Combined Rotordynamic Coefficients: - Direct and cross-coupled stiffness (K), damping (C), and mass (M) coefficients - Series combination: forces from both seals are added - Frequency-dependent coefficients for each operating speed
- Parameters:
- **Common Parameters (both seal stages):**
- nint
Node in which the hybrid seal will be located.
- shaft_radiusfloat, pint.Quantity
Radius of shaft (m).
- inlet_pressurefloat
Total inlet pressure at labyrinth entrance (Pa).
- outlet_pressurefloat
Final outlet pressure at hole-pattern exit (Pa).
- inlet_temperaturefloat
Inlet temperature (K).
- frequencyfloat, list, pint.Quantity,
Shaft rotational speed(s) (rad/s). Can be a single value or list of frequencies.
- gas_compositiondict, optional
Gas composition as a dictionary {component: molar_fraction}. Example: {“Nitrogen”: 0.79, “Oxygen”: 0.21} for air.
- 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.
- **Hole-Pattern Seal Parameters (downstream damping stage):**
- hole_pattern_parametersdict
Other parameters for hole-pattern seal with the following keys: - radial_clearance : float, 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).
- 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.
- **Labyrinth Seal Parameters (upstream throttling stage):**
- labyrinth_parametersdict
Other parameters for labyrinth seal with the following keys: - radial_clearance : float, pint.Quantity
Nominal radial clearance (m).
- n_teethint
Number of teeth (throttlings). Needs to be <= 30.
- 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.
- preswirlfloat
Inlet swirl velocity ratio. Positive values for swirl with shaft rotation and negative values for swirl against shaft rotations.
- tzlist of float, optional
Temperature at states: [T_state1, T_state2] (deg K). Required if gas_composition is None. Default is None.
- muzlist of float, optional
Dynamic viscosity at states: [mu_state1, mu_state2] (kg/(m·s)). Required if gas_composition is None. Default is None.
- nprtint, optional
Number of parameters to be printed in the output: 1 maximum, 5 minimum. Default is 1.
- iopt1int, optional
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. Default is 0.
- **Hybrid Seal Control Parameters:**
- tolerancefloat, optional
Tolerance for pressure matching. Default is 1e-6.
- max_iterationsint, optional
Maximum iterations for pressure matching. Default is 1e20.
- colorstr, optional
Color for element visualization. Default is “#787FF6”.
- scale_factorfloat, optional
Scale factor for element drawing. Default is 0.75.
- kwargsoptional
Additional keyword arguments passed to parent SealElement.
Examples
>>> from ross.seals.hybrid_seal import HybridSeal >>> from ross.units import Q_ >>> gas_composition = { ... "Nitrogen": 0.7812, ... "Oxygen": 0.2096, ... "Argon": 0.0092, ... } >>> holep_params = { ... "radial_clearance": 0.0003, ... "length": 0.04, ... "roughness": 0.0001, ... "cell_length": 0.003, ... "cell_width": 0.003, ... "cell_depth": 0.002, ... "preswirl": 0.8, ... "entr_coef": 0.5, ... "exit_coef": 1.0, ... } >>> laby_params = { ... "radial_clearance": Q_(0.25, "mm"), ... "n_teeth": 10, ... "pitch": Q_(3, "mm"), ... "tooth_height": Q_(3, "mm"), ... "tooth_width": Q_(0.15, "mm"), ... "seal_type": "inter", ... "preswirl": 0.9, ... "tz": [300.0, 299.5], ... "muz": [1.85e-05, 1.84e-05], ... } >>> hybrid = HybridSeal( ... n=0, ... shaft_radius=Q_(25, "mm"), ... inlet_pressure=500000, ... outlet_pressure=100000, ... inlet_temperature=300.0, ... frequency=Q_([2000, 3000, 5000], "RPM"), ... gas_composition=gas_composition, ... hole_pattern_parameters=holep_params, ... labyrinth_parameters=laby_params, ... ) >>> hybrid.seal_leakage 0.0348...
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, inlet_pressure, outlet_pressure, inlet_temperature, frequency, hole_pattern_parameters, labyrinth_parameters, gas_composition=None, molar=None, gamma=None, tolerance=1e-06, max_iterations=1e+20, color='#787FF6', scale_factor=0.75, **kwargs)#
- add_tag(index)#
Add a tag to the given element.
- 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...
- classmethod get_base_class()#
Get the direct subclass of Element in the inheritance chain.
Returns the first class in the inheritance hierarchy that directly inherits from Element. This is useful for identifying the base element type when working with subclasses or indirect subclasses.
- Returns:
- base_classtype
The direct subclass of Element in the inheritance chain.
- 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.
- 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_convergence()#
Plot convergence history.
This method creates a unified figure with three subplots showing: convergence history, interface pressure evolution, and leakage comparison.
- Returns:
- figPlotly graph_objects.Figure()
Plotly figure object with combined subplots.
- plot_pressure_distribution(pressure_units='MPa', length_units='m', fig=None, **kwargs)#
Plot pressure distribution for the hybrid seal.
- Parameters:
- pressure_unitsstr, optional
Units for the pressure. Default is “MPa”.
- length_unitsstr, optional
Units for the length. Default is “m”.
- figgo.Figure, optional
Plotly figure object with the plot. Default is None.
- 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()
Plotly figure object.
- 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.
- 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...
- summary_results()#
Print summary of hybrid seal analysis results.
This method displays a comprehensive summary of the hybrid seal calculation, including convergence information, seal leakage, interface pressure.
- Returns:
- tablePrettyTable object
Formatted table of results.
- 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([...