Package of control blocks for distribution systems
Information
This package contains models for control of distribution networks.
Package Content
Name |
Description |
AgentPump1Pipe
|
Ambient network storage and plants agent pump control, developed for reservoir network |
MainPump1Pipe
|
Main pump controller for 1 pipe networks, developed for reservoir network main circulation loop |
Examples
|
District controller example models |
Ambient network storage and plants agent pump control, developed for reservoir network
Information
Controller for balacing agents (i.e. reservoirs and plants) pump.
This controller decides to turn on or off the agent pump depending on the current net demand of the
district if TRetDis > TSupDis cooling else heating
and the temperature differential
between the agent source temperature TSou
and the agent inlet temperature TSouIn
adjusted by the offset dToff
. In particular the pump turns on : if heating and TSou - TSouIn - dToff > 0
or if cooling and TSouIn - Tsou - dToff > 0
. Then if the pump is turned on a PID controller,
by default used as P, controls the pump control input by using TSouOut
as measurement and as setpoint
TSou - dToff
for heating or TSou + dToff
for cooling. dToff
can be considered
the nominal value of the agent heat exchanger pinch point temperature difference.
References
Ettore Zanetti, David Blum, Michael Wetter
Control development and sizing analysis for a 5th generation district heating and cooling network using Modelica, 2023 International Modelica conference proceedings.
Parameters
Type | Name | Default | Description |
SimpleController | controllerType | Buildings.Controls.OBC.CDL.T... | Type of controller |
Real | yPumMin | 0.05 | Minimum pump speed [1] |
Real | yPumMax | 1 | Upper limit of output [1] |
Real | k | 1 | Gain of controller |
Real | Ti | 0.5 | Time constant of integrator block |
Real | Td | 0.1 | Time constant of derivative block |
TemperatureDifference | dToff | 1 | Temperature offset to account for heat exchanger pinch point [K] |
Real | uLowHea | 1 | if y=true and u<uLow, switch to y=false |
Real | uHighHea | 2 | if y=false and u>uHigh, switch to y=true |
Real | uLowCoo | 1 | if y=true and u<uLow, switch to y=false |
Real | uHighCoo | 2 | if y=false and u>uHigh, switch to y=true |
Real | h | 0.15 | Hysteresis for net demand temperature calculation |
Connectors
Type | Name | Description |
input RealInput | TSouIn | Temperatures at the inlet of the source [K] |
input RealInput | TSouOut | Agent supply temperature [K] |
input RealInput | TSou | Average temperature available at source [K] |
input RealInput | TRetDis | District return temperature [K] |
input RealInput | TSupDis | Plant supply temperature [K] |
output RealOutput | y | Pump control signal [1] |
Modelica definition
block AgentPump1Pipe
parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType =
Buildings.Controls.OBC.CDL.Types.SimpleController.P ;
parameter Real yPumMin(min=0, max=1,
final unit="1") = 0.05
;
parameter Real yPumMax(min=0, max=1,
final unit="1") = 1 ;
parameter Real k = 1 ;
parameter Real Ti = 0.5 ;
parameter Real Td = 0.1 ;
parameter Modelica.Units.SI.TemperatureDifference dToff(min=0.1) = 1
;
parameter Real uLowHea = 1 ;
parameter Real uHighHea = 2 ;
parameter Real uLowCoo = 1 ;
parameter Real uHighCoo = 2 ;
parameter Real h = 0.15 ;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TSouIn(
final unit="K",
displayUnit="degC") ;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TSouOut(
final unit="K",
displayUnit="degC") ;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TSou(
final unit="K",
displayUnit="degC") ;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TRetDis(
final unit="K",
displayUnit="degC") ;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TSupDis(
final unit="K",
displayUnit="degC") ;
Buildings.Controls.OBC.CDL.Reals.Less NetDemBool(h=h)
;
Buildings.Controls.OBC.CDL.Reals.Switch swi;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput y(
min=0,
max=1,
unit="1")
;
Buildings.Controls.OBC.CDL.Reals.PID conPIDHea(
controllerType=controllerType,
k=k,
Ti=Ti,
Td=Td,
yMax=yPumMax,
yMin=yPumMin) ;
Buildings.Controls.OBC.CDL.Reals.PID conPIDCoo(
controllerType=controllerType,
k=k,
Ti=Ti,
Td=Td,
yMax=yPumMax,
yMin=yPumMin,
reverseActing=false)
;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys(uLow=uLowCoo, uHigh=uHighCoo)
;
Buildings.Controls.OBC.CDL.Reals.Switch swi1;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant Zero(k=0) ;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys1(uLow=uLowHea, uHigh=uHighHea)
;
Buildings.Controls.OBC.CDL.Reals.Switch swi2;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(k=-1)
;
Buildings.Controls.OBC.CDL.Reals.AddParameter Tsou_negshift(
final p=-dToff,
y(
final unit="K", displayUnit="degC"))
;
Buildings.Controls.OBC.CDL.Reals.AddParameter Tsou_posshift(
final p=dToff,
y(
final unit="K", displayUnit="degC"))
;
Buildings.Controls.OBC.CDL.Reals.Subtract dTSouSup
;
Buildings.Controls.OBC.CDL.Reals.AddParameter dTSouSupHea(
final p=-dToff,
y(
final unit="K", displayUnit="degC"))
;
Buildings.Controls.OBC.CDL.Reals.AddParameter dTSouSupCoo(
final p=dToff,
y(
final unit="K", displayUnit="degC"))
;
equation
connect(NetDemBool.y, swi.u2);
connect(TRetDis, NetDemBool.u1);
connect(TSupDis, NetDemBool.u2);
connect(hys.y, swi1.u2);
connect(Zero.y, swi1.u3);
connect(swi.y, y);
connect(conPIDCoo.y, swi1.u1);
connect(swi1.y, swi.u3);
connect(hys1.y, swi2.u2);
connect(conPIDHea.y, swi2.u1);
connect(Zero.y, swi2.u3);
connect(swi2.y, swi.u1);
connect(TSou, Tsou_negshift.u);
connect(Tsou_negshift.y, conPIDHea.u_s);
connect(TSou, Tsou_posshift.u);
connect(Tsou_posshift.y, conPIDCoo.u_s);
connect(TSouOut, conPIDCoo.u_m);
connect(TSouOut, conPIDHea.u_m);
connect(gai1.y, hys.u);
connect(dTSouSup.y, dTSouSupHea.u);
connect(TSou,dTSouSup. u1);
connect(dTSouSupHea.y, hys1.u);
connect(dTSouSup.y,dTSouSupCoo. u);
connect(dTSouSupCoo.y, gai1.u);
connect(TSouIn,dTSouSup. u2);
end AgentPump1Pipe;
Main pump controller for 1 pipe networks, developed for reservoir network main circulation loop
Information
Controller for the main circulation pump.
This controller adjusts the pump speed in order to reduce it, unless
the water temperature at the mixing points after the agents in the district is too high
or too low, as measured by the difference to TMin
and TMax
.
In that case, the pump speed is increased to prevent the loop getting too cold or too warm.
The control is as follows:
Let TMixMin
and TMixMax
be the
minimum and maximum mixing temperatures.
If TMax-TMixMax
or TMixMin-TMin
is too small,
the pump speed is increased.
If the difference is larger than dTSlo
, then the pump speed
is set to the minimum speed yPumMin
.
This calculation is done for both, TMixMin
and TMixMax
.
The actual pump speed is then the larger of the two pump signals.
Therefore, the pump speeds are calculated as shown in the figure below.
Moreover, if the parameter use_temperatureShift
is set to true
,
then the district loop temperature is adjusted by changing the mass
flow rate of the pump to increase the overall efficiency if there is net
cooling or net heating on the loop. Specifically,
if the district heating or cooling loop is in net heating (cooling) mode,
it may be favorable to increase (decrease) the loop temperature, which can
be done by increasing the pump speed. Whether the loop
is in heating or cooling mode is determined based on the temperature differences
across the loop sources, which are the inputs TSouIn
and TSouOut
.
Each heat source or sink needs to be connected to one element of these
vectorized input signals.
This net difference is then used with a PI-controller to determine how much the slopes
should be shifted in order to increase the pump speed.
The shift of these slopes is indicated by the arrows
in the figure.
Note that this controller must be configured to be slow reacting, as it requires the
feedback from the district heating and cooling loop. Furthermore, if the parameter
use_constantHeaTemShift
is set to true
, then a constant temperature
offset offTMax
is added when only heating is present, this determination is done
by checking that the cooling demand for each energy transfer station via
QCoo
is close to zero. This mode can used by itself or in conjuction with use_temperatureShift
.
For a typical usage of this controller, see
Buildings.DHC.Examples.Combined.SeriesVariableFlow.
Parameters
Type | Name | Default | Description |
Integer | nMix | | Number of mixing points after the substations |
Integer | nSou | | Number of heat sources (and heat sinks) |
Integer | nBui | | Number of heat sources (and heat sinks) |
Real | yPumMin | 0.05 | Minimum pump speed [1] |
Temperature | TMin | 281.15 | Minimum loop temperature [K] |
Temperature | TMax | 291.15 | Maximum loop temperature [K] |
TemperatureDifference | dTSlo | 2 | Temperature difference for slope [K] |
Boolean | use_temperatureShift | false | Set to false to disable temperature shift of slopes |
Boolean | use_constantHeaTemShift | true | Set to false to disable constant temperature shift of TMax when only heating is occurring |
TemperatureDifference | offTMax | 2 | TMax constant temperature shift [K] |
TemperatureDifference | dTSou_nominal[nSou] | fill(4, nSou) | Nominal temperature difference over source [K] |
Real | k | 0.01 | Gain of controller that shifts upper and lower temperature setpoints |
Time | Ti | 300 | Time constant of integrator block that shifts upper and lower temperature setpoints [s] |
Real | PpumCooThr | 100 | Threshold for comparison for pump cooling power |
Real | hysPpumCoo | 10 | Hysteresis for cooling pump power threshold |
Connectors
Type | Name | Description |
input RealInput | TMix[nMix] | Temperatures at the mixing points [K] |
input RealInput | TSouIn[nSou] | Temperatures at the inlets of the sources [K] |
input RealInput | TSouOut[nSou] | Temperatures at the outlets of the sources [K] |
input RealInput | QCoo_flow[nBui] | Cooling power required by each building [W] |
output RealOutput | y | Pump control signal [1] |
Modelica definition
model MainPump1Pipe
parameter Integer nMix(min=1) ;
parameter Integer nSou(min=1) ;
parameter Integer nBui(min=1) ;
parameter Real yPumMin(min=0.01, max=1,
final unit="1") = 0.05
;
parameter Modelica.Units.SI.Temperature TMin(displayUnit="degC") = 281.15
;
parameter Modelica.Units.SI.Temperature TMax(displayUnit="degC") = 291.15
;
parameter Modelica.Units.SI.TemperatureDifference dTSlo(min=1) = 2
;
parameter Boolean use_temperatureShift = false
;
parameter Boolean use_constantHeaTemShift = true
;
parameter Modelica.Units.SI.TemperatureDifference offTMax = 2
;
final parameter Modelica.Units.SI.TemperatureDifference delta=
if
use_temperatureShift
then TMax - TMin - 3*dTSlo
else 0
;
parameter Modelica.Units.SI.TemperatureDifference dTSou_nominal[nSou](
each min=0) =
fill(4, nSou)
;
parameter Real k=0.01
;
parameter Modelica.Units.SI.Time Ti(displayUnit="min") = 300
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TMix[nMix](
each final unit="K",
each displayUnit="degC")
;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TSouIn[nSou](
each final unit="K",
each displayUnit="degC") ;
Buildings.Controls.OBC.CDL.Interfaces.RealInput TSouOut[nSou](
each final unit="K",
each displayUnit="degC") ;
Buildings.Controls.OBC.CDL.Interfaces.RealInput QCoo_flow[nBui](
each final unit=
"W") ;
Buildings.Controls.OBC.CDL.Interfaces.RealOutput y(min=0, max=1, unit="1")
;
Buildings.Controls.OBC.CDL.Reals.MultiMin TMixMin(
final nin=nMix,
y(
final unit="K",
displayUnit="degC"))
;
Buildings.Controls.OBC.CDL.Reals.MultiMax TMixMax(
final nin=nMix,
y(
final unit="K", displayUnit="degC"))
;
Buildings.Controls.OBC.CDL.Reals.MultiSum mulSum(
k=
fill(1, nSou), nin=nSou);
Buildings.Controls.OBC.CDL.Reals.Subtract dTSou[nSou]
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter dTSou_nor(k=1/(
sum(dTSou_nominal)))
;
Buildings.Controls.OBC.CDL.Reals.PID conShi(
controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI,
final k=k,
Ti(displayUnit="min") = Ti,
final yMax=1,
final yMin=-1)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer(k=0)
;
Buildings.Controls.OBC.CDL.Reals.Line uppCur ;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant one(k=1) ;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant yMin(k=yPumMin)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant TMax_nominal(k=TMax)
;
Buildings.Controls.OBC.CDL.Reals.Add TMax_upper(
y(
final unit="K", displayUnit="degC"))
;
Buildings.Controls.OBC.CDL.Reals.Max sPos ;
Buildings.Controls.OBC.CDL.Reals.Min sNeg ;
Buildings.Controls.OBC.CDL.Reals.AddParameter TMax_lower(
final p=-dTSlo,
y(
final unit="K", displayUnit="degC"))
;
Buildings.Controls.OBC.CDL.Reals.Line lowCur ;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant TMin_nominal(k=TMin)
;
Buildings.Controls.OBC.CDL.Reals.Add TMin_lower(
y(unit="K", displayUnit="degC"))
;
Buildings.Controls.OBC.CDL.Reals.AddParameter TMin_upper(
final p=dTSlo,
y(
final unit="K", displayUnit="degC"))
;
Buildings.Controls.OBC.CDL.Reals.Max ySetPum ;
Buildings.Controls.OBC.CDL.Reals.Switch swi2
;
Modelica.Blocks.Sources.BooleanExpression booleanExpression(y=
use_constantHeaTemShift) ;
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr(
t=PpumCooThr,
h=hysPpumCoo,
pre_y_start=false)
;
Buildings.Controls.OBC.CDL.Logical.And and2;
Buildings.Controls.OBC.CDL.Reals.MultiSum mulSum1( k=
fill(1,
nBui), nin=nBui) ;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(
final k=-delta)
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai2(
final k=-delta)
;
Buildings.Controls.OBC.CDL.Reals.Sources.Constant offTMaxExp(k=offTMax)
;
Buildings.Controls.OBC.CDL.Reals.Add Add(y(unit="K", displayUnit="degC"))
;
parameter Real PpumCooThr=100
;
parameter Real hysPpumCoo=10 ;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(
final k=-1)
;
equation
connect(TMix, TMixMin.u);
connect(TMix, TMixMax.u);
connect(mulSum.y, dTSou_nor.u);
connect(dTSou_nor.y, conShi.u_m);
connect(conShi.u_s, zer.y);
connect(uppCur.u, TMixMax.y);
connect(uppCur.f1, yMin.y);
connect(uppCur.f2, one.y);
connect(TMax_nominal.y, TMax_upper.u1);
connect(zer.y, sPos.u1);
connect(zer.y, sNeg.u1);
connect(conShi.y, sPos.u2);
connect(conShi.y, sNeg.u2);
connect(TMax_lower.u, TMax_upper.y);
connect(uppCur.x1, TMax_lower.y);
connect(TMax_upper.y, uppCur.x2);
connect(TMixMin.y, lowCur.u);
connect(TMin_nominal.y, TMin_lower.u1);
connect(TMin_lower.y, TMin_upper.u);
connect(TMin_upper.y, lowCur.x2);
connect(TMin_lower.y, lowCur.x1);
connect(lowCur.f1, one.y);
connect(lowCur.f2, yMin.y);
connect(uppCur.y, ySetPum.u1);
connect(lowCur.y, ySetPum.u2);
connect(ySetPum.y, y);
connect(TSouOut, dTSou.u1);
connect(TSouIn, dTSou.u2);
connect(booleanExpression.y, and2.u2);
connect(and2.y, swi2.u2);
connect(dTSou.y, mulSum.u);
connect(greThr.y, and2.u1);
connect(QCoo_flow, mulSum1.u);
connect(sPos.y, gai.u);
connect(sNeg.y, gai2.u);
connect(gai2.y, TMin_lower.u2);
connect(swi2.y, Add.u1);
connect(gai.y, Add.u2);
connect(Add.y, TMax_upper.u2);
connect(offTMaxExp.y, swi2.u3);
connect(zer.y, swi2.u1);
connect(mulSum1.y, gai1.u);
connect(gai1.y, greThr.u);
end MainPump1Pipe;