ross.SealElement
Contents
ross.SealElement#
- class ross.SealElement(n, kxx, cxx, mxx=0, kyy=None, kxy=0, kyx=0, cyy=None, cxy=0, cyx=0, myy=None, mxy=0, myx=0, kzz=0, czz=0, mzz=0, speed=None, frequency=None, seal_leakage=None, tag=None, n_link=None, scale_factor=None, color='#77ACA2', interpolation='pchip', radial_clearance=None, **kwargs)#
A seal element.
This class will create a seal element. Parameters can be a constant value or speed dependent. For speed dependent parameters, each argument should be passed as an array and the correspondent speed values should also be passed as an array. Values for each parameter will be_interpolated for the speed.
SealElement objects are handled differently in the Rotor class, even though it inherits from BearingElement class. Seal elements are not considered in static analysis, i.e., it does not add reaction forces (only bearings support the rotor). In stability level 1 analysis, seal elements are removed temporarily from the model, so that the cross coupled coefficients are calculated and replace the seals from the rotor model. SealElement data is stored in an individual data frame, separate from other bearing elements.
- Parameters:
- n: int
Node which the bearing will be located in
- kxxfloat, array, pint.Quantity
Direct stiffness in the x direction (N/m).
- cxxfloat, array, pint.Quantity
Direct damping in the x direction (N*s/m).
- mxxfloat, array, pint.Quantity
Direct mass in the x direction (kg). Default is 0.
- kyyfloat, array, pint.Quantity, optional
Direct stiffness in the y direction (N/m). Default is kxx.
- cyyfloat, array, pint.Quantity, optional
Direct damping in the y direction (N*s/m). Default is cxx.
- myyfloat, array, pint.Quantity, optional
Direct mass in the y direction (kg). Default is mxx.
- kxyfloat, array, pint.Quantity, optional
Cross coupled stiffness in the x direction (N/m). Default is 0.
- cxyfloat, array, pint.Quantity, optional
Cross coupled damping in the x direction (N*s/m). Default is 0.
- mxyfloat, array, pint.Quantity, optional
Cross coupled mass in the x direction (kg). Default is 0.
- kyxfloat, array, pint.Quantity, optional
Cross coupled stiffness in the y direction (N/m). Default is 0.
- cyxfloat, array, pint.Quantity, optional
Cross coupled damping in the y direction (N*s/m). Default is 0.
- myxfloat, array, pint.Quantity, optional
Cross coupled mass in the y direction (kg). Default is 0.
- kzzfloat, array, pint.Quantity, optional
Direct stiffness in the z direction (N/m). Default is 0.
- czzfloat, array, pint.Quantity, optional
Direct damping in the z direction (N*s/m). Default is 0.
- mzzfloat, array, pint.Quantity, optional
Direct mass in the z direction (kg). Default is 0.
- seal_leakagefloat, optional
Seal leakage mass flow rate (kg/s).
- speedarray, pint.Quantity, optional
Rotor speed axis of the coefficient table (rad/s). Default is None.
- frequencyarray, pint.Quantity, optional
Excitation (whirl) frequency axis of the coefficient table (rad/s). Default is None.
- 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. Defaults to half the parent BearingElement’s scale factor if not provided.
- colorstr, optional
A color to be used when the element is represented. Default is “#77ACA2”.
- interpolationstr, optional
Interpolation of the coefficient tables along each axis:
"pchip"(shape-preserving cubic, default) or"linear".- radial_clearancefloat, pint.Quantity, optional
Radial clearance between the rotor and the stationary part at this element (m). When given, the element is treated as a close-clearance location by
ross.Rotor.run_clearance_analysis(). Default is None.
Notes
SealElement class is strongly recommended to represent seals. Avoid using BearingElement class for this purpose.
Examples
>>> # A seal element located in the first rotor node, with these >>> # following stiffness and damping coefficients and speed range from >>> # 0 to 200 rad/s >>> import ross as rs >>> kxx = 1e6 >>> kyy = 0.8e6 >>> cxx = 2e2 >>> cyy = 1.5e2 >>> speed = np.linspace(0, 200, 11) >>> seal = rs.SealElement(n=0, kxx=kxx, kyy=kyy, cxx=cxx, cyy=cyy, speed=speed) >>> seal.K(speed[-1]) array([[1000000., 0., 0.], [ 0., 800000., 0.], [ 0., 0., 0.]]) >>> seal.C(speed[-1]) array([[200., 0., 0.], [ 0., 150., 0.], [ 0., 0., 0.]])
Methods
- C(frequency, speed=None)#
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 (whirl) frequency (rad/s).
- speedfloat, optional
The rotor speed (rad/s). Default is the excitation frequency (synchronous evaluation).
- 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, speed=None)#
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 (whirl) frequency (rad/s).
- speedfloat, optional
The rotor speed (rad/s). Default is the excitation frequency (synchronous evaluation).
- 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, speed=None)#
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 (whirl) frequency (rad/s).
- speedfloat, optional
The rotor speed (rad/s). Default is the excitation frequency (synchronous evaluation).
- 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, kxx, cxx, mxx=0, kyy=None, kxy=0, kyx=0, cyy=None, cxy=0, cyx=0, myy=None, mxy=0, myx=0, kzz=0, czz=0, mzz=0, speed=None, frequency=None, seal_leakage=None, tag=None, n_link=None, scale_factor=None, color='#77ACA2', interpolation='pchip', radial_clearance=None, **kwargs)#
- 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(speed=None, frequency=None, coefficients=None, frequency_units='rad/s', stiffness_units='N/m', damping_units='N*s/m', mass_units='kg')#
Return speed / frequency vs coefficients in table format.
The table lists the coefficients along the axes the element is tabulated on: the rotor speed, the excitation (whirl) frequency, or every (speed, frequency) pair for 2-D tables.
- Parameters:
- speedarray, pint.Quantity, optional
Array with rotor speeds (rad/s). Default is 5 values from min to max speed.
- frequencyarray, pint.Quantity, optional
Array with excitation (whirl) 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
Units for the speed and frequency columns. 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__)) + '/data/bearing_seal_si.xls' >>> BearingElement.from_table(0, file_path, n_link=1) BearingElement(n=0, n_link=1, kxx=[13798100.0, ...
- 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()#
Extract prefix of the class name preceding ‘Element’, insert spaces before uppercase letters.
- 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.
Classes whose
save()writes a plain coefficient table (seesave_coefficient_table()) read it back as the class named in the file, soPlainJournal.loadorSqueezeFilmDamper.loadreturns the savedBearingElementtable instead of re-running the solver. Other subclasses keep building themselves, as before.- Parameters:
- filestr, pathlib.Path
The name of the file the element will be loaded from.
- Returns:
- The element object.
Examples
>>> from tempfile import tempdir >>> from pathlib import Path >>> bearing = bearing_example() >>> file = Path(tempdir) / 'bearing_load.toml' >>> bearing.save(file) >>> BearingElement.load(file) == bearing True
- 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 speed or frequency.
Coefficients are plotted against the axis they are tabulated on: the rotor speed axis, the excitation (whirl) frequency axis, or, for 2-D tables, one curve per rotor speed against the frequency axis.
- Parameters:
- coefficientslist, str
List or str with the coefficients to plot.
- frequency_unitsstr, optional
Units for the speed or frequency axis. 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 the axial pressure distribution along the seal.
Available for seals whose solver computes a pressure distribution (e.g.
LabyrinthSealandHolePatternSeal). The distribution of the first speed inspeedis plotted.- 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.
- 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).
- more_argsdict, optional
More arguments to be saved if needed.
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)
- save_coefficient_table(file)#
Save the element as a plain coefficient-table BearingElement.
Solver-based bearings (
FluidFilmBearingand its configuration classes,ThrustPad,SqueezeFilmDamper) use this as theirsave(): the file holds the solved dynamic-coefficient table under aBearingElement_<tag>section, so loading it restores the rotordynamic behavior instantly instead of re-running the solver. Re-create the object from its constructor to change the bearing model.- Parameters:
- filestr or pathlib.Path
File to write (created or updated).
- set_tag(index, check_tag=True)#
Set a tag to the given element.
- Parameters:
- indexint
The index of the element to standardize the tag.
- check_tagbool, optional
Whether to check if the tag is already set.
- 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__)) + '/data/bearing_seal_si.xls' >>> BearingElement.table_to_toml(0, file_path) {'n': 0, 'kxx': [13798100.0, ...