|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| class | _Dome |
| class | CoolPropBackend |
Functions | |
| float | warm_tables (SpeciesSpec species) |
| PropertyBackend | _heos (SpeciesSpec species) |
| PropertyBackend | _bicubic (SpeciesSpec species) |
Variables | |
| float | R_UNIVERSAL = 8.31446261815324 |
| dict | _INPUT_PAIRS |
| frozenset | _SWAPPED = frozenset({StatePair.PH, StatePair.TQ, StatePair.PD}) |
| frozenset | _GUARDED = frozenset({StatePair.PT, StatePair.PH, StatePair.DT}) |
| dict | _PHASES |
| dict | _GETTERS |
| tuple | _OUT_OF_RANGE_MARKERS = ("not in range", "outside", "out of range") |
| tuple | _UNSUPPORTED_MARKERS = ("is not implemented", "not implemented for this backend") |
| float | DOME_LIQUID_K = 16.0 |
| float | DOME_VAPOUR_K = 16.0 |
| tuple | DOME_CRITICAL_SHARE = (0.75, 2.5) |
| float | DOME_CRITICAL_K = 30.0 |
| float | DOME_DENSE_SHARE = 0.25 |
| int | DOME_POINTS = 400 |
CoolProp-backed properties: Helmholtz equations of state, and tables over them. One class serves both. ``HEOS`` evaluates the Helmholtz energy directly and covers everything the equation of state is defined over; ``BICUBIC&HEOS`` interpolates precomputed tables over the same equation and is 10-30x faster inside a bounded region. They differ by a backend string, not by a code path, which is what keeps "fast where possible, exact where necessary" from turning into two implementations that drift. Measured on the development host, nitrogen, per call (update + read): ============= ======== =========== ========= property HEOS BICUBIC speedup ============= ======== =========== ========= density 3.17 us 0.128 us 24.8x viscosity 3.39 us 0.129 us 26.2x conductivity 4.25 us 0.127 us 33.5x cp 3.35 us 0.188 us 17.8x speed of sound 3.16 us 0.331 us 9.6x ============= ======== =========== ========= Two behaviours of the tabulated backend shape the design: **It refuses rather than extrapolates.** Outside its envelope it raises ``ValueError: inputs are not in range`` instead of returning a plausible wrong number. That is the good failure, and it is what makes the fallback chain in :mod:`feedtwin.props.fluid` sound -- translated here into :class:`OutOfRange`. **It does not implement every property.** ``compressibility_factor`` is missing on BICUBIC. Rather than special-case that, Z is *derived* here for every backend as ``p / (rho . R_specific . T)``, which reproduces CoolProp's own value to 3e-6. Deriving it means one definition of Z regardless of backend. Building tables costs 2-3 s per fluid on first use and about 17 MB on disk, in CoolProp's own cache. See :func:`warm_tables`.
|
protected |
Definition at line 429 of file coolprop.py.
|
protected |
Definition at line 425 of file coolprop.py.
| float feedtwin.props.backends.coolprop.warm_tables | ( | SpeciesSpec | species | ) |
Build this species' interpolation tables now instead of on first use. Returns the seconds spent. Costs 2-3 s and ~17 MB per fluid the first time on a machine, then loads from CoolProp's cache. Worth calling explicitly in a worker process, for the same reason EngineDesign's accelerator front-loads its JIT: paying it lazily means the cost lands inside whatever call happens to be first, which is usually a solve someone is timing.
Definition at line 404 of file coolprop.py.
|
protected |
Definition at line 99 of file coolprop.py.
|
protected |
Definition at line 85 of file coolprop.py.
|
protected |
Definition at line 65 of file coolprop.py.
|
protected |
Definition at line 118 of file coolprop.py.
|
protected |
Definition at line 88 of file coolprop.py.
|
protected |
Definition at line 80 of file coolprop.py.
|
protected |
Definition at line 120 of file coolprop.py.
| float feedtwin.props.backends.coolprop.DOME_CRITICAL_K = 30.0 |
Definition at line 146 of file coolprop.py.
| tuple feedtwin.props.backends.coolprop.DOME_CRITICAL_SHARE = (0.75, 2.5) |
Definition at line 144 of file coolprop.py.
| float feedtwin.props.backends.coolprop.DOME_DENSE_SHARE = 0.25 |
Definition at line 150 of file coolprop.py.
| float feedtwin.props.backends.coolprop.DOME_LIQUID_K = 16.0 |
Definition at line 132 of file coolprop.py.
| int feedtwin.props.backends.coolprop.DOME_POINTS = 400 |
Definition at line 152 of file coolprop.py.
| float feedtwin.props.backends.coolprop.DOME_VAPOUR_K = 16.0 |
Definition at line 133 of file coolprop.py.
| float feedtwin.props.backends.coolprop.R_UNIVERSAL = 8.31446261815324 |
Definition at line 54 of file coolprop.py.