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 strategy (Linear, Lumped, Explicit or Exponential) 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.

This component is the single owner of the per-cell medium-state (p, h) initialisation: the init_mode switch fills ps_start/hs_start for every distribution strategy, and the FixedInitial_ph branch of initialization_mode pins each mediums[i] to those profiles. Set initialization_mode = NoInit to let a parent take over the pinning. Explicit uses the per-cell ps_start_explicit / hs_start_explicit arrays; Exponential uses shape exponent k_init.

Usage ​

HVACComponents.Components.Partial.PartialDistributedVolume(medium_data, p_a_start, p_b_start, h_a_start, h_b_start, m_flow_start, ps_start_explicit=fill(p_a_start, N), hs_start_explicit=fill(h_a_start, N), k_init=1.6, 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
init_modeInitial-condition distribution strategy for the per-cell (p, h) states (Linear, Lumped, Explicit or Exponential)–HVACComponents.InitializationDistribution.Linear()
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
ps_start_explicitExplicit initial pressure per cell [Pa] (length N; used only when init_mode = Explicit)Pafill(p_a_start, N)
hs_start_explicitExplicit initial specific enthalpy per cell [J/kg] (length N; used only when init_mode = Explicit)J/kgfill(h_a_start, N)
k_initShape exponent of the Exponential enthalpy profile [-]; larger = more front-loaded (used only when init_mode = Exponential)–1.6

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