scieee AI-readable full text Open interactive document viewer

Hybrid power-heat microgrid solution using hydrogen as an energy vector for residential houses in Spain. A case study

Navas Herrera, Sergio Jesús; Cabello González, Gracia María; Pino Lucena, Francisco Javier

Abstract

In order to favor a transition to a renewable energy economy, it is necessary to study the possible permeation of renewable energy sources not only in the electric grid or industrial scale, but also in the small householding scale. One of the most interesting technologies available for this purpose is solar energy, since it is a mature technology that can be easily installed in every rooftop. Thus, a techno-economic assessment was carried out to evaluate the installation of a solar-based power-heat hybrid microgrid considering the use of hydrogen as an energy vector in a typical residential house in Spain. Lead-acid batteries plus the photovoltaic and solar thermal energy installation are complemented with a hydrogen system composed of an electrolyzer, two metal hydride bottles, and a fuel cell. A simulation tool has been generated using experimental models developed and validated with real equipment for each one of the electric microgrid component. Three operating modes were tested making use of this tool to better manage the energy consumed/produced and optimize the economic output of the facility. The results show that setting up a hydrogen-based microgrid in a residential house is unviable today, mainly due to the high cost of hydrogen generation and consumption equipment. If only solar energy is considered, the microgrid inversion (12.500 €) is recovered in ten years. On the other hand, selling the electricity output has almost no repercussions considering current electrical rates in Spain. Finally, while using an optimization algorithm to manage energy use, battery life-spam, and economic benefit slightly increase. However, this profit may not be enough to justify the use of a more complex control system. The results of this research will help users, renewable energy companies, investigators, and policymakers to better understand the different factors influencing the spread of renewable smart grids in households and propose solutions to address these.

Full text

Energy Conversion and Management 263 (2022) 115724 Available online 12 May 2022 0196-8904/© 2022 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/bync-nd/4.0/). Hybrid power-heat microgrid solution using hydrogen as an energy vector for residential houses in Spain. A case study Sergio J. Navas a , b , * , G.M. Cabello Gonz´ alez a , b , F.J. Pino b a AICIA- Thermal Engineering Group, Escuela T´ ecnica Superior de Ingeniería, Universidad de Sevilla, Camino de los Descubrimientos s/n, 41092 Sevilla, Spain b Dpto. de Ingeniería Energ´ etica, Escuela T´ ecnica Superior de Ingeniería, Universidad de Sevilla, Camino de los Descubrimientos s/n, 41092 Sevilla, Spain ARTICLE INFO Keywords: Smart grid Energy management Energy storage Modelling Simulation Green hydrogen Economic assessment ABSTRACT In order to favor a transition to a renewable energy economy, it is necessary to study the possible permeation of renewable energy sources not only in the electric grid or industrial scale, but also in the small householding scale. One of the most interesting technologies available for this purpose is solar energy, since it is a mature technology that can be easily installed in every rooftop. Thus, a techno-economic assessment was carried out to evaluate the installation of a solar-based power-heat hybrid microgrid considering the use of hydrogen as an energy vector in a typical residential house in Spain. Lead-acid batteries plus the photovoltaic and solar thermal energy installation are complemented with a hydrogen system composed of an electrolyzer, two metal hydride bottles, and a fuel cell. A simulation tool has been generated using experimental models developed and validated with real equipment for each one of the electric microgrid component. Three operating modes were tested making use of this tool to better manage the energy consumed/produced and optimize the economic output of the facility. The results show that setting up a hydrogen-based microgrid in a residential house is unviable today, mainly due to the high cost of hydrogen generation and consumption equipment. If only solar energy is considered, the microgrid inversion (12.500 € ) is recovered in ten years. On the other hand, selling the electricity output has almost no repercussions considering current electrical rates in Spain. Finally, while using an optimization algorithm to manage energy use, battery life-spam, and economic benefit slightly increase. However, this profit may not be enough to justify the use of a more complex control system. The results of this research will help users, renewable energy companies, investigators, and policymakers to better understand the different factors influencing the spread of renewable smart grids in households and propose solutions to address these. 1. Introduction The continuous rise in the electric bill along with the new energy transition policies towards renewable energies and the necessity of secure energy supply and reduce the energy dependence from external provenance have encouraged the use of renewable sources to cope not only with the electric, but also with the heat demand. Nowadays, more than 10% of the world’s population has no access to electricity, most of them in distant rural areas. The integration of renewable energy sources and storage systems into standalone microgrids is an environmentally friendly opportunity to provide electricity and thermal energy to remote isolated areas. In this sense, many countries are studding in a depth way the deployment of microgrid as an energy efficient and reliable power system for island communities [1,2]. Furthermore, in electrified areas, the inclusion and diversification of new local renewable energy sources contribute to a reduction in greenhouse gas emissions and a decrease in energy dependence. In developed countries, residential buildings account for approximately 30% of the energy demand [3]. This fact, together with the large amount of roof surface available (PV rooftop systems could cover up to 24% of the European electricity consumption) [4–7], makes this sector a key player when it comes to achieving greater penetration of renewable energy in the energy mix. In the industry, combined heat and power (CHP) microgrids have been shown to be successful in recovering wasted heat, increasing efficiency, and reducing pollutant gas emissions [8,9], but there are few studies that asses this issue for small household scale, and less that do it using only renewable energy. Some studies that evaluate the suitability of using a CHP microgrid for household or small rural applications contemplate the use of non-renewable energies such as diesel fuel or natural gas [10–13]. They concluded that hybridizing this kind of systems successfully cope with the household energy * Corresponding author. E-mail addresses: [email protected], [email protected] (S.J. Navas). Contents lists available at ScienceDirect Energy Conversion and Management journal homepage: www.elsevier.com/locate/enconman https://doi.org/10.1016/j.enconman.2022.115724 Received 7 March 2022; Received in revised form 21 April 2022; Accepted 4 May 2022 Energy Conversion and Management 263 (2022) 115724 2 demand contributing to the penetration of renewable energy and reducing dependence from the main grid, reducing energy waste and enabling the share of solar PV to be expanded without the use of large storage systems. Nevertheless, the goal of this study is to go a step further and consider only renewable options, using technologies that are well established in the market in order to cope with electricity and domestic hot water demand in an urban household. Because of that, a combination of photovoltaic and thermal solar energy has been chosen for this study, as among all the possible renewable technologies that can be used to cope with thermal and electrical supply based on renewable energy, solar technologies are the most mature, existing solutions in the market with increasingly competitive prizes. Also, studies have shown that inclusion in the grid of other renewable systems such as wind turbines [14] and biomass [15] is not as cost-effective as solutions that include only solar systems and batteries. As an example, Murty and Kumar [16] found that, for a standalone microgrid in India, the most economical configuration was a PV +battery system. On the other hand, Mohammadi et al. [17] used HOMER software and an hourly and average monthly load to investigate the best combination of PV +wind turbines +battery units for meeting the 95–100% of the demand. They found that the ratio of power generation to the investment cost of PV is better when compared to wind turbines, so it is better to always use photovoltaics instead of wind turbines even when it requires expensive systems like battery banks. Also, Pradhan et al. [15] study concludes that although biomass systems are suitable for remote off grid households, their operating cost and maintenance make them unviable from an economic point of view when compared with on-grid cases. Solar thermal installations have been proved to be an ecological promising technique to supply hot water for residential heating and other purposes [18–20]. Recently, Koˇ sican et al. [19] simulated different solar household water heating systems in Slovakia looking for the most efficient alternative from an economical, energetic and environmental point of view. In their case study, the conversion of a traditional gas boiler into a solar system installation proved to bring significant economical savings (up to 250 euro/month) with a pay-back period under 7 years with reasonable impacts on the environment. Lamnatou et al. [21] conducted a study evaluating the sustainability of this kind of systems finding that involving recycling material such as steel and copper in their construction translates into an outstanding reduction in their environmental impact. An interesting alternative was proposed by other authors that make use of, instead two separated solar systems, one for electricity and the other one for heat, PVT collectors, which are PV cells placed on a heat exchanger, covering in one system both purposes. For example, Herrando and Markides [22] considered the use of a hybrid PVT system for domestic heat-power applications. They found that, in the UK case, the combination of a thermal solar system with a PV had a better performance than considering only the PV in terms of covering the combined household energy demand. From a sensitivity analysis, they found that high covering factors (80 to 100%) and low cooling flow rates (20 to 80 l/h) were recommended as a tradeoff that can enhance the electrical and hot water outputs, covering the 51% of the household’s electrical demand and 36% of the hot water demand. The payback period of the installation was estimated to be 11 years. On the other hand, Pardo et al. [23] used TRNSYS simulations for a building (37 inhabitants) configuration in hourly steps along one year. The proposed system, located in Nomenclature α Power temperature coefficient η MPPT Maximum power point tracker efficiency ( τα )Transmittance-absorptance product θD Angle of incidence direct solar radiation θd Angle of incidence diffuse solar radiation A Collector area A i External area of inlet pipes An External area of zone “n” A o External area of outlet pipes A ST Heat exchange area of the storage tank C ( τα )Heat loss correction factor C A Number of collectors in series correction factor Ci Capacitor of “i” element of the equivalent circuit C M Flow correction factor C p Specific heat C x Energy cost of the “x” element C UL Heat loss correction factor CAN Controlled Area Network CF Number of cycles to failure CPH Combined heat and power F PV Derating factor F R Heat removal factor G Specific mass flow G t PV Incident solar radiation G tSTC PV Incident solar radiation under standar operating condition GC pi Specific heat capacity for the mass flow of the installation GC pe Specific heat capacity for the mass flow of the test i Current I Solar radiation I d Diffuse solar radiation Inv Investment cost of the batteries I D Direct solar radiation k Thermal conductivity K m Temperature correction factor mi nx Inlet mass flow from zone “n” to zone “x” mn Total mass of zone “n” mo nx Outlet mass flow from zone “n” to zone “x” M Mass flow through the pipes n Number of pannels OPC Ole Process Control P x Power produced/consumed by “x” PLC Programmable Logic Controller PV Photovoltaic field PVT Photovoltaic +thermal field Q Hydrogen flow rate Q u Useful energy Ri Resistance of “i” element of the equivalent circuit SOC State of Charge t Time T amb Ambient temperature T C,STC Temperature of the cell at standard operating condition T fe Fluid inlet temperature T fs Fluid outlet temperature Ty Temperature of zone “y” T ONC Temperature of the cell at nominal operating condition T s Sample time U Thermal transmittance U L Global loss coefficient U t Overall heat transfer coefficient Vi Voltage of “i” element of the equivalent circuit Voc Open Circuit Voltage xy Height of zone “y” Y PV Power under standar operating condition Zy Zone “y” of the storage tank S.J. Navas et al. Energy Conversion and Management 263 (2022) 115724 3 central Europe, needed external support from October to February to cover the demand. From March, the PVT system covers the entire hot water demand of the building and start to have more importance in the electricity one. The system was not profitable without external incentive because of the restrictions to feed heat into the district heating system, forcing the building to rely on thermal storage which implies substantial heat losses. Anyway, overall, the PVT system produced 34% of the heat and 55% of the electricity demand of the building occupying just the 50% of the roof space and proving that it is a technologically viable way with a huge potential, especially in those regions with higher solar irradiance. Those systems are interesting in the way of making a better use of the roof space, but its efficiency and commercial availability is still far from conventional solar systems. Due to the fact that they are very compact equipment, this type of combined PVT system has been evaluated even integrated into prefabricated housing units with optimal results and payback periods below 9 years [24]. The use of hydrogen storage systems through electrolyzers, hydrogen tanks, and fuel cells is a promising solution in terms of robustness, flexibility, efficiency, and energy density as an alternative to traditional storage systems. It can be used as long-term or seasonal energy storage, accumulating hydrogen when the excess of renewable energy is high, storing it in a safe way, and turning it into energy those months when there is a renewable energy shortage. However, this technology is still in early development and new studies and demonstration projects are necessary since, nowadays, it seems that its inclusion in smart grids is not yet profitable [25]. No matter what, hydrogen has been established as a viable solution for remote applications in Canada [26,27] and Australia [28,29] and governments around the world are encouraging the green hydrogen generation as the energy vector of the future. A combination of electrolizer +H 2 tanks +fuel cell along with a PV + battery system was deeply studied by Eriksson and Gray from a technical, economic, environmental, and sociopolitical point of view [30]. They concluded that hydrogen technologies had some drawback for this kind of application since an adequate energy surplus must be ready for use to run the electrolyzer, and, the fuel cell, if incorrectly sized, rely too much on generators. Besides, this yet immature technology increases the price of the project in an unprofitable way unless government funding is considered. On a higher scale, Gercek et al. [31,32] evaluated the installation of a smart grid powered with solar photovoltaic energy and heat pumps on a 20-household residential. They found that residential homes had a selfsufficiency of 41% over the year and every household reduced their electricity bill. This reduction was directly related to the household size and human behavioral changes from one house to another. Different operational strategies can be assessed making use of the same microgrid structure, but looking for different objectives such as simply satisfying the power-heat demand or, on the other hand, optimizing the use of energy from the performance or the economic benefit point of view. In this way, better control and operation of this kind of hybrid system involves solving a complex function of climatic conditions, power-heat demands, equipment degradation, tariff periods, and some other factors. In this case, the life of some devices is very sensitive to the way they are operated. For example, battery life-spam depends not only on the number of charge–discharge cycles, but also on the depth of the discharges, so the equipment operation management has an impact on the economy of the whole process. In this sense, several studies [33–36] have shown that a good energy management strategy is the key to the correct and optimized use of this type of systems. This study aims to investigate the potential of using a combination of photovoltaic energy and thermal solar energy on a residential scale to contribute to the penetration of renewable energy in the edification sector in Spain. The goal of this paper is to study the technical and economic viability of covering the electricity and hot water demand of a house with three inhabitants with a renewable system, including solar energy as energy source and batteries and hydrogen technologies for energy storage. In this sense, the novelty and main contributions of this work to the research field are highlighted in the following bullet points: •Instant power demand consideration instead of hourly energy demand. None of the studies found in the literature present a demand per second, instead they use average values in an interval between 30 min and a whole month. This small step of time considered allows us to guarantee the coverage of the instant power demand, to observe how the transient of the different equipment affects the operation of the microgrid, and to evaluate the depth of the discharge of the battery to estimate its degradation. •The contemplation of not only the electric, but also the hot water demand. In Spain, more of the household makes use of electric, natural gas, or butane water heaters to cover their hot water needs, while, on the other hand, the heating system are usually independent elements (stoves, radiators, heat pumps, and so on). That way, hot water is mainly used in showers and not for heating the buildings. In this sense, this study aims to cope with all the electrical and thermal consumption of a living place, since most of the studies found in the literature on microgrids focus only on the electric part. •Inclusion of hydrogen technologies on this scale. Hydrogen technologies are receiving a lot of attention lately and are presented as good candidates for seasonal energy storage as a result of the high energy density hydrogen has. Several macro projects are rising nowadays around the world, but there are few studies that consider this technology for small scale, and fewer that use it for conventional household., so more investigations in this scale and this field of application are needed. •The use of a tool that makes use of models developed and tested in a real experimental installation. A flexible simulation tool has been developed in the framework of this study. This tool allows to observe the behavior of the installation second by second and not hourly, as is the case with most microgrid simulation tools, incorporating models that have been tested in different conditions with real commercial equipment and considering their transient response. This work is structured as follows. First, a brief introduction sets the reader in context and clearly explains the goal and novelty of the study. Then, in Section 2, the methodology is explained, including a description of the experimental microgrid used to obtain the different models defined next. Also, the simulation system developed and the methodology used to run the simulations are described. The paper follows explaining the results obtained from the different simulation and operation modes in Section 3 to end with a last section including the main conclusions of the study. 2. Methodology 2.1. Experimental setup The facility used for the experiments is a versatile microgrid that allows research on the integration of renewable energy with hydrogen vector under the microgrid concept (Fig. 1a) [34,37–41]. The entire system is supervised by a programmable logic controller (PLC), being Controlled Area Network (CAN), Modbus and Ole Process Control (OPC) the systems used for the communication. Finally, a control computer has been installed in order to implement advanced controllers through a Matlab-Simulink® environment. The experimental installation (Fig. 1b) includes a photovoltaic (PV) solar field of 4 kWp; a solar thermal system composed of 2 collectors of 2.53 m 2 and a 300 l storage tank with a 2.5 kW auxiliary resistor for hot water production; a lead-acid battery stack (24 Classic EnerSol cells of 1110 Ah with a nominal voltage of 48 V) as an electric storage system; an electrolyzer of 2.6 kW with a production of 500 l/h of hydrogen at 30 bar; a Heliocentris fuel cell of 1.5 kW; and a metal hydride storage system of 14 Nm 3 . Besides, to simulate the connection to the grid or an alternative power source, the facility includes a POWERBOX LBX 6 kW S.J. Navas et al. Energy Conversion and Management 263 (2022) 115724 4 (0–60 V / 0–100 A) electronic power source. Finally, the electric demand is simulated with an AMREL PLA 2.5 kW (0–60 V/0–1000 A) electronic load. This same equipment will be the one included in the simulation as the different component of the microgrid proposed for the household. 2.2. Model description This subsection describes the models of the microgrid components used in the simulations. All electric component models have been validated with real data obtained from the microgrid above described. 2.2.1. PV field The photovoltaic field has been modelled using a static model based on parameters [42] where the power produced (P PV ) is given by Equation (1): PPV =n⋅ η MPPT [YPV FPV Gt Gt,STC (1+ α ((Tamb +Gt TONC −20 800 )−Tc,STC ))] (1) Being n the number of panels; η MPPT the maximum power point tracker (MPPT) charge regulator efficiency; Y PV the output power under standard operating conditions (265 kW); F PV the derating factor (0.69 experimentally obtained); G t the incident solar radiation in the photovoltaic solar array (kW/m 2 ) measured with the meteorological station; G t,STC the incident radiation under standard operating conditions (1 kW/ m 2 ); α the power temperature coefficient (-0.0043 /◦C); T amb is the ambient temperature and T ONC is the temperature in the nominal operating conditions of the cell (20 ◦C and 800 W/m 2 ); and T C,STC the temperature of the photovoltaic solar cell under standard operating conditions (25 ◦C). 2.2.2. Solar thermal field The solar thermal field has been modeled with a static model based on parameters [43], where the useful energy Qu depends on the heat removal factor (FR), the fluid inlet temperature (Tfe), the global loss coefficient UL, and the transmittance-absorptance product ( τα ), according to equation (2), where I is the solar radiation value, A is the collector reference area, and T fs and Tamb are the fluid outlet and ambient temperature, respectively. Qu=IAFR( τα ) − FRUL(Tfe −Tamb)=MCp(Tfs −Tfe)(2) The parameters FR( τα )and FRUL (F R ( τα ) of 0.696 and F R U L of 5.421 W/m 2 ⋅K) are obtained from the parameters of the yield curve provided by the manufacturer (a 0n , a 1 y a 2 ) through Equations (3) to (11), were Km is the temperature correction factor, CM the flow correction factor CA the number of collectors in series correction factor and C( τα )and CUL the heat loss correction factor. FR( τα ) = KmCMCAC( τα )a0n(3) FRUL=KmCMCACUL(a1+a2*40)(4) Km=(1−FRUL 2GCp)−1 (5) CM= GCpi(1−exp(−F’UL GCpi )) GCpe(1−exp(−F’UL GCpe ))(6) F’UL= − GCpeln(1−FRUL GCpe )(7) CA=1− (1−K)N NK (8) K=FRUL GCpi (9) Fig. 1. Block diagram of the solar hybrid system considered (a) and micro-grid of the Thermal Engineering group (b and c). S.J. Navas et al. Energy Conversion and Management 263 (2022) 115724 5 C( τα )=1 1+UtAo MCp (10) CUL =1−UtAi MCp+Ut(Ai+Ao) AFRUL 1+UtAo MCp (11) being Cp the specific heat, G the specific mass flow of the installation (0.02 kg/s⋅m 2 ), GCpi and GCpe the specific heat capacity for the mass flow of the installation and the test, respectively, Ut the overall heat transfer coefficient of the pipes, M the mass flow through the pipes, Ai and Ao the external areas of the field inlet and outlet pipes, and A is the collector area. Finally, it is necessary to correct the solar radiation value as a function of the angle of incidence. In this way, the irradiance is calculated following Equations (12) to (14): I=KDID+KdId(12) KD=1−b0(1 Cos(θD)−1)(13) Kd=1−b0(1 Cos(θd)−1)(14) where θD and θd are the angle of incidence of direct and diffuse (whose value can be assumed to be constant and equal to 60◦) solar radiation respectively, b0 is a parameter obtained from the value of KD supplied by Fig. 1. (continued). S.J. Navas et al. Energy Conversion and Management 263 (2022) 115724 6 the manufacturer for an angle of incidence of 50◦, and I D and I d are direct and diffuse solar radiation respectively. 2.2.3. Hot water storage tank The 300 l hot water storage tank (Fig. 2) was divided into 5 areas of different volumes: water inlet (Z1), heating coil (Z2), middle (Z3), electric resistor (Z4) and water outlet (Z5). Each part is modelled according to the mass and heat balance between itself and the contiguous part. For example, the middle area was modelled using Equations (15) to (19): - Mass balance mi23 =mo23 (15) mo34 =mi23 + ∂ m3/ ∂ t(16) mi43 =mo43 (17) mo32 =mi43 (18) where mi 23 is the mass flow from Z2 to Z3, mo 34 is the mass flow from Z3 to Z4, mi 43 is the mass flow from Z4 to Z3, mo 32 is the mass flow from Z3 to Z2, and m 3 is the total mass of Z3. - Heat balance m3⋅cp⋅ ∂ T3/ ∂ t=mi23⋅cp⋅T2+mi43⋅cp⋅T4−mo34⋅cp⋅T3− where c p is the specific heat, T is the temperature of the different zones (Z2, Z3, and Z4 in this case), k is the thermal conductivity, A ST is the heat exchange area, x is the height of the corresponding zone, U is the thermal transmittance, A3 is the external area of the cylinder of Z3, and T amb is the ambient temperature. 2.2.4. Electrolyzer The electrolyzer has been modeled using real data obtained in operation within the microgrid. Equation (20) relates the flow of H 2 produced as a function of the power supplied. Q=0.2313⋅P+30.548 (20) where Q is the flow rate of H 2 in Nl/h and P is the power in W. Furthermore, a dead time of 60 s has been considered between when the power set point change occurs, and that value is reached. 2.2.5. Fuel cell The fuel cell together with its associated converter has also been modeled using real data obtained in operation within the microgrid. Equation (21) relates the flow of H 2 consumed as a function of the power demanded. Q=0.0115⋅P−0.1716 (21) where Q is the H 2 flow rate in Nl/min and P is the power in W. For the dynamic part of the model, a first-order model with a gain of 1 and a time constant of 78 s. 2.2.6. Metal hydride storage tanks The two metal hydride tanks for the storage of the produced H 2 have been modelled using Equation (22), SOCk=SOCk−1+(Q⋅Ts 14000)⋅100 (22) where SOC is the state of charge in %, Q is the H 2 flow rate in Nl/s, and T s is the sample time. 2.2.7. Lead-Acid batteries The lead-acid battery bank has been modeled after an equivalent electrical circuit (Equations (23) to (25)). This model allows knowing both the state of charge (SOC) and their voltage. The proposed equivalent electrical circuit consists of a resistance (R) in series with two other elements composed of a resistance in parallel with a capacitor (C), which results in a second-order model with two time constants. The model parameters depend on the battery SOC according to Equations (26) to (35). ˙v1= − 1 R1C1 v1+1 C1 ibat (23) ˙v2= − 1 R2C2 v2+1 C2 ibat (24) vbat =Voc −R0ic−v1c −v2c −R0id−v1d −v2d (25) R0C=0.00000461⋅SOC2−0.000565⋅SOC +0.0572 (26) R1C=0.00159⋅SOC +0.0308 (27) C1C= − 437.8⋅SOC +52255.15 (28) R2C=0.000366⋅SOC +0.00527 (29) C2C=4000 (30) R0d=0.00000455⋅SOC2−0.000587⋅SOC +0.0575 (31) R1d=0.041 (32) C1d= − 318.99⋅SOC +58903.29 (33) Fig. 2. Thermal storage tank schematic. −mo32⋅cp⋅T3+ (k⋅AST )/Δx3(T4−T3) − (k⋅AST )/Δx3(T3−T2) − UA3(T3−Tamb)(19) S.J. Navas et al. Energy Conversion and Management 263 (2022) 115724 7 R2d=0.000171⋅SOC +0.000858 (34) C2d=5500 (35) where V OC is the open circuit voltage, v 1 and v 2 are the voltage values of the corresponding RC element, R 1 C 1 and R 2 C 2 are a resistor and a capacitor that describe the short- and long-term transient behaviour, respectively, and i bat is the value of the current of the battery output, which is positive when discharging and negative when charging. In addition, subscripts c and d represent the charging and discharging processes, respectively. Besides, SOC and V OC correlate according to Equation (36). Voc =0.0494⋅SOC +45.883 (36) 2.2.8. Validation of the models The models of the microgrid’s electrical components have been experimentally validated using the equipment described in 2.1. As can be seen in Fig. 3, these components are the electrolyzer (top left), fuel cell (top right), PV (bottom left), and the lead acid batteries (bottom right). The fit of the model data to the experimentally measured results presents very low errors and therefore these models allow the precise simulation of the behaviour of the different equipment. 2.3. Operation modes This section describes the operation modes evaluated in this paper. Three different modes were developed with an increasing range of complexity. The first one (OP1) was based on a self-regulatory control that makes use of lead-acid batteries as an energy buffer. The second one (OP2) bases its control strategy on a series of heuristic rules, similar to the one proposed in Valverde et al. [38] for the part-load mode. Finally, the third one (OP3) makes use of an optimal controller to operate the microgrid with the aim of minimizing the economic cost. 2.3.1. Mode OP1 The microgrid selected for Mode OP1 is composed of a PV solar field for electricity demand, a thermal solar field with a thermal storage system for hot water supply, and lead-acid batteries as an electric storage system. The operation of the microgrid in this mode is as follows: the PV system provides the electric energy consumed by the household. In case of an energy surplus, this is sent to batteries that will store the excess of electricity until 95% of the state of charge (SOC). From this SOC value, the energy generated by the PV system may be sold to the grid. When there is an energy shortage due to the lack of the required solar radiation, the energy demand will be supplied by the batteries. If, at the end of the day, the SOC of the batteries is less than 35%, they will be charged from the grid during the cheap energy period until the SOC reaches a 50% or that period ends. At the same time, the solar thermal energy system produces and stores hot water until a temperature of 85 ◦C in Z5 is reached in the storage tank. In case that hot water temperature is below 50 ◦C, we have considered that the user will start an electric 2.5 kW resistor 50 min before the shower. In this way, the facility control strategy can be easily and inexpensively implemented in a real installation. 2.3.2. Mode OP2 The microgrid chosen for mode OP2 is the same as that used for mode OP1 with the addition of an electrolyzer, a fuel cell, and a metal hydride tank storage system. In this case, the operation of the facility is regulated by a heuristic controller based on the following rules: when there is solar radiation, the PV system provides the electric energy demanded by the house. If there is an energy surplus, it is sent to the batteries first until 95% of their state of charge (SOC). From that SOC value, the electricity produced by the PV system can be used in two different ways: (i) being used to produce hydrogen with the electrolyzer if the PV production is greater than 1.1 kW (the minimum operation point of the electrolyzer) and the SOC of metal hydrides storage tanks is less than 95%, or (ii) sold into the grid if the former requirements are not met. When solar energy is not enough to satisfy the electricity demand, it will be supplied first by batteries until they reach a 40% SOC. From that point, if the SOC of the metal hydride storage tanks is greater than 50%, the fuel cell starts producing 1 kW until a battery SOC of 50% is reached or the SOC of the metal hydrides drops to 40%. If the SOC of the batteries is under 35% when the cheap energy period starts, they will be charged from the grid until the SOC reaches 50% or that period ends. At the same time, the solar thermal energy system follows the same rules described in mode OP1. 0 100 200 300 400 500 600 500 1000 1500 2000 2500 )h/lN(wolfnegordyH Power (W) Electrolyzer 46 48 50 52 0.0 0.5 1.0 1.5 2.0 2.5 3.0 Voltage (V) Time (h) Battery V experimental V model 0.0 0.5 1.0 1.5 2.0 2.5 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9.0 9.1 )Wk(rewoP Time (h) PV P experimental P model 0 5 10 15 20 25 30 0.0 0.5 1.0 1.5 2.0 Hydrogen flow (l/min) Time (h) Fuel cell Experimental hydrogen flow Model hydrogen flow Fig. 3. Model results vs experimental data for the different models developed with the microgrid. S.J. Navas et al. Energy Conversion and Management 263 (2022) 115724 8 2.3.3. Mode OP3 The microgrid selected for Mode OP3 is the same as that used for Mode OP1. The reason why this mode does not contemplate the use of hydrogen will be discussed in Section 3. This mode of operation is the most complex of the three proposed, since it is based on the use of an optimization algorithm that minimizes a function objective. The objective function selected for this case is. J=Pgrid⋅t⋅Cgrid −Psale⋅t⋅Csale −Pbat⋅t⋅Cbat (38) Subject to. 0⩽Pgrid⩽3450W(39) 0≤Psale ≤PPV (40) wherePgrid, Psale and Pbat are the values of power purchased from the grid, sold to the grid, and sent/removed from the batteries, respectively. WhileCgrid,Csale, and Cbat are the costs of the energy purchased from the grid, sold to the grid and the use of batteries respectively. Finally, the value of t corresponds to the time in hours selected for the optimization step, in this case 10 s. The group of constraints sets the value of the variable Pgrid between 0 and the value of the power contracted to the grid, and the variable Psale between 0 and the value of the power produced by the photovoltaic field to prevent selling the energy stored in the batteries. The optimization algorithm selected for the simulations is the MATLAB “fmincon” function. This function will be executed every 10 s, and from the values of the input variables, which are the power produced by the photovoltaic field PPV and the power demanded Pdem, it will determine the value of the independent variables Pgrid and Psale that minimize the objective function. In this case, the variable Pbat is a dependent variable, since with the configuration of the microgrid used, the batteries always absorb surpluses/deficits of energy; therefore, the value of the variable Pbat is. Pbat =PPV +Pgrid −Pdem −Psale (41) The purchase and sale costs used in the objective function were obtained from the prices of a Spanish electric company. On the other hand, the cost of batteries has been estimated based on their investment cost and the durability model based on the remaining discharge cycles until failure [44], so that each time the batteries are charged, the value of the objective function decreases (representing the savings that will result from storing excess energy instead of selling it) and that each time they are discharged, the value of the objective function increases (due to degradation of the battery by the discharge cycle). Likewise, a desirable operating value of 60% SOC has been set for the batteries, so that, moving away from it results in a higher cost for discharging them or less savings for charging them, in such a way as to prevent the batteries from operating at their extreme values of SOC, and thus preventing excessive degradation. The cost of the batteries is calculated using equation (42). Cbat =(Inv/CF Ah )⋅(1+(λ⋅(60−SOC 100 ))) Vbat (42) where I nv is the investment cost of the batteries, CF is the number of cycles to failure (in this case a value of 8000 cycles was selected), Ah is the value of the depth of discharge in Ampere-hour corresponding to the number of cycles to failure selected (in this case 110 Ah, that is the 10% of the batteries capacity), V bat is the batteries voltage, and λ is a weight factor that penalizes the use of the batteries while the SOC is far away from the reference value of 60%. This factor may have different values for the charge and discharge processes. 2.4. Simulation system Simulations of the operating modes have been carried out with the Matlab-Simulink® simulation tool. A user-friendly masked system has been developed that interconnects the different microgrid subsystems. These subsystems are composed of circuits that correlate the different variables through a Matlab function, including the mathematical equations that govern each component. That way, the simulation tool developed could be easily changed to evaluate different microgrid configurations. The electricity demand consists of real data measured from a residential home for a whole week [45], in the form of power measurements per second. The hot water demand has been considered to be due to 3 showers of 5 min with a flow rate of 20 l/min and a temperature of 38 ◦C (this temperature is obtained by mixing the hot water with the cold water, which requires hot water to be at a temperature greater than or equal to 50 ◦C to guarantee that the mixing temperature of 38 ◦C can be reached at all times) carried out at different times of the day (7:00, 18:30, and 21:00). Climate data were those of a typical meteorological year (Meteonorm® software) in the province of Seville. The same procedure has been followed for the simulation of the three modes. A week has been selected for each month of the year, starting with the month of July, assuming that this month begins with the maximum values of SOC (which is verified to be a correct assumption after simulating the entire year) of the different storage systems corresponding to the simulated mode (batteries for all of them and metal hydrides only for mode OP2). The first step is to simulate the selected week of the corresponding month. If after the simulation of the week, the SOC values remain stable (with a difference of +/- 4%), it is assumed that the behavior of the month will be the same as that of the simulated week, and therefore the energy calculations bought/sold to the grid would be the result of multiplying by 4 those obtained with the simulation of that week. However, if the state of charge values varies from starting ones after the week’s simulation, simulations continue for that week until either the states of charge stabilize or 4 simulations have been performed for that month (see Fig. 4). This process is repeated for each month until a year is completed. Once the year has been simulated, the total energy purchased from the grid, as well as the energy sold to the grid, can be calculated. With these data, an economic study is carried out that allows determining when the return on investment occurs for each of the proposed modes of operation, using the electric bill data of a house without a microgrid as the base case. 2.5. Economic evaluation A tariff from a Spanish electricity distribution company has been chosen for the grid connected base case, considering three periods during the day: peak (0.24442 € /kWh), shoulder (0.15097 € /kWh), and valley (0.11644 € /kWh), and a contracted power of 5.75 kW, as 5 kW is the highest peak observed in the house demand profiles. On the other hand, for the first, second, and third case study, a lower power contracted is necessary because the main peaks of demand are met with the solar energy and the batteries, not with the grid, so a contracted power of 3.45 kW was considered. In this case, a defined for solar energy users’ tariff was chosen because it allows to sell energy into the grid. This tariff considers a regular (0.242028 € /kWh) and a cheap period (0.194955 € /kWh) and buy the output energy (0.051 € /kWh). Moreover, in Spain, there is a specific tax on electricity of 0.5% and a VAT of 10% that affects the entire bill. The inversion and installation cost of buying and installing the different equipment in the house has been considered as follows: electrolyzer 38,000 € , metal hydrides 16,000 € , fuel cell 11,200 € , lead-acid batteries 5500 € , photovoltaic solar field 5000 € and thermal solar field 2000 € . That way, the initial inversion for the first and the third case study rises to 12,500 € , while in the second case the necessary amount of money is 77,700 € . In this study, the fact that the electrolyzer and fuel cell should be replaced after a 10-year and 12-year period respectively with a cost of 50% over the initial investment, and the PV, solar thermal system and S.J. Navas et al. Energy Conversion and Management 263 (2022) 115724 9 metal hydrides after a 25-year period with full cost was considered. Therefore, the economic evaluation will be done for a 25-year period in order to consider all the component replacements. Battery replacement has also been considered, but in this case, instead of having a fixed replacement period, such as solar installations, its durability has been estimated using a degradation model [44] that takes into account the number of cycles and the depth of the discharge of batteries. These costs include maintenance and possible part substitution. This will be a worst- Fig. 4. Algorithm for the simulation of the operation modes. Fig. 5. Simulation result for a June day in Mode OP1 (June 9). S.J. Navas et al.