Proceedings of Clima 2007 WellBeing Indoors Modeling Of Non-Linear HVAC system using SIMBAD K. N. Nagabhushan, K.N and D. C. Hittle, D.C. Colorado State University Corresponding email: hittle@colostate.edu ABSTRACT The term heating, ventilating and air conditioning (HVAC) covers a wide range of equipments. An air conditioning system maintains desired environmental conditions within the zone. In most cases term heating, ventilating and air conditioning (HVAC) systems, a central air supply provides air at the controlled temperature and flow rate for heating or cooling the space. The main objective of this project was to develop an accurate, dynamic and non-linear digital model of an HVAC system using SIMBAD that could be implemented in the MATLAB/Simulink environment [13]. HVAC system models have been implanted in many proprietary and public domain programs. However, our goal was to implement a model in MATLAB/Simulink, a software system and tool box widely used to study dynamic response and control systems. This paper documents the model for the benefit of those interested in studying HVAC control. The model was also verified by comparing its output to the dynamic response of an experimental HVAC system (see [16]for a discussion of the experimental facility). Our point of departure was the SIMBAD toolbox from CSTB Paris, used in the MATLAB/Simulink environment [12]. INTRODUCTION The SIMBAD toolbox provided many of the components of HVAC systems used in the modeling. The components of the system are modeled using standard Simulink block diagrams and models compiled in C code. The main characteristics of the SIMBAD tool box is the definition of connection vectors. The main two vectors used are : The air vector : Air dry bulb temperature [C], Air humidity ratio [kg/kg], Static pressure [Pa], Mass flow rate [kg/s] The water vector : Water temperature [C], Static pressure [Pa], Mass flow rate [kg/s] SIMBAD is obviously in a state of evolution (and like most software will probably always be in that state). Therefore we developed or modified models to reflect our needs, to consider North American versus European design practice, and to introduce options for multi input multi output control. MODELING The literature is quite rich about dynamic modeling of HVAC systems using linear approximation. This research is mainly concerned with the non-linear modeling and simulation of various HVAC components and the overall HVAC system. Proceedings of Clima 2007 WellBeing Indoors Components that are modeled here are : Dynamic heating and cooling coil, Electrically heated boiler, Variable speed pump, Two-way convergent air duct, Outside and return dampers, Threeway mixing valve, Variable speed fan, PI controllers. The first four component models came from the SIMBAD toolbox. The next three were developed in- house and the PI controller model was taken from the Simulink controls tool kit. Modeling of heat exchanger Almost every thermal environmental system involves heating or cooling of the atmospheric air. It forms the part of both water and air cycle. The parameters for our heat exchanger modeled are: 4 pass, 23 run, plate fin and counter flow type heat exchanger. The tube material is copper and the tube core is 0.01 m in diameter. The fins have a pitch of 472/m,are 0.25 mm thick and are made of aluminum. These parameters are by way of example. Any rational set of parameters can be used in the model. Simulink elements and five programs in “C” language calculate specific variables such as: Geometry, Exchange coefficients, Pressure calculations, Heat transfer, Temperature (C programs), Pressure (C programs), Humidity ratio (C programs), and Mass flow rates (C programs). Temperature calculations This section deals with the calculations of output air temperature. The equations used are : Tao = Tai – Qs / (Cpi * ma ) (1) Tao = Outlet air temperature (C), Tai = Inlet air temperature (C), Qs = Sensible heat transfer rate (kW), ma = Mass flow rate (kg/s). The sensible heat transfer rate is the heat transfer rate which is solely manifested in raising the temperature of the incoming air. Cpi = Cpa + Cpg * Gi (2) Cpi = Inlet air specific heat capacity (kJ/kg K), Cpa = Specific heat capacity of air (kJ/kg K), Cpg = Specific heat capacity of steam (kJ/kg K), Gi = Humidity ratio of inlet air (kg/kg). Proceedings of Clima 2007 WellBeing Indoors Figure 1 Dynamic model of the heat exchanger Qs = Qa * SHR (3) Qs = Sensible heat transfer rate (kW), Qa = Heat transfer rate on air side (kW), SHR = Sensible heat ratio (kg/kg). Qa = ( Tai – T[0] ) / Rst1 (4) Tai = Inlet air temperature (C), Rst1 = Air-side thermal resistance (K/kW), T[0] = Initial coil temperature (C), Rst1 depends on the type of regime, either dry or wet . Here it is assumed to be a dry regime. Rst1 = Bf * Rst (5) Rst = Coil total thermal resistance (K/kW), Bf = By-pass factor for dry coil . Rst = 1.0 / [ Effect * mcp] (6) Effect = coil effectiveness, mcp = minimum capacity rate (kW/K) Cair = Cpi * ma (7) Cair = Air capacity rate (kW/K), Cpi = Inlet air specific heat capacity (kJ/kg.K), ma = Mass flow rate of air (kg/s). Cwater = Cpw * mw (8) Cwater = Water capacity rate (kW/K), Cpw = Water specific heat capacity (kJ/kg.K), mw = Flow rate of water (kg/s). Pressure Calculations Here, we are introducing one independent variable u, and another dependent variable, x . Both u and x are not used in the model. It is used here to explain the model clearly. AD = (273.16 / (273.16 + Tai ) ) / 1.293 (9) Proceedings of Clima 2007 WellBeing Indoors AD = Air density (kg/m3), Tai = Inlet air temperature (C). u = (1 / AD ) * ma (10) x = u2 * Resistance coefficient (11) u = Volumetric flow rate (m3/s), x = Pressure drop (Pa), ma = mass flow rate of air (kg/s) and the resistance coefficient is an input parameter into the heat exchanger . Po = Pi – x (12) Po = Output pressure (Pa), Pi = Inlet pressure (Pa). Humidity ratio calculations : The equation used to calculate humidity ratio is : Go = Gi – ( Qa – Qsensi ) / ( HFG * ma ) (13) Go = Outlet air humidity ratio (kg/kg), Gi = Inlet air humidity ratio (kg/kg), Qa= Heat transfer rate on air side (kW), Qsensi = Sensible heat transfer rate (kW), HFG = Latent heat of vaporization of water (kJ/kg), ma = Mass flow rate of air (kg/s). Mass flow rate calculations There is no change in the mass flow rate of air through the heat exchanger. On the water side there are only two variables-temperature and flow rate. As the flow rate remains constant, the only calculation is that of temperature. Two = Twi + Qr / Cwater. (14) Two = Water output temperature (C), Twi = Water input temperature (C), Qr = Heat transfer rate on water side (kW), Cwater = Water capacity rate (kW/K). Qr = ( Tci –Twi ) / Rst2 . (15) Tci = Initial coil temperature (C), Rst2 = Water + metal thermal resistance (K/kW), Twi = Water inlet temperature (C). Rst2 = 0.001 * Rst (16) Rst = Total coil thermal resistance (K/kW). The value for Rst comes from program header files. Cwater = Cpw * mw (17) Cpw = Specific heat capacity of water (kJ/kg.K), mw = Mass flow rate of water (kg/s). Electrical Boiler The boiler modeled here is an electric heat boiler. The design of electric boilers is largely determined by the shape and heat release rate of electric heating elements used. The example boiler has a capacity of 14 kilowatts. The heater is controlled through a PI control loop that tracks the set point temperature under transient conditions as illustrated in figure 2. The boiler output water temperature can also be calculated using steady state calculations. Proceedings of Clima 2007 WellBeing Indoors The boiler model has two main sections, the thermal cycle and hydraulic cycle. The thermal cycle model calculates the output temperature of the water and the hydraulic cycle model calculates output pressure depending on the flow rate. Figure 2 Electrically heated boiler Thermal Cycle The inputs to the thermal model are: Qint = Command from the controller. This entity depends on the required hot water temperature. Win = Input water vector Tamb = Ambient temperature (C) The inputs are used to define a column matrix. The matrix will have 3 entities, A, B and U. These three entities will be used to calculate outlet water temperature both in steady state and in transient conditions. Defining the matrix : A = (( mwi * Cw /MC ) + ( Ahtank / MC ) )* Gain (18) mwi = Inlet flow rate of water (kg/s), Cw = Specific heat capacity of water (kJ/kg.K) Ahtank = Surface heat exchange product (kW/K), MC = Total thermal mass (kJ/K). MC = mCp_water + mCp_metal (19) mCp_water = Total thermal mass of water (kJ/K), mCp_metal = Total thermal mass of metal (kJ/K) mCp_water = V_water * ρwater * Cw (20) ρwater = Density of water (1000 kg/m3) V_water = Volume of water in the boiler (m3), Cw = Specific heat capacity of water (kJ/kg.K), mCp_metal = V_metal * ρcopper * Cpm (21) V_metal = Volume of metal on the boiler (m3), Cpm= Specific heat capacity of metal (kJ/kg.K), ρcopper = Density of copper (8000 kg/m3) . Proceedings of Clima 2007 WellBeing Indoors As per Simbad, the value of the gain is constant at –1. As shown in the equation, the values of Cw and Ahtank are normalized with MC. The second element in the matrix is B. It has three entities, B1, B2, B3. B1 = mwi * Cw / MC (22) B2 = Ahtank / MC (23) B3 = 1 / MC (24) The vector B can be defined as B = [ B1 B2 B3 ] (25) The last and final element in the matrix U is also a vector consisting of U = [ Twi Ta Qint * Pnom] (26) Twi = Inlet water temperature (C), Ta = Ambient temperature (C), Qint = Controller input, Pnom = Total capacity of the coil (14 kW) Subsequently the matrix will have three outputs: [ A B U ]. Here we have considered transient calculations. The matrix defined above forms the input for the transient calculations. For this purpose, we are defining two variables x and y. Where x = ∑ (B * U) (27) y= A+x (28) and Now the output water temperature is calculated by the formula Two = A * ∫ y (29) The output water temperature, in the transient calculation is determined by integrating the inlet water temperature, with matrix A, over time, until the set point temperature is attained. Hydraulic Cycle : The hydraulic phenomena calculates output pressure depending on the pressure drop during the nominal flow rate of the fluid. In this model we have assumed the pressure drop to be zero. Proceedings of Clima 2007 WellBeing Indoors Pump Figure 3 Variable speed pump One of the main methods for transporting thermal energy into, out of, and within a building is with water. The pump inputs the required flow rate into the water circuit. The flow rate from the pump depends on the command input given at the ‘com‘ input port as illustrated in figure 3. The pump speed can be varied to vary the flow rate of the fluid as required up to the maximum flow capacity of the pump. The equation is given as Fw = Com * Maximum flow rate. (kg/s) (30) Maximum flow rate is an input function of the pump. It is predominantly a linear function. The output water vector will have the same temperature and pressure as the input; only the flow rate will be changed depending on the command. Two-way convergent air duct The two-way convergent air duct gives the resultant air vector due to mixing of two air vectors - the fresh air vector from the atmosphere that comes through the outside air damper and the return air vector from the zone coming through the return damper. The flow rates of the two vectors are added and no head loss is considered. Mixing temperature Tmix = ( Ta1 * ma1 + Ta2 * ma2 ) / (ma1 + ma2 ) (31) Ta1 = Temperature of outside air (C), Ta2 = Temperature of return air (C), ma1 = Flow rate of outside air (kg/s), ma2 = Flow rate of return (kg/s. Mixing humidity Umix = ( U1 * ma1 + U3 * ma2 ) / (ma1 + ma2 ) (32) U1 = Humidity ratio of outside air (kg/kg), U3 = Humidity ratio of return air (kg/kg) ma1 = Flow rate of outside air (kg/s), ma2 = Flow rate of return air (kg/s).. Mixing pressure Pmix = ( P1 * ma1 + P2 * ma2 ) / (ma1 + ma2 ) (33) Proceedings of Clima 2007 WellBeing Indoors P1 = Pressure of outside air (Pa),P2 = Pressure of return air (Pa), ma1 = Flow rate of outside air (kg/s), ma2 = Flow rate of outside air (kg/s) The values of both P1 and P2 are equal at the entrance of the mixing box. The resultant flow rate will be the sum total of both the individual flow rates. The following components were designed and built in-house. The same components in SIMBAD were not working in accordance with the components in the experimental facility. Three-way mixing valve Figure 4 Three way mixing valve The valve has three inputs and three outputs. The three inputs are: Command signal from the controller depending on the set point temperature, Input port for water coming from boiler, Input port for water retuning from the heat exchanger, The three outputs are: Main water vector going into the heat exchanger, and Water vector going into the bypass circuit. The resultant water port mixes water vectors from the heat exchanger and bypass circuit. The bypass water vector and the water vector are mixed internally. Thus the bypass port is used for monitoring purposes and it is not connected anywhere in the system. The valve has three parts: Flow fraction determination: Depending on the command from the controller, which in turn is determined by the set point temperature, a look up table between the command and flow fraction determines the percentage of total flow going into the heat exchanger. The command from the controller is in effect the percentage opening of the valve. Flow calculations: The input to this function is the flow fraction in the form of percentage of the total flow going into the heat exchanger. The flow fraction in the by pass circuit is determined by formula:: mw (bypass) = mw - mw (main) (34) mw = Total flow rate of water from the boiler (kg/s), mw (main) = Flow rate of water into the main circuit (kg/s), mw (bypass) = Flow rate of water into the bypass circuit (kg/s). Proceedings of Clima 2007 WellBeing Indoors Temperature calculations: The main purpose of this block is to calculate the resultant water temperature after mixing between return water and bypass water vectors. Inputs to this block are flow fraction, temperature of water returning from the heat exchanger and temperature of water in the bypass vector. The flow rate of the resultant water vector is the summation of the two water vectors of bypass and return vector from the heat exchanger; no head loss is considered. The resultant temperature of the water is determined by the relation: Tres = (The * mw_he + Tbypass * mw_bypass) / (mw_he + mw_bypass) (35) The = Temperature of water returning from heat exchanger (C), Tbypass = Temperature of water in bypass circuit (C), mw_he = Flow rate of water returning from heat exchanger (kg/s), mw_bypass = Flow rate of water in bypass circuit (kg/s) Actuator The actuating action required here is linear motion of a piston. Depending on the set-point temperature, the valve regulates the flow of water into the heat exchanger. The actuator modeled here has a transfer function : F(s) = 0.005 / (3s+0.005) (36) Now the inverse laplace transform of the above transfer function is : f(t) = 1/600 * e-1/ 600*t (37) From the equation the time constant of the actuator is τ = 600 s. The time constant indicates that the response decays exponentially every 600 seconds. Dampers : Dampers are used for the control of airflow to maintain temperature and/or pressure. An important entity in the design of dampers is the dimensionless entity loss coefficient, Cd. Over most of the operating range, the loss coefficient is an exponential function of blade angle for both parallel and opposed blade dampers. That is, Cd=k1.ek2.θ (38) Where k1 and k2 are constants, and θ is the blade angle in degrees. Now the fraction of full flow is calculated by using the formula Fraction of full flow = Cdo f . Cd + (1-f). Cdo (39) Cdo = loss coefficient for the wide-open damper, Cd = loss coefficient, a function of blade angle, f = open damper resistance as a fraction of the total system resistance The values of Cdo and f are obtained from ASHRAE fundamentals (1997). Since return and outside dampers are used in tandem, one control loop is used to control both dampers depending on the set point temperature. Proceedings of Clima 2007 WellBeing Indoors Actuator : The main task of the actuator in a damper is to precisely open or close the damper blades depending on the command from the controller. Since the action required is circular motion of the damper blades, the actuator modeled here is a motor having the transfer function, F(s) = 5 / (3s+5) (40) Now the inverse laplace transform of the above transfer function is : f(t) = 5/3 * e-5/3t (41) From the equation the time constant of the actuator is τ = 0.6 s. This time constant indicates that the response decays exponentially every 0.6 seconds. Variable speed fan The fan modeled here has one input and two outputs. The input to the fan is the air vector coming from the heat exchanger . The outputs are: Air vector going into the zone and the total power imparted by the fan on the air. Figure 5 Damper Fig 6 Variable speed fan The fan model has two lookup tables : The relationship between volume flow and pressure loss and the relationship between volume flow and RPM. Depending on the mass flow rate of the input air vector the volume flow rate is calculated by: Q = ma /ρ (42) Proceedings of Clima 2007 WellBeing Indoors Q = Volume flow rate (m3/s ), ma = mass flow rate (kg/s), ρ = Density of the air (kg/m3) The volume flow rate thus obtained will be used to get the RPM from the second lookup table and the pressure loss from the first lookup table. The inertial effects of the fan impeller are calculated to make the model dynamically more accurate. The value of the RPM from the lookup is used to calculate the angular velocity (radians/s). θ’ = RPM * 2 * π / 60 (43) The angular acceleration is: θ” = θ’ / t. (radian/s2), with t=time constant taken as 10 s (44) Now the total energy imparted by the fan to the air is given by: W = Q*(P1-P2) + m * θ” + c * θ’ (45) W = Total energy imparted by the fan on air (kW), Q = Volume flow rate (m3/s ), P1 = Set point pressure in the zone (Pa), P2 = Pressure coming into the zone after all losses (Pa), m = Mass of the fan impeller (kg), c = Coefficient of bearing friction, θ” = Angular acceleration (m/s2), θ’ = Angular velocity (m/s) Speed change time constant The action required here is to change the circular motion of the fan impeller. Depending on the set-point temperature the fan regulates the volume of air flow into the zone. The motor has a transfer function: F(s) = 1 / (10s+1) (46) Now the inverse laplace transform of the above transfer function is : f(t) = 1/10 * e-1/10t (47) From the equation the time constant of the actuator is τ = 10 s. The time constant indicates that the response decays exponentially every 10 seconds RESULTS Steady State The following table gives simulation test results for steady state testing. Twi Two Ts Tai Tao m_w m_a Q_a (C) (C) (C) (C) (C) (kg/s) (kg/s) (kW) 55 13.86 18 10.96 17.99 0.0298 0.7191 5.086 55 27.39 25 13.46 25.12 0.0829 0.8197 9.624 55 35.76 30 20.96 30.04 0.1569 0.1.38 12.66 55 38.41 35 25.37 35.00 0.2185 1.5662 15.18 55 42.27 40 30.09 39.99 0.2851 1.5249 15.2 55 46.491 45 35.97 45.00 0.3543 1.3898 12.63 Steady state energy balances were calculated using EES Software. Q_w (kW) 5.058 9.571 12.62 15.15 15.17 12.61 EB 0.027 0.053 0.03 0.030 0.031 0.027 Proceedings of Clima 2007 WellBeing Indoors Dynamic testing : Dynamic tests were performed with step changes given to a set point temperature. The temperature set point was changed from 40 0C to 50 0C . The following graphs show the comparison between experimental data and the simulation data. In all the cases the temperature set points were 400C (initial value) and 500C (final value). CONCLUSIONS The primary objective of this project was to develop a Simulink model of an HVAC system to allow simulation in a software environment that will allow the study of intelligent control systems –MATLAB/Simulink are the preferred tools for studying dynamic response and control. This paper documents the models. A second objective, achieved and reported here was the experimental verification of the models. Agreement is good. This builds confidence that users can apply the model to study control problems. The “code” is available upon request – first visit our web site at http://www.engr.colostate.edu/nnhvac/. Fig 7 Water vector in main circuit of the 3-way mixing valve Proceedings of Clima 2007 WellBeing Indoors Fig 8 Water vector in the bypass circuit of 3-way mixing valve. Fig 9 Temperature of air entering the heat exchanger. Proceedings of Clima 2007 WellBeing Indoors Fig 10 Temperature of air leaving the heat exchanger. Fig 11 Graphs showing comparison between experimental data and simulation data for the same set point temperatures. Proceedings of Clima 2007 WellBeing Indoors Fig 12 Figure showing simulation model of complete HVAC system REFERENCES Harry H Will , Editor , “ The first century of air conditioning, ASHRAE code 90415, ASHRAE , Atlanta ,GA,1999. ASHRAE code 90387, ASHRAE ,GA,1998. J.R. Gartner and H.L. Harrison. 1965. Dynamic characteristics of water-to-air cross flow heat exchangers. ASHRAE transactions , Vol. 71, part I, pp.212-223. Thomas H.Kuehn, James W.Ramsey and James L.Threlkeld, Thermal Environmental Engineering. Third Edition. Prentice Hall, Upper Saddle River,NJ 07458 . H.Tamm. 1969. Dynamic response relations for multi-row cross flow heat exchangers. ASHRAE transactions, Vol.75,part 1, pp 69-80. H.Tamm and G.H.Green, experimental multi-row cross flow heat exchangers, ASHRAE transactions. Part 2, vol 79,pp 9-18,1973. Faye C. McQuiston, Jerald D. Parker and Jeffrey D.Spitler, Heating Ventilating and Air ConditioningAnalysis and Design. Sixth Edition,2005. John Wiley & Sons, Inc. Michael L.Anderson. 2001.MIMO Robust Control For Heating Ventilating And Air Conditioning Systems. Masters thesis at Department Of Electrical and Computer Engineering, Colorado State University. Douglas C.Hittle and Roger W.Haines, Control Systems for Heating, Ventilating and Air Conditioning. Sixth Edition, 2003. Kluwer Academic Publishers. G.Shaavit and S.G. Brandt. The dynamic performance of a discharge air temperature system with a PI controller . Technical report, Honeywell Inc., commercial division. Arlington heights,IL,Jan 1982. Douglas C.Hittle. Dynamic response and tuning.ASHRAE journal ,pages 40-43,Sep 1997. SIMBAD Building and HVAC Toolbox version 3.0.0. Sustainable Development Department. Building Automation and Energy Management, CSTB Paris. MATLAB version 7.0.1. The MathWorks, Inc . SIMULINK version 6.1 The MathWorks, Inc EES Version 7.464.1992-2005 S.A.Klein. F-Chart Software Madison,WI-53744. Anderson M.L. ,Buehner M.R. ,Young P.M. ,Hittle D.C. ,Anderson C. ,Tu J. ,Hodgson D., 2005, An Experimental System for Advanced Heating Ventilating and Air Conditioning (HVAC) Control, submitted for Energy and Buildings Journal.