Package of control blocks for distribution systems
Information
This package contains models for control of distribution networks.
Package Content
Name |
Description |
MainPump
|
Main pump controller |
Main pump controller
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.
For a typical usage of this controller, see
Buildings.Experimental.DHC.Examples.Combined.SeriesVariableFlow.
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Parameters
Type | Name | Default | Description |
Integer | nMix | | Number of mixing points after the substations |
Integer | nSou | | 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 | true | Set to false to disable temperature shift of slopes |
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] |
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] |
output RealOutput | y | Pump control signal [1] |
Modelica definition
model MainPump
extends Modelica.Blocks.Icons.Block;
parameter Integer nMix(min=1) ;
parameter Integer nSou(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 = true
;
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.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(
nin=nSou,
k=
fill(1, 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.MultiplyByParameter gai(
final k=-delta)
;
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(
final k=-delta)
;
equation
connect(TMix, TMixMin.u);
connect(TMix, TMixMax.u);
connect(mulSum.u, dTSou.y);
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(sNeg.y, gai1.u);
connect(gai1.y, TMin_lower.u2);
connect(sPos.y, gai.u);
connect(gai.y, TMax_upper.u2);
end MainPump;