I'm currently writing a simulation environment in python/c for heat networks and got to the point where I'm implementing the controls for the environment.
The PID controller is already implemented and should be working, but now I stumbled upon a question where I need some advice which way is the best or most common way to go.
Let's say I've got a heat generator with the power $P=40\,kW$, through which water with a heat capacity $c_p \approx 4000\,\frac{J}{kgK}$ is flowing. The inlet flow temperature is $T_{in} = 50\,^°C$, current outlet flow temperature at timestep $n$ is $T^{n}_{out} = 70\,^°C$ and the massflow is $\dot m^{n} = 0.5\,\frac{kg}{s}$. The desired outlet flow temperature $T^{*}_{out} = 90\,^°C$.
For a constant $c_p$ I need to tell the pump to reduce the massflow to $\dot m^{n+1} = 0.25\,\frac{kg}{s}$ to get $T^{n+1}_{out} = 90\,^°C$ (assuming infinitely long timesteps to get a steady state condition).
To make the example fast and easy, I assume to only have a P-controller with a proportional factor of $K_p = 1.2$ and a pump control algorithm, which is an equation to correlate massflow and temperature, but has no P/I/D-parts! The pump control algorithm equation is: $$\dot m = \frac{P}{c_p \left(T_{out} - T_{in}\right)}$$
Now I've got two possibilites which values to pass as setpoint-values to the P(ID)-controller:
- I can pass the desired outlet temperature $T^{*}_{out} = 90\,^°C$ as setpoint-value and the current outlet temperature $T^{n}_{out} = 70\,^°C$ as process-value to the controller.
This means that the control variable output of the controller will be $C = \left(90\,^°C - 70\,^°C\right)K_p = 24\,^°C$.
This will be fed into my pump-control-algorithm equation with $T_{out} = T^{n}_{out} + C$ which then yields $\dot m^{n+1} = \approx 0.2272 \frac{kg}{s}$ and will then be set as the massflow. - Or I can pass the desired outlet temperature $T^{*}_{out} = 90\,^°C$ to the pump-control algorithm to get the desired massflow and then pass the desired massflow as setpoint variable to the P(ID)-controller.
Thus the desired massflow will be according to the pump control algorithm equation: $\dot m^{*} = 0.25\,\frac{kg}{s}$. This will be passed to the P(ID)-controller as setpoint-value and the current massflow $\dot m^{n}_{out} = 0.5\,\frac{kg}{s}$ as process-value, which yieds the control variable: $C = \left(0.25\,\frac{kg}{s} - 0.5\,\frac{kg}{s}\right)K_p = -0.3\,\frac{kg}{s}$.
So the massflow set by the pump will be: $\dot m^{n+1} = \dot m^{n} + C = 0.2\,\frac{kg}{s}$
Considering both possibilities, the second path with passing the massflow to the controller seems alot more aggressive. Since I have little to no experience with controlling water flows with a pump, I don't know which is the common way to go. Or is there anything I forgot to consider?
What also could be interesting is the region/nation in which it is made in one or the other way and for which applications. My application would be on the one hand a district heating network and on the other hand potable hot water stations, both situated in germany.
Thanks for your help in advance!
Edit
As several people keep telling me, that a system like this is unlikely to be built: It is common and very much likely in central europe, where energy efficiency is rated quite highly!
In fact systems like this are being built often! (I definetely know this, as I am working at operation optimization for systems like this. Thus I'm working with alot of systems like this.)
So this question is not about if systems like this are likely to exist. It is if the control flow usually first goes to the controller and then to some algorithm which calculates a value to set for an actuator, or vice versa.
I know that usually a voltage or PWM is passed to the actuator and not a massflow which has to be set. This is the only point where I agree that it is unlikely it is going to be done in reality. But this is how it works best for my simulation environment and it does not affect my question which is about the order of the control flow!
So... Help is really appreciated, but I don't want to discuss if this system exists or not.
Thanks for help in advance!