A techno-economic analysis of an optimal self-sufficient district

Many cities and districts have announced that their ultimate goal is to be energy self-sufficient, but there are many technical and economic challenges that are required to be studied. The aim of this study is to find costoptimal technical solutions for districts with high energy self-sufficiency rates that can cover their electricity demand. Two methods are applied, a rule-based method and an optimization method, to find the renewable energy system capacities for local centralized wind power, solar photovoltaic, battery, heat storage and heat pump in a district with a minimum life cycle cost. The Kalasatama district in Helsinki-Finland, is taken as a case study. The results show that the full energy self-sufficiency target requires very high investments in the renewable energy systems. For the studied case, reducing the self-sufficiency rate to 76% can bring down the life cycle cost by 66% and achieve a net-zero annual energy balance. It is economically and technically more feasible to aim achieving Positive Energy District or Net-Zero Energy District instead of full energy self-sufficiency. Based on the obtained results, the main investment should be made in wind power, due to its higher utilization rate around the year compared to solar photovoltaic. Investments in the expensive centralized battery storage sharply drops when the self-sufficiency rate is reduced from 100%. It is revealed that due to the high population density and limited availability of renewables, the physical boundary of a district may not fit the required renewable energy installations if high self-sufficiency is targeted. This will frequently lead to expanding the district boundary towards a virtual balancing boundary.


Introduction
Community energy projects have big potential to meet the European Union (EU) energy transition targets. Individuals, communities and local authorities are at the vanguard of EU's energy transition: they are increasingly controlling and producing their own renewable energy and fostering the transition to fairer and more decentralised energy systems. According to a recent study [1], half of all European Union citizens could be producing their own electricity by 2050 and meeting 45% of the EU's energy demand. This, together with the revised Renewable Energy Directive (REDII) [2], provide a suitable framework for the establishment of Renewable Energy Communities for the decarbonisation of local energy systems. The new improved EU legislation provides citizens and energy communities with a number of guarantees that ensure they are able to invest in renewables and benefit from the energy transition, giving them the right to generate, store, consume and sell their own energy. One example of such a pioneer energy community is the LEMENE project [3]. In LEMENE, a district of a small-scale industry is planned to be energy self-sufficient, where energy is mainly produced by solar power (4 MWp) and biogas (gas engine 8.1 MW plus fuel cells 130 kW). There is a centralized battery storage to even out fluctuations in the electricity production, and thus secure the power balance. Combined heat and power (CHP) technology is utilized, so that most of the waste heat will be recovered for heating.
For research on Zero/Positive Energy Districts, Walker et al. [4] presented a review on the concept of energy hubs in energy positive neighbourhoods. An important finding from the review emphasizes making a clear definition of the boundary of the neighbourhood across which energy is exchanged. Good et al. [5] identified energy modelling and simulation, performance assessment, information technology, and business model development as the challenges for the development of positive energy neighbourhoods and districts. Becchio et al. [6] proposed an evaluation method based on the Cost-Benefit Analysis (CBA) in order to produce economic benefits. Their approach was validated on a real case of a Net Zero-Energy District in Turin (Italy). ur Rehman et al. [7] investigated achieving a positive energy community in a cold climate using renewable energy consisting of photovoltaic panels, wind turbines and electricity storage. They used a multi-objective optimization tool to minimize two objective functions: imported electricity and life cycle cost. The results suggest to firstly invest in wind turbines, secondly in electricity storages and thirdly in photovoltaic panels. The life cycle cost (LCC) of net/nearly zero energy buildings is subjected to many studies in terms of primary energy [8] and carbon dioxide emissions [9], which extend to the community and district scale.
The pathway towards the EU 2020 energy and climate targets has endorsed the transformation of Europe's communities to Net-Zero Energy Districts (NZED), raising interest in self-sufficiency solutions throughout Europe [10]. The NZED concept shifts the problem to the grid side because it targets reaching an annual balance between the energy import and export and does not care for seasonal imbalance (e.g. high energy export to the grid in summer and high import in winter). This requires high investments in smart grid installation and operation to cope with such a behaviour. Therefore, NZED is considered as a concept on the way towards achieving self-sufficient districts, which is the ultimate goal. However, reaching the 'Net-Zero Energy' objective is still a challenge for districts and reaching full self-sufficiency is even more challenging [11]. The importance of research on Zero/Positive Energy Districts has led the authors' organization to start a new global collaboration project: Annex 83 Positive Energy Buildings (PED) 2020-2023 [12] under the IEA-Energy in Buildings and Communities programme (EBC).
Available modelling tools used in analysing energy systems with different shares of renewable energy are numerous. Ringkjøb et al. [13] reviewed 75 modelling tools, Lopion et al. [14] evaluated 24 tools, of which 10 are not included in Ringkjøb's et al. paper. Pfenninger et al. [15] highlighted the need for faster and smarter models to answer specific questions along with large integrated models. Ma et al. [16] listed and compared several techno-economic analysis tools of hybrid renewable energy systems. They also listed several 100% renewable energy analysis made on national, district and building scale in different countries.
EnergyPLAN [17] is an analysis freeware for different kinds of energy systems, including both heat and electricity production and consumption. Input data of the energy production infrastructure, including condensing and CHP plants as well as renewable energy generation, is given as total sum of capacities and properties. Also electricity use and heat use are given as aggregated time series, i.e. for a whole district, even a country. The tool includes generic electricity and heat storage models. EnergyPLAN has been widely used to simulate 100% renewable energy systems on national levels in Croatia [18], Denmark [19], Finland [20], Ireland [21], Macedonia [22] and Portugal [23]. Østergaard and Lund studied 100% renewable scenarios for the Danish city of Fredrikshavn [24]. The analyses show that electricity storage gives significantly better integration of wind power compared to heat storage and biogas storage. In another study Østergaard et al. developed 100% renewable energy scenario for the Danish city of Aalborg based on wind power, bio-resources and low-temperature geothermal heat [25]. They investigated the system impact of different types of energy storage systems. Rinne and Syri [26] used EnergyPLAN to simulate the Finnish future energy system with large amounts of CHP and wind power combined with thermal storage. The economically optimal storage size was found to be up to 30% of the total annual heat demand. The use of economically optimal thermal storage can increase the CHP generation by 15%.
There are many studies that emphasise the necessity of full energy sector coupling when making strategies of shifting to 100% renewable energy system. Drysdale et al. show on a city level how shifting to 100% renewable energy system is possible by the full integration of all energy sectors (buildings heating and cooling, transport, and industry) and various inter-linked production technologies [27]. The case city is Sønderborg in Denmark and they used EnergyPLAN in the analysis. The study describes methods that can be used by the community to utilize the locally and even globally limited renewable energy resources like biomass, wind and photovoltaic (PV) even though the community does not have the aforementioned energy sources. Similar study is carried out by Thellufsen et al. [28]. They introduce guiding principles for local communities to build their energy strategy to reach 100% renewable Heat storage discharge efficiency (%) energy system as part of the national strategy or even from the global point of view. They show also principles of the ways to allocate the national, European and global energy demands of industry and transport to the local community. The used analysis tool is EnergyPLAN and case study municipality is Aalborg in Denmark. Dominković et al. present modelling method of smart energy systems and applies it in tropical regions [29]. They introduce an optimization model for energy systems based on minimizing holistic socio-economic costs including among others CO 2 emission and air pollution costs. The case study is made for Singapore. The focus of the work was on district cooling adoption in tropical environment. The optimization studies included integration of different energy sectors like power, cooling, gas, mobility and water desalination. The work included a mix of several power generation sources: CHP from biomass, waste and gas, PVs, and fuel cells. Moreover the batteries and heat storages where utilized like demand side management of industry and households. The conclusion is that sector coupling can significantly reduce socio-economic costs while reducing CO 2 emissions and providing cleaner air. Kilkiş extends the integrated energy system analysis to exergy analysis with a new developed tool REMM [30]. The work focuses on the integration of a district energy supply chain with the aim of bringing the pilot district closer to a ''netzero'' status. Results show that the pilot district, Ö stra Sala backe in the Uppsala Municipality, has the potential to become net-zero exergy district given that the various measures of the project are integrated to complement each another, i.e. measures to reduce annual exergy consumption and increase on-site exergy production. EnergyPRO [31] is a model for the design of small-scale CHP plants and the analysis of the operation of plants in complex energy systems. A 100% renewable energy scenario were analysed for the Danish city of Aalborg [32]. The study concentrate on the impact of energy storages in the system operation with wind power integration. Kiss [33] studied the energy system of the city of Pécs in Hungary with various proportions of renewable energy. The distributed energy generation and microgrid modelling software HOMER [34] was used in numerous city level studies around the world: hybrid wind-PV based energy system in Iran [35], techno-economic analysis in India [36], grid connected PV in Nigeria [37], etc. Rahman et al. [38] applied HOMER to assess the implementation of a hybrid energy system for the off-grid Sandy Lake community in Canada and to propose best hybrid energy combination to satisfy the electricity demand. They developed seven different energy scenarios from 0 to 100% renewable energy shares. Henning and Palzer [39] developed a comprehensive model (ReMod-D) for Germany's national electricity and heat sector in a future energy system with a dominant renewable energy contribution. The tool models the hourly energy balance of electricity and heat, including all renewable energy converters, storages and loads. Optimization is applied to identify the system configuration with minimal overall annual costs. The described approach of the model is similar to the tools used in this paper, but differs in the operation and control of the energy storages and heat pumps and also in the used optimization method. The results of the optimized hybrid renewable energy systems are presented as case studies for three different building retrofit energy demand levels.
Optimization-based design methods are widely used to maximize the utilization and to minimize the cost or environmental impacts of various renewable energy and energy storage systems. These are often formulated as time series optimization problems, where the design variables set constraints on the variables of the system's operation in every timestep. Many different stochastic optimization approaches have been used to solve such problems. Genetic algorithms (GA) have been used in many studies for optimizing renewable energy integration in buildings and communities. Some examples are: to optimize a solar energy driven thermal energy storage system [40], to minimize the LCC and imported electricity for a renewable-based district in Nordic conditions [7], to calculate the LCC and carbon dioxide emissions of Dutch and Finnish prosumers [41], for optimization of carbon dioxide emissions and exergy [42] and for multi-objective optimization design of a university campus energy system [43]. Other approaches, such as simulated annealing (SA), [44], and particle swarm optimization (PSO), [45], have also been used for optimizing energy systems. Zhang et al. 2018 used chaotic search and harmony search methods based on a SA approach to optimize renewable energy systems with integrated energy storages [46].
In a full energy self-sufficient district (100% self-sufficiency rate), all the operational electricity and heating/cooling demands are covered by renewable energy generated inside defined boundaries of the district. Achieving full energy self-sufficiency in a district using renewable energy technologies satisfies the operational carbon-free district target. From the financial perspective, in some countries and due to the absence of feed-in tariff, transmission fees and taxes, the energy export price from buildings to the energy networks is much lower than the import price. This promotes increasing self-sufficiency by matching the building's generated energy with the building's demand since it will avoid purchasing energy at a higher price.
From the above, it can be concluded that there is a need for research that focus on studying the economic and energy implications of different levels of self-sufficiency rates of districts, as well as investigating the potential of applying simple versus more advanced tools for this purpose. Moreover, most of the above studies consider cases where renewable energy is introduced to existing energy infrastructures. The case study considers a new district where energy demands are very low, which allows investigating different combinations of renewable energy integration. This study presents two methods to find the cost-optimal renewable energy solutions for districts with high energy selfsufficiency rates (SSR) and to apply the two methods on a new district under construction. The two methods are a new rule based method and a deterministic optimization method. The rule-based method gives priority for energy matching and self-consumption of the generated energy at each time-step and was presented in [47], where preliminary results of the implementation on the new Kalasatama district in Helsinki-Finland were presented. In this paper, the Kalasatama district is also used as a case study but here the study extends towards deep technoeconomic analysis by additionally calculating the life-cycle cost (LCC) and investment cost of the installed renewable energy technologies and the impacts of the SSR on the LCC and comparing the requirements for achieving full energy self-sufficient districts (SSR = 100%), PEDs and NZEDs.
The novelty of the paper can be summarized in the following: -to compare the performance and results of two methods (the rulebased method and the optimization method) that are used in techno-economic analysis of NZED, PED and self-sufficient districts and to determine whether a rule-based method can sufficiently identify best combinations of the renewable energy technologies and carry out the detailed energy analysis or an optimization method is anyway needed; -to investigate solutions for highly-dense urban districts that have limited renewable energy generation inside the boundary to become self-sufficient; -to apply the methods and find what sources of technologies of RE generation (solar-based or wind-based) and storage (electrical or thermal) will be more viable for a new Finnish district. To the authors' knowledge, no other published study was found investigating the techno-economic analysis of renewable energy self-sufficiency in Finland in a similar way as presented by this paper.
This study is very relevant nowadays since there are ambitious plans worldwide for making districts and cities self-sufficient and carbon--neutral. However, there are many technical and economic challenges that are to be studied. In comparison, other goals, like NZED, are less challenging but are on the way towards achieving the above goal. The paper will find the optimum range of solutions starting from NZED until reaching full self-sufficiency.
The study includes some aspects of energy sector coupling but not to the full scale. Energy integration is realized in the energy demand side where electricity demand of buildings is combined with the electrical vehicle and electricity load for building cooling. Heating is also integrated to the power sector via electrical heat pumps. Industry and heavy transport are not considered, nor complex variety of energy production technologies. The approach is rather straightforward: what are the required energy generation and storage capacities for a totally selfsufficient district based on PV and wind electricity generation integrated with electricity and heat storages with fixed demands? The paper is arranged as follows: Section 2 presents the two methods for calculating the techno-economic performance of the district; Section 3 presents the description of the Kalasatama case study including the cost data for the renewable energy components; Section 4 presents the results from the two calculation methods; Section 5 presents the discussion of the results including sensitivity analysis of the input data; Section 6 presents the conclusions of the study.

Methods
Two methods, a rule-based control method (EnFloMatch tool) and an optimization method, are used to find the techno-economic performance of the system. These two methods differ in their approach for solving a given problem. The rule-based method follows defined rules based on maximizing energy-matching and does not consider the data of the energy generation and demand in the next time-steps. On the other hand, the optimization method is a sophisticated method that targets finding the optimal design of the district energy system and considers the data of the energy generation and demand in the next time-steps. Both methods make post-processing of the annual energy demand data of the district (electricity, heating and cooling), produced by building energy performance simulation tools.

Life cycle cost definition and calculation
The EU's Energy Performance of Buildings Directive (EPBD) applies a comparative cost-optimality framework for global cost calculation considering long-term expenditures and savings during the calculation period. The global cost is a LCC that consists of the initial cost and the annual operational costs (running and replacement costs). The disposal cost can also be included in the global cost if applicable [48]. The LCC calculation in this paper includes investment costs and operational costs (including energy, maintenance and replacement costs) but not disposal cost. In the LCC calculation, future cash flows are calculated using an annualised discount factor. The LCC is calculated according to the following equation: The discount factor for annual costs is The discount factor for replacement costs is In these calculations, the operating life T is 25 years and only the battery system requires considerable replacement during that life time. The interest rate r is assumed = 3%.

The rule-based control method (EnFloMatch Excel tool)
The energy flow inside a district energy system and to/from the electricity grid is depicted in Fig. 1. At each time-step i, the rule-based method targets first to cover the electrical demand P d,i by the PV generation,P PV,i and the wind generation, P W,i . If there is surplus electricity generation, it is stored in the battery. When the battery is full, the excess electricity is used to run the heat pump to generate heat, Q HP,i . The battery can also be used to run the heat pump even if the battery is not fully charged, which is when the battery state of charge is higher than a given value and the heat storage state of charge is lower than a given value. If there is still excess electricity, it is exported to the grid, P exp,i . When the electrical demand is not covered by PV and wind generation, the needed power is discharged from the battery, P fB,i , and if it is not enough, the shortfall is covered by electricity imported from the grid, P imp,i . The heat side operation is similar, but the difference is that there is no local heat generation other than the heat pump. First the heat demand, Q d,i , is covered by the heat generation of the ground source heat pump system. If there is surplus heat, it is used to charge the heat storage, Q tQS,i . Since it is assumed that the system is only electrically connected to the grid, heat is produced only enough to cover the heat demand and to fill the heat storage. When the heat generation of the heat pump is not enough to cover the heat demand, the heat storage is discharged, Q fQS,i , and when even this is not enough, heat is generated by importing electricity from the grid to run the heat pump.

Verification of the EnFlowMatch tool
The developed rule-based EnFloMatch tool is verified against a welldocumented advanced energy systems analysis computer model Ener-gyPLAN [49]. The approach of the two tools is quite different, Ener-gyPLAN handles energy balances of complicated and integrated energy systems, whereas EnFlowMatch considers quite limited energy systems [27]. The strength of the EnergyPLAN is in sector coupling energy analysis of districts including the whole variety energy production technologies and energy demands ranging from industry and transport to buildings [28]. EnergyPLAN uses hourly simulations of complete regional or national energy systems. The focus is on the design and evaluation of sustainable energy systems with high penetration of fluctuating renewable energy sources, CHP and different energy storage options. EnergyPLAN can handle solar PV and wind power generation profiles as well as electricity demand profiles together with batteries for storing excess electricity generation. Despite of the different approaches of the tools, it was possible to verify the behaviour of the electricity storage. The verification was done by using the same electricity demand, solar PV generation and wind power generation profiles as well as the same battery storage capacity. The data used in this comparison is the same as used in the case study presented in this paper. The main focus of the verification is on the behaviour of the battery energy storage. Correlation analysis done in Excel indicates that the correlation factor between the results of the two tools for a battery capacity of 690 MWh in a one year simulation is 0.99964. This indicates that the EnFloMatch and EnergyPLAN tools give very similar results.
The heating side verification was not possible because of the difference in the strategies to use the heat storage. In EnergyPLAN the heat storage is used to optimize the electricity generation by minimizing the excess electricity and power-only production in the system (like condensing power plants with no heat production), which does not allow the use of the heat storage for covering the seasonal heat demand, which by contrast is allowed in the EnFlowMatch.

The optimization method
A linear programming (LP) optimization problem is formulated and solved in Matlab using the linprog algorithm [50]. The algorithm uses a dual-simplex deterministic approach to solve LP problems. The objective of the optimization problem is to minimize the LCC by optimizing the energy system components' capacities and operation. There are hence two types of variables; variables that determine the capacity of different system components, hereinafter referred to as design variables, and variables that define the operation of the system, hereinafter referred to as operational variables. The parameters in the optimization problem are comprised of different prices, costs and technical factors.
A four-hour time-step is used in the optimization method in order to keep the size of the optimization problem at a manageable size. Smaller time-steps would entail significantly more variables and thus form a too computationally expensive optimization problem to be solved within an acceptable calculation time frame.
In the context of the study, the optimization method is used to solve several optimization problems. Each problem is a single-objective optimization problem, which is solved by setting a target value for the SSR and minimizing the LCC, i.e. the objective function, using the design variables (P PV,c , P W,c , E B,c , Q QS,c , Q HP,c ) and operational variables (P imp,i , Collecting the solutions for a range of selected SSRs, will then give the minimum LCC as a function of the SSR.
The investment and maintenance costs are dependent on the capacities of the system components, while the energy cost equals the difference between the total exported electricity cost and the total imported electricity cost. To be able to present the objective function in a more compact form in the optimization problem, the components' capacity dimensions, costs and maintenance costs are, respectively, formulated as vectors as follows: The objective function is then expressed as follows: The last term of the objective function represents the replacement cost of the battery. The operational life of the battery, T B , is namely significantly shorter than the operational life of the other system components, T.
The constraints in the optimization method are comprised of equality constraints and inequality constraints. The equality constraints are three different types of energy balances. There is one energy balance for the electrical energy flows in each time-step: ( and one energy balance for the heat flows in each time-step: The last equality constraint is set by the SSR, and is expressed as follows: All the inequality constraints are related to the capacities of the system components. The heat pump power output at any time-step must be lower than the maximum output power capacity of the heat pump. The constraint for the heat pump is thus expressed as follows: The energy stored in the battery and the heat storage must always be lower than the storage capacity, and the energy storage demand at the end of the year must be the same as at the beginning of the year. The constraints for the battery and the heat storage are expressed as follows:

Definition of the Net-Zero energy district and Self-Sufficiency rate
The NZED level refers to the status when the district reaches an annual balance between the imported and exported energy crossing the defined boundary of the district. In the studied case, this is about balance between electricity export and import since it is the only type of energy that is exchanged with the external grid. Increasing the renewable energy generation in the district beyond the NZED level will bring the district to PED level, in which the annual exported energy is higher than the imported energy. Continuing investing in the local renewable energy generation can eventually make the district Full Energy Self-Sufficient, in which the district can cover all its energy demand by its own generation without a need for importing any energy from outside the boundary. In this state, the on-site generation and stored energy will cover the peak loads, even if they occur in a very short time. This will require very large solar PV and wind turbine installations, which would normally result in a considerable amount of energy export. However, the required generations can be reduced by implementing proper demand side management actions to reduce peak loads and using energy storage technologies.
The self-sufficiency rate is the ratio between the electricity demand covered by the local renewable sources and the total electricity demand of the district. The electricity demand is comprised of electrical energy used for appliances, lighting, electric vehicles (EVs), space cooling and heat pump. The self-sufficiency rate is defined as follows: (16) where N is the number of time-steps in one year, P imp,i is the imported electricity at time-step i, P d,i is the electricity demand of the district at time-step i, Q HP,i is the heat generated by the heat pump at time-step i, COP is the heat pump coefficient of performance and t is the size of the time-step.

Life cycle cost of the reference case
In order to create a picture of how the studied district-integrated with renewable energy installations performs financially compared to alternative energy systems, the LCC of the studied case is compared with a reference case. The reference case is based on a heat pump system with electricity import from the grid, without any local electricity generation, batteries or heat storages. The LCC of the reference case (LCC ref ) includes the cost of imported electricity as well as the investment and maintenance costs of the heat pump system only. The LCC does not include costs of decommissioning nor recycling of the installed equipment. The LCC for other parts of the district (other than the energy system) is assumed unchanged. The maintenance cost is assumed to cover the required replacement cost needed for the heat pump. The LCC ref can be calculated as the following: The heat pump system is dimensioned according to the maximum heat demand: In the reference case, the total electricity demand is imported (E imp,ref ). The difference between the LCC for any new case that includes renewable energy installations and the reference case is defined as ΔLCC.

Description of the case study
The case study is a based on simulating the Kalasatama district in the city of Helsinki-Finland, which is currently under construction. The district consists of apartment buildings, offices and schools. The area of the modelled buildings is indicated in Table 1. The estimation of the number of electric vehicle charging points is based on the city plan. The district is assumed to be built as an energy-efficient district with specifications of the building envelope insulation and heating, ventilation, and air conditioning (HVAC) system components as indicated in Table 2, which are better than those required by the current building regulations in Finland. Special attention is paid to the simulation of the apartment building in order to present the behaviour of the whole district by multiplications of one simulated building. As regard the apartment building, the standard building profile used in [51] is taken. This energy demand profile is built considering dynamic and realistic values for internal gains, appliances and schedules for people to emulate a more realistic behaviour.
The energy system of the district is presented in Fig. 2. It is consisted of electricity generation from renewable sources solar (PVs and wind turbines) connected to a centralized battery system in the district. The district does also have a heating system consisting of a centralized electrically-driven heat pump, which is connected to a centralized heat storage. There is also a bi-directional connection to the electrical grid for electricity import and export. As shown in Fig. 2, the boundary of the district may extend to a virtual balancing boundary that can include other renewable energy installations outside the physical boundary.
The energy demand for heating, cooling and electricity of the office buildings and schools are calculated using the IDA-ICE building performance simulation tool [52], while the energy demand for the residential buildings are calculated with the TRNSYS building simulation tool [53]. The simulations indicate that the annual heating demand of the community is 97.3 GWh, which consists of space heating (47%), ventilation (6%) and domestic hot water (47%) demands. The annual cooling demand of the community is 10.5 GWh, of which space cooling represents 74% and ventilation represents 26%. Offices and apartments constitute 51% and 49% of the cooling demand, respectively. There is practically no cooling demand in schools, which is due to long summer holiday from early June until mid of August.
The annual electricity demand of the district is 72.7 GWh, which includes the occupants' use loads, fans, pumps, electric vehicles and cooling electricity demands. For this latter, it is assumed that the cooling demand is covered by free cooling which has a seasonal energy efficiency ratio (SEER) of 25. As no reliable data is available about the EV charging loads in the district, this demand is assumed similar to the charging profile given for a small distribution system modelled in Sweden [54]. The EV demand includes a presumption that the utilization ratio of the EV charging points is 50%, so that only half of the charging points are in use at the same time. In total, the EV demand forms 13% of the district electricity demand (excluding the heat pump load). The aforementioned energy demands of different energy systems are collected in Table 3 3

.1. Solar and wind power generation simulations
The solar PV and wind power generation was simulated by the IDA-ICE tool. The solar PV generation was calculated assuming a tilt angle of 45 • and assuming that 50% of the panels are facing south, 25% facing east and 25% facing west. The total efficiency, including system losses, of the panels is assumed to be 0.15. It is assumed that the wind power is generated offshore and that the turbines have a 140 m hub height with a nominal power of 5 MWp per turbine. The wind generation is based on typical weather year (TRY2012) for Helsinki. The simulation tool (IDA ICE) includes wind generation estimation based on this weather data and the height of hub plus the location of the turbine (offshore).

Cost data
The sources of the input cost for the RE components and energy price data in the case study are presented in this subsection.

Solar photovoltaic panels
The global weighted average total installed costs of PV decreased  over 70% in less than ten years [55]. The investment cost for 10 MWp solar PV plant was estimated to be 1000 €/kWp [56] in Finland in 2017.
In the study, the total price is assumed to come down to 800 €/kWp in 2020. This is within the price range used by a German study in 2018 for large-scale PV systems [57]. The operational and maintenance (OM) costs include the necessary replacements due to degradation of electrical components. The annual OM costs are assumed equal to 1.5% of the solar PV investment costs, which is in accordance with the costs given by [56].

Wind power
In the case study, offshore wind power is chosen and not onshore wind power because the studied district is located in Helsinki, which is surrounded by sea. The investment costs of offshore wind have come slightly down during the past ten years [55], but the change is modest compared to solar PV prices. The price for a 40 MWp offshore wind farm in Finland is about 3000 €/kWp [56]. This is the price used in the study, which is also close to the price levels given by the German study [57]. Operational and maintenance cost is 2% of the investment cost, which also includes replacement of the components that are needed to reach the life time of 25 years. This is slightly higher than that given by [56].

Battery
Lithium-ion battery is chosen for the electricity storage among other possible storages, like pumped hydro, flywheel, compressed air and other battery technologies [55,58]. Batteries are flexible and react fast to the dynamic changes in charging and recharging. They were studied for balancing services in electrical markets among other storage technologies [59]. The hinder for wider use of batteries as seasonal electrical storage is the high investment costs. Battery technology is under extensive development and remarkable improvements of its technical features as well as decrease of the prices are in sight [60]. The price of Lithium-ion batteries has fallen by over 70% in less than a decade for transport applications and the price is expected to continue dropping up to 60% by 2030 [55]. Present energy installation costs vary in a wide range, starting at 200 USD/kWh, while the most expensive installations are topping out at 1260 USD/kWh [55]. The price of 600 €/kWh is chosen, which is close to the average price [55]. The range of the depth of discharge (DoD) of the battery is from 80% to 100% and the roundtrip efficiency is between 92 and 96% [55]. The maximum DoD is assumed to be 90% and the round-trip efficiency is assumed to be 94%. The calendar life of Lithium-ion batteries is between 5 and 18 years [55]. The life time of the battery is chosen as 12.5 years with a capacity loss of 20%. Replacement costs are assumed to include the renewal of the battery cells (50% of the original investment cost) and that the prices of battery cells is assumed to come down within the life time of 12.5 years [55].

Ground source heat pump
The investment cost of large-scale ground source heat pumps is considered a bit higher than presented by Piper et al. [61] but lower than the nominal investment cost for geothermal heat pump systems [60].
The used total nominal investment cost is 1000 €/kW including the heat pump and heat sources. The reason for the higher cost is that the most relevant heat source could be deep boreholes (>800 m) and such systems are only in the piloting phase, so exact costs are not available. Nevertheless, the cost of such systems is higher than that for standard shallow boreholes (<350 m). The heat pump COP is assumed constant and equal to 3, which also matches the COP of analysed existing large scale heat pumps connected to district heating network [62].

Hot water heat storage
Cavern hot water storage could be used as a large-scale heat storage in the context of this case study. In Helsinki, the local energy company Helen Ltd is building a cavern hot water heat storage in an old oil storage located on the Mustikkamaa island [63]. The size of the cavern is 260 000 m 3 and the estimated storage capacity is 11.6 GWh. The investment cost of this storage is estimated to be 1.3 €/kWh. In this case, the investment price includes only the alteration work from oil storage to hot water storage. IRENA gives price spread from 0.1 €/kWh to 10 €/kWh for underground thermal storages (UTES) [64]. Tonhammar [65] gives estimates for the excavation price from 116 €/m 3 to 296 €/m 3 , which is equal to 3.3 -8.5 €/kWh with 30 • C temperature difference. In the study, it is assumed that the investment price of the storage is 5 €/kWh, which is much higher than the price of the Mustikkamaa storage, but is rather low compared to the other investments. The energy efficiency of the cavern heat storage is estimated to be 80% [66], though higher estimates for the efficiency of cavern thermal energy storages are presented in [65].

Electricity price
Electricity price for households in Finland, including electrical energy, transmission fee and taxes, increased during the past years [67]. Electricity price for big energy consumers, like the district in the case study, is not clear. Hence, a fixed price of 80 €/MWh for the imported electricity is assumed, which is in the level for medium-scale industry. The price of the exported electricity follows the hourly spot-price by Nord Pool [68]. The yearly average spot-price in Finland during the last ten years ranges from 29.66 €/MWh in 2015 to 56.64 €/MWh in 2010 [68]. In 2019, the yearly average spot-price was 44.04 €/MWh [67]. The evolution of the spot-price is difficult to predict, so a quite moderate price for the exported electricity is assumed, namely 35 €/MWh. Table 4 collects the economic data of the system components.

Results of the rule-based and the optimization methods
This section presents the results of the energy system behaviour of the Kalasatama district case, first using the rule-based method (EnFlo-Match tool) and then using the optimization model.

Results of the rule-based method (EnFloMatch tool)
The following subsection presents the results of the required system capacities for full self-sufficient district as well as for reduced selfsufficiency.

Full self-sufficient district (100% self-sufficiency rate)
The district is studied with three solar PV panel capacities covering 100%, 50% and 0% of the total roof area of the buildings in the district, corresponding to 30 MWp, 15 MWp and 0 MWp, respectively. The studied range of the wind power is from 20 MWp to 50 MWp, corresponding to 4 to 10 wind generators, each has a nominal power of 5 MWp and a hub height of 140 m. The total capacity of the heat pump is fixed at 44 MW, which corresponds to the maximum heat demand with the used 4 h time-step.
It is to find the required battery and heat storage capacities to reach full energy self-sufficiency rate (SSR = 100%) for the total coverage of the electrical, heating and cooling demands with different PV and wind generation capacities. The results are shown in Fig. 3 and Fig. 4, where all presented combinations in these two figures fulfil the full selfsufficiency target. These results reveal that one possible system combination will require a 100% coverage of the available roof areas with solar PV panels (30 MWp nominal power) in addition to 4 offshore wind turbines (a total rated power of 20 MWp), a battery capacity of 715 MWh and heat storage of 44 GWh. This combination will also produce 13.5 GWh of surplus electricity for export. The required capacities of the battery and the heat storage presented in these two figures are extremely large when compared with the existing installations in the world (the 100 MWh battery field at Hornsdale in Australia and the 11.6 GWh cavern water heat storage at Mustikkamaa in Helsinki) and the investment costs are unrealistically high, especially at low wind power capacities.
When the roof coverage area of the PV drops to 50% and 0%, 15 MWp and 0 MWp, respectively, the minimum required wind power for SSR = 100% increases from 20 MWp to 25 MWp, because with smaller wind generation capacity it is not possible to reach 100% selfsufficiency. As a result, the required battery capacity (Fig. 3) and heat storage capacity (Fig. 4) also increase, but the surplus electricity decreases.

Reduced self-sufficiency (self-sufficiency rate below 100%)
In the following, the required battery and heat storage capacity is studied when the SSR is reduced from 100% to 99% and 95%. In these cases, the PV production is fixed at 30 MWp, i.e. 100% solar PV roof coverage. The required battery capacity and surplus electricity are presented in Fig. 5 and the heat storage capacity in Fig. 6. In these two figures, it can be observed that the required battery and heat storage capacities drop dramatically when loosening the self-sufficiency target. The battery capacity drops from 715 MWh to around 100 MWh and the heat storage capacity drops from 44 GWh to 27 GWh at SSR = 95% with a 20 MWp wind power generation. Loosening the SSR to 99% or 95% generates a remarkable drop in the LCC and investment cost, which can be seen in Fig. 7 when the solar PV capacity is fixed at 30 MWp (100% coverage of the roof area). These costs are presented as cost differences compared to the reference case cost. The LCC and the investment cost decrease along with the increasing wind power capacity. However, at SSR 95%, when the wind power is over 30 MWp, the LCC and investment cost tend to stop decreasing. The minimum LCC solution for SSR > 95% is reached when the wind power capacity is the highest possible (50 MWp), whereas the minimum LCC for SSR < 95%, is reached at a lower wind power capacity.

Results of the optimization method
The results of the optimization model are depicted in Figs. 8-10. These figures show the optimal solution for the LCC minimization for different SSRs. Fig. 8 shows the LCC of the renewable energy system as well as the ΔLCC, which is the difference between the LCC of the renewable energy system and that of the reference case. In Fig. 8, it can be observed that the optimal LCC drops by 30% and 49% when SSR is decreased from 100% to 99% and 95%, respectively. As the SSR Table 4 Economic data of the system. PV [56,57] Offshore wind [56,57] Battery [55] Heat pump [60,61] Heat storage [64,65]    continues to decrease, the optimal LCC declines at a reducing rate converging to a value that is about a third of that at 100% selfsufficiency. The ΔLCC curve in Fig. 8 shows that a renewable energy system with a SSR of 93% breaks even (ΔLCC = 0) with that for the reference case. The renewable energy system becomes increasingly more profitable than the reference case when the SSR drops below 93%, until it reaches a minimum ΔLCC level (maximum profitability compared to the reference case) at about SSR = 75%, where it almost stays at the same level. By examining the investment costs of the system components in Fig. 9 and the effect on the LCC in Fig. 8, it can be observed that the wind power capacity followed by the battery capacity are the biggest contributors to the investment cost for a full self-sufficient system (50% and 32%, respectively). Nevertheless, at full self-sufficiency, the optimal solar PV capacity is as high as 76% of the wind capacity, however, the solar PV does not have a significant impact on the LCC since investment in the solar PV is relatively low.
As the SSR starts to decrease from 100%, the battery investment cost drops sharply because coverage of electricity demand can be achieved at a lower cost by importing from the external grid. Fig. 9 indicates that, even if the SSR is reduced, most of the capital should be invested in wind power in order to reach the minimum LCC. For SSR below 80%, the solar PV generation totally diminishes and the wind power is the only electricity generation in the optimal energy system.
On the basis of the results shown in Fig. 8 and Fig. 9, it can be concluded that wind power is a more cost-effective solution for largescale energy generation than solar PV in Finland, which is due to the higher availability of wind power around the year. The wind power capacity utilization rate in the studied case is 53%, while the corresponding rate for solar PV is only 11% (the capacity utilization rate is defined as the fraction of the installed capacity that can be utilized on an annual basis). Hence, wind power is more remunerative than solar PV, despite that the investment cost per kW capacity is lower for solar PV than for wind power. A combination of wind and solar energy is, however, an effective way to increase the SSR of the district.
The energy generation and storage capacities of the different system components in the optimal renewable energy system are presented in Fig. 10. It can be observed that the battery capacity is very small    8. Optimization model results: LCC and ΔLCC of the optimal renewable energy system for different self-sufficiency rates (SSR). ΔLCC is the difference between the LCC of the renewable energy system and the LCC of the reference system.  compared to the heat storage capacity despite that the battery investment cost is significantly higher than the heat storage, which is due to its higher cost to energy ratio.

Comparison of cost and net energy results between the two methods
To compare the results of the two methods, a verification is made of the EnFloMatch tool calculations by implementing the optimal design values produced by the optimization model for the capacities of the wind power, PV power, heat pump power, battery capacity and heat storage capacity for the cases of SSRs from 70% to 100%. The compared results for the ΔLCC calculations in Fig. 11 show that there is a gap in the results for high SSRs starting from SSR = 90%, otherwise the results are very consistent for SSR < 90%. Fig. 12 shows the annual net energy, which is defined as the total annual energy export from the district across the defined boundary minus the total annual energy import. This Figure shows that the Kalasatama district can be a PED when SSR > 76%. This SSR is thus the NZED point of the cost optimal renewable energy system. At this point, 76% of the annual energy demand is covered by local energy generated inside the district, while 24% of the annual electricity demand is imported and an equal amount of electricity is annually exported. The total investment cost and the LCC at this point are, respectively, 21% and 34% of those at 100% SSR. Fig. 12 reveals that the EnFloMatch tool found the same SSR found by the optimization model at which the district is an NZED.
As a conclusion from this comparison, the rule-based EnFloMatch tool is shown to best suit the technical analysis when a range for the design variables is given, like available roof area, available land area for wind generators etc. It can give valuable guidance for the sizing of the various RE capacities and can make parametric analysis for the relationship between the variables. However, it is not able to consider energy demand and generation data in the next time-steps since its rules deal with the instantaneous states of the system components. On the other hand, the optimization model can find the optimal combinations of the design variables of the system that can minimise the objective function of the problem (in this case the LCC) and gives details of the techno-economic performance of the system. The optimization model considers the data of energy demand and generation during the whole year.

Discussion
The studied district is a very densely built urban environment in Helsinki, which imposes some constraints on the availability of local energy sources. Solar PV panels are possible to install, mainly on the roofs of the buildings. However, for wall-integrated PV installations, there are some limitations due to the density of the area, which causes shadowing. Even though the district is located by the seashore, wind power might not be feasible due to interference with the radar systems [69] and other conflicting issues like the produced noise [70]. This leads to investing in offshore wind turbines inside a virtual boundary outside the physical boundary of the district, which can expand to include also other extensions of renewable energy components, like extended geothermal borehole fields and solar PV power stations.
As shown in the results, the LCC rises dramatically when the SSR approaches 100%. Therefore, it would make sense not to aim full selfsufficiency. However, the cost optimal SSR can vary from case to case and other targets like PED or NZED can be more feasible to be achieved economically and technically. Moreover, it would be possible to invest in climate compensation solutions to reach higher emission reduction potential. Climate compensation refers to financing compensating measures outside the district's operations that can lead to equivalent reduction in the emissions. Therefore, green electricity can be imported from outside the balancing boundary of the district when the optimal economic study suggests selecting SSRs lower than 100%. This will still keep the concept of aiming for a fossil-and emission-free district. Currently this is a viable option on the basis of the guarantees of origin scheme [71]. Future studies may investigate dedicated peer to peer energy transaction business models and ownership schemes of the renewable generation assets located outside the district boundary. Such schemes should aim to foster investments in renewable energy systems by district developers and optimize the use of land by installing the most convenient renewable energy system in the most favourable location, even if the location is outside the district.
Capacity matching of electricity storage to solar PV size with different electrical load profiles in a global wide perspective was studied by Lund [72], who concluded that the optimum electricity storage-to-PV ratio is around 2 Wh/Wp when the PV peak power is sized to cover the yearly electrical load. As stated, this dimensioning will reach selfconsumption of 60-70% in northern climates and 80-90% in southern climates. That paper indicates that targeting off-grid solution through solar PV installations would require two orders of magnitude more storage. According to the EnFlowMatch results, the ratio of the battery storage capacity to the solar PV and wind peak power for full selfsufficient cases is 4.2 and according to the optimization model is 1.8. Thus, compared with the conclusion by Lund [72], the electrical storage sizes needed for off-grid solutions are much smaller when the solar PV is combined with wind production. This is due to the fact that wind power provides electricity production around the year, thus decreasing the need for high capacity electricity storage.
One possible way to decrease the needed storage capacities and to improve flexibility of the energy systems would be demand response (DR). Demand response seeks to adjust the demand for power instead of  adjusting the supply. This kind of activities could be for example controlling of fans and pumps of the ventilation and heating systems. DR is not considered in this paper and could be included in future studies. A comprehensive review of projects dealing with DR is given by Gjorgievski et al. [73]. Smart charging of electric vehicles would be very useful in reducing the economic and environmental impacts of transportation in the district. However, the two implemented methods cannot handle changing the load profiles of any device because they can only consider defined aggregated input time series of energy demands from the districts. Fig. 13 shows the investment costs of the optimal renewable energy systems per square meter of the buildings' floor area in the Kalasatama district and also the difference in the investment cost with respect to the reference case for various SSRs. In 2019, the average square meter price for sold apartments in Helsinki was about 5100 €/m 2 [74]. It can be observed from the results that the increase in the investment cost for the added renewable energy systems is 32 €/m 2 for NZED SSR = 76% and 253 €/m 2 for SSR = 100%, which is relatively low compared to the average apartment square meter price. When analysing the costs, one must keep in mind the impact of the overall price level in the studied districts. The costs for renewable energy technologies are almost the same independent on which part of the country the district is located, but the estimated price level for housing can vary significantly depending on the region. In high price regions, the share of the investments in renewable energy is, therefore, smaller compared to districts with lower housing prices. High price regions can be seen as good candidates for "first time demonstration" when the risks are higher.

Borehole field dimensioning
When reaching full self-sufficiency, the required heat for the heat pump from renewable energy source is about 65 GWh/a in the Kalasatama district. Possible heat sources could be ambient air, sea water, ground and sewage water. Ambient air could be part of the solution but the problem with it is the high electricity demand during winter-time. In the city area, it is almost impossible to find area for outdoor units, considering that they also generate noise. Roofs are also unavailable for such installations since the roofs are covered with PV-panels. Sea water is basically an unlimited heat source, but the sea around Helsinki is very shallow and the temperature is near zero during winter, which limits its utilisation. Warmer water would have to be pumped from up to 20 km distance, which could not be feasible [75]. Sewage water from the district may help, but it is not a sufficient source of thermal energy. This leaves the ground, i.e. boreholes, as the most promising heat source at Kalasatama district. Depending on the case, there might be other local possibilities to utilize heat sources, like waste heat from industry, data centres and refrigeration of shopping centres among others. Even far heat sources might be feasible, for instance the energy company Helen in Helsinki is planning to exploit excess heat from an oil refinery plant 40 km away from Helsinki [76].
Solar thermal systems compete with the PV on the limited roof area available in this studied dense district. Since heat is produced by the heat pump, electricity generation by PV is considered as the design variable because it can be used for both driving the heat pump and covering the appliances loads. Solar thermal collector is one of the many technologies that can be implemented in a renewable energy systems. In the future, photovoltaic thermal collector (PVT) technology could be part of the solution by helping to reduce the need for the boreholes when the produced thermal energy is used to charge the ground. This might also improve the efficiency of the heat pumps [77].
The Geological Survey of Finland (GTK) has estimated that the yearly available heat energy per depth of the borehole is about 30 kWh/m for borehole fields where the distance between the wells is at least 20 m, and over 100 kWh/m when the wells are undisturbed, i.e. distance between the wells is over 100 m. These extractable energies are valid regardless of the depth of the wells [78].
Conventional drilling techniques have limited the maximum depth of boreholes to around 300 m, but during the past few years, drilling of much deeper boreholes, even more than 1 km, has become feasible [78,79]. With these boundaries, the required land area to fulfil the heat demand is shown in Fig. 14. Deep boreholes enable a smaller borehole field, which would in theory make it possible to install a sufficient amount of heat pump capacity on-site in the Kalasatama district, which has a size of 175 ha. Moreover, the optimization model results for SSR = 100% indicate that a large PV capacity is required (57.3 MWp), which is larger than 100% coverage of the roof area (30 MWp). This means that a large PV panel field is required that will extend to outside the physical boundary of the district. On the other hand, the optimization results indicate that for SSR = 95%, the required PV power is 16.8 MWp, which can fit within the physical boundary of the district.
It can be concluded from the above analysis that the physical boundary of the studied district hardly fits the required borehole field area as a source for heating energy. An extension of the boundary towards defining a virtual balancing boundary is needed especially if 100% self-sufficiency is targeted. The virtual balancing boundary can also include the required offshore wind turbines as well as any additional area for solar PV panels.

Time-step size on the load duration curve
Due to the computational limitations in the optimization model implementation, a four hour time-step is used in the study. This means that a four hour average of the energy demand is used as input to both methods, the rule-based method and the optimization method. This has similar effect as a four hour demand response, which means that short-  term demand peaks are inherently balanced. This behaviour is evident when the annual electricity demand and heating demand duration curves of the four hour and 15 min time-steps are compared as shown in Fig. 15.
To observe the effect of the time-step on the required capacities, it was possible to run the EnFloMatch tool with 15 min time-step. The results for PV = 30 MWp (100% coverage of the roof area) show that to reach 100% SSR with wind power = 20 MWp, the required battery capacity = 777 MWh and the heat storage capacity = 37.4 GWh, and for the wind power = 50 MWp, the required battery capacity is 360.5 MWh and the heat storage capacity is 2.38 GWh. These values do in general agree with the corresponding ones indicated in Fig. 5 and Fig. 6 using the four hour time-step, and the relations between the variables follow the same trends. The four hour time-step slightly underestimates the needed battery capacity by 8% to 6.8%, while overestimates the needed heat storage capacity by 12% to 20%. Underestimation of the battery capacity and overestimation of the heat storage capacity with the four hours time-step is due to averaging both loads (electricity and heat) and the electricity generation by PV and wind.

Conclusions
The focus of this study was on integration of renewable energy produced by wind power and PV, which are used to cover the on-site electricity demand of a district, including electricity for cooling and heating demands by an electrically driven heat pump system. Due to the variable electricity generation by renewables, both a battery system and a heat storage system are required to cover the gap between demand and generation for a full energy self-sufficient district. This paper presents two methods, a rule-based method and an optimization method, to study technical solutions and economic performance of districts to reach full energy self-sufficiency, as well as PED and NZED levels. The presented example case study is the new Kalasatama district in Helsinki that includes 1 200 000 m 2 of apartment, 400 000 m 2 of office and 20 000 m 2 of school floor areas.
It is revealed that the developed rule-based method EnFloMatch tool can be used for parametric analysis of the energy system performance and can give guidance about the selection of the capacities of the system components. On the other hand, the optimization model can achieve the minimum LCC of the system and find the optimal combinations of the capacities of the system components, and thus can make detailed analysis of the techno-economic behaviour of the system. The two methods complement each other and their results are in general agreement.
The results of the EnFloMatch tool for the case study indicate that to reach full energy self-sufficiency, the minimum required wind power capacity is 20 MWp based on offshore turbines when all roof areas of the buildings in the district is covered with solar PV with a total of 30 MWp. This case will require unrealistically large battery and heat storage capacities, namely 715 MWh and 44 GWh, respectively. By increasing the energy generation capacity, it is possible to considerably reduce the required storage capacities and at the same time the district becomes strongly net-energy positive.
The optimum results shown by the optimization method for the totally energy self-sufficient district (self-sufficiency rate SSR = 100%) indicate that the wind turbines and the battery represent the largest share of the capital investment (50% and 32%, respectively). Comparatively, lower investments are expected in solar PV, heat pump and heat storage. When relieving the targeted SSR to lower than 100%, by importing electricity from the gird while maintaining a positive annual energy balance, the LCC drops drastically, even though the selfsufficiency reduction is only few percent. In these cases, the investment in the wind generation still has the priority but the investment in the battery will sharply drop. Investments in the heat pump and heat storage maintain their levels while the investment in solar PV drops notably. Therefore, it would make sense not to aim full energy selfsufficiency but rather aim more economically and technically feasible targets like PED or NZED. For example, reducing the SSR rate to high PED level (SSR = 95%) or NZED level (SSR = 76%), can bring down the LCC by 49% or 66%, respectively. At the NZED level, the total investment cost is only 21% of the investment cost at SSR 100%. At this point, investments in the PV and battery totally diminish while the main investment is in the wind power followed by the heat pump and a small investment in the heat storage.
The preference of wind power over solar PV is due to its higher availability around the year. The utilization rate for the wind power in the studied case is 53% while it is only 11% for the PV. This could also be valid for other locations with similar climate as in this study, e.g. in other Nordic countries. However, a combination of wind and solar energy is an effective way to increase the SSR of the district. Such a combination is found to reduce the required ratio of the battery capacity to the combined wind and solar energy generation peak powers in offgrid cases to 1.8 according to the optimization results compared with that indicated by Lund [72], who stated that it will require two orders of magnitude when only PV generation is used. A comparison with a reference case, which has no renewable energy system but only a heat pump system that imports electricity from outside the district, reveals that the LCC of the renewable energy system with SSR 93% breaks even with the LCC for the reference case.
The time-step of the calculations showed to have effect on the produced results. The used four hour time-step underestimates the required battery capacity by a maximum of 8% and overestimates the required heat storage capacity by a maximum of 20%. Hourly or sub-hourly timesteps can be handled by the rule-based method but it would be computationally challenging for the implemented optimization method. As the convergence of deterministic optimization methods, such as the dual-simplex used in this paper, is faster than the convergence of stochastic optimization methods, it is difficult to find a faster optimization method for computationally challenging problems [80].
The analysis of the required heat source for the heat pump indicates that geothermal heat would be a better choice than other ones, like ambient air or seawater. A large borehole field is required for standard depth of wells and for undisturbed wells. Therefore, when very high selfsufficiency energy rate is targeted, the required area will extend outside the physical boundary of the district. On the other hand, other optimal combinations of solutions may require large PV panel area that will also extend outside the physical boundary of the district. Besides, it is not possible to install wind turbines in the studied district due to the high density of the built urban environment, which leads to investing in offshore turbines outside the physical boundary of the district. It can be concluded from the above that, with high SSRs, the physical boundary of the studied Kalasatama district cannot fit the required RE generations. Therefore, an extension of the boundary towards a virtual balancing boundary would be needed anyway. The virtual boundary will accommodate all extensions of renewable energy installations that the district invests in. Moreover, it would also be possible to invest in climate compensation solutions to reach higher emission reduction potential.
Though the investigated case study is in Finland, the concluded guidelines for renewable energy integration in districts with different targeted SSR levels can be applied in other countries with similar building stock properties and renewable energy generation features. On the other hand, the two implemented methods are generic and can be applied to design the integration of renewable energy to districts in any region.
The study shows how difficult it is to put into practise a 100% selfsufficient local energy system based on strictly local renewable energy sources. This is in line with studies [27] and [28] that emphasise the necessity to integrate the local energy system to much wider national or even European strategies of transforming the energy system into 100% renewable energy system.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.