Source code for openairbearing.core.geometry

"""Bearing geometries as builders of a Film.

A geometry defines the film domain, which of its edges see which pressure,
and the gap as a function of the position q of the moving body. Everything
else (solve, forces, flows, stiffness) is common to all of them.

Lengths are in m, angles in rad and pressures absolute in Pa. Arguments that
the builders share:

porous: the restrictor (``Porous``).
ps, pa: supply and ambient pressure.
gas: the gas, air by default.
shape: function of the film coordinates x (shape (2, ...)) giving an extra
    gap in m, added at every position; None for none.
velocity: function of x giving the sum of the two surface velocities,
    (Ux, Uy) in m/s, or None. Thrust faces only: the others take the shaft
    speed omega in rad/s, positive toward +theta.
h_ref: gap scale of the solve in m. Thrust faces only: the others use the
    clearance.

Position conventions

Thrust faces (circular, annular, rectangular, sector pads): q = (h, rx, ry).
h is the gap of the flat face at the origin of the film coordinates, rx and
ry are small rotations of the runner about the x and y axes through that
origin:

    gap = h + rx·y - ry·x + shape(x)

The origin is the centre of a circular or rectangular pad and the axis of
an annular face or of sector pads, where there is no film. The gap at the
origin is h only where shape is zero there.

Journal: q = (x, y, rx, ry) is the motion of the shaft inside the bushing,
with rotations about axes through the bearing mid-plane:

    gap = c - (x + ry·z) cos(theta) - (y - rx·z) sin(theta) + shape(x)

The spherical bearing and the thrust bushing state theirs in their builders.

The generalised forces returned by the solver are conjugate to these: for a
thrust face, the load pushing the runner away and the moments on the runner;
for a journal, the film force and moment on the shaft.
"""

from __future__ import annotations

from collections.abc import Callable
from dataclasses import fields as dataclass_fields

import numpy as np

from . import meshes
from .film import Film, Porous
from .gas import AIR, Gas
from .restrictor import restrictor_layers

__all__ = [
    "annular_pad",
    "bore_form",
    "circular_pad",
    "corner_relief",
    "journal",
    "journal_pads",
    "rectangular_pad",
    "spherical_bearing",
    "thrust_bushing",
    "thrust_pads",
]

THRUST_DOFS = ("h", "rx", "ry")
JOURNAL_DOFS = ("x", "y", "rx", "ry")
BUSHING_DOFS = ("x", "y", "z", "rx", "ry", "rz")
SPHERE_DOFS = ("x", "y", "z")


def _no_shape(x):
    return 0.0


[docs] def bore_form( radius: float, length: float, *, conicity: float = 0.0, roundness: float = 0.0, lobes: int = 2, lobe_angle: float = 0.0, crowning: float = 0.0, ): """Extra gap of a journal whose bore (or shaft) is not a perfect cylinder. radius is the film radius and length the bearing length, m. Three form errors, each given as the size of the extra gap in m and each leaving the smallest gap where it was, so the clearance stays the tightest radial clearance: - conicity: the bore opens linearly along the axis by this much from one end to the other; positive opens toward +z. - roundness with ``lobes`` (2 is oval, 3 three-lobed): the gap varies around the bore between 0 and this much; lobe_angle is the angle of a tight spot, rad. - crowning: a parabola along the axis; positive opens toward both ends (a barrel-shaped shaft or a bell-mouthed bore), negative opens in the middle (an hourglass shaft or a bore worn in the middle). Returns a function of the film coordinates (s, z) of ``journal`` and ``journal_pads``, for their ``shape``, or None if all three are zero. """ if conicity == 0.0 and roundness == 0.0 and crowning == 0.0: return None if lobes < 1 or int(lobes) != lobes: raise ValueError("lobes must be a whole number of at least 1.") def shape(x): theta, axial = x[0] / radius, 2.0 * x[1] / length # axial: -1 to 1 cone = 0.5 * abs(conicity) * (1.0 + np.sign(conicity) * axial) lobed = 0.5 * abs(roundness) * (1.0 - np.cos(lobes * (theta - lobe_angle))) if crowning >= 0.0: crown = crowning * axial**2 else: crown = -crowning * (1.0 - axial**2) return cone + lobed + crown return shape
def _curved_wall(porous: Porous, radius: float, wall: str) -> Porous: """The restrictor as the curved wall of a cylindrical bearing.""" return porous.curved(radius, wall) def _thrust_gap(shape: Callable | None): """Gap of a thrust face at q = (h, rx, ry), with shape(x) added.""" shape = _no_shape if shape is None else shape def gap(x, q): return q[0] + q[1] * x[1] - q[2] * x[0] + shape(x) return gap def _thrust_film( basis, boundaries, name, *, porous, ps, pa, gas, shape, velocity, h_ref ): return Film( basis=basis, boundaries=boundaries, gap=_thrust_gap(shape), dof_names=THRUST_DOFS, porous=porous, ps=ps, pa=pa, gas=gas, velocity=velocity, h_ref=h_ref, name=name, )
[docs] def circular_pad( radius: float, *, porous: Porous, ps: float, pa: float = 101325.0, gas: Gas = AIR, shape: Callable | None = None, velocity: Callable | None = None, nrefs: int = 4, h_ref: float = 10e-6, rings=(), radial: int | None = None, circles=(), ) -> Film: """Circular thrust pad, ambient pressure at its edge "rim". nrefs, rings and radial are those of ``meshes.disc``. rings are radii that get a circle of mesh nodes, for the edges of a feed groove or hole behind the restrictor (``Porous.feed_area``) or of any other change of the restrictor at a radius. radial refines the mesh along the radius only, for a solution that does not change around the pad. circles are (x, y, r): circles anywhere on the face, such as the edges of feed inserts or holes off the centre, that element edges follow. They take the mesh of ``meshes.disc_circles`` instead, with its own nrefs; rings and radial are then a ValueError (a ring is the circle (0, 0, r)). """ if len(circles): if len(rings) or radial is not None: raise ValueError( "rings and radial belong to the mesh without circles; give a " "ring as the circle (0, 0, r)." ) basis, edges = meshes.disc_circles(radius, circles, nrefs) else: basis, edges = meshes.disc(radius, nrefs, rings=rings, radial=radial) return _thrust_film( basis, {"rim": (edges["rim"], pa)}, "circular pad", porous=porous, ps=ps, pa=pa, gas=gas, shape=shape, velocity=velocity, h_ref=h_ref, ) # fmt: skip
[docs] def annular_pad( r_in: float, r_out: float, *, porous: Porous, ps: float, pa: float = 101325.0, p_inner: float | None = None, gas: Gas = AIR, shape: Callable | None = None, velocity: Callable | None = None, n_circ: int = 96, n_radial: int = 16, h_ref: float = 10e-6, ) -> Film: """Annular thrust face between the radii r_in and r_out. The edge "inner" sees p_inner (a chamber), or ambient pressure if that is None; the edge "outer" sees ambient pressure. n_circ and n_radial are the numbers of elements around and across the face. """ basis, edges = meshes.annulus(r_in, r_out, n_circ, n_radial) boundaries = { "inner": (edges["inner"], pa if p_inner is None else p_inner), "outer": (edges["outer"], pa), } return _thrust_film( basis, boundaries, "annular pad", porous=porous, ps=ps, pa=pa, gas=gas, shape=shape, velocity=velocity, h_ref=h_ref, ) # fmt: skip
[docs] def rectangular_pad( lx: float, ly: float, *, porous: Porous, ps: float, pa: float = 101325.0, gas: Gas = AIR, open_edges: tuple = ("left", "right", "bottom", "top"), shape: Callable | None = None, velocity: Callable | None = None, nx: int = 32, ny: int = 32, h_ref: float = 10e-6, ) -> Film: """Rectangular thrust pad of lx by ly, centred at the origin. The edges are "left" and "right" (x = -lx/2 and lx/2) and "bottom" and "top" (y = -ly/2 and ly/2). Those in open_edges are at ambient pressure; the others are symmetry lines. With only "left" and "right" open, the pad is a slice of an infinitely long bearing of width lx. nx and ny are the numbers of elements along x and y. """ basis, edges = meshes.rectangle(lx, ly, nx, ny) boundaries = {name: (edges[name], pa) for name in open_edges} return _thrust_film( basis, boundaries, "rectangular pad", porous=porous, ps=ps, pa=pa, gas=gas, shape=shape, velocity=velocity, h_ref=h_ref, ) # fmt: skip
[docs] def journal( radius: float, length: float, clearance: float, *, porous: Porous, ps: float, pa: float = 101325.0, gas: Gas = AIR, omega: float = 0.0, shape: Callable | None = None, wall: str = "outside", n_circ: int = 96, n_axial: int = 16, axial_marks=(), ) -> Film: """Full journal bearing, ambient pressure at both ends. radius is the film radius, clearance the radial clearance with the shaft centred, omega the shaft speed in rad/s. Film coordinates are (s, z) with s = radius·theta, theta from the x axis and z zero at mid-length; the edges are "end_low" and "end_high". wall says how the porous wall curves around the film: "outside" (a sleeve around the shaft, the default), "inside" (a porous shaft or liner inside the film) or "flat" (a slab, as in most published theories). n_circ and n_axial are the numbers of elements around and along the axis. axial_marks are axial positions z that get a line of mesh nodes, for the edges of a feed groove behind the restrictor (``Porous.feed_area``). """ porous = _curved_wall(porous, radius, wall) basis, edges = meshes.cylinder( radius, length, n_circ, n_axial, axial_marks=axial_marks ) shape = _no_shape if shape is None else shape def gap(x, q): th, z = x[0] / radius, x[1] ex = q[0] + q[3] * z ey = q[1] - q[2] * z return clearance - ex * np.cos(th) - ey * np.sin(th) + shape(x) def velocity(x): return omega * radius + 0.0 * x[0], 0.0 * x[1] return Film( basis=basis, boundaries={name: (dofs, pa) for name, dofs in edges.items()}, gap=gap, dof_names=JOURNAL_DOFS, porous=porous, ps=ps, pa=pa, gas=gas, velocity=velocity if omega else None, h_ref=clearance, coords=(("s", "m"), ("z", "m")), name="journal", )
[docs] def corner_relief(distance, rotor_round: float, bushing_chamfer: float): """Extra gap in the corner of a thrust bushing, m. distance is measured along the bushing surface from the sharp corner, on either leg. The 45° chamfer on the bushing opens a triangular channel of area c²/2; the round where the shaft meets the runner fills r²(1 - pi/4) of it. Each is spread over the two legs so that the integral of the returned gap over both legs is the channel cross-section. The channel volume is therefore exact, while its flow resistance, from the thin-film equation applied to a gap of this size, is an estimate. """ a = np.abs(np.asarray(distance, dtype=float)) c, r = bushing_chamfer, rotor_round chamfer = 0.5 * np.clip(c - a, 0.0, None) inside = np.clip(r - a, 0.0, None) # distance into the round, zero outside it fillet = np.where( a < r, 0.5 * (r - np.sqrt(np.clip(r**2 - inside**2, 0.0, None))), 0.0 ) return chamfer - fillet
[docs] def thrust_bushing( bore_diameter: float, shaft_diameter: float, length: float, thrust_diameter: float, thrust_gap: float, *, porous_journal: Porous, porous_thrust: Porous | None = None, ps: float, pa: float = 101325.0, gas: Gas = AIR, omega: float = 0.0, rotor_round: float = 0.2e-3, bushing_chamfer: float = 0.5e-3, vented: bool = False, shaft_form: Callable | None = None, bore_form: Callable | None = None, wall: str = "outside", construction: str = "bonded", _size_only: bool = False, n_theta: int = 48, n_journal: int = 60, n_thrust: int = 30, n_corner: int = 4, grading: float = 2.0, ) -> Film: """Porous journal and its annular thrust face as one connected film. The film surface is unwrapped to (s, theta), s in m and theta in rad: the thrust face is s in [-(r_o - r_i), 0] at radius r_i - s, the bore is s in [0, length] at axial position z = s, with r_i and r_o half the bore and thrust diameters. Pressure and flow are continuous around the corner at s = 0. The corner holds a circumferential channel formed by the chamfer on the bushing and the round on the rotor (corner_relief); set both to zero for a sharp corner. The edges "thrust_edge" (the rim of the thrust face) and "journal_edge" (the far end of the bore) are at ambient pressure, and with vented=True so is the corner (edge "vent"). The supply flow is reported for the regions "thrust" and "journal" as well. Frame, fixed to the bushing: z is the axis, the thrust face is the plane z = 0, the bore runs from z = 0 to z = length and the runner sits on the -z side. Shaft and runner move as one rigid body, q = (x, y, z, rx, ry, rz), with rotations about the origin; positive z closes the thrust gap, which is thrust_gap at q = 0, and the radial clearance is half the difference of the two diameters. rz only matters with a shaft roundness error shaft_form(angle in the shaft frame), which reduces the journal gap by its value in m; bore_form(theta) increases it. The generalised forces are the film forces and moments on the shaft and runner. omega is the shaft speed in rad/s. The two restrictors are porous_journal and porous_thrust (the same as the bore's if None), and each of their options is either carried face by face or refused, never dropped. Permeability, thickness, the surface layer, slip coefficient, equivalent clearance and inertial resistance are those of each face, as numbers: a function of position is a ValueError. The in-plane ratio is carried face by face too; the volume model uses it, the column model has no flow along the face and leaves it out, as on any other bearing. slip and model must be the same on both faces (ValueError). Any other option that is not at its default (open rim, feed area, face seal, a spherical wall) is a NotImplementedError, and an in-plane ratio on a one-piece bushing is one too (its anisotropy follows the material axes of the body). wall says how the porous wall of the bore curves, as for ``journal``; the thrust restrictor is flat and may not carry a curvature. construction says how the porous part is built. "bonded": a sleeve and a thrust ring, two pieces with a sealed joint between them; each face is fed through its own restrictor (``Porous.model``) and no gas passes from one piece to the other inside the material. In the column model and in the volume model (one volume per face, ``restrictor.FaceVolumes``) each piece is the face extended through its own thickness, fed over its whole back: behind the corner the two extrusions overlap, and each counts that material as its own. "monolithic": one piece of porous material, L-shaped in section, meshed as a body (porous_body.py) with flow in it around the corner; the sleeve is fed on its outer surface and the flange on its back, beyond the sleeve, and the end of the sleeve and the rim of the flange are sealed. The two thicknesses are those of ``porous_journal`` and ``porous_thrust``; a surface layer of either lies between the pores at that face and the film, with its own thickness and permeability. Mesh: n_theta elements around; n_thrust and n_journal lines of nodes along the thrust face and the bore, outside the chamfer; n_corner elements on each leg of the chamfer; grading packs the lines toward the ends of each face (``meshes.graded``). """ if construction not in ("bonded", "monolithic"): raise ValueError("construction must be 'bonded' or 'monolithic'") porous_thrust = porous_journal if porous_thrust is None else porous_thrust material = (porous_journal, porous_thrust) # as given, before any wall factor if porous_thrust.curvature: raise ValueError("The thrust face is flat: its restrictor has no curvature.") # Asked here, on the restrictors as given: ``curved`` below sets the # bore's own flag again, and the loop over the other options would not # see it. if any(porous.spherical for porous in material): raise NotImplementedError( "The thrust bushing does not take the restrictor option spherical: " "its bore is a cylinder and its thrust face is flat." ) porous_journal = _curved_wall(porous_journal, 0.5 * bore_diameter, wall) if porous_thrust.slip != porous_journal.slip: raise ValueError("The two porous faces must share one slip factor.") r_i, r_o = 0.5 * bore_diameter, 0.5 * thrust_diameter clearance = 0.5 * (bore_diameter - shaft_diameter) if clearance <= 0.0: raise ValueError("Shaft diameter must be smaller than bore diameter.") c = bushing_chamfer if rotor_round and not c > rotor_round: raise ValueError("The bushing chamfer must be larger than the rotor round.") if c >= min(length, r_o - r_i): raise ValueError("The chamfer is larger than a bearing face.") if c > 0.0: s_nodes = np.concatenate( [ meshes.graded(-(r_o - r_i), -c, n_thrust, grading)[:-1], _corner_nodes(c, n_corner), meshes.graded(c, length, n_journal, grading)[1:], ] ) else: s_nodes = np.concatenate( [ meshes.graded(-(r_o - r_i), 0.0, n_thrust, grading), meshes.graded(0.0, length, n_journal, grading)[1:], ] ) if construction == "monolithic": # node lines where the back of the sleeve and the back of the flange # meet the film faces, so that the body can share the film's nodes thick = _monolithic_thicknesses(material, r_o - r_i, length) s_nodes = meshes.marked(s_nodes, (-thick[0], thick[1])) basis, edges = meshes.unwrapped(s_nodes, n_theta) if _size_only: body = 0 if construction == "monolithic": from skfem import MeshQuad2 section = _monolithic_section(s_nodes, r_i, thick) # every node of the quadratic section, at twice n_theta angles body = MeshQuad2.from_mesh(section.mesh).doflocs.shape[1] * 2 * n_theta return {"film": int(basis.N), "body": int(body)} boundaries = { "thrust_edge": (edges["s_min"], pa), "journal_edge": (edges["s_max"], pa), } if vented: corner = np.where(np.abs(basis.doflocs[0]) < 1e-9 * length)[0] boundaries["vent"] = (corner, pa) def on_thrust(x): return x[0] < 0.0 def radius(x): return r_i - np.minimum(x[0], 0.0) def by_face(thrust_value, journal_value): if callable(thrust_value) or callable(journal_value): raise ValueError("Position-dependent porous data is not supported here.") return lambda x: np.where(on_thrust(x), thrust_value, journal_value) # One restrictor description for the film, with every option of the two # given face by face. An option that cannot be given that way is refused # unless both faces leave it at its default: nothing is dropped. by_face_fields = ( "kappa", "hp", "layer_flow_reduction", "layer_thickness", "curvature", "equivalent_clearance", "slip_coefficient", "inertial_resistance", "inplane_ratio", ) # fmt: skip shared = ("slip", "model") set_here = ("bent_axis",) # by this builder, below default = Porous() for f in dataclass_fields(Porous): if f.name in by_face_fields or f.name in set_here: continue values = (getattr(porous_thrust, f.name), getattr(porous_journal, f.name)) if f.name in shared: if values[0] != values[1]: raise ValueError( f"The two porous faces of a thrust bushing must share {f.name}." ) elif any(v != getattr(default, f.name) for v in values): raise NotImplementedError( f"The thrust bushing does not take the restrictor option {f.name}." ) porous = Porous( slip=porous_journal.slip, model=porous_journal.model, # the bore's film coordinate round the bore is the second, theta bent_axis=1, **{ name: by_face(getattr(porous_thrust, name), getattr(porous_journal, name)) for name in by_face_fields }, ) def gap(x, q): s, theta = x dx, dy, dz, rx, ry, rz = q r, zj = radius(x), np.maximum(s, 0.0) ex = dx + ry * zj ey = dy - rx * zj h_journal = clearance - ex * np.cos(theta) - ey * np.sin(theta) if shaft_form is not None: h_journal = h_journal - shaft_form(theta - rz) if bore_form is not None: h_journal = h_journal + bore_form(theta) h_thrust = thrust_gap - dz - rx * r * np.sin(theta) + ry * r * np.cos(theta) relief = corner_relief(s, rotor_round, c) if c > 0.0 else 0.0 return np.where(on_thrust(x), h_thrust, h_journal) + relief def velocity(x): return 0.0 * x[0], omega * radius(x) film = Film( basis=basis, boundaries=boundaries, gap=gap, dof_names=BUSHING_DOFS, porous=porous, ps=ps, pa=pa, gas=gas, velocity=velocity if omega else None, metric=lambda x: (1.0, radius(x)), h_ref=clearance, coords=(("s", "m"), ("theta", "rad")), regions={"thrust": on_thrust, "journal": lambda x: ~on_thrust(x)}, name="thrust bushing", ) if construction == "bonded": return film return _on_monolithic_body(film, material, s_nodes, r_i, thick, n_theta)
def _corner_nodes(c, n): """2n + 1 nodes from -c to c, with the middle exactly at the corner. linspace can leave it a rounding error off zero, and the corner of the film is then not on the line where the two faces of a body meet. """ nodes = np.linspace(-c, c, 2 * n + 1) nodes[n] = 0.0 return nodes def thrust_bushing_size(*args, **kwargs) -> dict: """What a thrust bushing will cost, without building it. Takes the arguments of ``thrust_bushing`` and returns {"film": pressure unknowns of the film, "body": nodes of the one-piece porous body (0 for a bonded bushing)}. Only the meshes of the film and of the body's cross section are made: the body of a fine bushing has hundreds of thousands of nodes and takes many seconds and gigabytes to build. """ return thrust_bushing(*args, _size_only=True, **kwargs) def _monolithic_section(s_nodes, r_i, thick): """Cross-section of the one-piece body: sleeve and flange, in (r, z).""" from . import porous_body sleeve, flange = thick r_nodes = r_i - s_nodes[s_nodes <= 0.0][::-1] z_nodes = s_nodes[s_nodes >= 0.0] r_back, z_back = r_i + sleeve, flange return porous_body.section_grid( r_nodes, z_nodes, lambda r, z: r < r_back or z < z_back ) def _monolithic_thicknesses(material, flange_width, length): """(sleeve wall, flange) thickness of a one-piece bushing, checked.""" for porous in material: if callable(porous.kappa) or callable(porous.hp): raise ValueError("Position-dependent porous data is not supported here.") sleeve, flange = float(material[0].hp), float(material[1].hp) if not sleeve < flange_width: raise ValueError("The sleeve wall is as thick as the thrust face is wide.") if not flange < length: raise ValueError("The flange is as thick as the bore is long.") return sleeve, flange def _on_monolithic_body(film, material, s_nodes, r_i, thick, n_theta): """The bushing film on its one-piece porous body. Section in (r, z): the sleeve, r_i to r_i + sleeve wall over the whole length, and the flange, z from 0 to its thickness out to the rim. Its node lines are those of the two film faces, continued into the material. """ from . import porous_body if any(float(p.inplane_ratio) != 1.0 for p in material): raise NotImplementedError( "The thrust bushing does not take the restrictor option inplane_ratio " "as one piece. A one-piece bushing has one set of material axes: " "give its anisotropy along them with porous_body.PorousBody(ratios=...)." ) sleeve, flange = thick r_back, z_back = r_i + sleeve, flange tol = 1e-6 * r_i section = _monolithic_section(s_nodes, r_i, thick) def rad(X): return np.hypot(X[0], X[1]) def in_sleeve(X): return rad(X) < r_back # Bulk and surface layer of each piece of the description. The layer is # a resistance between the pores at the face and the film; a face # without one gets a micrometre of its own bulk, which is next to none. point = np.zeros((2, 1)) bulk, skin = [], [] for porous in material: layers = restrictor_layers(porous, point) bulk.append(float(layers[-1].kappa[0])) if len(layers) == 2: skin.append((float(layers[0].thickness[0]), float(layers[0].kappa[0]))) else: skin.append((1e-6, bulk[-1])) def by_piece(sleeve_value, flange_value): return lambda X: np.where(in_sleeve(X), sleeve_value, flange_value) def on_bore(X): # of the film faces: the bore, as against the thrust face return rad(X) < r_i + tol layer = None if any(p.layer_flow_reduction for p in material): layer = tuple( (lambda X, k=k: np.where(on_bore(X), skin[0][k], skin[1][k])) for k in range(2) ) faces = { "film": lambda X: (X[2] < tol) | (rad(X) < r_i + tol), "supply": lambda X: ( ((np.abs(rad(X) - r_back) < tol) & (X[2] > z_back - tol)) | ((np.abs(X[2] - z_back) < tol) & (rad(X) > r_back - tol)) ), } body = porous_body.PorousBody( porous_body.revolve(section, n_theta), by_piece(*bulk), faces, inertial_resistance=by_piece(*(float(p.inertial_resistance) for p in material)), ) def position(x): r, z = r_i - np.minimum(x[0], 0.0), np.maximum(x[0], 0.0) return np.array([r * np.cos(x[1]), r * np.sin(x[1]), z]) return porous_body.on_body(film, body, "film", position, "supply", layer=layer)
[docs] def spherical_bearing( radius: float, clearance: float, polar_from: float, polar_to: float, *, porous: Porous, ps: float, pa: float = 101325.0, gas: Gas = AIR, omega: float = 0.0, shape: Callable | None = None, wall: str = "outside", n_theta: int = 48, n_polar: int = 24, grading: float = 2.0, ) -> Film: """Band of a spherical bearing between two polar angles, ambient at both edges. The polar angle is measured from the +z axis, so (0.2, pi/2) is a hemispherical seat with a hole around the pole and its rim at the equator. Film coordinates are (s, theta) with s = radius·polar angle in m and theta in rad; the edges are "edge_low" (at polar_from) and "edge_high" (at polar_to). The band may not include the pole itself. q = (x, y, z) is the displacement of the ball centre in the socket; rotation of the ball about its centre does not change the gap. With c the radial clearance, gap = c - (x cos(theta) + y sin(theta)) sin(polar) - z cos(polar) + shape(x) The generalised forces are the film forces on the ball. omega is the spin about z in rad/s. wall is as for ``journal``, the seat curving in both directions. n_theta and n_polar are the numbers of elements around and along the band, which grading packs toward its two edges. """ if not 0.0 < polar_from < polar_to < np.pi: raise ValueError("Need 0 < polar_from < polar_to < pi (the pole is excluded).") s_nodes = meshes.graded( radius * polar_from, radius * polar_to, n_polar + 1, grading ) basis, edges = meshes.unwrapped(s_nodes, n_theta) shape = _no_shape if shape is None else shape def ring_radius(x): return radius * np.sin(x[0] / radius) def gap(x, q): polar, theta = x[0] / radius, x[1] radial = q[0] * np.cos(theta) + q[1] * np.sin(theta) return clearance - radial * np.sin(polar) - q[2] * np.cos(polar) + shape(x) def velocity(x): return 0.0 * x[0], omega * ring_radius(x) return Film( basis=basis, boundaries={ "edge_low": (edges["s_min"], pa), "edge_high": (edges["s_max"], pa), }, gap=gap, dof_names=SPHERE_DOFS, # the seat is a spherical shell: its area changes with depth squared porous=porous.curved(radius, wall, spherical=True), ps=ps, pa=pa, gas=gas, velocity=velocity if omega else None, metric=lambda x: (1.0, ring_radius(x)), h_ref=clearance, coords=(("s", "m"), ("theta", "rad")), name="spherical bearing", )
def _pad_taper(n_pads, pad_angle, offset, along, across, angle_of, across_of): """Extra gap of pads whose faces are tilted, each about its own centre. along is the rise of the gap across a pad's arc, across the rise across its other direction (m). A positive value closes the gap toward +theta (or toward the +side of the other direction), so that the pad converges for motion that way; the smallest extra gap on each pad is zero. angle_of(x) gives theta and across_of(x) the other pad coordinate, scaled to -1..1 between the pad's edges. Returns None for flat pads. """ if along == 0.0 and across == 0.0: return None pitch = 2.0 * np.pi / n_pads def shape(x): # position along the arc of the nearest pad, -1 at one edge to 1 at the other local = np.mod(angle_of(x) - offset + pitch / 2.0, pitch) - pitch / 2.0 xi = np.clip(local / (pad_angle / 2.0), -1.0, 1.0) eta = np.clip(across_of(x), -1.0, 1.0) return 0.5 * abs(along) * (1.0 - np.sign(along) * xi) + 0.5 * abs(across) * ( 1.0 - np.sign(across) * eta ) return shape def _sum_shapes(*shapes): """Sum of the gap shapes that are not None, or None if there is none.""" shapes = [f for f in shapes if f is not None] if not shapes: return None return lambda x: sum(f(x) for f in shapes)
[docs] def thrust_pads( r_in: float, r_out: float, n_pads: int = 3, pad_angle: float = np.deg2rad(100.0), *, porous: Porous, ps: float, pa: float = 101325.0, gas: Gas = AIR, offset: float = 0.0, taper: float = 0.0, taper_radial: float = 0.0, shape: Callable | None = None, velocity: Callable | None = None, n_circ: int = 20, n_radial: int = 12, h_ref: float = 10e-6, ) -> Film: """Thrust face made of equally spaced annular-sector pads. Every edge of every pad is at ambient pressure (edge "edge"): between the pads the stator is relieved. Pad k spans pad_angle between the radii r_in and r_out and is centred at angle offset + 2 pi k / n_pads from the x axis. The position is that of a thrust face, (h, rx, ry), about the bearing axis, and the forces are those of all pads together on the runner. taper tilts every pad along its arc and taper_radial across it: each is the rise of the gap across the pad in m. Positive taper closes the gap toward +theta, so the pads converge for a runner turning that way; positive taper_radial closes it toward the outer radius. Taper only adds to the gap: with no shape besides it, the film thickness h is the smallest gap of each pad. n_circ and n_radial are the numbers of elements along and across one pad. """ basis, edges = meshes.annular_sectors( r_in, r_out, n_pads, pad_angle, offset, n_circ, n_radial ) half = 0.5 * (r_out - r_in) shape = _sum_shapes( shape, _pad_taper( n_pads, pad_angle, offset, taper, taper_radial, lambda x: np.arctan2(x[1], x[0]), lambda x: (np.hypot(x[0], x[1]) - 0.5 * (r_in + r_out)) / half, ), ) # fmt: skip return _thrust_film( basis, {"edge": (edges["edge"], pa)}, "thrust pads", porous=porous, ps=ps, pa=pa, gas=gas, shape=shape, velocity=velocity, h_ref=h_ref, ) # fmt: skip
[docs] def journal_pads( radius: float, length: float, clearance: float, n_pads: int = 3, pad_angle: float = np.deg2rad(100.0), *, porous: Porous, ps: float, pa: float = 101325.0, gas: Gas = AIR, offset: float = 0.0, omega: float = 0.0, taper: float = 0.0, taper_axial: float = 0.0, shape: Callable | None = None, wall: str = "outside", n_circ: int = 20, n_axial: int = 12, ) -> Film: """Journal bearing made of equally spaced partial-arc pads. Every edge of every pad is at ambient pressure (edge "edge"): between the pads the bushing is relieved. Pad k spans pad_angle and is centred at angle offset + 2 pi k / n_pads from the x axis. Film coordinates, position and forces are those of ``journal``: (s, z), the shaft's (x, y, rx, ry) and the film forces on it. wall is as for ``journal``. taper tilts every pad along its arc and taper_axial along the axis: each is the rise of the gap across the pad in m. Positive taper closes the gap toward +theta, so the pads converge for a shaft turning that way (positive omega); positive taper_axial closes it toward +z. Taper only adds to the gap: with no shape besides it, the clearance is the smallest gap of each pad with the shaft centred. n_circ and n_axial are the numbers of elements along the arc and the axis of one pad. """ porous = _curved_wall(porous, radius, wall) basis, edges = meshes.cylinder_pads( radius, length, n_pads, pad_angle, offset, n_circ, n_axial ) shape = _sum_shapes( shape, _pad_taper( n_pads, pad_angle, offset, taper, taper_axial, lambda x: x[0] / radius, lambda x: x[1] / (0.5 * length), ), ) # fmt: skip shape = _no_shape if shape is None else shape def gap(x, q): th, z = x[0] / radius, x[1] ex = q[0] + q[3] * z ey = q[1] - q[2] * z return clearance - ex * np.cos(th) - ey * np.sin(th) + shape(x) def velocity(x): return omega * radius + 0.0 * x[0], 0.0 * x[1] return Film( basis=basis, boundaries={"edge": (edges["edge"], pa)}, gap=gap, dof_names=JOURNAL_DOFS, porous=porous, ps=ps, pa=pa, gas=gas, velocity=velocity if omega else None, h_ref=clearance, coords=(("s", "m"), ("z", "m")), name="journal pads", )