|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| class | StatePair |
| class | PropertyBackend |
Functions | |
| None | register_backend (str name, BackendFactory factory) |
| BackendFactory | get_backend_factory (str name) |
| list[str] | registered_backends () |
Variables | |
| BackendFactory = Callable[["SpeciesSpec"], PropertyBackend] | |
| dict | _BACKENDS = {} |
The backend seam: what a property source must provide, and how to add one.
A backend answers "given two independent state variables, what is this
property". That is the entire contract. CoolProp's Helmholtz equations of state
are one implementation; its bicubic tables are a second; a table of numbers
measured on a flow bench is a third, and the layer above cannot tell them apart.
Keeping this seam narrow is what lets Phase 12 drop measured data in front of an
equation of state without touching a solver, and what would let REFPROP or a
Modelica media model in later without touching anything else.
Backends are registered by name, so a project can add one without editing this
package::
from feedtwin.props.backend import register_backend
register_backend("my_eos", lambda species: MyBackend(species))
and then name it in a fluid's chain.
| BackendFactory feedtwin.props.backend.get_backend_factory | ( | str | name | ) |
Definition at line 128 of file backend.py.
| None feedtwin.props.backend.register_backend | ( | str | name, |
| BackendFactory | factory ) |
Register a backend factory under ``name``. Re-registering the same name replaces it, which is deliberate: a project overriding a shipped backend should not have to remove it first.
Definition at line 119 of file backend.py.
| list[str] feedtwin.props.backend.registered_backends | ( | ) |
Definition at line 137 of file backend.py.
|
protected |
Definition at line 116 of file backend.py.
| feedtwin.props.backend.BackendFactory = Callable[["SpeciesSpec"], PropertyBackend] |
Definition at line 114 of file backend.py.