Investigation of the thermohydraulic systems in MATLAB & Simulink using developed library

Recent developments in the designing of the thermohydraulic systems have heightened the need for special software tools. Possibility of incorporating the measured data, easy and quick rearrangement of the system and short simulation time play a key role in successful progress in designing of the thermohydraulic systems. Commercial software sometimes does not fit to our special tasks or it lacks some utilities. This paper attempts to show usefulness of MATLAB and Simulink in the development of the ”drag and drop” software. In the Simulink it is possible to develop specialized libraries containing graphical blocks representing parts of the real systems. Easy cooling circuit was designed using developed graphical blocks. The main parts of the circuit consist of the heat source and heat exchanger/cooler. Another parts such as pumps, pipes and properties of the cooling medium etc. are taken into account in the investigated system. These results obtained by the developed software are presented for similar circuits with different heat exchangers/coolers. Simulations for different heat exchangers were solved with different initial conditions. These results are consequently compared. Characteristic properties (heating/cooling power and pressure drop according to flow rate) of the heat exchangers/coolers were obtained experimentally in our laboratory and by the numerical CFD simulation in ANSYS/FLUENT software.


Introduction
The purpose of this paper is to describe the way of the designing and simulation of the thermohydraulic systems using own developed "drag and drop" graphical library based on the 1-D mathematical models in MATLAB and Simulink environment.A strong emphasis is placed on the easy and quick incorporation of the measured or computed (usually CFD) data to these models.There is also demand on the possibility of quick rearrangement in the designing of the investigated systems.Due to our research topics, special thermohydraulic library is being developed in our laboratory at New Technologies Research Centre at the University of West Bohemia in Pilsen.The main aim of this library is to solve and simulate special task in thermohydraulic systems such as cooling circuits, heating systems, air conditioning etc.
Developing of this library is in our laboratory further natural step in our work, where are separately experimentally measured and computed various characteristic of the different parts of the thermohydraulic systems.
As 1-D models noted above are denoted mathematical problems containing at most one spatial variable and one time variable.Physical problems are then expressed usually by the set of algebraic-differential equations (DAEs).Briefly it is possible to say that 1-D models have in comparison with multidimensional problems described usually by partial-differential equations (PDEs) advantage in the less computing time, because the solving of DAEs takes usually less time than solving of PDEs for example by finite element method.Also preparation for the simulation may take a less time in our approach, because there is no a e-mail: vacibera@ntc.zcu.czb e-mail: dlavicka@ntc.zcu.czneed to generate special mesh for every component of the investigated system.
The big disadvantages and limitations of 1-D models can be less accuracy and less possibilities in the inclusion of physical background in comparison with problems described by PDEs.In our approach is an effort to eliminate this disadvantage by inclusion of measured and computed (CFD) various characteristic properties of investigated system to the mathematical background i.e. to the used 1-D models.Integration of the measured and computed data such as heat exchangers characteristic, pump characteristic etc. to the more complex thermohydraulic system is one of the crucial tasks in our laboratory.The whole thermohydraulic systems is then simulated as a model of the real physical system represented by graphical blocks consisting from pipes, heat exchanger, expansion tanks, engines, heatings, thermostat, regulating valves etc..Although a lot of commercial software is available and able to design and simulate thermohydraulic systems, it was found that the best way in our case is to develop own software.The main reason for this solution was a fact that we missed suitable software, which would be flexible and suitable enough for incorporating our measured or computed data.Sometimes there was a demand to solve very special tasks.In these cases we lacked some options and tools for quickly developing new special elements in used libraries.
This paper first gives overview of the methods and tools used in our approach in the way of the developing new "drag and drop" graphical library in MATLAB and Simulink environment.A brief description about data measuring and computing is also given.As an example of our results are presented simulations of the whole cooling circuit for instance in a car.As a first step, the cooling circuit was designed using developed library.And as a second step,

Description of methods
In the thermohydraulic systems is usually treated with physical variables such as temperature, heat, pressure, fluid flow rate.As another variables in our work can be considered properties of the cooling fluids such as density, specific heat capacity and viscosity because of its temperature dependent behaviour.Hence in our models is dealt with seven basic variables: volume flow rate, temperature, heat flow, pressure, density, specific heat capacity, viscosity.Another variables can be used in special parts of the system such as variable air mass flow through heat exchanger, for example.The relations among variables such as between heat and temperature used for mathematical background in 1-D models are well-known formulas from classical thermodynamics or another physical or empirical laws.For description of volume flows and pressure in pipes is used physical analogy with electrical circuits [3].

Graphical "drag and drop" thermohydraulic library
Graphical thermohydraulic library is developed in MAT-LAB and Simulink.There is no need to introduce MAT-LAB and Simulink widely, because it is well-known almost in every academic or industrial environment, which was also one of the reasons for choosing this software.For the purpose of considered phenomena it can be briefly said that Simulink provides graphical interface for MATLAB by graphical blocks.These blocks may represent mathematical expression, MATLAB function, measured data etc.Graphical blocks can be connected to each other and thus can be easily and clearly graphically set the whole mathematical model of considered problem.Simulink provides a few tools and ways for developing own graphical blocks.Especially for our purpose has been chosen the use of the Level-2 MATLAB S-Function (see [4]).The method of the calculation on the blocks we can denote as signal approach.New values of variables are computed on the block in every simulation time according to general form: where X contain input values of variables mentioned above.These values are then recalculated to the new values according to the relations f (X), which represent physical or empirical laws.This is also the point where are included measured or calculated data.Usually it is done by interpolation from this data.If it is possible to construct a suitable function describing this data, constructed function is used.
It is worth to mention that the approach with constructed function of measured data is better, because the enumeration of the function usually takes a less computational time than interpolation of measured/computed data.
Another fact that should be stated here is that the connection ports among the graphical block are only unidirectional, see the figure 1.It might make a trouble in the cases that the flows in pipes change its directions.A lot of new block elements were developed using this approach in our laboratory.New elements were consequently added to the new Simulink library, which is now called Thermohydraulic NTC 2012, see the figure 2. As a consequence of the fact that our library is a part of Simulink is that in our library it is possible to use a lot of elements from the original libraries of Simulink.Graphical blocks were developed with the main aim to represent real components of the real thermohydraulics systems such as pipes, heat exchangers, engines, expansion tanks etc.An integral part of the library are also sensors, which are shown as a example of the part of library on the figure 3.These elements serve as "ideal" sensors and using it we can observe various variables in the course of simulation.All of the developed graphical blocks representing real parts of system can be consequently connected to each other like in the real physical system and thus can be new system easy designed and tested.To every component can be also created interface to set up this block.As an example of this interface is shown set up of the pipe on the figure 4. In this interface is possible to set up length, diameter and roughness of the each pipe.

Cooling circuit simulation
As an example was simulated cooling circuit in a car for two different heat exchangers.In the dependence of engine load, i.e. power of engine, different amount of heat is released to the piston walls.This amount of heat is (must be)  transferred to the cooling fluid.Characteristic properties of heat transfer from the engine walls to the cooling circuit can be computed using CFD models.In our case, characteristic of this transfer means we have some function or data for interpolation describing amount of the transferred heat into the cooling fluid in the dependence on cooling fluid flow rate, cooling fluid temperature, engine load, etc.The heat is consequently delivered to the heat exchanger through the another parts of the system such as pipes and whatever.In heat exchanger (cooler) is the heat transferred to the atmosphere according to the characteristic of this transfer.The characteristic of this transfer is usually measured in our laboratory.For the description of measuring methods and equipment see [1].This characteristic consists of measured data describing transfer of the heat out of the cooling circuit to the system surroundings in the dependence on cooling fluid flow rate, cooling fluid temperature, pressure in heat exchanger and air mass flow through the heat exchanger and surroundings temperature.
According to the procedure described above, the elements of the cooling circuit are connected to each other like in the real system.The scheme of designed cooling circuit using our library is shown on the figure 5.The cooling circuit consists of extension tank, pump, engine and cooler.These elements are connected by the pipes.After the circuit is prepared, all elements set, simulation time is set, simulation can start.

Results
The purpose of the simulation was to examine the behaviour of two different heat coolers in the same cooling circuit for the same engine load.In addition to the measured or computed data included in the elements, there were another inputs: cooling fluid flow rate through the system 40 l/min, air mass flow through the coolers 0.8 kg/s, atmospheric pressure on the expansion tank 101325 Pa.The curve describing the engine load, i.e. engine power, is shown on the figure 6. Simulation time was set to 6000 seconds.In the first 1000 seconds the load curve describes load of the cold engine in transit through the town.In this first seconds it is simulated driving in a traffic jam, where there is a greater frequency of braking and starting, standing on idle, etc.In the range of last 1000 − 6000 seconds the car goes out of town up the hill for example.After the simulation for the first cooler was completed, the second cooler was easily changed by dropping it to the model and by connecting to the pipes.Consequently the second simulation started.In a course of simulation we were interested the most in the temperatures and pressure drops behind the engine and coolers.Course of these variables was compared for the both coolers.
The results are presented on the four figures 7 -10 below.As can be seen on the figures 7 and 9 the results show that better cooling properties in the cooling circuit has the second cooler denoted in graphs as cooler 02.Its cooling properties has about 8% better cooling capacity in comparison with the heat exchanger denoted as cooler 01.In a opposite the cooler 02 has about 30 − 35% greater pressure drop.These results are in accordance with reality.

01056-p.3
The main differences between investigated heat exchangers were sizes of the heat transfer surfaces and different channel diameter in honeycombs.

Conclusion
Using developed graphical "drag and drop" thermohydraulic library based on the 1-D mathematical models we are able to simulate thermohydraulic system as a whole real physical system.This library is being developed in the MAT-LAB and Simulink environment.In the models designed in our library it is possible to include measured or computed (CFD) data.Inclusion of these data to the more complex systems is one of the crucial task in our laboratory at New Technologies Research Centre at the University of West Bohemia in Pilsen.Using our approach it is possible to quick simulate the whole thermohydraulic systems as a real physical systems.As a example of work in our laboratory was presented simulation of easy cooling circuit.In this simulation were tested two different coolers to find out, which one is more suitable for the designed system.One of the advantages in this approach is that the whole system can be easily and quickly rearranged and simulation usually takes a few minutes and sometimes less than one minute.Different properties and various parts of thermohydraulic systems can compared in a short time.

EPJ
Web of Conferences DOI: 10.1051/ C Owned by the authors, published by EDP Sciences, computed for two different heat exchangers for the same load of the engine.The graphs with results are presented and compared in the Result section.Finally in the last Conclusion section is a discussion about results.

Fig. 6 .
Fig. 6.Engine power in a course of time.

Fig. 7 .
Fig. 7. Temperature of the cooling fluid behind the engine in a course of time.

Fig. 8 .
Fig. 8. Pressure drop across the engine in a course of time.

Fig. 9 .
Fig. 9. Temperature behind the coolers in a course of time.

Fig. 10 .
Fig. 10.Pressure drops across the coolers in a course of time.