Study on the Implementation of a Solar Photovoltaic System with Self-Consumption in an Educational Building

: In this work, the study of different remuneration schemes for the implementation of a solar energy system on a building was performed. The photovoltaic system was implemented on a public educational building, and four different schemes are compared to understand the economic feasibility of self-consuming solar energy with and without a battery system, versus selling to the electricity grid. The system performance is compared to the building’s needs, and the different consumption and grid-injection shares are analyzed. Three of the schemes are applied according to the conditions and requirements of the Portuguese Law, while the remaining one is not yet allowed, and so the legislation from another chosen country is considered. Lastly, a ﬁnancial analysis was performed to evaluate and compare the feasibility of each project implementation. The results of this analysis show that both the non-legislated and legislated self-consumption schemes make for an attractive investment, and that savings resulting from the consumption of solar energy are much higher than the revenues from selling to the grid, which presents as the least attractive scheme. Finally, the battery implementation also does not show feasibility because the cost of technology is still too high, despite the reduction witnessed in recent years.


Introduction
The planet's population is using its natural resources at an extremely accelerated rate and this consumption is already leading to obvious environmental consequences. Mitigating and adapting to climate change are key challenges of the 21st century, and at the core of these challenges is the question of energy-more precisely, our overall energy consumption and our dependence on fossil fuels. To succeed in limiting global warming, the world urgently needs to use energy efficiently while embracing clean energy sources if we wish to see real changes in the near future.
According to data from the European Environment Agency, the residential and commercial sectors are the third biggest sector responsible for Greenhouse Gas (GHG) emissions, only behind the transport and industry sectors [1]. There have been continuous efforts to reduce these emissions by reducing consumption from fossil fuels in the sector, specifically by introducing renewables as one of (or the only) consumption source. This continuous and significant integration of Renewable Energy Sources (RES) has only been possible due to major kick-starting incentives and support policies created by governments. However, as the technologies become cost-competitive with fossil fuels, previous incentives are being lowered, and new approaches need to be employed to maintain the evolution of said technologies and reach the desired environmental goals.
Policy changes regarding RES have been essential for an increase of their share in worldwide energy generation. For photovoltaic (PV) systems especially the initial investment is a significant burden to the investor and even if the cost of technology has been decreasing significantly over the last years, the incentives coming from governments as a way to promote RES were incredibly important to "kickstart" their growth. The application of Feed-in Tariffs specifically showed the most effective promotion of wind and PV systems, which lead to a significant growth in generation from these sources [2]. High Feed-in Tariffs in the last decade helped PV technology to grow and mature, leading to the significant cost decrease. With this decrease, a threshold of economic feasibility was reached and the FIT schemes have been reduced or even terminated in various countries. For these solutions to continue to be affordable to costumers, innovation and sustainable solutions are needed, which currently means shifting to self-consumption of PV energy rather than selling it [3]. Rodrigues et al. (2016) [4] analyzed a representative set of countries to determine the ones with the best investment opportunities for self-consumption schemes. It was seen that the profitability of the projects always increased with more self-consumption, and for the majority of the cases, the 100% self-consumption scenario was the most viable. Lang et al. (2016) [5] also saw that self-consumption can already be attractive for many buildings in central Europe, particularly, large residential and commercial buildings, and it tends to be more favourable in commercial, rather than in residential buildings, due to a naturally better match of the demand and PV production curves. The implementation of these systems in public educational buildings has been studied, and has shown positive results [6][7][8].
Since the curves will never be a perfect match, not only residential but also commercial buildings can benefit from applying demand side management or adding a Battery Energy Storage System (BESS) to the installation [9]. Many authors have studied the implementation of a BESS for the improvement of self-consumption shares [9][10][11], and found that due to the high price and short life-cycle of batteries, the overall benefits of the implementation are negative. However, the declining cost and increasing life-cycle of batteries are the main factors that will turn these projects viable in the near future. In the end, what makes or breaks a project can be how the consumed and stored energy are managed.
This article aims to show the feasibility of implementing a PV system in an educational building considering new regulations and incentives for the technology. The viability of implementing a BESS together with the RES should also be studied, especially seeing how battery technologies are a growing solution that will start to be viable not just for residential applications. The regulation scheme considered are inserted in the Portuguese legal frame, apart from net metering, which is not allowed, but will also be studied. The comparison of these implementations is done through an economical analysis.
Following this introduction, in Section 2 the methodology for the study is presented, detailing the PV system topology, the legal workframe of the implementations and the economical model. In Section 3, the system is sized and implemented according to the building needs and area. Finally, the results of the implementation are discussed in Section 4, which is followed by the conclusions in Section 5.

Photovoltaic System Topology
To calculate the PV system's output, the solar cell behavior needs to be modeled. For this effect, the PVsyst software is used, and the outline of these calculations is presented to understand what are the factors that influence the system behavior and in what sense. To simulate the behavior of a solar cell, the one diode and five parameters model [12,13] defined by the equivalent circuit in Figure 1, is considered. The unknown variables of this model are the current supplied by the module (I) and the voltage at its terminals (V), which will be dependent on the remaining five variables, as seen in Equation (1). As this is an implicit equation, it needs to be solved using a successive approximations approach [12,13].
To determine the unknown variables, the five parameters that have to be calculated are: the photocurrent I ph,re f , the diode inverse saturation current I 0,re f , the series and shunt resistance, R S and R SH (Ω), and the diode's ideality factor n. These parameters can be calculated using the three following equations for the most relevant points on the I-V curve: short circuit, open circuit and maximum power point. Seeing that there are five different parameters to calculate and only three equations that result from these points, the calculations involve lengthy mathematical manipulation, as well as the use of other relations between the parameters in those equations [12][13][14].
The cell temperature and incident irradiance are the two main factors on which the cell's behavior will depend, because the short circuit current and open circuit voltage results are based on those parameters. The cell temperature is determined with regards to the energy balance between the ambient temperature and the cell's heating up due to incident irradiance, and this irradiance is calculated based on the values of its different components.
The irradiance has three components: direct, diffuse and albedo. Here, only the calculation of the direct component is detailed, and the geometrical relations seen in Figure 2 are considered. The vale of S incident depends on the elevation angle (α), which is the angular height of the sun in the sky, and the panel's tilt angle (β) for which the optimal choice in Portugal is around 33º [14]. These parameters are all present in Equation (2).

Compensation Schemes
In this work, the Portuguese legal framework for the decentralized production of energy for self-consumption or grid-injection is considered. The decree-law that is exposed here presents the conditions in which Self-consumption Units (UPACs) and Small Production Units (UPPs) can be implemented [15]. The addition of a battery system inserted in the self-consumption framework is also considered, as well as the implementation of net metering for self-consumption, which is not allowed in Portugal.

Self-Consumption
In this operating mode, the PV energy is generated by a UPAC and is directly consumed by the installation to which it is connected. In this case the UPAC is connected to the grid, so when the PV generated energy is higher than the consumer's needs, the surplus is injected into the grid and remunerated considering 90% of the monthly average Iberian electricity market (OMIE) closing price, as seen in Equation (3), where R UPAC,m is the remuneration in EUR (€), E inj,m is the energy injected in the grid, and OMIE m is the average Iberian market closing price; all considered for each month m. In this case, the value of OMIE m will be constant and equal to the average price for the year of 2019, which was 47.87 €/MWh.
Furthermore, for the entities that install these self-consumption units, the government has also permitted the exemption of the costs Energy Policy, Sustainability and General Economic Interest (CIEG) [16]. Units with installed capacity above 30 kW are exempt from paying 50% of these costs, during the first seven years of the project's lifetime. With this exemption, the yearly cash flows from the UPAC installations will correspond to the savings resulting from self-consumption and the exemption of CIEG costs, combined with the revenue of selling surplus energy to the grid.
Since this implementation of a UPAC is grid-connected, there will need to be two different electric meters installed: one at the interconnection of the installation with the UPAC to measure the installation's self-consumption, and another at the interconnection with the grid, to count the injected surplus and the purchased energy. The system configurations with the necessary interconnections can be seen in Figure 3. Furthermore, the UPAC's yearly generation must be inferior to the installation's consumption needs, and the power connection to the grid should be less than 100% of the installation's contracted power.

Battery Implementation
For the battery implementation, the same legal framework as for regular selfconsumption will apply, with the only difference being where the energy is consumed from (battery or PV system directly) and when it is injected in the grid or stored in the battery. In this work, only one type of implementation for the battery is considered: the energy is stored as soon as it is available (when there is a surplus of PV production), and then is "immediately" used when the consumer's consumption needs have to be satisfied. Since the storage capacity is limited, once the battery reaches its maximum state of charge, if there is still surplus, it will be injected into the grid. In this implementation the battery is only connected to the PV system, and never trades any energy with the utility grid. With the addition of the technology, the system display and energy flows are now as it is displayed in Figure 4.

Net Metering
This model simply presents a different remuneration method for a self-consumption system, and it is based on the concept that the grid can be used as a "long-term storage". Therefore, the functioning of the system is exactly like before, given that the surplus PV production will still be injected into the grid; but in net metering that energy is recorded as credits. As this model is applied to UPACs, the energy is measured like it is presented in Figure 3, and the metering is not done instantaneously, but rather after a more extended period of time (depending on the regulation).
Since, at present time, this operation is not allowed in Portugal, the example of another EU country that allows for net metering is applied as if it were legal also in Portugal. The chosen country was Cyprus, where net metering can be used in households with small capacities but also commercial units and public administration buildings [17]. In this regime, the electricity offsetting will be carried out each month, for each calendar year. This means that if, for example, at the end of January there is a surplus of production it will be recorded as credits that are available for usage in the following months, and the credits remaining in December are not available for the following year.

Full Grid-Injection
In this implementation, the production unit (UPP) is only connected to the grid and not the installation, so the totality of the produced energy will be sold to the grid, with the remuneration being done through a bidding scheme. This regime applies for a period 15 years, during which it is considered that the energy is sold at the rate of the reference tariff for 2020, which is 0.045 €/kWh [18]. After that period, the UPP has to sell its energy to the last resort trader, through the general regime [19], in which the monthly remuneration (Rem m ) is calculated as seen in Equation (4), where i represents the tariff periods (peak or off-peak) during which electricity is delivered to the installation; W i (kWh) is the energy generated in month m, during period i; OMIE m (€/kWh) is the average Iberian market closing price, relative to month m; f p is a factor to account for losses during each period; and C i is the weighting coefficient for each period (0.86 for off-peak, and 1.13 for peak).
In the display of this implementation seen in Figure 5 there are still two electric meters, but they are both uni-directional since they only measure the energy sold to the grid by the UPP, and the energy consumed from the grid by the installation. Furthermore, for each kW of installed power, the maximum amount of electricity that can be sold to the grid per year is 2.6 MWh; the yearly UPP produced energy cannot be higher than two times the energy consumed by the installation; the power connection to the grid should be lower than 100% of the installation's contracted power, and lower than 250 kW.

Financial Analysis
This analysis is based on the revenues (R) from the different compensation schemes and, in contrast, the cost of technology. The savings and compensation from the different schemes will be compared, to conclude which implementation might be the most profitable investment, by using different economic performance measurements such as the Net Present Value (NPV), Internal Rate of Return (IRR) and Return on Investment (ROI). The Simple Payback Time (SPBT) is also calculated.
Since there are three different implementations, the yearly cash flows will be different for all of them, but generally, they can be defined by Equation (5).
The values of all of these components are presented in EUR (€) and differ for each of the implementations. The savings refer to the money that is saved from self-consuming energy and the compensation is the revenue from selling energy to the grid.
The NPV metric shows the difference between the present value of cash inflows and the present value of cash outflows over a period of time. A positive NPV means that a project or investment's estimated profits surpass the planned costs, and that it is considered to be profitable. The metric is calculated with Equation (6), in which the initial investment I 0 is considered to be done in year 0, and a discount rate i is applied to the annual cash flows until the end of the project's lifetime n.
The cash flows to consider in this calculation will be different for each implementation: in the regular self consumption and net metering there is a constant cash flow until year 7 because of the CIEG savings, and then a different one from year 8 until the end-of-life and in the battery implementation, because its lifetime is shorter than the project's and higher than 7, there will be one constant cash flow from year 1 to 7 with savings from CIEG exemption and higher self-consumption, another from year 8 to 10 only for the battery utilization without the CIEG exemption and another until the end-of-life that will be equal to the cash flow from the regular self-consumption, since the battery has reached its end-of-life. Lastly, for the UPP implementation, there are two different cash flows: from year 1 until 15, and after that until the end-of-life.
These same cash flows will apply to the calculation of the IRR, expression (7), which is essentially the discount rate that makes the NPV equal to zero, so it estimates a project's break-even discount rate, which indicates the annual rate of growth an investment is expected to generate. If the IRR obtained is above the discount rate i considered in Equation (6), then the project will most likely be accepted. Otherwise, it is rejected.
Lastly, the ROI calculates the ratio of the gain from an investment relative to the amount invested, expression (8), but it does not consider the time frame of the investment as it just indicates the total growth of the investment from start to finish, and not annually like the IRR.

ROI =
Net bene f it Total Investment (8)

Life Cycle Analysis
With this assessment, the environmental impacts associated with the life-cycle of the complete system (PV modules and Balance of System (BoS) are studied, so the energy requirements throughout the complete life cycle (manufacturing, transport, operation, disposal, etc.) are estimated to perform the evaluation. Even though there are no CO 2 emissions that result from the PV energy generation, the system still presents an environmental impact in other phases of its life, especially during the manufacturing and disposal. The net saving of emissions is calculated in tons through the carbon balance, in Equation (9), where E output is the yearly energy generated by the PV system, in MWh; LCE grid and LCE system are the grid and PV system life cycle emissions in gCO 2 /kWh and tCO 2 , respectively; n is the project's lifetime in years.
Furthermore, to understand the impacts of the system, the greenhouse gas and energy payback time are calculated as seen in Equations (10) and (11), respectively.

Implementation
The system implementation was performed for a public educational building located in Beja, Portugal. The real meteorological conditions for the year of 2019 are obtained from Solcast [20], and considered constant for the remaining years of the simulation. The architectural plan of the building is seen in Figure 6 and the system will be implemented in rooftops G and E.

Consumer Energy Needs and Billing
To size a PV system that is designed for self-consumption, the user's consumption needs must be known. For this effect, the monthly electricity bills from the school's chosen utility company were consulted, and showed that the installation has a contracted power of 465 kW, and the yearly consumption and electricity bills amount to 337.609 MWh and 53.634 k€, respectively. The building is connected to the grid at a medium voltage level, and so the energy consumption is charged at a tetrahourly rate, based on a daily cycle, which means that the cycles apply equally to weekdays, Saturday and Sunday. The tariffs applied in each of the cycle, as well as the breakdown of the hours in each cycle are presented in Table 1. Since the information in the electricity bills is not detailed enough to know the hourly consumption of the building, all of the daily values will be an average, based on the monthly data that are known. For each month, the only information available is of the overall consumption for each one of the four cycles, which means that for every hour that is included in each cycle, the consumption value will be considered equal. In Figure 7 the daily load profile for a specific month can be seen, with the different cycles highlighted in the same colors as in Table 1.

System Components Details, Sizing and Costs
The complete system is composed of PV modules, battery and BoS hardware, including the inverter, and the choices made for these components are crucial for both the system's final costs and overall performance. Firstly, the chosen module was the TallMax TSM-PE15H, a polycrystalline model from Trina Solar, rated at 340 Wp [21]. Considering the available roof area and the peak power of the panels, it is seen that in rooftop E it is possible to install 17 arrays with 8 modules each, and in rooftop G also 17 arrays but with 19 modules each. This calculations for the system display in each in each rooftop are done according to the spacing that is necessary between each array to minimize nearby shading, using the HelioScope online software [22]. To simplify the calculations the two systems will be considered as one, with a peak power of 156.06 kWp.
The inverter choice is based on the ratio between the array and the inverter's nominal power, which should have a value of around 1.25, for the inverter to support the output energy of the PV system. The model chosen was a Sunny Tripower 5.0 from SMA [23], which has a nominal power of 5 kW.
Lastly, for the battery implementation, the considered technology was Lithium-Ion. According to [24], among various storage technologies, Li-ion have had a rapid cost decrease over the past decade and currently show the lowest cost of energy (271 $/kWh). The sizing is dependent on the building's consumption needs, and so it is only performed later in this work.

Overall PV System Production and Self-Consumption Shares
From the simulation of the implemented system, it was seen that the yearly production amounts to 267.131 MWh, which will also be the total amount of energy sold to the grid each year in the UPP installation. This is less than the building's yearly consumption, and well below the maximum of 2.6 MWh per each kW installed that is allowed by the Portuguese law. Furthermore, the power connection to the grid is also lower than the building's contracted power, which was a necessary condition for both UPP and UPAC installations, which establishes that the PV system implementation is within the parameters of the law for both cases. The monthly PV produced energy compared to the building's needs is presented in Figure 8. From the results presented in Figure 8, it can be seen that, in 8 out of 12 months, the total PV production is lower than the building's consumption needs. The yearly production represents around 79% of the user's needs, which does not mean that these needs will be reduced by that percentage, because some of this energy is surplus that will be injected into the grid. To understand the relation between these two parameters, the daily values from two different days are exposed: one day with high needs and low production (January), and another with lower needs and high production (July). The weak PV production (2nd worst after November) combined with extremely high consumption needs are what cause the monthly discrepancy that is seen in Figure 8. This can be observed in Figure 9, where the plotted PV production corresponds to a random day for which the output of the system was considerably lower than the needs of the consumer. In Figure 9, the effective global irradiance is also presented, and, as expected, its plot follows the PV system output very closely, meaning that these parameters are almost equal in shape. This is because, as it was seen before, the output of the PV system depends mainly on irradiance and temperature, and with such significant changes in irradiance, the output will also vary. Such low and inconsistent values of irradiance are seen due to clouds blocking the sun and partial shading of the modules, but the resulting system losses are only 1.1% of the array's nominal energy for the worst month (November), and much higher losses are observed due to high temperatures (around 13.6% in August). So, even though the month of August shows the highest accumulated irradiance value, the PV output is not the highest because of temperature losses, which makes July instead the best performing month.
Considering now the month of July, besides it showing the highest PV energy output compared to the rest of the year, this is the month in which the consumer's needs are lowest, making it the most promising case for a high share of self-consumption. In contrast to the previous example for January, here the irradiance values are considerably higher, and while in January there are several days with no grid injection, in July there is surplus energy generation every day. Figure 10 shows a day in July with the highest levels of irradiance of the whole month, and it can be seen that the majority of the PV generated energy is surplus, that could be grid-injected, stored or both. Figure 10. Hourly plot of the user's needs (purple), effective global irradiance (red) and output of the PV system (green), for a day in July.

Sizing of the BESS and Daily Charging/Discharging Profile
Now that the user's needs and PV production are known, it is possible to perform the battery sizing. Ideally, for considerably higher shares of self-consumption, the battery would be sized for the highest daily surplus observed. However, this would mean having a capacity of above 600 kWh, and knowing that the price of technology is 229 €/kWh, this investment would be too high and certainly there would be no feasibility in such an implementation. Therefore, the battery energy capacity is chosen simply based on the options that the PVSyst software presents, considering an energy capacity in the hundreds of kWh range. A model from LG Chem with a capacity of 110.9 kWh is chosen and three battery banks were implemented.
The simulation was performed for this implementation and the plots of the battery charging and discharging energy, together with the grid-injected and the available solar energy, for the day in July with the maximum energy surplus, are seen in Figure 11. Since the battery was not sized to store all of the PV energy surplus, it is seen that in this particular day a share of that surplus is stored, and when the battery reaches its maximum state of charge the charging energy goes to zero, with the remaining surplus of the following hours being injected into the grid. Once the PV energy fails to meet the user's consumption needs, the battery starts to discharge until it reaches its maximum state of discharge. Figure 11. Hourly plot of the user's needs (grey), PV system output (blue), grid-inject energy (purple), battery discharging energy (green) and battery charging energy (red), for a day in July.

Shares of Self-Consumption for the Different Implementations
In a real-life implementation, the daily load profile of an educational building would be significantly more similar to the PV production curve, since generally these buildings have the most activity from 8 AM to 7 PM. However, with the conditions that were established from the available data, the shares of self-consumption might not be as high as they could be; results are shown in Table 2, which presents the breakdown of the consumed and injected energy for each of the three self-consumption implementations. Table 2. Self-consumed, bought from grid and grid-injected energy for all three implementations: with and without Battery Energy Storage System (BESS), and net metering. As expected, it is seen that the net-metering implementation is the one with the most self-consumption of PV energy, representing a share of 76.5% of the yearly building consumption, while the self-consumption in the regular implementation (without BESS) and with BESS represent 39.5% and 62.6%, respectively.

Self-Consumed Brought from Grid Grid-Injected
Even though it is said that the grid works as "long-term storage" for net metering, it is seen just how different the results are from the actual storage implementation. Because the battery is limited by its capacity, there is less self-consumption and more energy bought from the grid, but there is also the additional revenue of selling all of the surplus energy to the grid (like in the regular implementation). Previous studies say that the self-consumption of energy is becoming more profitable than selling surplus to the grid, and so it is necessary to analyse the revenues and savings from each implementation to complement the energy consumption information and conclude which of the schemes (if any) is a viable investment.

Regular Self-Consumption, BESS Implementation and Net Metering
In the law it is foreseen that the energy metering for self-consumption should be done in a 15 minute time frame, which was not the case for this project. Since the building's consumption and the PV system production are only known hourly, the metering was done according to this time frame as well. The yearly savings and revenues in k€ resulting from the self-consumption and grid-injection of energy, respectively, for each of the implementations, are seen in Table 3. Table 3. Yearly cash flows from savings and revenues of self-consumed and grid-injected energy, for each implementation.

Self Consumption
Grid Injection Logically, as seen in Table 3, the higher shares of self-consumption that were seen in the previous section result in higher cash-flows, and therefore the possibility of higher savings on the electricity bills. The cash flows presented here do not consider the savings from the CIEG exemption, which amounts to 5.636 k€ each year until year 7, for all implementations. For the BESS implementation, the cash flows presented are only for the years of until the battery's end-of-life, and after that they will be equal to the regular implementation. Figure 12 shows the impact of these cash flows on the yearly electricity bill. Recalling the results from Table 2, for the implementation without a BESS, the amount of energy that is self-consumed and sold to the grid is rather similar, but it is seen here that the cash flows differ significantly, with the self-consumption resulting in significantly higher savings when compared to the revenues from selling to the grid. More specifically, the average saving for each MWh that is self-consumed was 71.490 €, while the revenue per each grid-injected MWh was 43.083 €. This serves to confirm that injecting energy into the grid is being discouraged ever since FIT schemes were terminated, and energy from a PV source is sold to the grid at a much lower price than what it is bought for.

Full Grid Injection
For the UPP implementation, the only positive cash flow comes from selling energy to the grid in two different, so the results of the yearly remuneration for those periods (year 1 to 15, and 16 to 25) are presented in Table 4. Table 4. Yearly remuneration for the grid-injected energy in two different time periods.

Years
Cash Flows (k€/yr) 1-15 11.700 16- 25 9.573 As expected, it is seen that selling energy to the grid, even in this scheme, is less profitable than self-consuming. Even though, for the first 15 years of the project, the remuneration per each MWh is slightly higher than in the self-consumption scheme, for the following 10 the average value per MWh that is injected is 35.836 €. Comparing these results with the previous self-consumption implementations makes it undeniable that simply self-consuming energy is more profitable than injecting and selling surplus (or all) energy to the electricity grid.

Detailed System Costs
To perform the economic analysis it is necessary to have the detailed system costs, in order to know the value of the initial investment. The total system cost is composed of the installation/investment costs, and operational costs (CAPEX and OPEX): the OPEX costs are simply the Operation and Maintenance costs, which are considered to be 2.5% of the CAPEX [23]. The CAPEX costs include the modules, inverter, battery and all components of the BoS, which were based on [25], and are displayed in Table 5. Finally, the total costs of each system implementation can be seen in Table 6. These costs will be constant for all simulations and the only possible value to add to the initial investment will be if the battery is implemented or not, which is how these final costs are organized.

Investment Viability
The considered investment period/lifetime of the project is 25 years, the discount rate i is considered to be 6% and a VAT of 23% is applied to the income cash flows that have been previously detailed. Now that the Operation and Maintenance (O&M) costs are known, they are considered in the cash flows that are presented in Table 7, which depend also on the revenues and savings of each implementation for the different time periods. The results for the metrics of the financial analysis are now presented, and the viability of investing in the different project implementations can now be studied precisely. As expected, the net-metering scheme is the most profitable implementation out of all four, above the regular self-consumption, which is the only other implementation in which the investment shows a positive financial outcome. Both of these implementations show a positive NPV, an IRR above the discount rate and a positive ROI, and so they can be considered economically viable. The ROI, however, is a less reliable metric out of all three, because it shows positive results even for extremely unattractive investments. This is the case for the BESS implementation, for which the ROI remains positive, with a small percentage (8.7%) above the initial investment being recovered, even though the NPV and IRR are both negative.
Only now, knowing the system costs for the BESS implementation and considering them in the financial analysis, can it be concluded that the cost of this technology is a definite setback for the investment. Even with negative values for the BESS implementation it is still seen that, because there is self-consumption of energy, the project might present a less unattractive investment, compared to full grid-injection. However, it is still relevant to denote the considerably negative impact that the high costs of this technology have on the system's financial results. This shows that the existent battery technologies have not matured enough to be a viable self-consumption solution, and even considering a technology that is widely commercialized and generally the cheapest option (Li-Ion), it still was not able to make the investment reach a level of attractiveness.

Life Cycle Assessment
To calculate the carbon balance, as seen in Equation (9), the project's lifetime and energy generated by the PV system are known, the grid Life Cycle Emissions (LCE) for Portugal is considered to be 310 gCO 2 /kWh [26], and the system LCE is calculated according to the default values set by PVSyst for the manufacturing, transport and disposal of the modules and BoS components. Table 8 presents the values for the LCE and and embodied energy of each system component. The sum of the embodied energies of all components is equal to the total system LCE, so knowing this value the carbon balance can be calculated, and it is estimated that the implementation of this system saves 1567.142 tons of CO 2 emissions during its lifetime. Lastly, with the results from Table 8, the GPBT and EPBT are calculated and it is seen that it takes around 3.5 years to compensate for the CO 2 emissions of the transport and manufacturing processes, and just 1.5 years to recover the energy that was spent during those stages.

Conclusions
This work presented the study of different compensation schemes for PV technology, and their financial viability, as well as the environmental impacts and gains of the implementation. The different schemes were applied as it is foreseen in the Portuguese law, excluding the net-metering implementation, which is not allowed. Other than selfconsumption with net metering, this work implements the self-consumption legislation with and without storage, and full grid injection.
In most months out of the simulated year, the PV produced energy did not match the needs of the building, and yearly it represents around 79% of the needs. With the regular self-consumption, the solar energy consumed by the building was still lower than the amount that was bought from the grid, but with the BESS and net-metering, the self-consumption was 1.6 and 1.9 times higher, respectively, compared to the regular implementation.
The profitability of self-consumption and selling energy to the grid was first studied by calculating only the positive cash flows for each implementations. It was seen that the self-consumption allows for an average saving of 71.49 €/MWh, while the revenues from selling energy to the grid were 43.083 €/MWh, clearly showing why self-consumption is preferred over the selling of surplus. This is observed because of the termination of FITs, and therefore, continuous discouragement of grid-injection schemes.
The results of the financial analysis showed that only the net metering and regular self-consumption schemes would be a viable investment, and as expected, the net-metering implementation showed the most attractive results for investment. As for the BESS implementation and the full grid-injection, both schemes show negative results overall and the investment fails to reach attractiveness, with the lowest NPV result seen for the BESS implementation, and the only negative IRR for the grid-injection. The overall results of the analysis show that the self-consumption of energy is more profitable than grid-injection, and BESS technology still needs to improve to see a significant price reduction for its implementation and become viable on a medium-system scale.