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

Namespaces

namespace  backend
namespace  backends
namespace  errors
namespace  fluid
namespace  species
namespace  state

Functions

dict[str, float] warmup (list[str]|None fluids=None)

Variables

list __all__

Detailed Description

Real-gas thermophysical properties, fast enough to sit inside a solver.

Everything above this package asks a :class:`Fluid` for numbers and never
touches an equation-of-state library::

    from feedtwin.props import Fluid

    n2 = Fluid("nitrogen")
    n2.get("rho", p=3.1e7, T=293.0)      # 44.5 kg/m3, ~0.13 us
    n2.get("Z", p=3.1e7, T=293.0)        # 1.150 -- a COPV is not an ideal gas
    n2.state(p=5e5, q=0.5).phase         # Phase.TWO_PHASE

Three ideas carry the whole package:

**A chain, not a branch.** A fluid holds an ordered list of backends. Tabulated
interpolation answers ordinary states in ~0.13 us; the Helmholtz equation of
state behind it answers everything the tables refuse. Put measured data at the
front and it wins wherever it has coverage. Nobody writes the routing.

**Refuse, never extrapolate.** A backend outside its envelope raises
:class:`OutOfRange` and the chain moves on. No backend in this package will
return a plausible number for a state point it cannot actually reach.

**Fluids are data.** Species live in ``species.toml``. Adding a propellant is a
data edit, and :func:`register_species` adds one at runtime without touching
this package at all.

SI throughout: Pa, K, kg/m3, Pa.s, J/kg, J/(kg.K), W/(m.K), m/s.

Function Documentation

◆ warmup()

dict[str, float] feedtwin.props.warmup ( list[str] | None fluids = None)
Build interpolation tables now rather than inside the first solve.

Returns seconds spent per fluid. Costs 2-3 s and ~17 MB each the first time
on a machine; afterwards CoolProp loads them from its own cache.

Call this when a process starts if it is going to do physics -- a pool
worker, an API container. The reason is the same one EngineDesign's
accelerator front-loads its JIT for: paid lazily, the cost lands inside
whichever call happens to come first, which is usually one somebody is
timing.

Args:
    fluids: Names or aliases to warm. Defaults to every declared species.

Definition at line 65 of file __init__.py.

Variable Documentation

◆ __all__

list feedtwin.props.__all__
private
Initial value:
1= [
2 "DEFAULT_CHAIN",
3 "PROPERTIES",
4 "CoolPropBackend",
5 "Fluid",
6 "OutOfRange",
7 "Phase",
8 "PropertyBackend",
9 "PropertyError",
10 "PropertySpec",
11 "SpeciesSpec",
12 "StatePair",
13 "TabulatedProperties",
14 "ThermoState",
15 "UnknownFluid",
16 "UnsupportedProperty",
17 "get_species",
18 "load_species_file",
19 "register_backend",
20 "register_property",
21 "register_species",
22 "registered_backends",
23 "registered_species",
24 "warm_tables",
25 "warmup",
26]

Definition at line 84 of file __init__.py.