Skip to content
LIBRARY
Components.Partial.PartialStraightPipe.md

Components.Partial.PartialStraightPipe

Partial base class for a 1-D staggered-grid straight-pipe refrigerant model.

Wires together the distributed-volume cells (from PartialDistributedVolume), a staggered SimpleStaggeredFlowModel for momentum, and the two FluidPorts, and provides the (p, h) ODE system in each cell. Extending components must declare model_structure (av_vb, av_b, a_vb, a_v_b — these control how port-side flow cells line up with volume cells), flow_model_mode (FromPressureDifference or FromMassFlow), and bind the geometry arrays (lengths, crossAreas, dimensions, roughnesses, dheights) plus the scalar **start values via initial equations from their own scalar geometry parameters. m_flow > 0 means refrigerant enters through port_a; medium*data must be a refrigerant medium (inherited).

This component extends from PartialDistributedVolume

Usage

HVACComponents.Components.Partial.PartialStraightPipe(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)

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

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