STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
feedtwin.props.backend.PropertyBackend Class Reference
Inheritance diagram for feedtwin.props.backend.PropertyBackend:
[legend]
Collaboration diagram for feedtwin.props.backend.PropertyBackend:
[legend]

Public Member Functions

str name (self)
bool supports (self, str prop)
None update (self, StatePair pair, float v1, float v2)
float value (self, str prop)
Phase phase (self)
float|None quality (self)

Detailed Description

A source of thermophysical properties for one species.

Implementations are **stateful and single-threaded**: :meth:`update` moves
the backend to a state point and :meth:`value` reads from wherever it was
last moved. That is CoolProp's model and it is fast for exactly the reason
it is dangerous -- one object, reused. :class:`~feedtwin.props.fluid.Fluid`
owns the thread-confinement that makes it safe; do not share an instance.

Definition at line 62 of file backend.py.

Member Function Documentation

◆ name()

str feedtwin.props.backend.PropertyBackend.name ( self)
Short identifier, e.g. ``"bicubic"``. Appears in ThermoState.

Definition at line 73 of file backend.py.

◆ phase()

Phase feedtwin.props.backend.PropertyBackend.phase ( self)
Phase at the current state point.

Definition at line 102 of file backend.py.

◆ quality()

float | None feedtwin.props.backend.PropertyBackend.quality ( self)
Vapour mass fraction, or ``None`` outside the two-phase dome.

Definition at line 106 of file backend.py.

◆ supports()

bool feedtwin.props.backend.PropertyBackend.supports ( self,
str prop )
Whether this backend can compute ``prop`` at all.

A property of the backend, not of the state, so callers can answer it
once and route around a gap rather than probing per state point.

Definition at line 77 of file backend.py.

◆ update()

None feedtwin.props.backend.PropertyBackend.update ( self,
StatePair pair,
float v1,
float v2 )
Move to a state point.

Raises:
    OutOfRange: the point is outside this backend's envelope. Routine --
        the caller's chain tries the next backend.

Definition at line 85 of file backend.py.

Referenced by combined_gui.PressureBarWidget.set_global_line_ys(), combined_gui.PressureBarWidget.set_limits(), and combined_gui.PressureBarWidget.set_value().

◆ value()

float feedtwin.props.backend.PropertyBackend.value ( self,
str prop )
Read a property at the current state point.

Raises:
    UnsupportedProperty: this backend cannot compute it.

Definition at line 94 of file backend.py.

Referenced by feedtwin.model.param.Uncertainty.__post_init__(), feedtwin.model.param.Uncertainty.bounds(), and feedtwin.props.backends.coolprop.CoolPropBackend.value().


The documentation for this class was generated from the following file: