Skip to content
LIBRARY
Components.Partial.PartialDistributedVolume.md

Components.Partial.PartialDistributedVolume ​

Partial base class for an N-cell 1-D distributed-volume refrigerant model.

Discretises a flow path into N ideally-mixed control volumes that store mass and energy, with upwind enthalpy fluxes between cells. Extending components must set N, the initialisation distribution mode (Linear or Lumped) and the initialisation mode (FixedInitial_ph or NoInit), supply medium_data and start values at the two ports, fill in fluidVolumes via an initial equation, and provide source/sink contributions for each cell (mb_flows, Hb_flows, Qb_flows, Wb_flows) — mb_flows[i] and Hb_flows[i] are constrained to equal the net convective in/out flow automatically. medium_data must be a refrigerant medium.

Usage ​

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

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 guesses–HVACComponents.FiniteVolumeInitializationMode.FixedInitial_ph()
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

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