openairbearing.core.porous_body

The porous part as a body of its own: Darcy flow on a mesh of hexahedra.

The restrictor models of restrictor.py describe the porous part from the film: a column under each point of it, or the film surface extended along its normal through a uniform thickness. That cannot describe a part whose shape is not such an extension: a monolithic bushing with flow around its corner, a sleeve with feed grooves cut into it, a seat that is fed from the side.

Here the porous part is meshed as it is, with hexahedra, and steady Darcy flow of an isothermal gas is solved in it. In the flow potential phi(p) (gas.py, kg/(m³·s)) that is a linear problem,

div( kappa grad(phi) ) = 0,

with kappa the permeability in m², -kappa grad(phi) the mass flux in kg/(m² s), phi given on the faces where a pressure acts (supply, ambient) and no flow through the others (sealed, glued to metal, a plane of symmetry). The mass flow through a face follows from the residual of the discrete equations, so the flows balance to rounding. The permeability may differ along the material axes, or the flow may have inertial (Forchheimer) resistance, which makes it nonlinear in phi; not both.

A film on a face of the body. on_body puts a film (film.py) on one of the faces. The body then replaces both restrictor models of restrictor.py for that film, whatever Porous.model says. The film pressure is the pore pressure on that face, one unknown for both, and the flux into the film is the film’s own mass balance: the film equation is the boundary condition of the body there. film.solve_static solves the two together, as it does for the extruded volume of restrictor.py. The mesh of the film and the face of the body must share their nodes.

Meshes. PorousBody takes any mesh of hexahedra (scikit-fem MeshHex2, quadratic so that curved faces are followed). revolve makes one for a body of revolution from its cross-section in the (r, z) plane, a mesh of quadrilaterals. section_grid makes such a cross-section from lines of constant r and z, with cells left out for grooves and corners; section_blocks makes one from four-sided blocks with straight or circular sides, for conical and spherical seats, chamfers and rounds.

What it is for, next to restrictor.py: parts that are not the film surface extended through a thickness (grooves cut into the material, a one-piece bushing, a part fed from the side). Where a part is such an extension the extruded volume of restrictor.py describes it at a fraction of the cost, and the two agree (the tests compare them). The body is solved directly in three dimensions, so its cost per node grows with its size (study.BODY_WEIGHT).

Free flow. core.free_flow of a film on a body is that of the body as a whole. Per restrictor it is not offered for a one-piece bushing: gas passes between its faces inside the material, so the flows of its faces taken one by one would not add up to that of the whole.

class PorousBody(mesh: MeshHex2, kappa: float | Callable, faces: dict = <factory>, ratios: tuple = (1.0, 1.0, 1.0), axes: str = 'cylindrical', inertial_resistance: float | Callable = 0.0)[source]

Bases: object

A porous part with Darcy flow in it.

  • mesh: hexahedra (MeshHex2), positions in m.

  • kappa: permeability in m², a number or a function of position X (shape (3, …)), so it may be graded or differ from one region to another.

  • faces: name -> function of X that is true on that part of the surface; it is asked at the centre of every boundary facet (on the surface itself, also where it is curved). Surface that no name claims is sealed. A face that covers nothing or overlaps another is a ValueError.

nodes[name] are the nodes of each face and K is the Darcy operator on nodal values of the flow potential.

mesh: MeshHex2
kappa: float | Callable
faces: dict
ratios: tuple = (1.0, 1.0, 1.0)
axes: str = 'cylindrical'
inertial_resistance: float | Callable = 0.0
inertial_flow(potential, mu, unit=1.0, tangent=False)[source]

Residual of Darcy-Forchheimer flow, and its tangent matrix.

potential: nodal values in units of unit (so the flow potential in kg/(m³·s) is unit·potential); mu: gas viscosity, Pa·s, taken as uniform in the body. The mass flux m obeys

beta·|m|·m + (mu/kappa)·m = -mu·grad(phi),

which is an effective permeability kappa_eff(|grad(phi)|) below kappa. Returns the residual, in the units of K @ potential, and with tangent=True also its derivative with respect to the nodal values; tangent=”secant” gives the matrix with kappa_eff held fixed in its place.

solve(potential: dict, mu: float | None = None) → ndarray[source]

Flow potential at every node, given its value on some faces.

potential: face name -> phi in kg/(m³·s) (a number, or one value per node of that face in the order of nodes[name]). Faces left out are sealed. At least one face must be given. mu: the gas viscosity, Pa·s, needed with an inertial resistance; the flow is then found by Newton iteration from the Darcy solution (RuntimeError if that does not converge).

flow(phi: ndarray, name: str, mu: float | None = None) → float[source]

Mass flow leaving the body through a face, kg/s (negative: entering).

phi: the flow potential at the nodes in kg/(m³·s) (gas.py), so that -kappa·grad(phi) is the mass flux; mu as in solve. Taken from the residual at the nodes of the face, which makes the flows of all faces sum to zero to rounding. A node shared by two faces is counted with the first of them in faces.

class Section(mesh: MeshQuad1, nodes: ndarray)[source]

Bases: object

Cross-section of a body of revolution: quadrilaterals in the (r, z) plane.

mesh holds the corners. nodes holds the position of every node of the quadratic mesh made from it (corners, edge midpoints, centres, in the order of MeshQuad2.from_mesh(mesh).doflocs): on a curved side the midpoints lie on the curve, not on the chord between the corners.

mesh: MeshQuad1
nodes: ndarray
on_body(film, body: PorousBody, face: str, position: Callable, supply, ambient=None, layer=None, seal=None)[source]

The film with the porous body as its restrictor.

face: the face of the body that the film lies on; it must be the film surface, no more and no less, with the same nodes (ValueError otherwise). position(x) gives the place in space, X of shape (3, …) in m, of a point x of the film’s own coordinates, which is how the two are matched. supply: name or names of the faces under the film’s supply pressure. ambient: {face name: absolute pressure in Pa} for faces open to a given pressure. All other faces are sealed. A supply face must not touch an ambient one.

layer: a surface-restrictive layer on the film face, as (thickness in m, permeability in m²), each a number or a function of X. It lies between the pores at the face and the film: a resistance in series, thin enough that nothing moves along it. Without a layer the film pressure is the pore pressure at the face.

seal: a function of X that is true where the film face is sealed (lacquered, smeared shut): nothing passes between the pores and the film there, while the body behind it still carries gas. It is taken at the nodes of the film, so its edge is as sharp as the mesh; put a line of nodes on it (axial_marks of a journal) to make it exact.

Returns a copy of the film with the body as its restrictor. The body replaces film.porous there; film.porous still gives the slip at the face (the Beavers-Joseph model with its own kappa) and an equivalent clearance, and nothing else of it is used.

revolve(section: Section, n_theta: int = 48) → MeshHex2[source]

The body made by turning a cross-section once around the z axis.

Each quadrilateral of the section becomes a ring of n_theta hexahedra (at least three). The section must lie at r > 0. The mesh is quadratic: nodes between two angles are put on the circle, and nodes on a curved side of the section on its curve, so cylindrical, conical and spherical faces are followed closely with few elements.

section_blocks(blocks) → Section[source]

Cross-section made of four-sided blocks with straight or circular sides.

Each block is a dict with

  • corners: four points (r, z) in m, going around the block;

  • n: (elements along the side from corner 0 to 1, elements along the side from corner 1 to 2), or the node positions along them as arrays from 0 to 1, for example to pack elements toward one end;

  • arcs: optional, {side: centre (r, z)} for sides that are arcs of a circle, less than half of it; side k runs from corner k to corner k + 1. Other sides are straight, which makes a cone when revolved.

Blocks that share a side must have the same nodes along it (ValueError otherwise). The inside of a block is filled by blending its four sides, so a conical or spherical seat, the chamfer of a bushing and a rounded corner are all followed exactly at the nodes.

section_grid(r, z, solid: Callable | None = None) → Section[source]

Cross-section on lines of constant r and z.

r, z: increasing node positions in m. solid(r, z) says for the centre of each cell whether it is material (default: all of them); cells that are not are left out, which is how a groove, a relief or the corner of an L-shaped section is made. ValueError if no cell is left.