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:
| Name | Description | Units | Default value |
|---|---|---|---|
N | Number of control volumes | – | |
N_Plus_1 | Number of cell faces (= N + 1) | – | N + 1 |
ph_distribution | Distribution mode for the initial pressure/enthalpy profile (Linear or Lumped) | – | |
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 |
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 |