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

  1. Install the package where the assistant works: pip install openairbearing.

  2. Give the assistant this page, and point it at examples/ and validation/cases/ in the repository as working scripts to adapt.

  3. 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 (from openairbearing.core) lists the bearing kinds, and cases.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_flow and study.permeability answer for one case at one position.

  • For anything the study layer does not cover, openairbearing.core is 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 ps too; ambient pa is 101325 Pa by default.

  • Permeability kappa in m², restrictor thickness hp in m.

  • Volume flow is free gas at the ambient pressure of the case, in m³/s.

  • Position: h is the film thickness at the reference point, rx and ry are tilts in rad; journals take eccentricities x, y in m. force.h is the load the film carries.

  • Stiffness stiffness.a.b is -dF_a/dq_b, asked for with "stiffness": True.

  • display and scale beside 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 None in every output and listed under errors with 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.