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.
use_constantHeaTemShift