(**c**)1st week of April (**d**)1st week of April

#### (**e**)1st week of July (**f**)1st week of July

**Figure 6.** Heat and power profiles in 3 weeks of the year (areas are for consumption, lines for production).

The CHP delivers the base load during the winter season and the heat pumps meet the heating demand. The boilers are rarely used as the electricity produced by the renewables sources and CHP is enough to run the heat pumps. During the mid-seasons, the CHP mainly meets the high electricity demand of the appliances. The HPs are rarely used as it is more convenient to use the boilers to meet the few thermal peaks with respect to purchasing more electrical energy from the grid. In summer, the CHP still operates at high load factors to meet the residual electrical load from the variable solar and wind production. The thermal overproduction mainly occurs during the mid and summer seasons because it is more convenient to maximize the electrical production of the CHP unit, with respect to purchasing electricity from the grid.

The annual values reported in Figures 7 and 8 highlight the energy and economic advantages of the distributed configuration. The distributed configuration reduces both the DHN thermal losses and the CHP overproduction (−27% and −9%, respectively), thus, reducing the overall thermal energy production (−6%). The heat pumps deliver about 24 % of the heating load and the boilers reduce their output to about 68%. In the centralized configuration, the CHP unit delivers 77% of the thermal load, being more cost-effective than the gas boiler. However, the corresponding total electricity production (CHP, PV, and wind generator) is significantly greater than the electrical load, resulting in an unprofitable overproduction (about 28% of the total electricity production is sold to the grid at an uneconomical price). On the contrary, the introduction of the heat pumps shifts part of the thermal load to the electrical one, increasing the self-consumption of electricity and reducing both the CHP energy production (−20% of thermal and −21% of electrical energy, respectively) and the power sold to the grid (−51%). In total, the presence of the HPs reduces the power exchange with the electrical grid from 259 to 159 MWh (−40%) considering both sold and purchased quantities.

Although the objective function of the optimization process refers to an economic index, the energy and the environmental benefits of the distributed configuration are shown in Table 6. The net no-RES primary energy consumption was reduced by about 8%, and the equivalent CO2 emissions were reduced by about 11%. These values were evaluated considering the primary energy factors and the specific CO2 emissions of the Italian energy systems [31,32]. According to a grid perspective, the energy system can be thought of as an electricity generator with a specific emission of 232 g/kWh in the distributed configuration and 238 g/kWh in the centralized one. We note that the average value of specific CO2 emissions for Italian power production is about 313 g/kWh.

**Figure 7.** Thermal energy balance (MWh/yr).

**Figure 8.** Electrical energy balance (MWh/yr).



Overall, the results show that the proposed hybrid centralized-distributed configuration outperforms the more conventional centralized configuration from an economic, environmental, and efficiency perspectives. Indeed, the introduction of heat pumps at the building level enhances the operational flexibility of the system by enabling the interconnection between the thermal and electric networks. In this way, RES-based energy production can be used mainly on-site–instead of being sold to the regional grid–and the use of inefficient technologies, such as natural-gas boilers, can be drastically reduced.

#### **6. Conclusions**

An innovative configuration for smart multi-energy microgrids serving clusters of buildings has been presented. The energy system combines both centralized and distributed generation units, optimally integrating cogeneration-based micro-district heating, RES technologies, and reversible heat pumps.

The proposed system was tested in a hypothetical case study, namely, a University Campus located in Trieste (Italy). A detailed modeling of the building load demands, district heating network, and all energy units has been provided in order to simulate the energy system in a reference-year scenario. Moreover, an operational optimization algorithm was specifically developed to identify the generator scheduling that meets the energy demand while minimizing the operational cost. The optimal size of the cogeneration unit and reversible heat pumps has also been found.

The proposed configuration was compared to a more conventional layout based completely on centralized heat production. The results show how the introduction of distributed heat pumps to assist the thermal production at the building level enhances the flexibility and cost-effectiveness of the energy system. Indeed, an 8% total-cost saving, 11% carbon emission reduction, and 8% primary energy saving were achieved compared to the centralized reference case. Moreover, the proposed configuration significantly reduced the electric energy exchange with the regional grid (around 40% less).

Future work will address the current limitations of the work: the optimal sizing of the whole system will be investigated, the effect of uncertainty in weather conditions and economic parameters will be analyzed, and the effectiveness of energy storage managed by predictive control will be evaluated.

**Author Contributions:** Conceptualization, D.T.; Data curation, D.T., P.C., E.S., L.U. and F.D.; Methodology, D.T., P.C., E.S., L.U. and F.D.; Software, D.T., P.C., E.S., L.U. and F.D. Supervision, D.T.; Writing–original draft, D.T., P.C., E.S., L.U. and F.D.; Writing–review & editing, D.T., P.C., E.S., L.U. and F.D.

**Funding:** This research was funded by the University of Pisa (PRA 2017–18, Grant n. 33).

**Acknowledgments:** We would like to thank our colleagues at the University of Pisa involved in energy systems integration activities, who contributed to the discussion and development of the mathematical and engineering models, with a special acknowledgement to Professors Marco Raugi, Davide Poli, Davide Aloini, and Antonio Frangioni.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Nomenclature**


