pyskyfire.common.friction¶
Duct friction physics shared by cooling channels and piping.
This module is deliberately geometry-agnostic. Every entry point takes plain scalars – a Reynolds number, a hydraulic diameter, an absolute roughness, a signed radius of curvature – so the same physics serves a regen cooling channel marching on an axial coordinate and a pipe run marching on arc length. Anything that knows about contours, centerlines or stations belongs elsewhere.
Two interchangeable backends are provided:
"native"The correlations pyskyfire has always used, inherited from the RL10 modelling work of Binder et al. Laminar
64/Re, Petukhov (smooth) or Colebrook-White (rough) in the turbulent branch, linearly blended across2300 < Re < 3500, with an Ito-type curvature multiplier."fluids"The same quantities taken from the
fluidslibrary. The straight-duct factor blends the laminar and Clamond branches smoothly fromRe=2040; curved ducts use the same transition policy starting at Schmidt’s curvature-dependent critical Reynolds number. The curvature multiplier is the ratio of the blended Schmidt curved factor to the blended straight factor, with the same roughness in both.
The native backend remains the default for validation while the fluids
backend is evaluated. Comparing them measures model sensitivity; it does not
establish a bound on modelling uncertainty.
Notes¶
Both curvature multipliers are helical-coil correlations. They model curvature as an enhanced local wall friction over a continuously curved duct, which fits a cooling channel bending gently over many diameters. They are not a model for a discrete pipe bend, where the loss is set by secondary-flow development and its decay downstream. Use a fitting loss coefficient for those.
Attributes¶
Exceptions¶
A friction correlation is being extrapolated beyond a documented limit. |
Functions¶
|
Return a concentric annulus' laminar |
|
Return the friction multiplier due to streamwise curvature. |
|
Return the Darcy friction factor for a straight duct. |
|
Return the irreversible pressure gradient |
|
Return a validated backend name. |
|
Return the shared laminar-to-turbulent blending weight. |
Module Contents¶
- pyskyfire.common.friction.annulus_laminar_factor(radius_ratio)¶
Return a concentric annulus’ laminar
f*Rerelative to a pipe’s 64.The exact fully developed solution on the hydraulic diameter
2*(r_o - r_i)isf*Re = 64*(1-k)**2 / (1 + k**2 + (1-k**2)/ln k)withk = r_i/r_o. It runs from 1 for a pipe (k = 0) to 1.5 for parallel plates (k -> 1). Turbulent friction on the same hydraulic diameter differs from a pipe’s by only a few percent and is not corrected.
- pyskyfire.common.friction.curvature_multiplier(ReDh, Dh, R_curv, *, roughness=0.0, model='native')¶
Return the friction multiplier due to streamwise curvature.
- Parameters:
- ReDh
float Reynolds number on the hydraulic diameter.
- Dh
float Hydraulic diameter [m].
- R_curv
float Signed radius of curvature of the duct centerline [m]. Use
np.inffor a straight duct. The native backend ignores the sign; so does thefluidsbackend.- roughness
float,optional Absolute wall roughness [m]. Zero or
Nonemeans smooth. Used in both factors of thefluidscurved/straight ratio; ignored by the native curvature correlation. Use the same value as for the straight factor being multiplied.- model{‘native’, ‘fluids’},
optional Backend to evaluate. Default
'native'.
- ReDh
- Returns:
floatMultiplier on the straight-duct Darcy factor. Exactly
1.0for a straight duct; native also returns one below its activation threshold.
- Warns:
FrictionCorrelationWarningFor the
fluidscurved model, whenReDh <= 100,ReDh > 150000, orDh/(2*abs(R_curv)) >= 0.14. The last limit is the recommendation for the Schmidt transition criterion; upstream does not specify a separate curvature range for the friction fits. Extrapolated results are returned without clipping or model switching.
Notes
Limits are from the
fluids.frictiondocumentation forhelical_laminar_fd_Schmidt,helical_turbulent_fd_Schmidtandhelical_transition_Re_Schmidt. These warnings concern the coil models, not straight-pipe Colebrook numerical accuracy or two-phase validity.
- pyskyfire.common.friction.darcy_friction_factor(ReDh, Dh, roughness=0.0, *, model='native', laminar_factor=1.0)¶
Return the Darcy friction factor for a straight duct.
- Parameters:
- ReDh
float Reynolds number on the hydraulic diameter.
- Dh
float Hydraulic diameter [m].
- roughness
float,optional Absolute wall roughness [m]. Zero or
Nonemeans hydraulically smooth. Default 0.- model{‘native’, ‘fluids’},
optional Backend to evaluate. Default
'native'.- laminar_factor
float,optional Multiplier on the laminar branch’s
64/Refor a non-circular section, such asannulus_laminar_factor(). Default 1.
- ReDh
- Returns:
floatDarcy friction factor (dimensionless).
- pyskyfire.common.friction.friction_pressure_gradient(ReDh, Dh, rho, velocity, *, roughness=0.0, R_curv=np.inf, curvature_correction=True, model='native')¶
Return the irreversible pressure gradient
dp/ds[Pa m⁻¹].This is the friction term of the one-dimensional momentum equation only. The reversible acceleration term
-rho u du/dsdepends on the state at both ends of a segment rather than on a local gradient, so the caller applies it while marching.- Parameters:
- ReDh
float Reynolds number on the hydraulic diameter.
- Dh
float Hydraulic diameter [m].
- rho
float Bulk density [kg m⁻³].
- velocity
float Bulk velocity [m s⁻¹].
- roughness
float,optional Absolute wall roughness [m]. Default 0.
- R_curv
float,optional Signed radius of curvature [m]. Default
np.inf(straight).- curvature_correctionbool,
optional Apply
curvature_multiplier(). Default True.- model{‘native’, ‘fluids’},
optional Backend to evaluate. Default
'native'.
- ReDh
- Returns:
floatPressure gradient with respect to arc length [Pa m⁻¹]. Negative for flow in the positive arc-length direction.
- pyskyfire.common.friction.resolve_friction_model(model)¶
Return a validated backend name.
- Parameters:
- model
str Backend name, case-insensitive. One of
FRICTION_MODELS.
- model
- Returns:
strThe normalized (lower-case) backend name.
- Raises:
ValueErrorIf
modelis not a recognized backend.
- pyskyfire.common.friction.transition_weight(Re, Re_critical)¶
Return the shared laminar-to-turbulent blending weight.
The weight is zero through
Re_criticaland one fromRe_critical * (3500/2300)onward. Between those limits it follows the cubic smoothstep3*x**2 - 2*x**3, giving continuous values and first derivatives where the pure laminar and turbulent branches are joined.The fixed critical value
2040is used for straight ducts. Curved ducts supply Schmidt’s geometry-dependent critical Reynolds number.
- pyskyfire.common.friction.FRICTION_MODELS = ('native', 'fluids')¶
- pyskyfire.common.friction.ReDh_laminar = 2300¶
- pyskyfire.common.friction.ReDh_turbulent = 3500¶