Getting started¶
Install¶
OpenAirBearing needs Python 3.12 or newer.
pip install "openairbearing[web]"
installs the solver and the web workbench. Without the workbench:
pip install openairbearing
The gas extra adds CoolProp, for gas properties at other temperatures and
for real-gas behaviour: pip install "openairbearing[gas]". It is included
in web.
A first bearing¶
A bearing is a film: a mesh of the gap, a porous restrictor, the supply and
ambient pressures, and a rule that gives the gap from the position of the
supported body. The builders in openairbearing.core.geometry make one
for each bearing type.
from openairbearing import core
porous = core.Porous(kappa=1.5e-15, hp=4e-3) # permeability m², thickness m
film = core.circular_pad(18.5e-3, porous=porous, ps=0.5e6)
state = core.solve_static(film, [5e-6, 0.0, 0.0]) # film 5 µm, no tilt
state.force("h") # load, N
state.flow_normal # supply flow
K = core.stiffness(film, [5e-6, 0.0, 0.0]) # K[0, 0] is the film stiffness, N/m
All inputs and results are in SI units, and pressures are absolute. The position is a list of coordinates that depends on the bearing: film thickness and two tilts for a pad, shaft displacements for a journal. Each geometry builder documents its own.
The builders are circular_pad(),
annular_pad(),
rectangular_pad(),
journal(),
journal_pads(),
thrust_pads(),
spherical_bearing() and
thrust_bushing().
Where things are¶
Module |
Contents |
|---|---|
the film, the static solver and stiffness |
|
the porous restrictor: its description, and its column and volume flow models |
|
builders for each bearing type, with form errors |
|
the porous part as a body of its own, meshed in three dimensions |
|
meshes of the film domains |
|
closed-form solutions for flat parallel pads |
|
air, nitrogen, hydrogen and helium as ideal gases; real gases with properties from CoolProp |
|
bearings as plain data that can be saved as JSON |
|
sweeps and comparisons from a request document |
|
figures of a state, a film and a study result |
|
the units values are shown in |
|
results in the dimensionless forms of the literature |
Sweeps and comparisons¶
openairbearing.study evaluates one or more bearings over one or two
swept quantities. The request and the result are plain dictionaries, so the
same study can be run from a script, saved as JSON, or sent from the
workbench.
from openairbearing import study
result = study.run(
{
"cases": [
{"name": "A", "case": {"kind": "circular_pad"}},
{"name": "B", "case": {"kind": "circular_pad", "radius": 25e-3}},
],
"sweep": [{"path": "position.h", "values": [3e-6, 5e-6, 8e-6]}],
}
)
result["cases"][0]["outputs"]["force.h"]["values"] # N, one per film thickness
The workbench¶
The web workbench is a local page for setting up bearings, running studies
and plotting the results. It needs the web extra.
python -m openairbearing.ui
then open http://127.0.0.1:8050. The openairbearing command does the
same. The page is served entirely from the package and makes no request to
any other host. To host it for other people, see Hosting the workbench.
Working with an AI assistant¶
An AI coding assistant can run your simulations by writing Python against the study layer, as the examples do. See Working with an AI assistant.
Next¶
The examples are complete scripts, each with its figures. The validation cases show how far the model agrees with published data, case by case.