Buildings.Fluid.HydronicConfigurations.Interfaces
Package with interface classes
Information
This package contains interface classes that are used to build models of hydronic configurations. An interface class is not directly usable, but can be extended when building a new model.
Extends from Modelica.Icons.InterfacesPackage (Icon for packages containing interfaces).
Package Content
Name | Description |
---|---|
PartialHydronicConfiguration |
Buildings.Fluid.HydronicConfigurations.Interfaces.PartialHydronicConfiguration
Information
This is the interface class for all models of hydronic configurations in Buildings.Fluid.HydronicConfigurations.ActiveNetworks and Buildings.Fluid.HydronicConfigurations.PassiveNetworks.
This interface class (conditionally) instantiates all possible outside connectors that any derived class may use. This provides plug-compatibility across all the models extending this class.
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Buildings.Media.Water | Medium in the component | |
Configuration | |||
Boolean | use_siz | true | Set to true for built-in sizing of control valve and optional pump |
Boolean | use_dp1 | Set to true to enable dp1_nominal | |
Boolean | use_dp2 | Set to true to enable dp2_nominal | |
Valve | typVal | Type of control valve | |
Boolean | have_typVar | true | Set to true to enable the choice of the controlled variable |
Nominal condition | |||
MassFlowRate | m1_flow_nominal | Mass flow rate in primary circuit at design conditions [kg/s] | |
MassFlowRate | m2_flow_nominal | Mass flow rate in consumer circuit at design conditions [kg/s] | |
PressureDifference | dp1_nominal | Primary circuit pressure differential at design conditions [Pa] | |
PressureDifference | dp2_nominal | Consumer circuit pressure differential at design conditions [Pa] | |
Control valve | |||
ValveCharacteristic | typCha | Buildings.Fluid.HydronicConf... | Control valve characteristic |
PressureDifference | dpValve_nominal | Control valve pressure drop at design conditions [Pa] | |
Generic | flowCharacteristics | flowCharacteristics(y={0,1},... | Table with flow characteristics |
Generic | flowCharacteristics1 | flowCharacteristics1(y={0,1}... | Table with flow characteristics for direct flow path at port_1 |
Generic | flowCharacteristics3 | flowCharacteristics3(y={0,1}... | Table with flow characteristics for bypass flow path at port_3 |
Pump | |||
Pump | typPum | Buildings.Fluid.HydronicConf... | Type of secondary pump |
PumpModel | typPumMod | Buildings.Fluid.HydronicConf... | Type of pump model |
MassFlowRate | mPum_flow_nominal | m2_flow_nominal | Pump head at design conditions [kg/s] |
PressureDifference | dpPum_nominal | dp2_nominal + dpBal2_nominal | Pump head at design conditions [Pa] |
Generic | perPum | redeclare parameter Movers.D... | Pump parameters |
Controls | |||
Control | typCtl | Buildings.Fluid.HydronicConf... | Type of built-in controls |
ControlVariable | typVar | Buildings.Fluid.HydronicConf... | Controlled variable |
SimpleController | controllerType | Buildings.Controls.OBC.CDL.T... | Type of controller |
Real | k | 0.1 | Gain of controller |
Real | Ti | 120 | Time constant of integrator block [s] |
Balancing valves | |||
PressureDifference | dpBal1_nominal | 0 | Primary balancing valve pressure drop at design conditions [Pa] |
PressureDifference | dpBal2_nominal | 0 | Secondary balancing valve pressure drop at design conditions [Pa] |
PressureDifference | dpBal3_nominal | 0 | Bypass balancing valve pressure drop at design conditions [Pa] |
Assumptions | |||
Boolean | use_lumFloRes | true | Set to true to use a lumped flow resistance when possible |
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1 |
Dynamics | |||
Conservation equations | |||
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Advanced | |||
Diagnostics | |||
Boolean | show_T | false | = true, if actual temperature at port is computed |
Connectors
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium in the component | |
FluidPort_a | port_a1 | Primary supply port |
FluidPort_b | port_b1 | Primary return port |
FluidPort_a | port_a2 | Secondary return port |
FluidPort_b | port_b2 | Secondary supply port |
input RealInput | yVal | Valve control signal [1] |
input RealInput | set | Set point |
input RealInput | yPum | Pump control signal (variable speed) [1] |
input IntegerInput | mode | Operating mode |
output RealOutput | yVal_actual | Valve position feedback [1] |
output RealOutput | yPum_actual | Actual pump input value that is used for computations [1] |
output RealOutput | PPum | Pump electrical power [W] |
Modelica definition
model PartialHydronicConfiguration
replaceable package Medium =
Buildings.Media.Water "Medium in the component";
parameter Boolean use_siz = true
"Set to true for built-in sizing of control valve and optional pump";
parameter Modelica.Units.SI.MassFlowRate m1_flow_nominal(min=0)
"Mass flow rate in primary circuit at design conditions";
parameter Modelica.Units.SI.MassFlowRate m2_flow_nominal(min=0)
"Mass flow rate in consumer circuit at design conditions";
parameter Modelica.Units.SI.PressureDifference dp1_nominal(
displayUnit="Pa",
start=0)
"Primary circuit pressure differential at design conditions";
parameter Modelica.Units.SI.PressureDifference dp2_nominal(
displayUnit="Pa",
start=0)
"Consumer circuit pressure differential at design conditions";
parameter Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic typCha=
Buildings.Fluid.HydronicConfigurations.Types.ValveCharacteristic.EqualPercentage
"Control valve characteristic";
parameter Buildings.Fluid.HydronicConfigurations.Types.Pump typPum=
Buildings.Fluid.HydronicConfigurations.Types.Pump.VariableInput
"Type of secondary pump";
parameter Buildings.Fluid.HydronicConfigurations.Types.PumpModel typPumMod=
Buildings.Fluid.HydronicConfigurations.Types.PumpModel.Speed
"Type of pump model";
parameter Buildings.Fluid.HydronicConfigurations.Types.Control typCtl=
Buildings.Fluid.HydronicConfigurations.Types.Control.None
"Type of built-in controls";
parameter Buildings.Fluid.HydronicConfigurations.Types.ControlVariable
typVar=Buildings.Fluid.HydronicConfigurations.Types.ControlVariable.SupplyTemperature
"Controlled variable";
parameter Boolean use_lumFloRes = true
"Set to true to use a lumped flow resistance when possible";
parameter Modelica.Units.SI.PressureDifference dpValve_nominal(
displayUnit="Pa")
"Control valve pressure drop at design conditions";
parameter Modelica.Units.SI.PressureDifference dpBal1_nominal(
displayUnit="Pa")=0
"Primary balancing valve pressure drop at design conditions";
parameter Modelica.Units.SI.PressureDifference dpBal2_nominal(
displayUnit="Pa")=0
"Secondary balancing valve pressure drop at design conditions";
parameter Modelica.Units.SI.PressureDifference dpBal3_nominal(
displayUnit="Pa")=0
"Bypass balancing valve pressure drop at design conditions";
parameter Actuators.Valves.Data.Generic flowCharacteristics(
y={0,1},
phi={0.0001,1})
"Table with flow characteristics";
parameter Actuators.Valves.Data.Generic flowCharacteristics1(
y={0,1},
phi={0.0001,1})
"Table with flow characteristics for direct flow path at port_1";
parameter Actuators.Valves.Data.Generic flowCharacteristics3(
y={0,1},
phi={0.0001,1})
"Table with flow characteristics for bypass flow path at port_3";
parameter Modelica.Units.SI.MassFlowRate mPum_flow_nominal=m2_flow_nominal
"Pump head at design conditions";
parameter Modelica.Units.SI.PressureDifference dpPum_nominal(
displayUnit="Pa")= dp2_nominal + dpBal2_nominal
"Pump head at design conditions";
replaceable parameter Movers.Data.Generic perPum
constrainedby Movers.Data.Generic(
pressure(
V_flow={0, 1, 2} * mPum_flow_nominal / rho_default,
dp=if typPum<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None then
{1.14, 1, 0.42} * dpPum_nominal else {1.14, 1, 0.42}))
"Pump parameters";
parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType=
Buildings.Controls.OBC.CDL.Types.SimpleController.PI
"Type of controller";
parameter Real k(
min=100*Buildings.Controls.OBC.CDL.Constants.eps)=0.1
"Gain of controller";
parameter Real Ti(unit="s")=120
"Time constant of integrator block";
parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial
"Type of energy balance: dynamic (3 initialization options) or steady state";
parameter Boolean allowFlowReversal = true
"= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1";
// Diagnostics
parameter Boolean show_T = false
"= true, if actual temperature at port is computed";
/* Workaround for Dymola 2022x (#SR00922000-01):
The parameters below should be located inside the protected section.
However, doing so yields an incorrect interpretation of the enable
annotation attribute.
The temporary workaround is to declare them in the public section
and systematically assign them final values in the derived models.
*/
parameter Boolean use_dp1
"Set to true to enable dp1_nominal";
parameter Boolean use_dp2
"Set to true to enable dp2_nominal";
parameter Buildings.Fluid.HydronicConfigurations.Types.Valve typVal
"Type of control valve";
parameter Boolean have_typVar = true
"Set to true to enable the choice of the controlled variable";
Modelica.Fluid.Interfaces.FluidPort_a port_a1(
redeclare final package Medium = Medium,
m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0),
h_outflow(start = Medium.h_default, nominal = Medium.h_default))
"Primary supply port";
Modelica.Fluid.Interfaces.FluidPort_b port_b1(
redeclare final package Medium = Medium,
m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0),
h_outflow(start = Medium.h_default, nominal = Medium.h_default))
"Primary return port";
Modelica.Fluid.Interfaces.FluidPort_a port_a2(
redeclare final package Medium = Medium,
m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0),
h_outflow(start = Medium.h_default, nominal = Medium.h_default))
"Secondary return port";
Modelica.Fluid.Interfaces.FluidPort_b port_b2(
redeclare final package Medium = Medium,
m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0),
h_outflow(start = Medium.h_default, nominal = Medium.h_default))
"Secondary supply port";
Buildings.Controls.OBC.CDL.Interfaces.RealInput yVal(
final unit="1", final min=0, final max=1) if have_yVal
"Valve control signal";
Buildings.Controls.OBC.CDL.Interfaces.RealInput set if have_set
"Set point";
Buildings.Controls.OBC.CDL.Interfaces.RealInput yPum(
final unit="1", final min=0, final max=1) if have_yPum
"Pump control signal (variable speed)";
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput mode(final min=0, final
max=if typCtl == Buildings.Fluid.HydronicConfigurations.Types.Control.ChangeOver
then 2 else 1) if have_mod "Operating mode";
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yVal_actual(
final unit="1")
if typVal <> Buildings.Fluid.HydronicConfigurations.Types.Valve.None
"Valve position feedback";
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPum_actual(
final unit="1") if typPum<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
"Actual pump input value that is used for computations";
Buildings.Controls.OBC.CDL.Interfaces.RealOutput PPum(
quantity="Power",
final unit="W") if typPum<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
"Pump electrical power";
Medium.MassFlowRate m1_flow = port_a1.m_flow
"Mass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction)";
Modelica.Units.SI.PressureDifference dp1(displayUnit="Pa") = port_a1.p - port_b1.p
"Pressure difference between port_a1 and port_b1";
Medium.MassFlowRate m2_flow = port_a2.m_flow
"Mass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction)";
Modelica.Units.SI.PressureDifference dp2(displayUnit="Pa") = port_a2.p - port_b2.p
"Pressure difference between port_a2 and port_b2";
Medium.ThermodynamicState sta_a1=
if allowFlowReversal then
Medium.setState_phX(port_a1.p,
noEvent(actualStream(port_a1.h_outflow)),
noEvent(actualStream(port_a1.Xi_outflow)))
else
Medium.setState_phX(port_a1.p,
inStream(port_a1.h_outflow),
inStream(port_a1.Xi_outflow))
if show_T "Medium properties in port_a1";
Medium.ThermodynamicState sta_b1=
if allowFlowReversal then
Medium.setState_phX(port_b1.p,
noEvent(actualStream(port_b1.h_outflow)),
noEvent(actualStream(port_b1.Xi_outflow)))
else
Medium.setState_phX(port_b1.p,
port_b1.h_outflow,
port_b1.Xi_outflow)
if show_T "Medium properties in port_b1";
Medium.ThermodynamicState sta_a2=
if allowFlowReversal then
Medium.setState_phX(port_a2.p,
noEvent(actualStream(port_a2.h_outflow)),
noEvent(actualStream(port_a2.Xi_outflow)))
else
Medium.setState_phX(port_a2.p,
inStream(port_a2.h_outflow),
inStream(port_a2.Xi_outflow))
if show_T "Medium properties in port_a2";
Medium.ThermodynamicState sta_b2=
if allowFlowReversal then
Medium.setState_phX(port_b2.p,
noEvent(actualStream(port_b2.h_outflow)),
noEvent(actualStream(port_b2.Xi_outflow)))
else
Medium.setState_phX(port_b2.p,
port_b2.h_outflow,
port_b2.Xi_outflow)
if show_T "Medium properties in port_b2";
protected
final parameter Boolean have_yPum=
typPum<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None and
typPum==Buildings.Fluid.HydronicConfigurations.Types.Pump.VariableInput
"Set to true if an analog input is used for pump control";
final parameter Boolean have_y1Pum=
typPum<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None and
typPum==Buildings.Fluid.HydronicConfigurations.Types.Pump.NoVariableInput
"Set to true if a digital input is used for pump control";
final parameter Boolean have_yVal=
typCtl==Buildings.Fluid.HydronicConfigurations.Types.Control.None and
typVal<>Buildings.Fluid.HydronicConfigurations.Types.Valve.None
"Set to true if an analog input is used for valve control";
parameter Boolean have_set=
typCtl<>Buildings.Fluid.HydronicConfigurations.Types.Control.None
"Set to true if an analog input is used as a set point";
final parameter Boolean have_mod=
typCtl<>Buildings.Fluid.HydronicConfigurations.Types.Control.None
or typPum<>Buildings.Fluid.HydronicConfigurations.Types.Pump.None
"Set to true if an analog input is used as a control mode selector";
Medium.ThermodynamicState state_a1_inflow=
Medium.setState_phX(port_a1.p, inStream(port_a1.h_outflow), inStream(port_a1.Xi_outflow))
"state for medium inflowing through port_a1";
Medium.ThermodynamicState state_b1_inflow=
Medium.setState_phX(port_b1.p, inStream(port_b1.h_outflow), inStream(port_b1.Xi_outflow))
"state for medium inflowing through port_b1";
Medium.ThermodynamicState state_a2_inflow=
Medium.setState_phX(port_a2.p, inStream(port_a2.h_outflow), inStream(port_a2.Xi_outflow))
"state for medium inflowing through port_a2";
Medium.ThermodynamicState state_b2_inflow=
Medium.setState_phX(port_b2.p, inStream(port_b2.h_outflow), inStream(port_b2.Xi_outflow))
"state for medium inflowing through port_b2";
final parameter Modelica.Units.SI.Density rho_default=Medium.density_pTX(
p=Medium.p_default,
T=Medium.T_default,
X=Medium.X_default) "Default medium density";
end PartialHydronicConfiguration;