Novel Use of Green Hydrogen Fuel Cell-Based Combined Heat and Power Systems to Reduce Primary Energy Intake and Greenhouse Emissions in the Building Sector

: Achieving European climate neutrality by 2050 requires further efforts not only from the industry and society, but also from policymakers. The use of high-efﬁciency cogeneration facilities will help to reduce both primary energy consumption and CO 2 emissions because of the increase in overall efﬁciency. Fuel cell-based cogeneration technologies are relevant solutions to these points for small- and microscale units. In this research, an innovative and new fuel cell-based cogeneration plant is studied, and its performance is compared with other cogeneration technologies to evaluate the potential reduction degree in energy consumption and CO 2 emissions. Four energy consumption proﬁle datasets have been generated from real consumption data of different dwellings located in the Mediterranean coast of Spain to perform numerical simulations in different energy scenarios according to the fuel used in the cogeneration. Results show that the fuel cell-based cogeneration systems reduce primary energy consumption and CO 2 emissions in buildings, to a degree that depends on the heat-to-power ratio of the consumer. Primary energy consumption varies from 40% to 90% of the original primary energy consumption, when hydrogen is produced from natural gas reforming process, and from 5% to 40% of the original primary energy consumption if the cogeneration is fueled with hydrogen obtained from renewable energy sources. Similar reduction degrees are achieved in CO 2 emissions.


Introduction
Europe aims to achieve climate neutrality by 2050, which means net-zero greenhouse gas emissions. Entire society and economic sectors must join this task to reach the final objective, from industry to mobility, building, agriculture, etc. Building sector in Europe consumed 40% of the final energy in 2018, with just household being 26% of the final energy, similar to the industry sector [1]. According to the Spanish "Instituto para la Diversificación y Ahorro de la Energía (IDAE)" report [2], space heating and sanitary hot water are responsible of 58% to 75% of the final energy consumption in flats and singlefamily houses in Spain, respectively. Single-family houses account for the biggest energy share supplied from renewable energy, which is close to 40% in the Mediterranean area. However, this is not enough to meet the 2050 EU objective, because 47% of the energy supply still comes from fossil fuels. The Energy Performance of Buildings Directive (EPBD) (2010/31/EU) [3] is the legislative framework "to achieve a high energy efficiency and decarbonize building stock by 2050". EPBD states that from 31 December 2020 all new edifications must be nearly zero-energy buildings (nZEB). These are "buildings with a

Background
Cogeneration, also known as combined heat and power system (CHP), shows the ability to decrease primary energy consumption and reduce greenhouse gas emissions due to the increase in building energy efficiency [6,7]. Thermal energy demand can be supplied by a heater or a boiler, but the use of the CHP technology could provide the same thermal energy consumption and a fraction or the whole electrical demand depending on the CHP technology used. CHP technologies must be easily scalable for low power ratios to make them suitable for residential applications. CHP systems for buildings can be classified depending on the rated thermal power as micro-(1-5 kW) and small-scale (≤50 kW) units [8]. Because CHP systems produce the energy at the point of use, they can be referred as decentralized energy sources [9]. This advantage of decentralized generation includes an improved energy efficiency, which means an optimized fuel utilization that results in decreased CO 2 emissions and primary energy consumption and a reduction in the national transmission losses, that account for 2%-11% of the losses in the European transmission network [10]. However, benefits of the distributed generation are only achievable if there is a proper energy management between generation and consumption [10]. Proper management would require of an energy storage system. Electrical energy storage (EES) improves the self-consumption ratio for small CHP units [11] and thermal energy storage (TES) eliminates system oversize and also optimizes the use of produced energy [12]. All the CHP units considered in this paper will integrate both EES and TES systems. Figure 1 shows the different CHP technologies suitable to be installed in a residential building [13]. The zones have been delimited using the technical parameters obtained from the "Cogen Challenge Project" document [14], where micro-scale and small-scale cogeneration technologies are analyzed. Each technology is represented as a colored fuzzy area, delimited by four straight lines, two thick solid lines and two dotted ones. Thermal/electrical efficiency is indicated in the vertical axis and thermal/electrical rated power in the horizontal one. The represented surface covers the power range for the applicability in buildings, from single-family houses to blocks of apartments. The figure can be read as follows. Solid lines represent two possible CHP configurations in each technology. The right-side solid line of each area indicates the most common or typical "small-scale" unit of the technology and the left-side one corresponds to the smallest CHP unit possible as indicated in [14]. Solid lines can be understood as an operating point of the real CHP unit, where the upper extreme of the line is for the CHP unit thermal characteristic and the lower one corresponds to the electrical one. For example, the solid line of the right side in the blue area means the "typical smallscale gas turbine CHP unit" as stated in [14], which means a rated electrical power of 250 kW and around 330 kW for its rated thermal power. The corresponding conversion efficiencies, around 30% and 40% for the electrical and thermal energies respectively, are read in the vertical axis. On the left side of the same fuzzy area, the electrical and thermal rated power of the smallest gas turbine CHP unit analyzed are 30 kW (26%) and 50 kW (47%), respectively. Both units are connected with the dotted lines that create the fuzzy area, which can be considered as an operational chart for the technology in the small-scale use. In other words, this area can be understood as the operating range for each technology. According to Figure 1 the following conclusions can be extracted:

•
Stirling CHP technology is suitable for any kind of fuel. Its performance is similar to that of a boiler due to its high thermal energy conversion efficiency with the additional benefit of the electrical production that can compensate some of the building intakes. Nevertheless, the heat-to-power (HtP) ratio, which is an important selection parameter [15], is too high for residential uses meaning that the energy production is unbalanced with respect to the thermal energy demand. Stirling technology is included in Figure 1 chart due to its scientific interest, but it is not going to be considered in the present analysis. • Gas turbine and internal combustion engine (Gas ICE) are mature technologies that can be scaled from small to large sizes. Both can consume natural gas, which is a fuel widely available in the residential building sector, but its consumption should be minimized due to environmental constraints. The use of pure hydrogen into ICEs and turbines has several technical problems that is now under research and still need to be improved [16]. In this paper both options are going to be analyzed.

•
Fuel cell-based CHP (FC-CHP) is the most promising technology due to its balanced heat-to-power ratio, better adapted to the residential building energy profiles, which are more electricity demanding [17]. Fuel cell presents the highest electrical conversion efficiency. Fuel cells are easily scaled from few watts or kilowatts to hundreds of kilowatts keeping a constant energy conversion efficiency when they are fueled from pure hydrogen [18][19][20][21]. When this pure hydrogen comes from a green production process, the energy obtained can also be considered as green or carbon-free.
FC-CHP are classified as a function of the fuel cell technology used in the power unit. The most common technologies in commercial units are based on polymer exchange membrane fuel cells (PEMFC), The most successful examples of these systems can be found in Japan and Europe [22,23]. PEMFC can be classified into low-(up to 80 • C) and hightemperature (from 120 • C to 180 • C) devices. They only differ in the working temperature required by the polymer used as solid electrolyte membrane. Low-temperature PEM fuel cell-based CHP systems are the most common. In this paper both PEM technologies are considered, paying special attention to a high-temperature PEM fuel cell-based micro-CHP system specifically conceived in the framework of the MICAPEM project that is been integrated into an existent nearly-zero energy house, developed and built for the international Solar Decathlon 2012 contest [24,25]. The use of high-temperature PEMFC is promising due to the improved chemical kinetics in the electrodes, better tolerance to CO impurities in the fuel, simplification of the water management because it is produced in vapor phase and simpler and compact heat recovery system because of the higher enthalpy of the thermal energy [26,27]. A majority of the significant studies in the literature involving a high-temperature PEM fuel cell-based CHP system are theoretical works [28][29][30][31] Only one report on tests in an experimental facility has been found [32].
The objective of this research paper is to expose, using numerical simulations, how fuel cell-based CHP systems can drive a potential reduction of primary energy consumption and CO 2 emissions in the building sector. Numerical simulations are performed using preliminary results from the characterization of the high-temperature PEM fuel cell prototype built and tested to be installed in a demonstrative scale CHP facility. Once installed, the CHP technology will be evaluated and a novel oil-based refrigeration system for HT-PEMFC will also be tested, as explained in Section 3.3. In the same project framework, a hydrogen electrolyzer integrated with the solar system is also being installed to link with the green hydrogen source requirement objective.

Methods and Materials
Numerical simulations were performed using the electrical and gas energy consumptions from four real dwellings in the east coast (Mediterranean area) of Spain. Weather in this region can be classified as a "Csa climate" with hot, dry summers and cool, wet winters, according to Köppen climate international classification [33].
Using the information from actual energy invoices, four daily consumption datasets have been created. Four 10-apartment building consumption profiles were determined considering simultaneously factors from the single dwelling datasets. The selected dwellings are described as follows: Data obtained from the gas and electrical utility invoices are one-month aggregated information that must be statistically treated to create the useful datasets to simulate the daily energy demand of the users. The numerical treatment has consisted of normal randomized daily energy consumption estimation using the daily seasonal average consumption values and its seasonal data standard deviation ( Figure 2). This process was applied to both energy invoices (electricity and gas), taking the billing date into account to correct the consumption data of the different energy suppliers. The results of the treatment of the numerical data can be observed in Figure 3, where the vertical axis is the daily electrical consumption and the horizontal one represents the daily thermal energy one. Darker dots are the daily consumption calculated from the utility invoices and the "x" markers are the randomized values obtained from the numerical treatment. Electrical and thermal data in Figure 3 are correlated values, where two main tendencies can be observed. Dwellings with gas-powered heating facilities (Id 1 and Id 3) show a greater thermal energy demand for heating seasons. This results in two different "x-clouds": one energy demand cloud at the right-top side of the chart (Id 1: from 30 to 50 kWh th. , Id 3: from 15 to 30kWh th. ), where the heating demand can be detected; and a second cloud below 15 kWh th. that is overlapped with the two less-thermal demanding dwellings (Id 2 and Id 4). In the case of dwellings Id 2 and Id 4, the seasonal variation is notorious in the vertical axis due to the increase in the electrical energy demand during the heating season caused by the use of electrical heaters. When the thermal demand is limited to hot water, the energy consumption is function of the number of inhabitants as can be observed for the daily energy thermal values for Id 2 and Id 4, respectively. Heat-to-power (HtP) is calculated as the thermal demand over the electrical demand. This ratio is a season-dependent value, and normally a year-based calculation is provided. The results obtained with the datasets sorted in decreasing order are 3.4 (Id 1), 2.3 (Id 3), 1.5 (Id 2) and 0.7 (Id 4).
Considering each dwelling dataset, four 10-dwelling buildings were created using a randomized factor to simulate a centralized CHP. Heat-to-power ratios for the building datasets are similar in value and order.

Simulation Algorithm
Cogeneration facilities are designed to supply the user's thermal energy demand and to provide electricity as a secondary energy source [15]. Industrial-scale CHPs use the heat directly, but residential-scale CHPs require a thermal energy storage system (TES) to manage the energy demand avoiding system oversizing [12,34]. Because of this, two simplifications have been assumed for the simulation analysis. The first simplification is that thermal energy demand is supplied daily from a thermal energy buffer (Figure 4), that can be charged with the CHP unit and discharged by the user without any time dependence. The second simplification is that the electrical energy is also managed using an electrical energy storage system (EES) with the suitable capacity to manage the daily consumption. EES ensures the generation-consumption correlation [24]. Electrical energy surplus is daily exported to the electrical grid.   Figure 4 shows the functioning block diagram of the CHP system for the simulation algorithm programmed in a Python [35] script that is graphically described in Figure 5. The code is used to evaluate a day-by-day energy balance from the user dataset for each individual dwelling and the 10-dwelling buildings. The calculation process starts with the evaluation of the total time that the CHP requires to produce the daily thermal demand, which will depend on the rated thermal power of the CHP technology used. This time can be calculated with the equation: where Q D is the daily thermal energy demand, . Q CHP is the rated CHP thermal power and η Q the thermal efficiency of the energy conversions required to feed the demand. Energy conversions are due to the energy extraction process of the thermal energy from the buffer used to match the energy production and demand ( Figure 4). The same efficiency (85%) is considered for all the CHP technologies. The result of Equation (1) is the time that the CHP requires to produce the daily thermal energy, where two different situations can occur. If the total time calculated is lower than 24 h, the CHP technology is capable to provide the entire daily thermal demand and no back-up energy system will be required. In case of a CHP technology that is not suitably sized the total estimated time can be greater than 24 h, and the maximum achievable energy will be the obtained from the CHP unit working at the rated power the entire day. In this case, it is considered that the shortage of thermal energy will be compensated by a back-up system, e.g., a boiler, using natural gas as fuel.
The fuel consumption to produce the thermal energy with the CHP can be determined as: where Q CHP stands for the thermal energy produced by the CHP unit, and η Q CHP is the energy performance for the thermal energy flow in the CHP system. The back-up energy (Q backup ) equals the lack of thermal energy because the value comes from the boiler consumption as can be read in Figure 5.
The electrical energy produced with the CHP unit depends on the CHP gas consumption and the electrical efficiency of the unit, η W CHP , as: where η W is additional electrical efficiency due to the energy conversions. The electrical energy produced will be used to provide the daily electrical energy demand (W D ). The electrical energy balance is determined as: Attending to the sign value reported from this equation, electrical energy will be imported from the grid when it is negative and exported or sold to the grid if it is positive.

Primary Energy Factors
Primary energy (PE) is a concept used to compare different kinds of energy sources, but the scale used in the calculations is relevant [4,36]. In this research, the primary energy factors published by the Spanish Government in 2016 [37] are used to determine the building performance required for legalization. Corresponding values are summarized in Table 1 for both utilities considered, namely, the national electrical grid and the natural gas supply facility. The PE factor depends on the energy carrier and relates the primary energy consumed to provide one kWh to the end-user, in this case the final energy consumed by the residential users. PE factors are also divided into renewable and non-renewable. As can be observed in Table 1, renewable factors are smaller that non-renewable ones, but they are values above zero. This means that a certain amount of energy is required to serve the renewable source, i.e., maintenance tasks. Not only the PE, but also the CO 2 emissions will be compared to determine the benefits of the cogeneration technologies. The PE reductions are measured from the initial situation, and they can be evaluated using the equation: where f PE stands for the primary energy factor (subscripts g and e represent gas and electricity, respectively), Q D is the total thermal energy demanded and W D stands for the total electrical energy. The PE consumption with the use of a CHP system will depend on the technology. A general case is shown in Equation (6): where exported energy (W Exp ) is considered as a primary energy decrement due to its decreasing effect in primary energy consumption. When hydrogen or any other fuel obtained from renewable energy sources is used, the gas terms (Q fuel and Q backup ) in Equation (6) can be neglected. Carbon emissions can be calculated using the same equations, just replacing the primary energy factors with the CO 2 emission factor (f CO 2 ).

Fuel Cell Stack and Its Cooling System Design
The power unit of the CHP in the present research consists of a prototype of hightemperature PEM fuel cell and its novel cooling system that were designed and developed specifically for this project. The 40-cells high-temperature PEM fuel cell stack (HT-PEMFC) is formed by 41 JP-945 graphite bipolar plates 280 mm high × 195 mm wide × 5 mm thick manufactured by Mersen, as well as two stainless steel end plates where all the connectors for the reactant gases, H 2 and O 2 /air, are placed. The flowfield geometry in both anode and cathode sides consisted of straight parallel channels with a land-to-channel ratio of 1, as recommended by the MEA manufacturer. The anode side was formed by 47 channels 1 mm wide, 1.5 mm deep, and a total length of 210 mm, while the cathode side is formed by 87 channels with a width of 1 mm and a depth of 2 mm, and a total length of 120 mm. With this design, pressure losses were minimized to 5.87 Pa in the anode and 2.6 Pa in the cathode, ensuring both the homogenous distribution of the reactant gases over the electrodes and the correct water management. Commercial high-temperature membrane-electrode assemblies (MEAs) G1018 Dapozol-110, manufactured by Danish Power System (DPS) with a rectangular active area of 163.5 cm 2 , were used [38]. The MEAs are formed by phosphoric acid doped PBI polymeric membranes, with a nominal thickness of 650 ± 50 μm, gas diffusion layers of non-woven carbon paper and a platinum load of 1.5 mg cm −2 in both electrodes. The nominal thickness of the electrodes is 250 μm, including the GDL, the microporous layer and the catalyst layer. To obtain the best results, a minimum compression rate of 13% is advised, as well as a recommended working temperature ranging from 150 • C to 180 • C. Figure 6a shows the manufactured prototype developed by the PEMFC research team from LIFTEC-CSIC in Zaragoza (Spain), which has an ample expertise in this field [39,40]. Figure 6b shows the electrical and thermal performance of the HT-PEMFC stack. The vertical axes represent the voltage (left axis and red curve) and the power (right axis and green curves), and the horizontal values are the current produced by the electrochemical device. Solid green line corresponds to the electrical power, and the dashed green line is the estimated thermal power. The fuel cell rated operating point is set in 1.6 kW and 1.9 kW for electrical and thermal power respectively, which ensures a long lifetime of the MEAs [41]. Despite this, the fuel cell is capable to achieve a maximum electrical and thermal power of 2.5 kW and 4.8 kW, respectively with excellent performance. Both operating points are considered in the primary energy analysis.
High-temperature PEM fuel cells work in a temperature range from 120 • C to 180 • C that has to be controlled to avoid fast degradation. Figure 6c shows the manufactured novel cooling system specially designed to preheat the stack before starting, and to maintain the required temperature during the HT-PEMFC operation. The novelty of the system is the use of an isothermal oil bath with a dielectric oil that helps not only to keep the fuel cell temperature in the suitable range, but also as an energy buffer system extracting heat from the oil. Preliminary results show that for such system the heat extraction efficiency is higher than the value selected for the algorithm (85%), but no re-calculations have been performed with this higher efficiency.

Results
Simulations with the above discussed algorithm were performed using the datasets for single dwellings and 10-dwelling buildings. Five different CHPs were considered, which are summarized in Table 2, where "Gas ICE", "Gas turbine" and "Fuel cell" are the smallest CHP commercial units as shown in Figure 1, from [14]. "MICAPEM rated " and "MICAPEM max " is the fuel cell-based CHP system with the manufactured fuel cell operating at both rated and maximum power points, respectively. The simulations for single-dwellings and buildings used the same CHP unit characteristics from Table 2 to help in the results comparison. Calculations were performed considering three possible scenarios for the primary energy and carbon dioxide emissions reductions. These scenarios are classified as a function of the fuel used to power the CHP installation and the back-up heater, if it is necessary.

•
Natural gas scenario: In this case, all of the thermal systems, namely, CHP and backup heater, were fueled with natural gas. Gas ICE and gas turbine can use this fuel directly, but not the fuel cell-based systems, which require pure hydrogen. So, a natural gas reforming process was considered. The efficiency for such process depends on the gas volume managed, and it is fixed in 87% for the small-scale reforming system required in this study [42]. • Green gas scenario: In this scenario, all of the systems were powered with carbon-free fuels, like green hydrogen. Thus, hydrogen production did not require non-renewable primary energy consumption. In fact, today actual environmental impact of hydrogen production is not zero because the distribution infrastructure is not fully developed yet [43][44][45][46][47]. Nevertheless, in the present research it is considered as a carbon-free fuel because it is locally produced with a hydrogen electrolyzer included in the CHP infrastructure of the project. Same thermal and electrical efficiency was considered for gas ICE and gas turbine fueled with green source gas. • Expected scenario is the most probable situation. Here, natural gas is considered as the fuel for gas ICE, gas turbine, and backup heaters in all the cases, but the fuel cell-based power system is fueled with pure green hydrogen.
Results are graphically displayed in

Primary Energy Consumption
Final primary energy (PE) consumption is calculated according to Equation (6) where the exported electricity has a positive effect because of the decrease in PE consumption (negative in the equation). Figure 7 groups the graphs with the simulation results for the PE reduction in the vertical axis as the percentage value of the PE consumed with the CHP operative over the PE consumption calculated for the dataset (without an operative CHP installation). Figure 7a1,a2 resume the simulation results under the "Natural gas scenario" for single dwellings and 10-dwelling buildings, respectively. Similarly, Figure 7b1,b2 summarize the results for the same dwellings when the "green gas scenario" is simulated, while Figure 7c1,c2 correspond to the results for the "expected scenario".  (7) and (8). These plots are similar to PE reduction graphs due to the linear relationship between the two variables, but it should be noted the relative value in each scenario.

Cogeneration and Energy Demand Rates
The graphs on this section are independent of the scenarios because the energy balances depend on the consumption and the CHP parameters but not on the fuel. Figure 9a   In Figure 10a,b, the results for the relative electrical production over the electrical energy demanded are depicted. The plots show the capacity of the CHP system to meet the electrical energy demand of the consumers. Values above 100% mean that the system exceeds the electrical demand resulting in an energy surplus. Figure 11a,b show the percentage of thermal energy produced with the CHP against the thermal demand. When the system is well-sized the value is 100% because the entire thermal demand is met with the CHP production. When the system is under-sized, the thermal production has to be compensated with some thermal energy produced with the back-up boiler. There is not a thermal energy surplus because the system control was set to feed the thermal demand without exceeding it.
The use of CHP systems has to be economically viable. This viability depends not only on the facility cost, but also on the rate of use. Figure 12a,b show the percentage of the year-hour that each technology will operate in each dwelling and building respectively.
The time is calculated with Equation (1) as a function of the thermal demand and the production capacity of the CHP system. As can be observed in Figure 12a for the individual dwellings simulation, where the fuel-cell-based CHP systems present a higher duty cycle, the smaller the rated power, the higher the duty cycle. A similar behavior is observed in the results for the 10-dwelling building simulation (Figure 12b).

Discussion
The simulation results for the "natural gas scenario" show some interesting conclusions. In this scenario, natural gas is used as the only fuel for all CHP systems. Fuel cell-based technologies reform the gas to obtain pure hydrogen, which results in an additional gas consumption. Even so, the fuel cell-based CHP systems have a significant impact into PE reduction as can be observed in Figure 7a1,a2. It is noteworthy that the smallest fuel cell CHP ("1 kW e FC") system presents the greatest PE reductions for the 10-dwelling building simulations. PE consumptions are from ca. 50% for B-Id 1 to ca. 90% for B-Id 4. On the contrary, the same facility does not show such good behavior in the single dwelling simulation. This is due to the better efficiency of the back-up heater for the energy conversion of natural gas into heat. In other words, the "1 kW e FC" system used in the high-rise buildings means a longer operation time because of the lower proportion of heat demand fed from the CHP (see Figures 11b and 12b for operating time and thermal demand respectively). Thus, more energy from the back-up heater is needed to cover the heating demand and this means that lower energy from the natural gas is required. Even so, the use of the CHP decreases the consumed energy from the electrical grid, which benefits the PE reduction. This can also be observed in the CO 2 emissions in Figure 8a1,a2, where only fuel cell-based CHP systems show an effective greenhouse gases reduction because of the impact of the reduction in electrical energy importation. It is easy to see in Figure 7a2 that the higher the HtP ratio the better the PE reduction.
"MICAPEM rated " fuel cell CHP was designed according to a standard dwelling consumption, showing the best PE reduction in all scenarios. Focusing on the first scenario ( Figure 7a1) the PE consumption is around 80% for the user with the higher HtP ratio (Id 1) and around 90% for the lower HtP ratio (Id 4). However, CO 2 emissions are maintained because of the increment in natural gas consumption to meet the thermal demand (Figure 8a1). Electrical energy surplus achieves a maximum value, doubling the energy demand, as can be observed in Figure 9a. In the same Figure, Id 4 and B-Id 4 always import electricity from grid because the datasets are based on a high electrified user with a low HtP ratio, ca. 0.7.
The results for the "green gas scenario" are also interesting and as expected, the use of carbon-free fuel has a significant impact on the PE reduction in buildings. The higher the energy exported; the higher PE reduction is achieved. Main differences for fuel-cell-based systems in Figure 7b1,b2 are the PE reduction rate sign. On the one hand, in Figure 7b1 it is negative because the CHP unit is able to cover the entire thermal demand (see also Figure 11a) yielding an exported electrical energy surplus. On the other hand, 10-dwelling building results in Figure 7b2 show that the reduction is not so high because neither the thermal nor the electrical demand are fully covered by the CHP unit and despite the fact that green gas can be used in the backup heater, the electricity has to be imported from the commercial grid. Decreasing the energy importation rather than creating an energy surplus is the preferred situation for the actual electrical systems because energy consumers can be managed more easily than small energy producers (self-consumption without net balance). The case Id 4 is an exception not only in the carbon-free fuel scenario, but also in the other ones, because it is a highly electrified consumer with a low thermal energy demand. In fact, this means that the total operation time of the units is lower than others, so electricity has to be imported. Nevertheless, the PE reduction is significant for Id 4 due to the cogeneration.
The "expected scenario" is the most probable scenario, where only hydrogen is used to power the fuel cell-based CHP systems and natural gas for back-up heaters and the other CHP technologies. This means that the fuel consumption term in Equation (6) can be neglected for fuel cell-based system exclusively. Figure 7c1 shows that the most powerful thermal CHP units ("gas ICE" and "gas turbine") result in a worst PE reduction for all dwellings due to the low operating time (see Figure 12a) and, consequently, the lowest electrical energy production (see Figure 9a). The negative value in the PE ratio for fuelcell-based CHP units is due to the electrical energy surplus. Figure 7a1 shows, again, an optimal design point in the "MICAPEM rated " characteristics. For the 10-dwelling buildings, the higher the power the higher the PE reduction due to the ability to provide the energy demands from a low consumption of carbon-free fuel for PE production. The contrary can be observed in Figure 7a2 for the "natural gas scenario", where a greater fuel consumption is penalized. Figure 8a1,a2 show the CO 2 reduction results for the "gas-fueled scenario" for both individual and building dwellings, respectively. The use of CHP in dwellings does not have a carbon emissions reduction due to the higher gas consumption because of the efficiency reduction compared to the use of a boiler. Nevertheless, the 10-dwelling building simulation shows that CO 2 emissions are lower for the fuel cell-based system due to the electrical generation and the increase in global efficiency. Similarly, in both the "green fuel scenario" and the "expected scenario", the reduction of CO 2 emission shows the same behavior compared to the PE reduction.
The size of the CHP system is an important design and a critical economical parameter. The size of the CHP is directly related to the ability to meet the energy demand, but indirectly related to the operation time (and the economic viability). Figure 11 shows the share of thermal energy demand produced with the CHP system and Figure 12 the share of operation hours per year. The total operating time for the smaller units of the "gas ICE" and the "gas turbine" CHP units applied to low thermal demand consumers like a single dwelling (Figure 12a), makes its use unviable (less than 5%-year hours). "Gas turbine" units still are unviable for typical buildings in Spain (less than 20%-year hours). Contrary, fuel cell-based technologies, due to their lower power appear to be a better solution for CHP systems in the building sector, ca. 80%-year hours in the best cases. The low thermal power is not a handicap because fuel-cell-based CHP systems are fully scalable.

Conclusions
When the primary energy (PE) consumption in Spanish buildings is calculated with the official factors summarized in Table 1, which depend on the energy carrier and its energy source, it was demonstrated that the electrical energy carrier is 1.6 times more demanding than the natural gas from non-renewable sources. Even so, there is a tendency to electrify the consumptions because it is an energy carrier that can be more easily decarbonized. Some industrial heating systems are electrified due to the availability of powerful transmission lines. Despite of this, building centralized heating systems are not normally electrified because of the limitations of electrical grids in the cities.
Fuel cell-based CHP systems are a good solution to provide the energy demand for heating and hot water in buildings, showing a decrease in both PE consumption and CO 2 emissions, even if the hydrogen is obtained from natural gas reforming. However, this PE reduction is directly related to the thermal energy conversion efficiency of the CHP and the boiler because in the best situation a 50% PE reduction can be achieved with an energy production of ca. 20% of thermal demand and ca. 50% of the electrical demand. When the fuel cell-based CHP systems are powered with carbon-free hydrogen, the PE reduction is higher when the system is able to meet a big share of the energy demand, which corresponds to a better fit of the heat-to-power ratio between production and demand. The use of micro-CHP units integrated into smart grids can help to reduce not only the thermal and electrical demand of the user but also the electrical demand from the nearby with the proper energy management.
The economic viability of fuel cell-based CHP units is similar to other technologies such as solar thermal systems that are projected to supply a maximum share of the thermal demand, ensuring the higher possible operating time. Based on the results of Figure 12, the optimal situation corresponds to centralized systems where the total operating time is above 80% of the year-hours and the thermal demand can be fully supplied.
Author Contributions: The first author, J.R., has taken lead on all the steps of the research and writing process. The rest of authors have contributed as follow: research methodology, F.S., A.L. and F.B.; simulation, V.G., L.D. and A.R.; validation, P.V., A.G.; writing-original draft preparation, F.S., A.L. and F.B.; supervision, F.S. and A.L.; writing-review and editing, F.S., A.L. and F.B. All authors have read and agreed to the published version of the manuscript.

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

Abbreviations CHP
Combined heat and power system EES Electrical energy storage system EPBD Energy Performance of Buildings Directive (2010/31/EU) HtP Heat-to-power energy ratio PE Primary energy PEMFC Polymer exchange membrane fuel cell TES Thermal energy storage system Variables CO CHP 2 CO 2 emissions from the combined heat and power unit (kg) f CO 2 CO 2 emissions conversion factor, kg of CO 2 per kWh of end-use energy f PE Primary energy conversion factor, kWh of primary energy per kWh of end-use energy . Q Rated thermal power of the combined heat and power unit (kW) Q backup Back-up heater energy flow (kWh) Q D Daily thermal energy demand (kWh) Q fuel Fuel energy flow in the combined heat and power unit (kWh) Q CHP Thermal energy produced by the combined heat and power unit (kWh) t Estimated daily operation time of the combined heat and power unit (h) W bal Electrical energy balance (kWh) W CHP Electrical energy produced by the combined heat and power unit (kWh) W D Daily electrical energy demand (kWh) W Exp Net electrical exported energy to the grid (kWh) W Imp Net electrical imported energy from the grid (kWh) η Q Thermal efficiency to supply the energy demand from the generation η Q CHP Thermal energy performance for the combined heat and power unit η W CHP Electrical energy performance for the combined heat and power unit η W Electrical efficiency to supply the demand from the generation Subscripts e electricity g gas