Working with an AI assistant¶
An AI coding assistant can run your bearing simulations with OpenAirBearing: you describe the bearing and the question, it writes a Python script against the package, runs it and reports the numbers. The script stays with you, so the result can be rerun, checked and kept.
Setting it up¶
Install the package where the assistant works:
pip install openairbearing.Give the assistant this page, and point it at
examples/andvalidation/cases/in the repository as working scripts to adapt.Tell it the bearing and what you want to know. For example:
A circular porous thrust pad, radius 25 mm, restrictor 4 mm thick with a permeability of 1.5e-15 m², supplied at 0.5 MPa absolute. Use openairbearing to compute load, stiffness and flow for film thicknesses from 3 to 15 µm, and plot them.
What the assistant should use¶
The study layer (openairbearing.study) takes one request document per
computation and returns one result document, in SI units:
from openairbearing import study
request = {
"cases": [{"name": "A", "case": {"kind": "circular_pad", "radius": 25e-3}}],
"sweep": [{"path": "position.h", "values": [3e-6, 5e-6, 8e-6]}],
"stiffness": True,
}
study.validate(request) # raises ValueError with the reason if it cannot run
cost = study.work(request) # solves × mesh nodes: a count, not a time
result = study.run(request)
cases.KINDS(fromopenairbearing.core) lists the bearing kinds, andcases.describe(kind)the fields of one: dotted path, SI unit, default and limits. A case document holds"kind"and only the fields that differ from the defaults.study.field,study.mesh,study.free_flowandstudy.permeabilityanswer for one case at one position.For anything the study layer does not cover,
openairbearing.coreis the solver itself; most of the examples call it directly.
Before a large sweep, a fine mesh, the volume restrictor model or a porous
body, have the assistant call study.work first and time a single point: a
script has no limits, and what it asks for runs however long it takes.
Conventions¶
SI units throughout: m, N, Pa, kg, s, K, rad. Pressures are absolute, the supply pressure
pstoo; ambientpais 101325 Pa by default.Permeability
kappain m², restrictor thicknesshpin m.Volume flow is free gas at the ambient pressure of the case, in m³/s.
Position:
his the film thickness at the reference point,rxandryare tilts in rad; journals take eccentricitiesx,yin m.force.his the load the film carries.Stiffness
stiffness.a.bis -dF_a/dq_b, asked for with"stiffness": True.displayandscalebeside a value are for showing it only (shown = value × scale); compute with the SI value.A point that cannot be solved (contact, no convergence) is
Nonein every output and listed undererrorswith the reason; the rest of the result stands.
Checking what you get¶
Read the script, not only the answer: the inputs and their units are where mistakes are made.
Ask for a comparison with a closed form where one exists (
openairbearing.core.reference), or with the validation case nearest to your bearing.Ask for the result on a finer mesh (
mesh_refinements) and see that it does not move.Every result names the version it was computed with, under
provenance: keep it with the numbers.