*4.2. TRNSYS Model*

In the dynamic simulation software TRNSYS (version 17) [33], the whole system is first broken up into specific models (named "Types") of each single system component, where each "Type" is represented by a FORTRAN code. The users can assemble the TRNSYS Types by connecting component outputs with component inputs and then specifying the corresponding components' performance parameters. Finally, the software solves the corresponding equations in order to characterize the component/system operation every time step.

In this study, a detailed model in TRNSYS environment has been developed to simulate, using a time step of 1 min (according to the time step of experimental data utilized in this work for training, testing, and validating the ANN-based model), (i) the return air temperature (TRA); (ii) the return air relative humidity (RHRA); as well as the electric energy consumptions (not measured) of (iii) the heat pump (HP), (iv) the refrigerating system (RS), (v) the humidifier (HUM), (vi) the supply air fan (SAF), and (vii) the return air fan (RAF). With reference to the several performance parameters to be specified in the TRNSYS Types used into the simulation model, it can be noticed that, in this study, some

of the parameters have been directly identified or calculated based on catalog data; the remaining parameters have been defined based on field measurements.

Table 10 lists the main modeled components and the corresponding TRNSYS Types used in the simulation model.


**Table 10.** Main simulated components and corresponding types of TRNSYS software.

Figure 10 depicts a screenshot of the TRNSYS model, highlighting the main circuits with different colors. In particular, the circuit of cold fluid supplied by the refrigerating system to the cooling coil is depicted in blue; the circuit of hot fluid supplied by the heat pump to the post-heating coil is indicated in red; finally, the inputs and outputs of the ANN-based model are highlighted in light blue. The other connections of TRNSYS Types are pointed out by dashed black lines.

**Figure 10.** Screenshot of the TRNSYS model.

The TRNSYS model has been coupled with the artificial neural network ANN16 (described in the previous section) via the TRNSYS Type 155.

The ANN16 uses as inputs the 10 variables indicated in the previous section and provides as outputs the 5 parameters specified in the same section.

The Type 155 links ANN16 with both the Type 56 as well as the Type 661. In particular, the Type 155 provides two of the outputs of the ANN16, i.e., the supply air temperature and relative humidity, as inputs to the Type 56. In addition, the Type 155 provides as inputs to the Type 661 all the outputs of the ANN16, i.e., the supply air temperature, the supply air relative humidity, as well as the opening percentages of the valves supplying the humidifier, the pre-heating coil, and the cooling coil. The Type 661 models a "sticky" controller with its outputs assumed equal to the inputs at the earlier time step; the outputs of the Type 661 are then provided as inputs to the Type 155.

A dynamic model of the "building" corresponding to the integrated test room has been developed by means of the Type 56. This model allows calculation of the return air temperature and relative humidity (then assigned as inputs to the Type 661) according to the geometry, thermo-physical properties of walls' layers, air infiltration rate, as well as internal loads/gains. In particular, the geometry and walls' layers have been characterized according to the content of the previous section, while air infiltration rate as well as internal loads/gains are kept equal to zero according to the experimental conditions.

The Type 941 has been considered for simulating the operation of both the refrigerating unit (RS) and the heat pump (HP) of the experimental setup. This Type allows to obtain as outputs (a) the absorbed power and (b) the exiting fluid temperature in the case of (i) the outside air temperature, (ii) the entering fluid temperature, (iii) the fluid flow rate, as well as (iv) the performance maps of the devices are provided as inputs. In this study, the outside temperature has been assumed to be equal to the measured values (the Type 9a has been used for reading data from an external file and making them available to the TRNSYS Types 941), the fluid mass flow rate is set to 2310 kg/h for the refrigerating system and 2410 kg/h for the heat pump according to the manufacturer datasheet [36], and the performance maps suggested by the manufacturer [36] and reported in Figure A2a,b of Appendix A have been provided. In particular, Figure A2a,b, respectively, indicates the coefficient of performance COP of the heap pump (useful thermal power output divided by required electric power input) and the energy efficiency ratio EER of the refrigerating system (useful cooling power output divided by required electric power input) depending on supply fluid temperature and outside air temperature.

Both the heat pump and the refrigerating system are coupled with a 75 L tank that is devoted to storing the hot and cold fluids, respectively. The operations of both hot and cold tanks have been simulated with the Type 534. This Type models a cylindrical vertical tank; it divides the tanks into 10 isothermal temperature layers in order to carefully consider thermal stratification (where the layer n. 1 is positioned on the uppermost portion of the tank and the layer n. 10 is positioned on the lowest part of the tank).

With reference to the modeling of the fans, a specifically devoted data set was gathered from a calibration activity performed by adjusting and maintaining the supply and return fans at various speeds from 10% to 100%. Figure A3 in Appendix A shows the air volumetric flow rate QV measured at SENS i-Lab and the power consumption Pel suggested by the manufacturer as a function of the fan' velocity OL. In particular, Figure A3a refers to the supply air fan, while Figure A3b is related to the return air fan.

The following equations, interpolating the values reported in Figure A3a,b, have been derived to calculate both the air volumetric flow rate QV as well as the power consumption Pel of both supply and return air fans as a function of fans' velocity:

$$\text{QV}^{\text{SAF}} = -0.00001 \cdot \text{OL}\_{\text{SAF}}^3 + 0.0634 \cdot \text{OL}\_{\text{SAF}}^2 + 5.1789 \cdot \text{OL}\_{\text{SAF}} + 8.7704 \tag{12}$$

$$P\_{\rm el} \, ^{\rm SAF} = 0.0003 \cdot \text{OL}\_{\rm SAT} \, ^3 + 0.1068 \cdot \text{OL}\_{\rm SAT} \, ^2 + 0.7383 \cdot \text{OL}\_{\rm SAT} + 4.9372 \tag{13}$$

$$\text{QV}^{\text{RAF}} = 14.491 \cdot \text{OL}\_{\text{RAF}} + 12.352 \tag{14}$$

$$P\_{\rm el} \, ^{\rm RAF} = 0.001 \cdot \text{OL}\_{\rm RAF} \, ^3 \text{-} 0.078 \cdot \text{OL}\_{\rm RAF} \, ^2 + 3.120 \cdot \text{OL}\_{\rm RAF} \, -2.102 \tag{15}$$

Equations (12)–(15) have been included in the TRNSYS project via the Type 9a (external file data reader) for calculating the fans' power consumption according to the fans' velocity.

The operation of the adiabatic steam humidifier has been modeled via the Type 641; this model permits the humidifier not to respond instantaneously to the control signal, but to get the steady-state values of both power consumption and gain rate exponentially. In the TRNSYS project, the control signal associated to the opening percentage of the humidifier valve is provided as input to the Type 641 by the ANN16 through the Type 155. Based on catalog data, the humidifier power consumption has been considered equal to the nominal value of 3.7 kW, while the humidifier is activated taking into account that it has been experimentally verified that water flow rate supplied by the humidifier increases from the minimum to the maximum value (5 kg/h) almost instantaneously.

The Type 654 has been used for modeling the single-speed pumps maintaining a constant fluid flow exiting/entering the heat pump and the refrigerating system.

The Type 647 has been used to model the diverting valves that split a liquid inlet flow into two fractional outlet flows, while the Type 649 is adopted to simulate the mixing valves that combine two individual liquid streams into a single outlet.

The moist air properties have been evaluated by means of the Type 33e; this Type takes as inputs the air relative humidity and the air dry bulb temperature and generate the other corresponding air properties as outputs.

In this paper, the Type 2 has been adopted for simulating on/off differential controllers. These devises generate a value in the range between 0 and 1 that is used to deactivate or activate the refrigerating system or the heat pump. In particular, this Type activates the component generating a signal equal to 1 when the observed parameter becomes lower than the user-defined setpoint by a certain value (upper deadband), while it is switched off in the case of the observed parameter approaches the user-defined setpoint within a given limit (lower deadband). The successive value generated by the differential controller is also affected by the value assumed by the control signal used as input at the earlier time step. In this work, the differential controller is operated by connecting the input and output signals in order to give a hysteresis effect. In greater detail, the temperature at node 2 of the tank storing the cold fluid has been assumed as the observed temperature for activating/deactivating the refrigeration unit; with reference to the hot tank, the temperature at node 8 has been adopted as the watched temperature for operating the heat pump. A target temperature of 45 ◦C was assumed for activating the heap pump, with a turn-on temperature difference of 1 ◦C and a turn-off temperature difference of −1 ◦C. A target temperature of 7 ◦C was defined for activating the refrigeration unit, with a turn-on temperature difference of 1 ◦C and a turn-off temperature difference of −1 ◦C. The hot/cold heat carrier fluid is moved by the pumps into the post-heating/cooling coil according to the opening percentage of the corresponding valves defined by the related outputs of the ANN16 via the Type 155. The temperature of the hot heat carrier fluid is assumed to be reduced by 5 ◦C when flowing into the post-heating coil (before entering the hot tank), while the temperature of the cold heat carrier fluid is assumed as increased by 5 ◦C when flowing into the cooling coil (before entering the cold tank).

#### **5. Assessment of Faults' Impact**

In this section, the experimental performances of the HVAC system operating under faulty conditions (summer tests n. 5–9 of Table 4 and winter tests n. 14–18 of Table 5) have been compared with those predicted by the artificial neural network ANN16 (described in Section 4a), coupled with the TRNSYS model (described in Section 4b), in the cases of the HVAC system is operating under the same boundary conditions without faults. In more detail, the following inputs have been provided to the ANN16 in order to simulate the HVAC performance without faults: (i) return air temperature calculated by the TRNSYS Type 56 as well as target of indoor air temperature equal to 26 ◦C; (ii) return air relative humidity calculated by the TRNSYS Type 56 as well as target of indoor air relative humidity equal to 50%; (iii) supply air temperature calculated by the ANN16 itself at previous time step; (iv) supply air relative humidity calculated by the ANN16 itself at previous time step; (v) experimental value of outside air temperature; (vi) opening percentage of the valve supplying the post-heating coil calculated by the ANN16 itself at previous time step; (vii) opening percentage of the valve supplying the cooling coil calculated by the ANN16 itself at previous time step; (viii) opening percentage of the valve supplying the humidifier calculated by the ANN16 itself at previous time step; (ix) velocity of supply air fan equal to the nominal value of 50%; and (x) velocity of return air fan equal to the nominal value of 50%.This means that:


Figures 11 and 12 highlight the values of return air temperature (TRA) and return air relative humidity (RHRA) over time, for the cases without faults (predicted values represented by solid lines) and the cases when only one of the 5 above-mentioned faults is occurred (experimental values indicated by dashed lines) with the aim of helping the contrast between normal and faulty scenarios. In particular, Figure 11 refers to the summer tests, while Figure 12 corresponds to the winter tests.

**Figure 11.** *Cont*.

**Figure 11.** Comparison between experimental faulty operation (dashed lines) and predicted normal operation tests (solid lines) during summer in terms of TRA and RHRA: test n. 5 (**a**), test n. 6 (**b**), test n. 7 (**c**), test n. 8 (**d**), and test n. 9 (**e**).

**Figure 12.** Comparison between experimental faulty operation (dashed lines) and predicted fault free operation tests during winter in terms of TRA and RHRA: test n. 14 (**a**), test n. 15 (**b**), test n. 16 (**c**), test n. 17 (**d**), and test n. 18 (**e**).

These comparisons have been performed in order to assess the impact of each fault on (i) the capability to achieve the desired indoor conditions, (ii) the arithmetic mean and standard deviation of return air temperature and relative humidity, as well as (iii) the electric energy consumptions. In particular, the effects of faults on occupant thermohygrometric comfort are reported in Section 5.1.; the faults' impact associated with the trends of return air temperature and relative humidity is described in Section 5.2.; the influence of each fault on electric energy consumptions is indicated in Section 5.3. The discussion about all the results is performed in last Section 5.4.

#### *5.1. Results: Faults' Impact on Thermo-Hygrometric Comfort*

Table 11 compares the thermal/hygrometric comfort times (i.e., the percentage of time during with values of indoor air temperature/relative humidity within the given deadbands) of the simulation tests without faults with respect to those associated to the corresponding experimental tests when only one of the five faults (described in the previous Section 3) is occurring.


**Table 11.** Thermal-hygrometric time with/without faults.
