Modeling Energy Communities with Collective Photovoltaic Self-Consumption: Synergies between a Small City and a Winery in Portugal

The recently approved regulation on Energy Communities in Europe is paving the way for new collective forms of energy consumption and production, mainly based on photovoltaics. However, energy modeling approaches that can adequately evaluate the impact of these new regulations on energy community configurations are still lacking, particularly with regards to the grid tariffs imposed on collective systems. Thus, the present work models three different energy community configurations sustained on collective photovoltaics self-consumption for a small city in southern Portugal. This energy community, which integrates the city consumers and a local winery, was modeled using the Python-based Calliope framework. Using real electricity demand data from power transformers and an actual winery, the techno-economic feasibility of each configuration was assessed. Results show that all collective arrangements can promote a higher penetration of photovoltaic capacity (up to 23%) and a modest reduction in the overall cost of electricity (up to 8%). However, there are clear trade-offs between the different pathways: more centralized configurations have 53% lower installation costs but are more sensitive to grid use costs (which can represent up to 74% of the total system costs). Moreover, key actor’s individual self-consumption rate may decrease by 10% in order to benefit the energy community as a whole.


Introduction
The recent approval of the Clean Energy Package (CEP) by the European Union, through the recast of the Renewable Energy Directive (Directive (EU) 2018/2001) [1] and the Internal Electricity Market Directive (Directive (EU) 2019/944) [2], provided a legal background for the emergence of new collective energy initiatives. Its main novelty is the introduction of new organizational and legal frameworks such as Renewable Energy Communities (REC) and Citizen Energy Communities (CEC)-legal entities that must be collective, voluntary, and open organizations and are primarily value-driven rather than by profits [3]. After the approval, the directives must be transposed into the member states' specific regulatory frameworks, a process which is evolving at different speeds in each member state. For example, while specific activities such as collective self-consumption are already regulated in most EU countries, for the REC and CEC legal concepts, the transposition process is still lagging behind [4]. At the center of this process lies the emergence of prosumers as active actors in the energy system, with the expectation that new democratic forms of citizen participation are brought forward [5]. Thus, the CEP urges the EU member states to legislate REC and CEC but also new decentralized models, such as collective self-consumption, virtual power plants (VPP), peer-to-peer (P2P) energy trading schemes, or demand flexibility aggregators [6,7]. allowing to compare the impact of a range of scenarios and their assumptions in their optimal configuration [18].
Most of the literature considers photovoltaics (PV) as the most fitting generation technology for collective self-consumption schemes, due to its affordability and technological readiness level, but also its modularity, making it compatible with contexts of considerably different scales (from a single building to a large-scale power plant). Before collective self-consumption was even introduced by the CEP, several authors had shown that one of the benefits for collective PV schemes was the increase in the Self-Consumption Rate (the fraction of local production which is consumed on-site): the aggregation of somewhat decorrelated load profiles results in smoother aggregated profiles, thus reducing the mismatch with the PV profile [8,[10][11][12]. Fina et al. (2019) expanded this type of approach (i.e., an arbitrary aggregation of loads) by using a Mixed Integer Linear Programming (MILP) model to determine the maximum net present value and optimal system capacities of PV and/or heating systems for a set of illustrative collective arrangements, which the authors named "settlement patterns" [9]. The same authors extended this work and moved to model greater scales using representative ECs at the neighborhood level [19]. On the other hand, Contreras-Ocaña et al. addressed the problem of sizing and operating a collective PV system with storage in the context of French regulation considering a business model where the renewable system is financed by an investor and the consumers are charged for consuming its energy [20]. The model the authors present has a coupled structure combining MILP and Model Predictive Control approaches. Other works explore well-established energy modeling tools such as TIMES [21][22][23] and EnergyPLAN [24][25][26] to study and optimize energy systems at the district or city scales, considering multiple energy sources and/or longer-term periods of analysis. Chen et al. explored the SystemC-AMS framework to design and simulate a power grid encompassing a residential community of 15 houses, a wind turbine, a PV array, and a battery pack [27]. This approach addresses the operation of a power grid at the power electronics-scale (modeling DC buses, converters, inverters, transformers), with incredibly high-resolution (seconds timescale). Other tools explicitly consider spatial resolution in their energy modeling and optimization [28], such as Calliope, an open-source energy modeling framework which has been used to address district-, city-, or even neighborhood-scale case studies [29,30]. Table 1 provides a comparison between the reviewed works considering several key parameters.
None of these works cumulatively consider collective PV arrangements while explicitly modeling the impact of self-consumption tariffs (which depend on the applicable regulation, EU or local) and the spatial configuration of ECs. As pointed out by Alaton et al., to properly evaluate collective EC frameworks at the light of the CEP, numerical modeling works must consider elements such as electricity sharing, management of distribution networks, geographical restrictions, and network tariffs [31]. Fina et al. (2020) further highlighted that future EC analyses must also address the associated grid costs [19].
Therefore, the present work aims at filling this research gap by assessing the potentialities of an EC in a small city in southern Portugal which integrates residential and commercial consumers (in particular, a local winery) to explore PV for collective selfconsumption. This assessment is performed in Calliope, due to its considerable flexibility, allowing users to custom design power grid layouts, define the spatio-temporal scale and level of detail of the system under analysis, and to parametrize a wide range of technical and economic constraints. This framework is, thus, scale-agnostic and can explicitly model several key aspects involving the new business models and legal realities of ECs, namely collective energy configurations and the application of grid tariffs. In this work, the Calliope framework is applied to a real dataset containing electricity demand and distribution grid metadata. The optimal allocation of PV capacity is computed for a set of EC setups and then evaluated from a techno-economic perspective. To the best of authors understanding, this is the first work to extend the application of the Calliope framework to the modeling of ECs and collective PV arrangements. The remainder of this work is organized as follows: Section 2 describes the case study, while Section 3 presents the datasets used, the modeling methodology, its assumptions, and the scenarios considered. Section 4 presents and discusses results and, lastly, Section 5 lays out the final conclusions.

The Portuguese Context on Energy Communities and Collective Self-Consumption
The recent Portuguese Decree-Law 162/2019 [32], approved in late 2019, introduced for the first time the figure of REC and collective self-consumption in the Portuguese context. However, the new Portuguese law is still in a testing phase and its final version will be published in 2021 after a process of experimentation and pilot projects that are expected to emerge all around the country. This new legal framework is expected to further increase the penetration of RES in the Portuguese energy mix, with 39.8% of fossil energy (coal, natural gas, fossil co-generation) in 2020 [33].
Several key issues for the development and implementation of collective energy projects find themselves unclear or undefined, such as a precise definition of geographical proximity between consumers and production, concrete aspects of the interaction between an energy collective and the distribution system operator, and the operation of P2P energy trading, among other things. For example, the grid tariffs applicable for energy collectives with members at different tension levels is yet to be defined.
However, while ECs are presented as flexible legal structures, collective self-consumption is a concrete output of this new legal framework. However, the Portuguese energy sector and potential EC adopters (e.g., households, industries, and public sector) are still evaluating this new set of legislation in order to understand how to implement, in practice, these new collective arrangements, assess potential benefits and devise efficient business models. This situation further highlights the need for detailed techno-economic assessments in order to pave the way for a concrete adoption of EC and its associated collective schemes.

Reguengos de Monsaraz: A City + Winery Potential Energy Community in Southern Portugal
The present work is built on the outputs of the Living Lab developed during 2019 within the H2020 PROSEU project (PROSumers for the Energy Union) [34]. Throughout this Living Lab, several actors from the wine sector were involved in a series of co-creation sessions to design the future of RES adoption within the sector; one of the elaborated strategies was the establishment of ECs between wineries and nearby urban residential areas. As a sector which is considerably energy intensive and particularly vulnerable to climate change [35,36], vine growers and winemakers in Portugal are aware of the need to transform their energy sub-system and, thus, are receptive to the adoption of RES to increase the sector's resilience [37]. However, these same actors highlighted how their highly seasonal electricity demand profile (with peak demand concentrated in a short 2-month period) poses a barrier for a massive adoption of renewable energy systems as it would require costly storage systems.
Thus, Reguengos de Monsaraz, a city in the district of Évora in southern Portugal, where the wine sector plays a major role in the local economy and has a relevant weight in the city's energy budget, was a pertaining case study. With an area of less than 500 km 2 , its population was of 7261 inhabitants by 2012 [38]. Moreover, Campos et al. concluded that the wine sector is interested in going beyond the mere adoption of RES, showing interest in activities such as the selling of surplus energy to other companies or consumers, which the new Portuguese legislation now allows. These results further support the relevance for modeling and assessing the potentialities of EC where the wine sector and other local actors integrate collective prosumer setups. Therefore, the motivation for an EC in Reguengos de Monsaraz starts with the idea that bringing different local actors together under the same collective arrangement may expose fruitful synergies among them, resulting in mutual economic, technical, and environmental benefits. Here, only PV technology is considered, mainly due to four factors: (i) Portugal has a considerable solar resource availability, with more than 1500 kWh/m2/year (from PVGIS [39]), resulting in very interesting PV generation yields; (ii) PV is an affordable technology and represents a profitable investment even without the support of feed-in tariffs; (iii) PV is also quite modular (as a given system can be as small as an individual module) and, thus, ideal for deployment in both urban and rural areas, where very diverse rooftops and terrains (in size and shape) exist; and (iv) the current self-consumption and EC regulations in Portugal often highlight PV collective schemes as illustrative examples, probably motivated by the previous factors.
The EC comprised a semi-rural city (mainly residential) and a local winery, with both actors being considered in the energy modeling process. There are many differentiating elements between these two actors, such as the electricity demand profiles (in quantity and seasonality), area availability for deploying PV, and the scale of such installations (i.e., whether residential rooftop or utility scale systems). The EC will share and manage a collective PV system to meet part of its electricity needs in the context of recently approved Portuguese regulation. Depending on the collective arrangement, the city and the local winery can interchange or complement the consumer/prosumer roles. The question addressed in this work is concerned with the determination of the different possible configurations for this collective energy project and the corresponding techno-economic implications.

Materials and Methods
Figure 1 presents a high-level vision of the modeling workflow implemented in this work, showing the interdependence of the various elements of the modeling process. At first, a diverse dataset was gathered provided by several unrelated data sources. Then, the local power grid of Reguengos de Monsaraz was represented in the Calliope framework following its native architecture, comprised by locations, links, and technologies (cf. Section 3.2.1). At this point, different scenarios were built setting up different collective PV arrangements for assessment. At last, outputs were collected and a set of indicators were calculated. In the next subsections, the various data inputs and the modeling components are described in detail.

Data
Implementing the EC model in Calliope required multiple datasets, obtained from unrelated sources. Electricity demand timeseries with 15-min resolution from 31 distribution power transformers (PT) installed in Reguengos de Monsaraz was provided by EDP Distribuição, the national Distribution System Operator (DSO). Although these represent 54% of the existing PTs in the region, their aggregated data corresponds to 73% of the region's annual electricity demand (17.5 out of 23.9 GWh/year, estimated using municipal-level records [40] calibrated to the population of the city). This partial sampling is justified by data privacy compliance, since the DSO is only allowed to share demand data from PTs that comprise a minimum number of consumption points. This information was complemented by the rated capacity (Figure 2), as well as their geographical position ( Figure 3).
Additionally, electricity demand data was obtained from the local winery considered in this work, with a total electricity demand of 2.17 GWh/year. Figures 4 and 5 compare the normalized load profile of the city and the local winery at different time scales. The first figure focuses on an intraday resolution, highlighting the afternoon peak load of the city, characteristic of residential consumers, mainly during the wintertime when demand is overall higher (Figure 4, top row). It is also possible to observe the high seasonality of the local winery, with considerably more demand during the harvest period and a stronger daily pattern during weekdays (the second and third day of Figure 4, bottom row). Figure 5, showing total daily demand throughout the year, clearly displays the seasonality of both load profiles, with the city having a higher electricity demand during wintertime and the local winery during September and October. The highly seasonal consumption pattern observed for the winery (with a peak between September-October) confirms the challenge that a massive adoption of renewable energy systems represents (mentioned in Section 2.2.). The establishment of an EC with other local actors with whom synergies can be established may be a solution to address this issue.       Additionally, electricity demand data was obtained from the local winery considered in this work, with a total electricity demand of 2.17 GWh/year. Figures 4 and 5 compare the normalized load profile of the city and the local winery at different time scales. The first figure focuses on an intraday resolution, highlighting the afternoon peak load of the city, characteristic of residential consumers, mainly during the wintertime when demand is overall higher (Figure 4, top row). It is also possible to observe the high seasonality of the local winery, with considerably more demand during the harvest period and a stronger daily pattern during weekdays (the second and third day of Figure 4, bottom row). Figure 5, showing total daily demand throughout the year, clearly displays the seasonality of both load profiles, with the city having a higher electricity demand during wintertime and the local winery during September and October. The highly seasonal consumption pattern observed for the winery (with a peak between September-October) confirms the challenge that a massive adoption of renewable energy systems represents (mentioned in Section 2.2.). The establishment of an EC with other local actors with whom synergies can be established may be a solution to address this issue.
In order to quantify the available areas for the installation of rooftop PV, a GIS-based rooftop cadaster was provided by the local municipality. Unavailable or degraded areas were dismissed, according to their use classification already included in the dataset. As the correspondence between the various buildings and the respective PTs was unknown, Voronoi polygons were computed using the PTs as generating points ( Figure 6). Based on this approach, the total rooftop area contained in each of the polygons (histogram in Figure 7) was assigned to the respective PT and inserted in Calliope as a constraining parameter (c.f. Section 3.2.2). As the rooftop tilt and orientation was not provided, it was assumed, as a simplification, that all areas have an optimal geometry for PV generation, i.e., southfacing with orientation equal to latitude.
Lastly, 15-min weather data, i.e., on solar irradiance and air temperature, was provided by SoDa-Solar radiation Data [41]. The irradiance data are respective to a plane of In order to quantify the available areas for the installation of rooftop PV, a GIS-based rooftop cadaster was provided by the local municipality. Unavailable or degraded areas were dismissed, according to their use classification already included in the dataset. As the correspondence between the various buildings and the respective PTs was unknown, Voronoi polygons were computed using the PTs as generating points ( Figure 6). Based on this approach, the total rooftop area contained in each of the polygons (histogram in Figure 7) was assigned to the respective PT and inserted in Calliope as a constraining parameter (cf. Section 3.2.2). As the rooftop tilt and orientation was not provided, it was assumed, as a simplification, that all areas have an optimal geometry for PV generation, i.e., south-facing with orientation equal to latitude.
Lastly, 15-min weather data, i.e., on solar irradiance and air temperature, was provided by SoDa-Solar radiation Data [41]. The irradiance data are respective to a plane of array identical to the assumed rooftop geometry: south-facing and orientation equal to the location's latitude. To convert the weather data to PV potential, a generic approach was considered, in order to avoid assuming a specific, but arbitrary, PV module. Thus, solar resource was converted to effective PV potential by assuming a 17% efficiency in Standard Test Conditions (STC) and a −0.04%/ • C temperature coefficient. The module temperature was estimated using the Sandia model for a glass/cell/glass module type, with solar irradiance incident on the module, ambient air temperature, and wind speed as inputs. Figure 8 shows the calculated PV potential profile for Reguengos de Monsaraz, with typically higher values during summertime and some weather-related variability.
Standard Test Conditions (STC) and a −0.04%/°C temperature coefficient. The mod temperature was estimated using the Sandia model for a glass/cell/glass module ty with solar irradiance incident on the module, ambient air temperature, and wind speed inputs. Figure 8 shows the calculated PV potential profile for Reguengos de Monsar with typically higher values during summertime and some weather-related variability        An overall description of the used datasets is synthesized in Table 2.   An overall description of the used datasets is synthesized in Table 2.  An overall description of the used datasets is synthesized in Table 2.

Modeling the Local Energy System and the Energy Community
For this work, the energy modeling tool should adequately describe three different perspectives of the local power grid: (i) a spatially-resolved characterization of the electricity demand and PV generation; (ii) the relevant technical constraints, i.e., the PTs rated capacity and corresponding rooftop area availability; and (iii) the various costs associated to equipment acquisition and grid use (through grid tariffs). To do so, the Calliope framework was used as a computational modeling and optimization tool.

Calliope-An Overview
Calliope is a Python-based multi-energy system modeling and linear optimization framework [42][43][44]. It allows users to consider the behavior of energy systems both in time and in space (i.e., energy fluxes between nodes) and is quite flexible as an energy modeling tool. There are several studies exploring this framework, with different spatial scales and end goals: evaluating concentrated solar power as a possible replacement for nuclear power plants in South Africa [45]; assessing if the phasing out of nuclear power in Switzerland is feasible [46]; explore the potential of gas power as a bridging fuel in the transition to wind and solar power [47]; or evaluating the trade-offs between geographic scale, cost, and infrastructure requirements in a 100% renewable Europe [48]. As pointed out before, Calliope has also been applied for smaller spatial scales, such as neighborhoods or small urban districts [29,30].
This modeling framework is built on three essential elements: locations (nodes), technologies, and links. Locations are specific points in space (e.g., a single house, a piece of land in which an individual power plant can be installed, entire cities, regions, or continents) to which users can associate energy consumption and/or generation. Technologies, on the other hand, correspond to equipment that consume, produce, convert, transport, or store energy (e.g., power generators, battery systems, electric devices, or grid cables). Additionally, as a multi-energy framework, Calliope can model any kind of energy carrier, whether it is heat or electricity. Links are the elements which interconnect the different locations and enable energy fluxes between them, usually coupled with energy transfer technologies (e.g., power lines, heat pipes). Furthermore, Calliope allows users to define a broad range of technical and economic parameters to characterize locations and technologies but also several constraints that allow for modeling energy systems behavior (e.g., the available area in a given location, the conversion efficiency, area occupancy or unitary cost of a given technology, the resource a given generator depends on-solar or wind-or the maximum power flow a given link can withstand). Calliope builds a linear optimization problem (cf. [29] for its formulation) with the objective of minimizing the total system cost which can then be solved using any available solver (e.g., Gurobi, CPLEX, GLPK, CBC). Other objectives, such as minimizing CO 2 emissions, may also be considered. Calliope returns a range of outputs, such as the optimal capacities for each technology and location, alongside a myriad of interest variables.

Designing the Local Power Grid Layout
The designed local power grid includes the following elements: a set of mediumvoltage distribution PTs; a substation; and transmission cables interconnecting these elements. Each distribution PT represents an associated low-voltage grid section and the corresponding aggregated electricity demand, as well as rooftop area availability for installing PV. On the other hand, the electricity supply imports and PV generation surpluses flow through the substation, as it is a bidirectional interface between the PTs and the higher voltage generators or adjacent regional grids.
A detailed representation of how the various PTs are connected (i.e., the layout of the power grid) would lead, necessarily, to a larger computational complexity resulting in prohibitive computational times. However, as it would not bring an added value to the simulation, the power grid layout was simplified, assuming a star topology as shown in Figure 9. In this simplified representation, the substation is connected to a derivation node which, in turn, is connected to various PTs, each representing an LV grid section. Each of these nodes has associated the net demand from the corresponding PT as well as the total rooftop area available, with the latter corresponding to an upper bound for PV deployment in the Calliope optimization process. An extra location was inserted, working as an interface between the city and the winery and where, as described in more detail in the following subsection, the grid tariff for energy exchanges between actors on different voltage levels (in this case, the LV-grid and MV-grid for the city and the winery, respectively) is charged.

Designing the Local Power Grid Layout
The designed local power grid includes the following elements: a set of mediumvoltage distribution PTs; a substation; and transmission cables interconnecting these elements. Each distribution PT represents an associated low-voltage grid section and the corresponding aggregated electricity demand, as well as rooftop area availability for installing PV. On the other hand, the electricity supply imports and PV generation surpluses flow through the substation, as it is a bidirectional interface between the PTs and the higher voltage generators or adjacent regional grids.
A detailed representation of how the various PTs are connected (i.e., the layout of the power grid) would lead, necessarily, to a larger computational complexity resulting in prohibitive computational times. However, as it would not bring an added value to the simulation, the power grid layout was simplified, assuming a star topology as shown in Figure 9. In this simplified representation, the substation is connected to a derivation node which, in turn, is connected to various PTs, each representing an LV grid section. Each of these nodes has associated the net demand from the corresponding PT as well as the total rooftop area available, with the latter corresponding to an upper bound for PV deployment in the Calliope optimization process. An extra location was inserted, working as an interface between the city and the winery and where, as described in more detail in the following subsection, the grid tariff for energy exchanges between actors on different voltage levels (in this case, the LV-grid and MV-grid for the city and the winery, respectively) is charged. Figure 9. Local power grid layout assumed for this work/Reguengos de Monsaraz, which was implemented in calliope. Electricity can be generated in the substation (i.e., the traditional electricity supply/from the supply grid) and in the power transformers and winery (by means of PV), with the last two also incorporating their respective electricity demand.

Grid Tariffs Allocation
Collective self-consumption schemes can have members residing in a location different from the one where the self-consumption system is installed, implying the possible use of the public grid. For consumers in the same voltage-level, the Portuguese regulation states that in such situations, the renewable generation is to be charged by the grid tariffs respective to the voltage levels it goes through to reach a given consumption point. In other words, a given collective self-consumption investment can maximize its profitability by minimizing the use of the public grid. Figure 9. Local power grid layout assumed for this work/Reguengos de Monsaraz, which was implemented in calliope. Electricity can be generated in the substation (i.e., the traditional electricity supply/from the supply grid) and in the power transformers and winery (by means of PV), with the last two also incorporating their respective electricity demand.

Grid Tariffs Allocation
Collective self-consumption schemes can have members residing in a location different from the one where the self-consumption system is installed, implying the possible use of the public grid. For consumers in the same voltage-level, the Portuguese regulation states that in such situations, the renewable generation is to be charged by the grid tariffs respective to the voltage levels it goes through to reach a given consumption point. In other words, a given collective self-consumption investment can maximize its profitability by minimizing the use of the public grid. For low-voltage consumers, the grid tariff components are as follows: 5.88 c€/kWh for the use of the low-voltage grid (τ grid,LV ); 0.65 c€/kWh for the mid-voltage grid (τ grid,MV ); and 0.59 c€/kWh for the high-voltage grid (τ grid,HV ). PV generation, which is consumed on-site and, therefore, does not use the public grid, is exempt from such tariffs.
Since electricity demand was only available at the PT level, the PV generation also has to be modeled at the same aggregation level. This does not allow to quantify how much of the PV generation is consumed on-site and how much of it uses the public grid to reach a prosumer on the same LV grid section (i.e., below a given a PT). Thus, the use of the public grid for collective self-consumption below a given PT and the corresponding grid tariffs application was parametrized under certain assumptions (described in the next section). The PV generation from the winery, which is consumed on-site, was considered to be exempt from grid tariffs even if the winery consists of different buildings, as the whole industrial facility is considered to belong to a single internal grid. On the other hand, the grid tariff for energy exchanges between low-voltage and mid-voltage grid consumers (τ grid,LV-MV ) has not yet been regulated in Portugal. Thus, to assess the feasibility of collective PV arrangements which involve such exchanges, a sensitivity test was performed considering τ grid,LV-MV values between 5 and 11 c€/kWh.
To correctly model this scheme in Calliope, it was important to consider how the energy flows across the designed grid. Four different situations may occur: (i) electricity is supplied from the substation directly to a given PT or the local winery; (ii) PV generation is consumed in the same PT where the PV system is installed; (iii) PV surplus from one PT is transferred to a neighboring PT; (iv) PV generation from the winery is transferred to one or more of the city's power transformers (or the other way around). Based on this, Figure 10 illustrates how the various costs are allocated. Four volumetric cost parameters (which can correspond to the carrier production cost, or om_prod, parameter in Calliope) were then defined: A, which is allocated in the PV generation of each PT; B, which is allocated in the link (i.e., transmission cable) that connects each PT to the derivation node; C and D, which are allocated in the substations for the city and the winery, respectively (this apparent duplication is driven by the different electricity price and grid costs assumptions of these two actors); and E and F, which are allocated in the interfacing node between the city and the winery (in this case motivated by the different elements involved in the two possible directions, adding the possibility for the LV-MV tariff to depend on the assumed direction).

Modeling Assumptions and Simplifications
In order to implement the energy system model in Calliope, further assumptions were made, listed in Table 3 alongside the reasoning behind them. Table 3. Modeling assumptions considered in the present work.

Assumption Reasoning
Only 25% of the PV energy that is consumed in the same power transformer where it was generated uses the public grid (GUF = 25%).
While 40-55% of the PV generation is exported to the public grid in individual self-consumption systems [8,49,50], a lower percentage is to be expected in collective ones [8]. This parametrization of the LV grid below each PT is essential for the application of grid tariffs.
The solar resource is homogeneous in space across Reguengos de Monsaraz.
As no on-site weather data was available, a timeseries for a single point in space (provided by the SoDa-Solar radiation data company) is considered PV generation exported through the substation (i.e., to adjacent regions) is not remunerated.
While enabling exportations can increase PV penetration and the self-sufficiency of the EC, the objective is still to promote the interaction between the city and the winery.  Table 3. Cont.

Assumption Reasoning
The unitary cost of residential PV is 1.5 €/Wp, while at the winery it is 0.7 €/Wp.
Reference values provided by agents operating in the PV sector. These translate the impact of economies of scale: while small-scale rooftop systems were considered for the city, the winery has more available land and can, thus, install a single larger-scale system.
The power density of residential PV is 10 Wp/m 2 , while at the winery it is 20 Wp/m 2 .
Reference values provided by agents operating in the PV sector. The larger area per unit of capacity of larger PV systems is justified by the need for additional equipment and the spacing between PV arrays (to take into account for shadowing effects).
The electricity tariff (τ supply,city ) for the city is fixed and is 20 c€/kWh. This is considered as a reasonable value for low-voltage consumers in Portugal, which, as can be seen by the late afternoon peak load in Figure 4, are dominant in the electricity demand profile of Reguengos de Monsaraz.
The electricity tariff for the winery (τ supply,winery ) depends on the time of the day and season of the year, with an average value of 9.37 c€/kWh. This information was provided by the winery; however, due to confidentiality issues, only the average value can be presented.
The interest rate for investment in PV, be it in the city or the winery, is 5%. This value is commonly found in the PV literature.
Even though 15-min data was provided for the electricity demand and the solar resource, the corresponding model built in Calliope implied a prohibitive memory demand. To circumvent this, and in order to reach a viable compromise between temporal resolution and temporal coverage, the data were resampled to 30-min timesteps and alternate days were considered (i.e., the first of every two days). This approach reduces the amount of data by a factor of 4 while still maintaining the annual seasonality of electricity demand and solar resource as well as a rather high intra-day resolution.
When compared to other works identified in the literature (cf . Table 1), this work is, according to the authors' best understanding, the first to model collective self-consumption systems while considering the application of grid tariffs to the RES generation using the public grid infrastructure. Regarding data characteristics, the considered 30-min temporal resolution and 1-year coverage is in line with most of the reported values (between 15 and 60 min; and 1 year, unless synthetic datasets are considered). From a spatial point of view, this work considered a coarser resolution than several other references (i.e., aggregated at the PT level opposed to individual household data), which required the set of assumptions previously described. However, the grid layout and network constraints (i.e., the PTs rated capacity) were considered, whereas most works in the literature assume a single-node approach. Several of the tools used (e.g., TIMES, Calliope, and SystemC-AMS) are in fact complementary with each other, as they address different perspectives such as energy system planning or operation) with different spatio-temporal scales. Thus, the use of several tools to model the same case study can greatly contribute to a deeper understanding of the feasibility of a given EC configuration.

Scenarios and Pathways for an Energy Community in Reguengos de Monsaraz
The flexibility of ECs regarding how the distributed generation is allocated allows for EC designers to leverage on the different characteristics of the actors involved. Thus, this work considers and evaluates a set of scenarios with different PV arrangements, representing possible pathways for the implementation of the EC in which the involved actors (i.e., the city and the winery) can perform different roles and establish synergies.  Figure 10. Allocation for the different cost components (A to F) in the designed power grid. The picture depicts how the Calliope parameters incorporate the tariff from the electricity supplied by retailers through the substation (S) to the power transformers that are connected to LV grid sections and the winery (W), τ supply,city and τ supply,winery ; the LV and MV grid use tariffs for energy exchanges between LV prosumers (τ grid,LV and τ grid,MV ), and the overall use tariff for exchanges between LV and MV prosumers (in this case, the winery (W)). The Grid Use Factor (GUF) is a scalar, parameterizing the percentage of PV generation that uses the public LV grid that flows from the PV system to the respective prosumer(s).
The following scenarios are here considered: 1. Independent self-consumption.

2.
Alternating the prosumer/consumer role between actors: a.
Winery as a prosumer, city as a consumer. b.
City as a prosumer, winery as a consumer.

3.
Both actors as prosumers, assuming two PV adoption scenarios for the city: a.
Rooftop PV capacity equivalent to 10% of diurnal electricity demand. b.
Rooftop PV capacity equivalent to 75% of diurnal electricity demand.
In scenario 1, PV generation is not allowed to flow between the city and the winery. This constrains PV's capacity to be installed in each of the actors, with each one optimizing its own system in a self-consumption model. In scenario 2, the exchange of PV generation between actors was allowed, but PV capacity could only be installed in the city or in the winery. In scenario 2a, only the winery can install PV capacity, being also able to supply the city. In scenario 2b, only rooftop PV capacity can be installed, distributed among the various low-voltage networks represented by each of the PTs. In scenario 3, PV capacity can be installed in both the city and the winery, and PV generation can flow from one to the other, i.e., energy trading is allowed. To understand how the residential PV deployment impacts the role of the winery in the EC (namely, its optimal PV capacity and the exchanges between the two actors), two sub-scenarios were designed: in scenario 3a, which corresponds to a modest penetration of PV, the installed capacity in each PT generates the equivalent of 10% of the corresponding diurnal electricity demand; in the more ambitious scenario 3b, this value is raised to 75%.
In short, while scenario 1 represents a context where there is no collaboration between the city and the winery, the remaining scenarios correspond to different collective arrangement possibilities that could be considered in an EC framework. Additionally, it is important to compare the electricity costs of all these scenarios with a baseline case where no PV capacity is installed (scenario 0), i.e., a scenario in which all energy is imported from the grid.

Considered Assessment Metrics
The different collective PV arrangements were evaluated and compared based on some of the relevant optimization outputs: PV installed capacities, area occupation (city rooftops and the winery terrains), and production/demand timeseries. However, in order to assess the technical and economic performance of the EC, additional metrics were considered: (i) the levelized cost of electricity (LCOE) for PV (LCOE PV , Equation (1)), which considers the initial capital investment (C capital,I,PV ) and the capital associated to the grid use of PV (C grid use,PV ), which represents the payment of the applicable grid tariffs; (ii) the LCOE for the energy system as a whole (LCOE total , Equation (2)), which expands the LCOE calculations to include the costs and generation from the energy imports; and (iii) the Self-Sufficiency Rate (SSR, Equation (3)), indicating how much of the electricity demand is supplied by PV generation. For this work, the PV generation exported through the substation was not considered for the SSR calculation:

Scenario 1: Independent Self-Consumption
For this scenario, both the city and the winery were modeled under the assumption that both parties cannot exchange their PV surpluses between them. Thus, the PV capacities are sized considering the city and the winery energy needs individually. Table 4 synthesizes the results and, as expected, the city installs more PV capacity, since it has a considerably larger electricity demand. However, it does so with a higher LCOE for its renewable generation: on the one hand, residential-scale rooftop systems have a higher unit cost; on the other hand, self-consumption in the city has associated grid costs due to the use of the public grid. Nonetheless, for both cases, the deployment of renewable capacity reduces the overall LCOE of the consumed electricity. While the absolute reduction is fairly similar for the city and the winery (3.69 and 3.02 c€/kWh, respectively), the winery achieves higher relative savings (18 and 30%). This is justified by the higher SSR, which corresponds to a lower dependence of the costlier supply grid, possibly driven by a higher penetration of PV capacity and a better correlation between the PV generation and electricity demand profiles.

Alternating the Prosumer/Consumer Role between Actors
Scenarios 2a and 2b introduce the possibility of power exchanges between the actors as described in Section 3.2.5. However, the deployment of PV capacity (i.e., the prosumer role) is only allowed in one of them, either the city or the winery. These sub-scenarios represent two opposing strategies towards collective schemes adoption: scenario 2a is a centralized option, in which a PV system, which is exclusively deployed in the terrains of the winery, supplies the whole Reguengos de Monsaraz electricity demand; scenario 2b represents a decentralized option, in which PV capacity is distributed across the rooftops of the city. In the first case, a possible business model would be the winery acting as an electricity supplier from which the city purchases PV energy through Power Purchase Agreements; in the second, a local aggregator of PV surpluses would gather the exceeding generation from the city and sell it to the winery. These scenarios allow for a simple, unidirectional analysis that serves to build more complex scenarios further ahead.
As discussed in Section 3.2.3, since the grid tariff for energy exchanges between low-voltage and mid-voltage is not yet regulated in Portugal, a sensitivity analysis was performed considering tariff values between 5 and 11 c€/kWh. Figure 11 presents the results in a series of bar plots containing the relevant outputs. When comparing the two sub-scenarios, the first conclusion that can be drawn is that installing PV exclusively in the winery (scenario 2a), which implies a cheaper investment cost (cf. Table 3), leading to a larger capacity deployment (5-6 MW vs. 4.0-4.2 MW, when compared to scenario 2b). In both cases, higher LV-MV grid tariffs (cf. Figure 10) results in installing less PV capacity, with scenario 2a showing considerably more sensitivity to this parameter. portant to note that allowing for some energy exports indirectly contributes to the increase in SSR: adding more PV capacity can lead to generation surpluses in some time periods (mainly around midday, when generation is maximum) but will also increase self-consumption (mostly in the beginning and end of the day, when generation is at its minimum). Depending on the balance between added costs and savings, exportations may lead to economic benefits.  LCOE PV , shown in Figure 12, helps to understand this: installing PV in the winery (scenario 2a) is more efficient in terms of investment in technology, but its associated grid costs increase greatly with the considered LV-MV grid tariff and even surpass the LCOE PV of scenario 2b. This is justified by the considerable difference in electricity demand between the city and the winery: for scenario 2a, around 70% (6 GWh/year) of the PV generation is transferred to the city, whereas for scenario 2b, only around 6% (0.4 GWh/year) is transferred to the winery. This dependence has a greater impact on the electricity exports to adjacent regions than the SSR (8.7% variation vs. 2.1% for scenario 2a), as Calliope optimization model minimizes this non-remunerated generation. Nonetheless, it is important to note that allowing for some energy exports indirectly contributes to the increase in SSR: adding more PV capacity can lead to generation surpluses in some time periods (mainly around midday, when generation is maximum) but will also increase self-consumption (mostly in the beginning and end of the day, when generation is at its minimum). Depending on the balance between added costs and savings, exportations may lead to economic benefits.
In terms of overall economic benefit, the LCOE total for scenario 2a increases linearly with the LV-MV grid from 14.6 to 16.1 c€/kWh (2.3-4.2 c€/kWh reduction when compared to the scenario 0), depending on the considered grid tariff, whereas for scenario 2b, it is 15.1-15.3 c€/kWh (3.5-3.7 c€/kWh) with small oscillations. Additionally, scenario 2a is more cost-efficient if the LV-MV grid tariff is not higher than 6 c€/kWh, as this sub-scenario is greatly dependent on exchanges between the city and the winery. For costlier tariffs, the savings from a larger scale, i.e., cheaper, PV investment in the winery is surpassed by the consequent increase in grid costs, benefitting from the deployment of more distributed PV capacity.  Thus, both collective arrangements contribute to a more sustainable but also a more cost-efficient power system. From these two sub-scenarios, some high-level relevant conclusions must be highlighted: both cases present benefits and drawbacks, but a fundamental trade-off emerges from its comparison. On the one hand, the global energy cost in the whole EC is more dependent on grid costs when all the production is centralized in the winery what can be interpreted as the cost of centralization; on the other, for low tariff values, these centralization costs are balanced by the benefits of reduced investment costs. In any case, the more stable and decentralized solution (i.e., city as a PV production aggregator) does not allow for the PV penetration or SSR that the winery-only solution is able to reach.

Both Actors as Prosumers, Assuming Two PV Adoption Scenarios for the City
Besides the limitation in available area for each PT, the previous scenarios considered the installed PV capacity as an unbounded variable, constrained only by location (city or winery). Although this increases the search space of optimal system configurations, the fact is that the deployment of residential-scale PV is highly dependent on local RES adoption targets or climate change mitigation plans set up by municipalities or other regional actors [23,51]. However, the integration of such plans within the present modeling framework is straightforward. Scenarios 3a and 3b allow for PV to be deployed in the winery and in the city but constrains the city to two distinct levels of residential PV adoption: whereas the first sub-scenario assumes a modest deployment, with the installed capacity in each power transformer of the city generating as much energy as 10% (0.52 MW) of its corresponding diurnal electricity demand, the second considers this value to be 75% (3.87 MW). Thus, the optimization process resides in determining the optimal PV capacity to be installed in the winery, with its prosumer role becoming more relevant in scenario 3a. Figure 13 shows the relevant outputs and metrics. The technical outputs and indicators (i.e., total PV capacity, SSR, and exported generation) achieve fairly similar results for both sub-scenarios, seeming to be independent of the considered grid tariff and adoption level of residential PV. Additionally, it is important to note that even the more ambitious subscenario 3b leaves room for a considerable deployment of PV capacity in the winery (between 2.6-3.5 MW). Thus, a scenario with high residential PV penetration, can also be considered in a context where land availability in the winery is a limitation.  Figure 14 compares the various scenarios presented so far. This is an essential step to assess the implications of different pathways for the implementation of a coordinated selfconsumption scheme between the residential actors in the city of Reguengos de Monsaraz and a local winery. For scenarios 2a, 2b, 3a, and 3b, the intervals of values presented correspond to the different LV-MV grid tariff values tested.

An Overall Comparison of Pathways
A first conclusion is that, except for scenario 2b, every collective arrangement promotes the deployment of additional 0.4 to 1.35 MW of PV capacity (an 8 to 29% increase) when compared with scenario 1 (independent self-consumption). This results in an increase in self-sufficiency by 1.5-3.6 percentual points (a 4.5-11.1% relative increase), which translates to a more sustainable power system with less greenhouse gas emissions.
In terms of economics, the adoption of PV, regardless of the considered arrangement, reduces the cost of electricity when compared to the actual context (i.e., scenario 0) where electricity is supplied by the grid with a grey energy mix (coal, natural gas, fossil co-generation, RES). However, the overall impact of the collective setups in the LCOEtotal, when compared to scenario 1, is, at most, modest: for a reduced LV-MV grid tariff, scenario 2a and scenario 3a lead to the higher savings (around 0.6 c€/kWh, near 4%). Moreover, for higher grid tariff values, these same scenarios can in fact increase the LCOEtotal by up to 1.1 c€/kWh or 8%. Nonetheless, these results are influenced by the assumption that the exported PV generation was not remunerated and that it does not contribute to the SSR of the EC. This highlights the need for further studies which evaluate the possibility for nearby regions to accommodate this excess generation and/or for the deployment of complementary technologies such as storage, electric mobility, or flexible demand. Additionally, the variation interval of LCOEtotal values for scenarios 2a and 3a highlight how centralized PV configurations (i.e., with most or all of the PV capacity corresponding to a In terms of economic benefits, both sub-scenarios reduce the LCOE total when compared to the baseline scenario 0. However, while for scenario 3a, this indicator increases linearly with the considered LV-MV grid tariff value, ranging from 14.6 to 16.3 c€/kWh, scenario 3b is much less sensitive to the tariff value and ranges from 14.9 to 15.1c €/kWh. This compared evolution of LCOE total for these two configurations follows the same pattern that was already observed for scenarios 2a and 2b (i.e., the LV-MV grid tariff defines which configuration is more cost-efficient, with 6 c€/kWh being a threshold value). This is to be expected, as scenarios 2a and 2b can be seen as extreme versions of scenarios 3a and 3b (i.e., in terms of PV capacity, scenario 2a is more winery-oriented than 3a, and 2b more city-oriented than 3b). Figure 14 compares the various scenarios presented so far. This is an essential step to assess the implications of different pathways for the implementation of a coordinated selfconsumption scheme between the residential actors in the city of Reguengos de Monsaraz and a local winery. For scenarios 2a, 2b, 3a, and 3b, the intervals of values presented correspond to the different LV-MV grid tariff values tested.

An Overall Comparison of Pathways
A first conclusion is that, except for scenario 2b, every collective arrangement promotes the deployment of additional 0.4 to 1.35 MW of PV capacity (an 8 to 29% increase) when compared with scenario 1 (independent self-consumption). This results in an increase in self-sufficiency by 1.5-3.6 percentual points (a 4.5-11.1% relative increase), which translates to a more sustainable power system with less greenhouse gas emissions.
In terms of economics, the adoption of PV, regardless of the considered arrangement, reduces the cost of electricity when compared to the actual context (i.e., scenario 0) where electricity is supplied by the grid with a grey energy mix (coal, natural gas, fossil cogeneration, RES). However, the overall impact of the collective setups in the LCOE total , when compared to scenario 1, is, at most, modest: for a reduced LV-MV grid tariff, scenario 2a and scenario 3a lead to the higher savings (around 0.6 c€/kWh, near 4%). Moreover, for higher grid tariff values, these same scenarios can in fact increase the LCOE total by up to 1.1 c€/kWh or 8%. Nonetheless, these results are influenced by the assumption that the exported PV generation was not remunerated and that it does not contribute to the SSR of the EC. This highlights the need for further studies which evaluate the possibility for nearby regions to accommodate this excess generation and/or for the deployment of complementary technologies such as storage, electric mobility, or flexible demand. Additionally, the variation interval of LCOE total values for scenarios 2a and 3a highlight how centralized PV configurations (i.e., with most or all of the PV capacity corresponding to a single installation, in this case in the winery) are more sensitive to the considered LV-MV grid tariff. single installation, in this case in the winery) are more sensitive to the considered LV-MV grid tariff.
It is also of further importance to consider how each collective arrangement translates into the individual performance of each actor. The bottom center and bottom right plots of Figure 14 show the individual SSR for the winery and for the city. In scenario 1, the winery reaches greater SSR values than the city (39.5% vs. 31.3%). However, the collective self-consumption arrangements prioritize the costlier electricity demand from the city. A slight increase in the SSR of the city (between 1.0 and 5.0 percentual points) is accompanied by a more considerable decrease for the SSR of the winery (between 7.3 and 19.3 percentual points), despite the overall increase (due to the difference in scale between the two actors). Thus, it is relevant to note that a collective arrangement between different actors can imply different compromises for the different actors: the winery as a prosumer in the EC increases the collective performance, but at the expense of its own individual performance. This behavior is to be expected, since the optimization process is driven by the minimization of the global costs of the considered energy system.

Conclusions
The present work explored the techno-economic feasibility of an EC in the semi-rural city of Reguengos de Monsaraz in southern Portugal. The considered EC involves two different local actors, namely the residential consumers and a local winery. A strong focus was placed in exploring different pathways to achieve higher renewable penetration scenarios at the local level by adopting different collective PV arrangements under the EC framework. These arrangements involved assigning different roles to the involved actors, choosing different system architectures, but that will also demand different business models.
Building on real electricity demand from PTs and from a local winery, as well as a GIS-based rooftop cadaster and weather data, the Reguengos de Monsaraz EC was modeled using the open-source Calliope modeling framework. Results showed that collective arrangements contribute to the deployment of additional PV capacity and, potentially, a It is also of further importance to consider how each collective arrangement translates into the individual performance of each actor. The bottom center and bottom right plots of Figure 14 show the individual SSR for the winery and for the city. In scenario 1, the winery reaches greater SSR values than the city (39.5% vs. 31.3%). However, the collective self-consumption arrangements prioritize the costlier electricity demand from the city. A slight increase in the SSR of the city (between 1.0 and 5.0 percentual points) is accompanied by a more considerable decrease for the SSR of the winery (between 7.3 and 19.3 percentual points), despite the overall increase (due to the difference in scale between the two actors). Thus, it is relevant to note that a collective arrangement between different actors can imply different compromises for the different actors: the winery as a prosumer in the EC increases the collective performance, but at the expense of its own individual performance. This behavior is to be expected, since the optimization process is driven by the minimization of the global costs of the considered energy system.

Conclusions
The present work explored the techno-economic feasibility of an EC in the semi-rural city of Reguengos de Monsaraz in southern Portugal. The considered EC involves two different local actors, namely the residential consumers and a local winery. A strong focus was placed in exploring different pathways to achieve higher renewable penetration scenarios at the local level by adopting different collective PV arrangements under the EC framework. These arrangements involved assigning different roles to the involved actors, choosing different system architectures, but that will also demand different business models.
Building on real electricity demand from PTs and from a local winery, as well as a GISbased rooftop cadaster and weather data, the Reguengos de Monsaraz EC was modeled using the open-source Calliope modeling framework. Results showed that collective arrangements contribute to the deployment of additional PV capacity and, potentially, a modest reduction in the LCOE of the generated electricity. However, there are clear trade-offs between pathways: choosing to centralize the PV capacity in a small number of actors may lead to more cost-efficient investments (driven by economies of scale) but lead to a greater use of the public distribution grid and increases grid costs. On the other hand, a more decentralized configuration promotes energy democracy and citizen participation.
Overall, all configurations are feasible and with positive environmental and economic impacts for the Reguengos de Monsaraz case study. Moreover, the results show that local actors can make use of energy modeling tools for local decision-making processes, namely, to identify the most suitable EC set-up. Nonetheless, the implications of the trade-off between pathways suggest that collective PV arrangements and other business models fostered by EC (e.g., aggregators, VPP) may be addressed as multi-objective problems rather than only focusing on cost minimization (e.g., minimize greenhouse gas emissions and considering land use or social acceptance). In this context, the newly made-available Calliope feature SPORES [52] may be considered in order to determine several near-optimal alternative configurations.
The implementation of complementary technologies (e.g., demand-side management, storage, or curtailment) or local energy markets (grouping adjacent urban areas) could be considered to increase the local SSR and valorize eventual RES surpluses. It is also important for this type of study to be complemented with both multi-year and highresolution analyses to validate and consolidate the reported findings (e.g., evaluate the impacts of deploying PV capacity in local grids from a power electronics perspective). However, this requires that energy optimization models be able to tackle computational complexity challenges to ensure model tractability when large datasets and/or complex power grids are considered.  System-wide levelized cost of electricity