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

Public Member Functions

None __init__ (self, SpeciesSpec species, str backend, str name)
str name (self)
bool supports (self, str prop)
None update (self, StatePair pair, float v1, float v2)
float value (self, str prop)
dict[str, float] constants (self)
Phase phase (self)
float|None quality (self)

Protected Member Functions

float _compressibility (self)
NoReturn _reraise (self, Exception exc, str detail, str|None prop=None)

Protected Attributes

 _species = species
 _backend = backend
str _name = name
 _state = CP.AbstractState(backend, species.backend_fluid)
set[str] _unsupported = set()
float|None _r_specific = None
_Dome|None _dome = None
 _tabulated = backend.upper().startswith(("BICUBIC", "TTSE"))

Detailed Description

Properties for one species from one CoolProp backend.

Stateful and **not thread-safe** -- it wraps a single ``AbstractState`` that
:meth:`update` moves around. :class:`~feedtwin.props.fluid.Fluid` gives each
thread its own; never share an instance across threads.

Definition at line 251 of file coolprop.py.

Constructor & Destructor Documentation

◆ __init__()

None feedtwin.props.backends.coolprop.CoolPropBackend.__init__ ( self,
SpeciesSpec species,
str backend,
str name )

Definition at line 259 of file coolprop.py.

Member Function Documentation

◆ _compressibility()

float feedtwin.props.backends.coolprop.CoolPropBackend._compressibility ( self)
protected
Z = p / (rho . R_specific . T), derived rather than read.

BICUBIC does not implement ``compressibility_factor``. Deriving it from
density gives one definition of Z on every backend, and it agrees with
CoolProp's own to ~3e-6.

Definition at line 357 of file coolprop.py.

References _name, _r_specific, and _state.

Referenced by value().

◆ _reraise()

NoReturn feedtwin.props.backends.coolprop.CoolPropBackend._reraise ( self,
Exception exc,
str detail,
str | None prop = None )
protected
Translate a CoolProp failure into the layer's own vocabulary.

``prop`` is given only when the failure came from reading a named
property, and is what gets remembered as unsupported -- a failed
``update`` says nothing about any property's availability, so passing
the state-pair description here would poison the capability cache.

Definition at line 380 of file coolprop.py.

References _name, _species, and _unsupported.

Referenced by update(), and value().

◆ constants()

dict[str, float] feedtwin.props.backends.coolprop.CoolPropBackend.constants ( self)
Constants of the substance, not of any state point.

Critical pressure and temperature are needed by the IEC 60534 choked
liquid correlation, and they are properties of the fluid rather than of
where it happens to be -- so they are read once, from the same backend
that answers everything else, rather than through a convenience call.

Definition at line 323 of file coolprop.py.

References _state.

Referenced by feedtwin.props.fluid.Fluid.critical_pressure(), and feedtwin.props.fluid.Fluid.critical_temperature().

◆ name()

str feedtwin.props.backends.coolprop.CoolPropBackend.name ( self)

Definition at line 278 of file coolprop.py.

References _name.

◆ phase()

Phase feedtwin.props.backends.coolprop.CoolPropBackend.phase ( self)

Definition at line 337 of file coolprop.py.

References _state, and phase().

Referenced by phase().

◆ quality()

float | None feedtwin.props.backends.coolprop.CoolPropBackend.quality ( self)
Vapour fraction, or ``None`` when the state is not two-phase.

CoolProp signals "not applicable" with an out-of-band number, and uses
more than one: -1 for a subcooled liquid, -1000 for a supercritical
state. Anything outside [0, 1] is therefore treated as "no quality"
rather than matched against those two values specifically.

Definition at line 343 of file coolprop.py.

References _state.

◆ supports()

bool feedtwin.props.backends.coolprop.CoolPropBackend.supports ( self,
str prop )

Definition at line 281 of file coolprop.py.

References _unsupported.

◆ update()

None feedtwin.props.backends.coolprop.CoolPropBackend.update ( self,
StatePair pair,
float v1,
float v2 )

◆ value()

float feedtwin.props.backends.coolprop.CoolPropBackend.value ( self,
str prop )

Definition at line 308 of file coolprop.py.

References _compressibility(), _name, _reraise(), _state, _unsupported, value, ADS126X::ADCReading.value, ads126x_reading.value, array_init_elem.value, comms::CommsMessage< Fields >::MessageSizeHelper< T >.value, comms::CommsMessage< Fields >::MessageSizeHelper< CommsMessage< Ts... > >.value, detail::has_from_json< BasicJsonType, T, enable_if_t< !is_basic_json< T >::value > >.value, detail::has_non_default_from_json< BasicJsonType, T, enable_if_t< !is_basic_json< T >::value > >.value, detail::has_to_json< BasicJsonType, T, enable_if_t< !is_basic_json< T >::value > >.value, detail::is_compatible_array_type_impl< BasicJsonType, CompatibleArrayType, enable_if_t< is_detected< iterator_t, CompatibleArrayType >::value &&is_iterator_traits< iterator_traits< detected_t< iterator_t, CompatibleArrayType > > >::value &&!std::is_same< CompatibleArrayType, detected_t< range_value_t, CompatibleArrayType > >::value > >.value, detail::is_compatible_integer_type_impl< RealIntegerType, CompatibleNumberIntegerType, enable_if_t< std::is_integral< RealIntegerType >::value &&std::is_integral< CompatibleNumberIntegerType >::value &&!std::is_same< bool, CompatibleNumberIntegerType >::value > >.value, detail::is_compatible_object_type_impl< BasicJsonType, CompatibleObjectType, enable_if_t< is_detected< mapped_type_t, CompatibleObjectType >::value &&is_detected< key_type_t, CompatibleObjectType >::value > >.value, detail::is_compatible_string_type< BasicJsonType, CompatibleStringType >.value, detail::is_compatible_type_impl< BasicJsonType, CompatibleType, enable_if_t< is_complete_type< CompatibleType >::value > >.value, detail::is_constructible_array_type_impl< BasicJsonType, ConstructibleArrayType, enable_if_t< !std::is_same< ConstructibleArrayType, typename BasicJsonType::value_type >::value &&!is_compatible_string_type< BasicJsonType, ConstructibleArrayType >::value &&is_default_constructible< ConstructibleArrayType >::value &&(std::is_move_assignable< ConstructibleArrayType >::value||std::is_copy_assignable< ConstructibleArrayType >::value)&&is_detected< iterator_t, ConstructibleArrayType >::value &&is_iterator_traits< iterator_traits< detected_t< iterator_t, ConstructibleArrayType > > >::value &&is_detected< range_value_t, ConstructibleArrayType >::value &&!std::is_same< ConstructibleArrayType, detected_t< range_value_t, ConstructibleArrayType > >::value &&is_complete_type< detected_t< range_value_t, ConstructibleArrayType > >::value > >.value, detail::is_constructible_object_type_impl< BasicJsonType, ConstructibleObjectType, enable_if_t< is_detected< mapped_type_t, ConstructibleObjectType >::value &&is_detected< key_type_t, ConstructibleObjectType >::value > >.value, detail::is_constructible_string_type< BasicJsonType, ConstructibleStringType >.value, detail::is_getable< BasicJsonType, T >.value, detail::is_iterator_traits< iterator_traits< T > >.value, detail::is_ordered_map< T >.value, detail::is_range< T >.value, detail::is_sax< SAX, BasicJsonType >.value, detail::static_const< T >.value, engine.pipeline.config_schemas.MeasuredValue.value, engine.pipeline.numerical_robustness.ValidationResult.value, feedtwin.model.param.Param.value, feedtwin.props.backend.PropertyBackend.value(), value(), fsw::calibration::IMUCalibration::CalibratedReading.value, fsw::calibration::IMUCalibration::RawReading.value, inserter< T >.value, MessageSize< T >.value, MessageSize< comms::CommsMessage< Ts... > >.value, node_type_getter< T >.value, node_type_getter< array >.value, node_type_getter< table >.value, node_type_getter< void >.value, parsed_string.value, table_init_pair.value, ubx_item_t.value, and utf8_codepoint.value.

Referenced by feedtwin.model.param.Uncertainty.__post_init__(), feedtwin.model.param.Uncertainty.bounds(), and value().

Member Data Documentation

◆ _backend

feedtwin.props.backends.coolprop.CoolPropBackend._backend = backend
protected

◆ _dome

_Dome | None feedtwin.props.backends.coolprop.CoolPropBackend._dome = None
protected

Definition at line 274 of file coolprop.py.

Referenced by update().

◆ _name

◆ _r_specific

float | None feedtwin.props.backends.coolprop.CoolPropBackend._r_specific = None
protected

Definition at line 271 of file coolprop.py.

Referenced by _compressibility().

◆ _species

feedtwin.props.backends.coolprop.CoolPropBackend._species = species
protected

◆ _state

feedtwin.props.backends.coolprop.CoolPropBackend._state = CP.AbstractState(backend, species.backend_fluid)
protected

Definition at line 263 of file coolprop.py.

Referenced by _compressibility(), constants(), phase(), quality(), update(), and value().

◆ _tabulated

feedtwin.props.backends.coolprop.CoolPropBackend._tabulated = backend.upper().startswith(("BICUBIC", "TTSE"))
protected

Definition at line 275 of file coolprop.py.

Referenced by update().

◆ _unsupported

set[str] feedtwin.props.backends.coolprop.CoolPropBackend._unsupported = set()
protected

Definition at line 268 of file coolprop.py.

Referenced by _reraise(), supports(), and value().


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