Modelling and Control of Thermal System

Work presented here deals with the modelling of thermal processes in a thermal system consisting of direct and indirect heat exchangers. The overall thermal properties of the medium and the system itself such as liquid mixing or heat capacity are shortly analysed and their features required for modelling are reasoned and therefore simplified or neglected. Special attention is given to modelling heat losses radiated into the surroundings through the walls as they are the main issue of the effective work with the heat systems. Final part of the paper proposes several ways of controlling the individual parts’ temperatures as well as the temperature of the system considering heating elements or flowage rate as actuators.


Introduction
Thermal processes are nowadays quite explored area, but the importance of their modelling is not decreasing as the present trends are focusing on the energy saving, therefore the more effective control is needed.One of the ways obtaining such kind of control is to derive the more precise model of the system.
This paper is divided into chapters reproducing the methodology of our work.It starts with the description of the whole system and its parts.The most important physical properties are considered in the following chapter together with the reasons for their simplifications.Using them the individual parts are modelled and the several ways of control are the most important outcome of our work.
Actual template for creating the model was the heat exchanger station located in the laboratory B513 of Faculty of Electrical Engineering and Informatics, Technical University of Kosice (Fig. 1).Created model is planned to be used in lectures of Department of Cybernetics and Artificial Intelligence containing the principles of modelling, control, sensors and actuators.

Description of the Thermal System
The entire thermal system consists of several sensors (temperature, pressure, pressure difference), actuators (pump, regulating valve, heating element) and remaining components like indirect heat exchanger.
The goal of the system is to model the process of producing and supplying a dose of heat from the heat exchanger station to a household.Losses caused by transport and draw-off are simulated by the indirect heat exchanger.Working process of the system is as follows: water heated by the heating elements flows from the accumulation container into the indirect heat exchanger that has its other side connected to the cold water pipe.Hot water is thus cooled and then returned into the accumulation container.The goal of control is to com-pensate for these heat losses by controlling the heating elements and regulating the flow in the entire system.

Model Simplifications
Modelling thermal processes requires considering various simplifications as they are influenced by multiple physical properties of the material and flowing medium bringing nonlinearities into model.Together with its complexity the necessary computational power rises.
From this reason, we decided to simplify or neglect few of the physical properties.
Walls of containers -during modelling we consider the walls to be without capacitance [2], i.e. we ignore the thickness of container walls.In reality, there is a slight temperature variation between the liquid and the container wall which we decided to ignore since the containers are made out of (metal) alloys that have high thermal conductivity, and will therefore quickly heat up to a temperature close to that of the liquid.
Other simplification, which is directly connected to the heat conduction, is the thermal inertia of the heating elements.Because of the high non-linear character of the heat elements' cooling process after their turn off we decided to neglect this feature.
Complete mixing -in reality mixed liquids don't have the same temperature in every point of their volume.During the simulation, however, we have to for simplicity consider complete mixing.In practice, this means that if the water is flowing into the exchanger then it has its temperature until the point of entry.Temperature of the water in the exchanger is then calculated from the total accumulated thermal energy [3].
Specific heat capacity -similarly to other properties of a medium its heat capacity also changes with temperature.It characterizes the amount of energy required to change a 1 kg substance temperature by 1 • C.During modelling and simulation, however, the mean value was used.This simplification does not visibly affect model's accuracy and lets us avoid highly increased computational requirements.
Thermal expansion -as the temperature of a medium changes so does its density and volume.This phenomenon is known as thermal expansion.Due to its negligible effect on the model we have decided to ignore it.

Modelling of Thermal Processes
For the physical model of thermal processes we have used an energy balance equation.This equation con-sists of thermal flows, which enter and exit the system.Thus, we gain information about total accumulated energy, in this case heat.To create these equations we used physical formulae contained in [2] and [3].

Mathematical Model of Direct Heat Exchanger
Modelled direct heat exchanger consisted of accumulation container with inflow, outflow and three heating elements (merge into one with power of all three).From this, we can create an energy balance equation: where Q Ain is the heat flow entering the container (inflow of the container), Q Aout is the heat flow exiting the container (outflow), Q AH is the heat flow added by the heating elements and Q AX is the heat flow as a consequence of thermal losses, while T A is the current temperature in the exchanger and C A is the medium's heat capacity.Index A represents the direct heat exchanger (useful in merging all equations later).The following equation applies [3]: where ρ A is the density of the medium, V A is volume of the medium, c p is the medium's mean value of specific heat capacity.
Individual heat flows can be expressed as: where M Ain and M Aout are mass inflow and outflow of the container, T Ain is the temperature of the inflowing medium, P is the actual power of the heating elements, η is the effectiveness of heating (with electric heating it is considered to be 98 %), k AX is the heat transfer coefficient between the exchanger and its surroundings, F AX is the contact area between the walls of the exchanger and its surroundings and T X is the ambient temperature.
For heating in the real system three heating spirals were used each with the (theoretical) power of 1000 W.
In the model itself, the heat flows were integrated and to calculate the actual temperature they were divided by the heat capacity of the medium.The initial requirement was set as a conjunction of initial heat capacity C A0 , and the initial temperature T A0 (we therefore consider the accumulated energy received by the medium since the initial temperature of 0 • C during which the water can not circulate within the exchanger).

Mathematical Model of Indirect Heat Exchanger
This device, purposed to exchange heat between two mediums, consists of two chambers separated by a heat exchanging surface, which is constructed to have the largest surface area.Our model exchanger had a heat exchanging surface area of F N = 0.6 m 2 .
To differentiate the two chambers we denote them as primary and secondary.The primary chamber contains the hotter medium which then transfers heat to the medium in the secondary container.This way we get two balance equations, one for each side of the exchanger: where indexes next to the parameters represent B for the indirect exchanger, P primary side, S secondary side, X heat loss, in and out inflow and outflow respectively.
We consider the case in which the primary side has no thermal losses and all heat is transferred to the secondary side.It is only the secondary side from which some amount of heat is radiated into the surroundings.Individual heat flows are similar to those in the primary exchanger, specifically: where M stands for mass flow, k stands for heattransfer coefficient and F stands for contact area.Connecting the two sides of the indirect exchanger is Q BP S heat flow, which can be seen in both balance equations with a different plus/minus sign (minus on the primary side, which radiates heat and plus on the secondary side, which receives heat).Such model's drawback is that we cannot determine whether the exchanger is counter-current or co-current.A certain solution could be provided by the space discretization of the two sides of the exchanger in space.

Mathematical Description of Heat Loss
Heat loss radiated into the surroundings is created as a result of the temperature difference between the surfaces of the exchangers or pipes and the outer temperature.These losses depend on (since we ignore thickness of the walls) the heat-transfer coefficient.To calculate it we need to ascertain the so-called Nusselt number for plate walls as described by this equation: where: Pr stands for Prandtl number (according to tables of constants) and Ra stands for Rayleigh number, which we calculate by: where Gr-Grashof number determined thusly: where g is gravity acceleration, α V is coefficient of thermal expansion, ϑ is the temperature difference between the medium and ambient temperature, L is determining dimension (for flat walls it's height, for pipes it's diameter) and υ is the kinematic viscosity of air.
The resulting heat transfer coefficient consists of two partial coefficients which consisted of part for dissipation and for conduction: where where λ is the thermal conductivity, l is the length of planar wall, = 0.7, σ = 5.67•10 −8 , T 1 and T 2 are temperatures of water and air in Kelvin.All table values of parameters are searched for according to the characteristic temperature of air T m = 0.5 • (T S + T t ), where T S is the water temperature and T t is the temperature of the surrounding air.
To calculate the heat transfer coefficient in pipes we adjust the calculation of Nusselt number with a correcting element: in which h stands for pipe length and D for its diameter.All equations listed above are used according to [4].
Individual properties of air were approximated with polynomials of varying degrees (according to sufficient accuracy of the approximation).Used data are summed up on Tab. 1, [4].
Tab. 1: Values for individual physical parameters of air used for the polynomial approximations.Due to computational requirements we have created two models of the accumulation container.The first one to truly simulate PWM control and to generate its signal with required duty cycle and the second one, which uses continuous values of power for its calculations.Comparison of the real experiment in accordance with [1] and these models is on Fig. 2. In this experiment, the water in the accumulation container was heated without flow with gradual change of duty cycle.
On the Fig. 1, the difference between two models of PWM control can not be seen as they are almost equal.

Temperature Control of the Direct Exchanger by Heating Elements
In order to create a complex control of the entire system, control of the individual heat exchangers has to be designed first.During the synthesis of PI regulators, Naslin method was used with a maximum overshooting of 5 %.For the synthesis of the PI regulator we linearized the direct exchanger model near its equilibrium, in which equality between the temperatures of the medium and the surroundings occurs in the exchanger.The output of the system was the temperature in the exchanger and its input (and therefore actuating variable) was the required power of the heating elements.Results of the simulation can be seen on Fig. 3 and Fig. 4.
Main flaw of this type of control is in the impossibility to lower the temperature in the exchanger as we can only add heat to the system.

Temperature Control of Direct Exchanger by Flowage
During linearization of the direct heat exchangers energy balance equation in its equilibrium in regard to flowage a problem has arisen in negating of the elements containing flowage (during equilibrium flowage is equal to inflow).For this reason change of thermal flow was chosen as the actuating variable, which was created by combining Q Ain and Q Aout .Regulator then calculates the required action as an energy variance in Joules, from which a specific value of flowage needs to be calculated.It has to be noted, that without full numeric communication and regulation this wouldn't be possible.Results of the simulation are on Fig. 5 and Fig. 6.

Temperature Control of Indirect Exchanger by Temperature of Input Medium
In regard to the impossibility of heat generation in the indirect exchanger we can, unlike the heating elements in the direct exchanger, affect its temperature by changing the temperature of the inflowing medium.
Actuating variable is therefore the temperature in the primary side T BP in .Graphs of the simulation with PI regulator control are on Fig. 7 and Fig. 8.

Temperature Control of Indirect Exchanger by Flowage
As in the case of the direct exchanger, the temperature in the indirect exchanger can be affected by the flowage, however, during linearization of the system we again encounter the negating problem during equilibrium.We can, however, join the input and output thermal flows and consider the variation of this new flow to be the actuating variable, from which we need to calculate the value of flowage.Results of the simulations can be seen on Fig. 9 and Fig. 10.We consider the temperature of the direct heat exchanger to be the input value of the primary side of the indirect exchanger.After a serial connection of linearized systems from chapters 4.2 and 4.4 we gained a transfer whose output is T BP and whose input is power of the heating elements.
For the synthesis of a PI regulator we once again used Naslin method with a maximum overshooting of 5 %.Results of the simulation are on Fig. 11.

Practical Application
Proposed model can be used in the hot water distribution systems, for example in a flat-building with the number of flats 1 to 16, [6].
In the Fig. 13 is an example of hot water distribution system with the effect of the interrupted operations during the night in flat buildings.Heat losses in hot water pipes are negligible.A lost heat is indirectly used for the building heating in a winter season.However the heat from hot water transferred through the pipe walls into building flats is the unwanted heat energy loss in the summer season.Properly designed model can help to reduce the heat losses to the minimum [5].

Characterization of the distribution system:
• hot water is heated in the hot water storage tank installed in the house, • supply water temperature is maintained by the hot water circulation, • interrupted supply of the hot water is systems lasted for: 4, 5 and 6 hours a-day.
Assumed limit values of parameters: • feed hot water temperature at the distribution system inlet is 55 • C, • circulating hot water temperature at the end of distribution system is 50 • C, • mean ambient temperature is 20 • C, • pipe material -steel (galvanized), • volume of hot water delivered to flat at the specified temperature is 17.28 m 3 /year.

Conclusion
During the modelling of thermal systems we have to, due to their complexity, work with a number of simplifications.In practice, however, these simplifications have no profound effect on the model's accuracy.During the creation of regulation we have to account for the slow dynamic of the system, determine which parameters affect individual heat flows and adjust accordingly.
In the future work, we plan to use the implemented model for control in more complex structures on account of a better reference trajectory tracking using the predictive control.It would be suitable to have statistical data of heating water consumption at different time intervals.In that manner we could generate approximate trajectory of desired temperature for 24 hours a day and real data could help to specify the heat loss during the heat water consumption.
The important element of the system designed in such a way is a control by flow of heating water and also by heating spirals with the aim of electricity saving with respect to low energy consumption of control by the flow.It is necessary to emphasize that the use of the spirals is unavoidable (they, as the only actuator, are able to supply the heat energy to the system), however, control by the flow valve can save a significant amount of energy depending on temperature of the water returning from end user.Therefore, the more sophisticated control should prefer regulation by flow whenever possible.One of the options is using the controller in the form of neural networks, which allows the use of more outputs and it better reflects non-linearities of the system.
Pulse Width Modulation (PWM) can create the impression of a continuous control of logical devices.During the control of heating elements, it has the advantage of a more accurate control and possible energy savings.

Fig. 2 :
Fig. 2: Comparison model heating elements with the experimental results.

Fig. 3 :
Fig. 3: Simulation of regulation of the temperature in the direct exchanger by using heating elements.

Fig. 4 :
Fig. 4: Values of the real and required power during simulation of regulation of the direct exchanger by using heating elements.

Fig. 5 :
Fig. 5: Regulation of temperature of the direct exchanger by using flowage.

Fig. 6 :
Fig. 6: Graph of mass flowage during regulation of the direct exchanger using flowage.

Fig. 7 :
Fig. 7: Temperature regulation of the primary side of the indirect exchanger by controlling T BP in with flowage malfunctions since 0.8h.

Fig. 8 :
Fig. 8: Graph of the actuating variable -input temperature of the primary side during regulation of the indirect exchanger.

Fig. 9 :
Fig. 9: Regulation of the primary side of the exchanger by controlling flowage.

Fig. 10 :
Fig. 10: Graph of the actuating variable -flowage during temperature control of the indirect heat exchanger.

4. 6 .
Temperature Control of Indirect Exchanger in the Case of Serial Connection of ExchangersBecause we can not make new energy in the form of heat by controlling flowage (we can only affect the speed of thermal flows) we decided to create a complex control by using the heating elements.

Fig. 11 :
Fig. 11: Regulation of temperature of the indirect heat exchanger using heating elements during a serial connection of the two exchangers.

Fig. 12 :
Fig. 12: Graph of the actuating variable -power of the heating elements during regulation of the entire thermal system.