|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| class | FittingContext |
Functions | |
| float | darcy_friction_factor (float Re, float roughness_ratio, str method) |
| float | reynolds (float mdot, float bore, float rho, float mu) |
| float | velocity (float mdot, float bore, float rho) |
| None | register_fitting (str name, FittingK fn) |
| FittingK | get_fitting (str name) |
| list[str] | registered_fittings () |
| float | fitting_K (str name, FittingContext ctx) |
| float | _bend (FittingContext ctx, float angle) |
| float | _contraction (FittingContext ctx) |
| float | _expansion (FittingContext ctx) |
| FittingK | _crane (float constant) |
Variables | |
| tuple | FRICTION_METHODS |
| str | DEFAULT_FRICTION_METHOD = "Clamond" |
| float | LAMINAR_LIMIT = 2040.0 |
| FittingK = Callable[[FittingContext], float] | |
| dict | _FITTINGS = {} |
Friction factors and fitting losses, as registries rather than choices. Two registries, both extensible from outside this package, both wrapping ``fluids`` rather than reimplementing it. **Friction factors.** Colebrook is implicit and has to be iterated; a dozen explicit approximations to it exist, and they disagree in the third significant figure. Which one a project uses is a modelling decision, not a fact, so it is an *option* on the component -- ``pipe.options.friction`` -- and changing it is a config edit. **Fitting losses.** Crane TP-410's resistance coefficients, plus the Hooper 2K and Darby 3K methods, all of which ``fluids`` implements and validates against the source books. Every fitting here is a thin adapter that unpacks a uniform context into the arguments one of those functions wants -- deliberately thin, so that what this package contributes is the plumbing and never the physics. Nothing in this module computes a loss coefficient from first principles. If a number here disagrees with Crane, it is this module's adapter that is wrong.
|
protected |
Definition at line 160 of file correlations.py.
Referenced by _crane().
|
protected |
Definition at line 185 of file correlations.py.
|
protected |
A Crane coefficient expressed as a multiple of the pipe friction factor. Crane TP-410 gives many fittings as ``K = n . f_T``, where f_T is the fully-turbulent friction factor *of the pipe size* -- ``fluids.fittings. ft_Crane(D)``, a constant of the bore, not the line's friction factor at its own Reynolds number. Scaling ``ctx.fd`` instead put a 30 f_T elbow anywhere from 0.55 to 1.09 against Crane's 0.885 in 9.5 mm tube, and laminar flow (64/Re) made it larger still.
Definition at line 201 of file correlations.py.
References _bend(), _crane(), and register_fitting().
Referenced by _crane().
|
protected |
Definition at line 193 of file correlations.py.
| float feedtwin.comps.correlations.darcy_friction_factor | ( | float | Re, |
| float | roughness_ratio, | ||
| str | method ) |
Darcy friction factor from a named correlation.
Args:
Re: Reynolds number.
roughness_ratio: Absolute roughness over bore, e/D.
method: One of :data:`FRICTION_METHODS`.
Zero and negative Reynolds numbers return zero rather than raising: a
solver's first iterate legitimately passes through zero flow, and a
component with no flow through it has no frictional loss.
Below the transition the answer is 64/Re regardless of which turbulent
correlation was named -- ``fluids`` applies that itself, and it matters
because a solve sweeping down toward zero flow passes through the laminar
regime whether or not the design point is anywhere near it.
Definition at line 55 of file correlations.py.
| float feedtwin.comps.correlations.fitting_K | ( | str | name, |
| FittingContext | ctx ) |
Resistance coefficient of one fitting, referred to ``ctx.bore``.
Definition at line 150 of file correlations.py.
References get_fitting().
| FittingK feedtwin.comps.correlations.get_fitting | ( | str | name | ) |
Definition at line 138 of file correlations.py.
Referenced by fitting_K().
| None feedtwin.comps.correlations.register_fitting | ( | str | name, |
| FittingK | fn ) |
Register a fitting correlation. Replacing a name is allowed.
Definition at line 133 of file correlations.py.
Referenced by _crane().
| list[str] feedtwin.comps.correlations.registered_fittings | ( | ) |
Definition at line 146 of file correlations.py.
| float feedtwin.comps.correlations.reynolds | ( | float | mdot, |
| float | bore, | ||
| float | rho, | ||
| float | mu ) |
Reynolds number from mass flow. ``Re = 4 m / (pi D mu)``. Written in terms of mass flow rather than velocity because that is what a network solver carries, and going via velocity would divide by density and then multiply by it again.
Definition at line 82 of file correlations.py.
| float feedtwin.comps.correlations.velocity | ( | float | mdot, |
| float | bore, | ||
| float | rho ) |
Bulk velocity [m/s] through a circular bore.
Definition at line 94 of file correlations.py.
|
protected |
Definition at line 130 of file correlations.py.
| str feedtwin.comps.correlations.DEFAULT_FRICTION_METHOD = "Clamond" |
Definition at line 45 of file correlations.py.
| feedtwin.comps.correlations.FittingK = Callable[[FittingContext], float] |
Definition at line 128 of file correlations.py.
| tuple feedtwin.comps.correlations.FRICTION_METHODS |
Definition at line 41 of file correlations.py.
| float feedtwin.comps.correlations.LAMINAR_LIMIT = 2040.0 |
Definition at line 51 of file correlations.py.