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: ​
| Name | Description | Units | Default value |
|---|---|---|---|
N | Number of control volumes | – | |
N_Plus_1 | Number of cell faces (= N + 1) | – | N + 1 |
init_mode | Initial-condition distribution strategy for the per-cell (p, h) states (Linear, Lumped, Explicit or Exponential) | – | HVACComponents.InitializationDistribution.Linear() |
initialization_mode | Initialisation mode: FixedInitial_ph sets initial equations on each mediums[i]; NoInit only seeds guesses | – | HVACComponents.FiniteVolumeInitializationMode.FixedInitial_ph() |
medium_data | Refrigerant medium properties shared by all N control volumes | – | |
p_a_start | Initial pressure at port_a [Pa] | Pa | |
p_b_start | Initial pressure at port_b [Pa] | Pa | |
h_a_start | Initial specific enthalpy at port_a [J/kg] | J/kg | |
h_b_start | Initial specific enthalpy at port_b [J/kg] | J/kg | |
m_flow_start | Initial mass flow rate [kg/s] (solver guess on m_flows) | kg/s | |
ps_start_explicit | Explicit initial pressure per cell [Pa] (length N; used only when init_mode = Explicit) | Pa | fill(p_a_start, N) |
hs_start_explicit | Explicit initial specific enthalpy per cell [J/kg] (length N; used only when init_mode = Explicit) | J/kg | fill(h_a_start, N) |
k_init | Shape exponent of the Exponential enthalpy profile [-]; larger = more front-loaded (used only when init_mode = Exponential) | – | 1.6 |
Variables ​
| Name | Description | Units |
|---|---|---|
dms | Time derivative of fluid mass in each cell [kg/s] (length N) | – |
dUs | Time derivative of internal energy in each cell [W] (length N) | – |
m_flows | Mass flow rate at each cell face [kg/s] (length N+1) | kg/s |
H_flows | Enthalpy flow rate at each cell face [W] (length N+1); upwind-discretised on internal faces | – |
mb_flows | Net convective mass inflow per cell [kg/s] (length N; = m_flows[i] - m_flows[i+1]) | kg/s |
Hb_flows | Net convective enthalpy inflow per cell [W] (length N; = H_flows[i] - H_flows[i+1]) | – |
Qb_flows | Source/sink heat flow per cell [W] (length N); extender supplies | W |
Wb_flows | Source/sink mechanical power per cell [W] (length N); extender supplies | W |