Skip to content
LIBRARY
Components.StraightPipe.md

Components.StraightPipe

Distributed-volume straight pipe with circular cross-section.

m_flow > 0 means flow enters through port_a. The pipe is discretised into N cells (inherited from PartialStraightPipe via PartialDistributedVolume); set N and model_structure (av_vb, av_b, a_vb, a_v_b) when instantiating, plus the flow_model_mode. Cross-section and perimeter are derived from diameter, so only length, diameter, and roughness define geometry. Provide phase-specific heat-transfer coefficients (alpha_liq / alpha_2ph / alpha_vap, with alpha0 as a base value and xdot_1, xdot_2 as the two-phase blending vapor qualities) and the friction correlation parameters (dp_nominal, m_flow_nominal, K_dp, dp_exp) used by the staggered flow model.

This component extends from HVACComponents.Components.Partial.PartialStraightPipe

Usage

HVACComponents.Components.StraightPipe(medium_data, p_a_start, p_b_start, h_a_start, h_b_start, m_flow_start, ps_start=missing, hs_start=missing, fluidVolumes=missing, lengths=missing, crossAreas=missing, dimensions=missing, roughnesses=missing, dheights=missing, crossAreas_start=missing, dimensions_start=missing, roughnesses_start=missing, dheights_start=missing, diameters_start=missing, dp_nominal_start=missing, m_flow_nominal_start=missing, K_dp_start=missing, dp_exp_start=missing, length, diameter, crossArea=pi * diameter * diameter / 4, perimeter=pi * diameter, roughness, V=crossArea * length, height_ab=0.0, g=9.80665, dxs=missing, alpha0, alpha_liq, alpha_2ph, alpha_vap, xdot_1, xdot_2, dp_nominal, m_flow_nominal, K_dp, dp_exp)

Parameters:

NameDescriptionUnitsDefault value
NNumber of control volumes
N_Plus_1Number of cell faces (= N + 1)N + 1
ph_distributionDistribution mode for the initial pressure/enthalpy profile (Linear or Lumped)
initialization_modeInitialisation mode: FixedInitial_ph sets initial equations on each mediums[i]; NoInit only seeds guessesHVACComponents.FiniteVolumeInitializationMode.FixedInitial_ph()
model_structureStaggered-grid model structure controlling how flow cells line up with mass/energy cells
flow_model_modeFlow formulation: FromPressureDifference computes m_flows from dps_f; FromMassFlow does the reverse
nFMNumber of momentum cells, derived from model_structure (av_vb: N-1, a_v_b: N+1, otherwise N)ifelse(model_structure == HVACComponents.ModelStructure.av_vb(), N - 1, ifelse(model_structure == HVACComponents.ModelStructure.a_v_b(), N + 1, N))
nFM_Plus_1Number of momentum cells plus one (face count for flow-model arrays)nFM + 1
medium_dataRefrigerant medium properties shared by all N control volumes
p_a_startInitial pressure at port_a [Pa]Pa
p_b_startInitial pressure at port_b [Pa]Pa
h_a_startInitial specific enthalpy at port_a [J/kg]J/kg
h_b_startInitial specific enthalpy at port_b [J/kg]J/kg
m_flow_startInitial mass flow rate [kg/s] (solver guess on m_flows)kg/s
lengthTotal pipe length [m]m
diameterInner pipe diameter [m]m
crossAreaPipe cross-sectional area [m^2] (= pi * diameter^2 / 4)m2pi * diameter * diameter / 4
perimeterWetted perimeter [m] (= pi * diameter)mpi * diameter
roughnessWall surface roughness [m]m
VTotal internal fluid volume [m^3] (= crossArea * length)m3crossArea * length
height_abElevation of port_b above port_a [m]m0
gGravitational acceleration [m/s^2]m/s29.80665
alpha0Reference heat-transfer coefficient [W/(m^2.K)]
alpha_liqLiquid-phase heat-transfer coefficient [W/(m^2.K)]
alpha_2phTwo-phase heat-transfer coefficient [W/(m^2.K)]
alpha_vapVapor-phase heat-transfer coefficient [W/(m^2.K)]
xdot_1Lower vapor-quality blending bound between liquid and two-phase regimes [-]
xdot_2Upper vapor-quality blending bound between two-phase and vapor regimes [-]
dp_nominalNominal pressure drop for the friction correlation [Pa]Pa
m_flow_nominalNominal mass flow for the friction correlation [kg/s]kg/s
K_dpFriction-correlation gain coefficient
dp_expFriction-correlation exponent

Connectors

Variables

NameDescriptionUnits
dmsTime derivative of fluid mass in each cell [kg/s] (length N)
dUsTime derivative of internal energy in each cell [W] (length N)
m_flowsMass flow rate at each cell face [kg/s] (length N+1)kg/s
H_flowsEnthalpy flow rate at each cell face [W] (length N+1); upwind-discretised on internal faces
mb_flowsNet convective mass inflow per cell [kg/s] (length N; = m_flows[i] - m_flows[i+1])kg/s
Hb_flowsNet convective enthalpy inflow per cell [W] (length N; = H_flows[i] - H_flows[i+1])
Qb_flowsSource/sink heat flow per cell [W] (length N); extender suppliesW
Wb_flowsSource/sink mechanical power per cell [W] (length N); extender suppliesW
MtotTotal refrigerant mass inventory across all cells [kg]
M_cvRefrigerant mass in each cell [kg] (length N)
vsMean refrigerant velocity in each cell [m/s] (length N)
aTop-left entry of the (mass, energy) 2x2 system in each cell [s]
bTop-right entry of the (mass, energy) 2x2 system in each cell [kg.m^3/J]
cBottom-left entry of the (mass, energy) 2x2 system in each cell
dBottom-right entry of the (mass, energy) 2x2 system in each cell [kg]
detDeterminant of the (mass, energy) 2x2 system in each cell