STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
feedtwin.props.backend Namespace Reference

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 = {}

Detailed Description

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.

Function Documentation

◆ get_backend_factory()

BackendFactory feedtwin.props.backend.get_backend_factory ( str name)

Definition at line 128 of file backend.py.

◆ register_backend()

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.

◆ registered_backends()

list[str] feedtwin.props.backend.registered_backends ( )

Definition at line 137 of file backend.py.

Variable Documentation

◆ _BACKENDS

dict feedtwin.props.backend._BACKENDS = {}
protected

Definition at line 116 of file backend.py.

◆ BackendFactory

feedtwin.props.backend.BackendFactory = Callable[["SpeciesSpec"], PropertyBackend]

Definition at line 114 of file backend.py.