Towards Positive Energy Districts: Energy Renovation of a Mediterranean District and Activation of Energy Flexibility †

: The paper presents the analysis of energy retroﬁtting, integration of renewable energy and activation of energy ﬂexibility in a cluster of buildings in the surroundings of a port on the Mediterranean Sea in Southern Italy, with the aim of checking the potential for it to achieve the status of positive energy district (PED). The objective of this study is to improve the contemporaneity between local energy generation and energy demand and reduce CO 2eq emissions by considering signals that reﬂect the environmental variability of the electricity grid, through ﬂexibility solutions applied to the HVAC system. The proposed scenarios are based on the dynamic simulation of the district and analyze the effect of actions that activate the energy ﬂexibility of buildings through advanced control strategies of the air conditioning system. The results show that the joint action of energy efﬁciency strategies, integration of solar energy and energy ﬂexibility improves the environmental sustainability of the district and the balance of energy ﬂows. Speciﬁcally, the activation of energy ﬂexibility contributes to a 10% reduction in operational CO 2eq emissions and increases in self-consumption of energy per year. The operational emissions of the district vary from the base value of 33.37 tons CO 2eq /y to 19.52 tons CO 2eq /y in the scenario based on the integration of solar energy systems and energy efﬁciency measures, and to 17.39 tons CO 2eq /y when also the demand-side energy ﬂexibility is activated.


Introduction
Research on development paths oriented towards sustainability and the decarbonisation of technological and energy processes is nowadays at the center of energy and social policies and of the interest of the scientific community. The ecological transition is already underway, but further efforts are needed in order to achieve the climate neutrality objective by 2050, curb climate change [1][2][3] and, overall, comply with the sustainable development goals [4,5]. In this context, the buildings sector requires particular attention considering that it contributes to 39% of CO 2 emissions globally and that cities are destined to become energy innovation hubs, producers of clean energy and laboratories of the concept of sustainable development [6,7]. In this direction, however, distributed energy generation requires further research efforts in the field of management of energy flows inside and outside the urban environment, balancing the electricity grid and optimizing energy systems and the energy behavior of buildings [7][8][9][10]. Indeed, the need for net zero or positive energy buildings is not limited to energy balances but is marking the rise in research and implementation of energy flexibility practices [11][12][13]. Moreover, and as also highlighted in [14,15], the energy efficiency of the building stock (building envelope, energy systems, Solar 2023, 3 254 local energy availability) and its redesign in compliance with local technical constraints, energy performance requirements and the targets of environmental, economic and social sustainability are also crucial.
Energy flexibility in urban environments is an emerging research field that aims to identify smart management solutions of the energy flows aimed at satisfying specific objectives, such as the improvement of contemporaneity between intermittent on-site energy generation (e.g., weather-driven energy sources such as photovoltaic, wind, solar, etc.) and energy demand. The contribution of the activation of energy flexibility in buildings is also fundamental with regard to the recent growing diffusion of positive energy districts (PEDs).
Research on positive energy districts is highly topical thanks to the attention of the scientific community, the International Energy Agency (IEA) and the initiatives and projects financed with the aim of promoting the dissemination of PEDs and favoring the transformation of cities into energy eco-innovation hubs.

Positive Energy Districts and Energy Flexibility
A positive energy district (PED) could be broadly defined as an innovative urban area, with defined boundaries, characterized by a positive energy balance between local renewable energy generation and energy demand [16][17][18]. The PED concept is related to the climate and sustainability goals and aims to accelerate the transition towards decarbonised cities and a sustainable society.
Among the several initiatives and pilot projects, action no. 3.2 of the European Union Strategic Energy Technology (EU-SET) plan aimed at the realization of 100 PEDs by 2025, based on the development and implementation of smart energy management solutions [19], on the one hand, while the Joint Programming Initiative (JPI) Urban Europe [20,21] works to support the diffusion and economic financing of PED projects in Europe. In addition, the International Energy Agency's Energy in Buildings and Communities (IEA-EBC) Annex 83 "positive energy districts" focuses on the challenges and needs for conceptualisation, modeling and evaluation to stimulate research on PEDs and guide their planning and operation [17]. Within this framework, energy flexibility is considered a key factor in balancing the energy flows within the PED and in the interaction with the surrounding energy networks.
Along the same line, [22] found that the redesign of existing districts from a PED perspective should be directed towards the combination energy efficiency and energy flexibility strategies in order to obtain a positive balance even in the case of high population density, while [23,24] highlights the need for energy sharing and optimal control in energy communities.
However, as highlighted in [25,26], the need for smart and demand management approaches energy in PEDs requires research efforts to develop and demonstrate energy solutions that incorporate the concept of energy flexibility. On the other hand and as discussed in [27], as a result of the IEA-EBC Annex 67 "Energy Flexible Buildings" and Annex 82 "Energy Flexible Buildings Towards Resilient Low Carbon Energy Systems", it is necessary to shift the focus from the energy flexibility of the single building to the district one in order to work with aggregate quantities of energy, contribute more to the interaction with the surrounding energy grids and increase flexibility potential.
The general definition of energy flexibility is as follows: "The ability to manage demand and generation according to the local climatic conditions, user needs and grid requirements" [28]. Indeed, strategies for activating energy flexibility in urban environments aim to modify generation and load profiles in response to energy, environmental or economic signals, generally known as penalty signals [28,29].
These penalty signals can be of different types and must be specified on the basis of the characteristics and research objectives for each case study. In general, they could be based on the price of electricity, on CO 2 emissions or specific incentives aimed at reducing the risk of congestion phenomena in the electricity grid, etc. [11,[30][31][32].
Energy flexibility approaches fall within the broader concept of demand-side management (DSM), and could cover different areas such as the following: integration of energy storage systems or electric vehicles, adjustment of air-conditioning systems in order to exploit the passive thermal mass of the building envelope, ventilation or domestic hot water (DHW) production control, management of programmable equipment, etc. [27,33,34]. Some literature experiences at the single-building level concerned the application of rule-based control (RBC) or model predictive control (MPC) algorithms for the flexible management of the space heating and cooling set-point and/or DHW production [11,31,[35][36][37][38][39][40][41]; some others concerned the integration and RBC flexible control of energy storage systems (TES and/or BESS) [11,[42][43][44] or the flexible operation of ground source heat pumps [45], etc.
With regard to the penalty signal that guides the control algorithms, directly linked to the objective of the study, the fact that the penalty signal is mostly of an economic nature emerges, except for some cases in which it instead reflects the environmental characteristics of the electricity grid (carbon footprint of potentially imported energy on an hourly basis) [11,37].
Although there is a great variety of experience with flexibility at the individual building level, research at the district level is limited and needs definition and demonstration of flexibility methods and practices. As discussed in [46], attention to the cluster scale would benefit from the differences in energy consumption patterns between buildings, favouring the flexibility potential. However, [27] highlighted the need for the control of negative co-impacts of flexibility approaches such as higher rebound peaks on the one hand, and of more detailed building models and controls on the other.
In this regard, further research efforts are required in order to elaborate data specific to the district scale, especially in positive energy districts which would benefit from the activation of energy flexibility in balancing flows and reducing emissions and operating costs [47].
The general line of this research is placed in this context, which focuses on the redesign of an existing district in order to turning it into a positive energy district and the demonstration of some energy efficiency and energy flexibility strategies.

Objective and Structure of the Study
This article summarizes and discusses the key points of a redesign scenario from a PED perspective of an existing cluster of commercial and office buildings located in the Mediterranean area (Licata, Italy). Some scenarios based on the analysis of the energy retrofitting, integration of renewable energy systems and activation of energy flexibility are described in this paper.
The objectives of the research are as follows: • The quantification of the energy-environmental impacts of the district retrofitting in order to achieve the PED status; • The investigation of the activation potential of the energy flexibility of the district in terms of interaction with the electricity grid, self-consumption of energy from local RES and reduction in the carbon footprint, considering signals that reflect the environmental variability of the grid, operational costs and reduction in peak loads. In particular, the research work aims at investigating the potential of control algorithms for the air-conditioning system in order to activate the energy flexibility offered by thermal mass of buildings and at evaluating the influence of energy flexibility on the PED energy balance.
This document is structured in four sections. Section 2 contains a description of the case study and illustrates the research methodology adopted for the (a) dynamic analysis of the energy-environmental performance and energy flexibility of the district, (b) redesign of the district in order to achieve the PED target and the development of flexible control algorithms for the management and balancing of energy flows within it, and (c) the analysis of energy, environmental and flexibility impacts through appropriate key performance indicators (KPIs) and calculation methods. Section 3 shows the research results related to the calibration of the model on the basis of real measured data, analysis of the thermo-physical and energy behavior of the district, analysis of the redesign scenario aimed at the PED target, analysis of the flexibility scenarios, comparison of the results and discussion of the benefits and energy-environmental impacts resulting from the implementation of flexible control.
Finally, Section 4 presents the conclusions of the study and possible future perspectives.

Materials and Method
This section contains the description of the case study and illustrates the research methodology followed:

•
Develop a model of the district consistent with the real measured data and analyze its behavior in a dynamic simulation regime; • Evaluate the potential for energy efficiency and integration of renewable energy sources; • Plan the redesign of the district from a positive energy district perspective; • Define energy flexibility strategies aimed at managing energy flows in the building cluster; • Evaluate the impacts in terms of interaction with the electricity grid, self-consumption of energy, energy flexibility and operational CO 2 equivalent (CO 2eq ) emissions.

Description of the Case Study
The case study is a Mediterranean cluster of commercial and office buildings located in the port area of Licata, Sicily, Italy ( Figure 1). Solar 2023, 3, FOR PEER REVIEW 4 the analysis of energy, environmental and flexibility impacts through appropriate key performance indicators (KPIs) and calculation methods. Section 3 shows the research results related to the calibration of the model on the basis of real measured data, analysis of the thermo-physical and energy behavior of the district, analysis of the redesign scenario aimed at the PED target, analysis of the flexibility scenarios, comparison of the results and discussion of the benefits and energy-environmental impacts resulting from the implementation of flexible control.
Finally, Section 4 presents the conclusions of the study and possible future perspectives.

Materials and Method
This section contains the description of the case study and illustrates the research methodology followed: • Develop a model of the district consistent with the real measured data and analyze its behavior in a dynamic simulation regime; • Evaluate the potential for energy efficiency and integration of renewable energy sources; • Plan the redesign of the district from a positive energy district perspective; • Define energy flexibility strategies aimed at managing energy flows in the building cluster; • Evaluate the impacts in terms of interaction with the electricity grid, self-consumption of energy, energy flexibility and operational CO2 equivalent (CO2eq) emissions.

Description of the Case Study
The case study is a Mediterranean cluster of commercial and office buildings located in the port area of Licata, Sicily, Italy ( Figure 1). During the on site investigation phase, data related to the geometry of the district, occupation and use, installed systems and energy consumption of the buildings were collected. The cluster includes eight offices, a restaurant, a pizzeria, a pub-cafeteria, a laundry, a shop (nautical store) and other unoccupied premises. The total floor area is equal to 2040 m 2 and the inter-floor height is equal to 3.70 m, while the windows to wall ratio is equal to 10.4%. The building envelope composition is the same between all buildings and therefore have the same layers and transmittance. Specifically, there is no thermal insulation and the transmittance value U [W/(m 2 K)] is expected to be very close to 0.77 for the external vertical walls, 2.24 for the horizontal external roof, 2 for the interior walls and 1.53 for the ground floor among all buildings. The windows are of the double-glazed type During the on site investigation phase, data related to the geometry of the district, occupation and use, installed systems and energy consumption of the buildings were collected. The cluster includes eight offices, a restaurant, a pizzeria, a pub-cafeteria, a laundry, a shop (nautical store) and other unoccupied premises. The total floor area is equal to 2040 m 2 and the inter-floor height is equal to 3.70 m, while the windows to wall ratio is equal to 10.4%. The building envelope composition is the same between all buildings and therefore have the same layers and transmittance. Specifically, there is no thermal insulation and the transmittance value U [W/(m 2 K)] is expected to be very close to 0.77 for the external vertical walls, 2.24 for the horizontal external roof, 2 for the interior walls and 1.53 for the ground floor among all buildings. The windows are of the double-glazed type with a gas gap. All buildings are equipped with heat pumps for space air-conditioning and are naturally ventilated. Table 1 summarizes the internal loads and the main characteristics of the energy systems per building type. As for the occupation and use of the buildings, it should be noted the city of Licata presents a variable population depending on the season of year with peaks during the summer months and depopulation during the remaining time of the year. This affects the work rhythms of restaurant and commercial businesses in general, reflected in highly variable energy consumption during the months of the year. The kitchen area is usually occupied by two people, while the number of customers occupying the hall varies according to the time of day and the seasons.
The pizzeria building is open during the hours 17:00-24:00 from June to September, while in periods of low population it operates only on Saturdays. Occupancy varies, but on average around three people are present in the kitchen areas.
The café-pub is open on average from 8:30 to 01:00 from June to September. In the other periods of the year, closing is brought forward to 10.00 p.m. on average. The number of occupants in the kitchen area is generally equal to equal, while that of the internal lounge varies with the hours of the day and the months of the year. The building, as well as the restaurant, have an outdoor lounge which is generally occupied in the summer months.
The laundry shop, of the self-service type with tokens, is used on average from 09:30 to 20:00, mostly by the tourists who own the numerous boats docked at the marina which is located in the immediate vicinity.
The nautical store is open from 9:00 to 13:00 on Mondays and Saturdays and 9:00 to 13:00 and 14:30 to 19:00 from Tuesday to Friday, with a flow of customers that varies with the hours of the day.
The office building is characterized by a slightly variable occupancy between the opening hours of 9:00-13:00 and 16:00-20:00, except for the reception office which is also occupied by two employees from 8:00 to 14:00.

Modeling of the District and Redesign Scenarios
Consistently, with the data acquired during the site investigation, the district has been modeled in TRNSYS 18 environment and the 3D model made in SketchUp is shown in Figure 2. The 3D model contains a total of 57 thermal zones, one for each building space, and the shading elements against solar radiation have been introduced as shading generating elements. Part of the TRNSYS model in the Simulation Studio graphical environment is shown in Figure 3. Multizone building modeling with Type 56 and TRNBUILD is used in order to model the energy and thermophysical model of buildings. The building description is transferred to the model by the building description file (*.b18,*.b17, *.bui). The main inputs of Type 56 are the climatic variables and the use and occupation profiles of the thermal zones. Occupancy differences on a hourly-daily (differences between holidays and workdays) and monthly (due to the variable activity of the city) basis were modeled in TRNSYS Simulation Studio, through specific occupation and use profiles. Climatic conditions are modeled using an EPW file (EnergyPlus Weather File) containing the historical climatic data, used as input by Type 15. Type 15 reads and interpolates the climatic data, calculating additional variables (e.g., the effective sky temperature).
The climate of Licata is characterized by temperate winters and hot summers. Figures 4 and 5 describe the trend of the main climatic variables-total radiation, wind velocity, relative and external temperature (dry bulb and wet bulb temperature)-for some days in the winter period and in the summer period, for example.
The modeling of natural ventilation has been carried out according to the "Wind and Humidity Stack with Open Area" method [48] while the infiltration is modeled according to the "Sherman Grimsrud" method (Type 932) in TRNSYS [49]. Starting from the input variables (temperature, relative humidity and pressure of the zone) and parameters (volume, zone leakage area, stack coefficients and wind coefficients), the component determines the infiltration air changes and other significant terms.
To realistically represent the district in the existing configuration and obtain a consistent model, the periods of activation of the heat pumps were modeled on the basis of the real habits of the occupants through interviews and data collection carried out during the inspection phase. On average, the summer season is from May to early October, while the winter season is from December to March, although also in other periods of the year there may be a limited demand for air conditioning. Multizone building modeling with Type 56 and TRNBUILD is used in order to model the energy and thermophysical model of buildings. The building description is transferred to the model by the building description file (*.b18,*.b17, *.bui). The main inputs of Type 56 are the climatic variables and the use and occupation profiles of the thermal zones. Occupancy differences on a hourly-daily (differences between holidays and workdays) and monthly (due to the variable activity of the city) basis were modeled in TRNSYS Simulation Studio, through specific occupation and use profiles. Climatic conditions are modeled using an EPW file (EnergyPlus Weather File) containing the historical climatic data, used as input by Type 15. Type 15 reads and interpolates the climatic data, calculating additional variables (e.g., the effective sky temperature).
The climate of Licata is characterized by temperate winters and hot summers. Figures 4 and 5 describe the trend of the main climatic variables-total radiation, wind velocity, relative and external temperature (dry bulb and wet bulb temperature)-for some days in the winter period and in the summer period, for example.
The modeling of natural ventilation has been carried out according to the "Wind and Humidity Stack with Open Area" method [48] while the infiltration is modeled according to the "Sherman Grimsrud" method (Type 932) in TRNSYS [49]. Starting from the input variables (temperature, relative humidity and pressure of the zone) and parameters (volume, zone leakage area, stack coefficients and wind coefficients), the component determines the infiltration air changes and other significant terms.
To realistically represent the district in the existing configuration and obtain a consistent model, the periods of activation of the heat pumps were modeled on the basis of the real habits of the occupants through interviews and data collection carried out during the inspection phase. On average, the summer season is from May to early October, while the winter season is from December to March, although also in other periods of the year there may be a limited demand for air conditioning.      Overall, the method adopted for the energy redesign of the building complex follows several steps:

1.
Building energy modeling of the district and non-steady state simulation; 2.
Calibration of the model on the basis of monthly measured data of the electricity consumption of the building units; 3.
Energy efficiency solutions modeling and simulation of the calibrated model by insulating the building envelope, according to the transmittance limit values (U lim ) imposed by current Italian legislation [50] for net zero energy buildings; 4.
Integration of renewable energy sources through the sizing and modeling, in the TRNSYS environment, of a photovoltaic (PV) system on the roof of the buildings; 5.
Analysis of the results in terms of energy efficiency and interaction with the electricity grid, environmental impact of the district's operation phase, energy flexibility of the PED scenario (called "base PED"/"PED") according to the key performance indicators (KPIs) described in Table 2. Furthermore, the impact on thermal comfort of buildings retrofitting is evaluated on the basis of the European standard EN 16798-1 [51]. Even if the objective and scope of the study does not consist in optimizing thermal comfort, a thermal comfort analysis is carried out with the aim to assess the improvement in the thermal comfort conditions of the occupants as a co-impact of the redesign scenarios. The comfort analysis is performed by monitoring the PMV variable, based on the TRNSYS output values, and calculating the percentage of time in which the thermal comfort conditions fall within the categories I, II, III and IV defined in the standard; 6.
The PED energy balance is calculated, according to Equation (1), as the difference between the sum of the energy generated by the local RES systems in each time step ( P el,g (t)dt) and the total energy demand of the district ( P el,c (t)dt) over a period of one year; 7. Development and modeling of energy flexibility scenarios (PED I and PED II) based on the flexible control of the air conditioning system using rule-based control (RBC) algorithms, predicting energy consumption and production through historical climatic data.
The objective of this part is to improve the simultaneity between generation and load and the operational environmental impact of the building cluster by activating the thermal mass of the building envelope through flexible control of the air conditioning set point (T set ).
More precisely, the tested control strategies are based on the following: (a) Upward modulation of the space heating T set,h during the low penalty (lp) periods and downward modulation during high penalty (hp) periods; (b) Upward modulation of the space cooling T set,c during the hp periods and downward modulation during the lp periods.
The magnitude of the temperature upward and downward deviation (∆T) is fixed at 1 • C (scenario I) and 2 • C (scenario II).
In general, the objective of a flexibility strategy is the load-shifting (e.g., derived from shifting air conditioning needs) from periods with a high penalty (hp), towards periods of low penalty (lp), properly defined according to the environmental, economic or energy perspective adopted [11,35,37,43,52,53].
In this study, high penalty periods are defined as those periods of time in which there is a deficit in energy production of the on-site photovoltaic system compared to the electricity demand of the district. On the contrary, the periods of time with a surplus of local energy production constitute the periods of low penalty.
For the calculation of energy flexibility based on emissions, low penalty periods are time steps during which electricity is produced with lower carbon footprint, considering Solar 2023, 3 262 the availability of the local solar energy production (the lp periods previously described) and the import of electricity from the grid during low emission hours.
In order to determine the low emission hours, i.e., low penalty periods, of the electricity grid the historical hourly data disclosed by Terna, the Italian electricity market operator, [54] are used. These data describe for each hour of the year the composition of the regional electricity mix (electricity mix of the electricity zone of Sicily, the region in which the city of Licata is located), in terms of the type of energy sources that constitute it for each hour, and they also provide information on the total amount of electricity produced (MWh) from each energy source, sold and fed into the electricity grid for each hour. Figure 6 describes for two example days (days 1 and 2 of January) the composition of the regional electricity mix and the distribution for each energy source of the total amount of electricity fed into the grid for each hour of the day. Solar 2023, 3, FOR PEER REVIEW 10 For the calculation of energy flexibility based on emissions, low penalty periods are time steps during which electricity is produced with lower carbon footprint, considering the availability of the local solar energy production (the lp periods previously described) and the import of electricity from the grid during low emission hours.
In order to determine the low emission hours, i.e., low penalty periods, of the electricity grid the historical hourly data disclosed by Terna, the Italian electricity market operator, [54] are used. These data describe for each hour of the year the composition of the regional electricity mix (electricity mix of the electricity zone of Sicily, the region in which the city of Licata is located), in terms of the type of energy sources that constitute it for each hour, and they also provide information on the total amount of electricity produced (MWh) from each energy source, sold and fed into the electricity grid for each hour. Figure 6 describes for two example days (days 1 and 2 of January) the composition of the regional electricity mix and the distribution for each energy source of the total amount of electricity fed into the grid for each hour of the day.
(a) (b) Figure 6. Composition of the regional electricity mix and the distribution for each energy source of the total amount of electricity fed into the grid for each hour of the day. Example for the 1st (a) and 2nd (b) of January. Figure 6. Composition of the regional electricity mix and the distribution for each energy source of the total amount of electricity fed into the grid for each hour of the day. Example for the 1st (a) and 2nd (b) of January.
From the analysis of the data, it emerges that 100% coverage from RES never occurs during the year, while the maximum degree of energy penetration from RES is equal to 89% and occurs only for one hour a year. For the evaluation of the energy flexibility based on emissions, the hours per year for which the electricity imported from the grid is produced for at least 50% (of the total electricity fed into the grid at that hour) from renewable sources are assumed as low penalty hours. In other words, lp periods occur in the hours of the year in which the rate of penetration of energy from RES, in the regional electricity mix, is greater than 50%. Figure 7 shows the duration curve of the penetration rate of energy from renewable sources in the regional electricity mix.
during the year, while the maximum degree of energy penetration from RES is equal to 89% and occurs only for one hour a year. For the evaluation of the energy flexibility based on emissions, the hours per year for which the electricity imported from the grid is produced for at least 50% (of the total electricity fed into the grid at that hour) from renewable sources are assumed as low penalty hours. In other words, lp periods occur in the hours of the year in which the rate of penetration of energy from RES, in the regional electricity mix, is greater than 50%. Figure 7 shows the duration curve of the penetration rate of energy from renewable sources in the regional electricity mix.
A generic point "i" on the duration curve is characterized by an ordinate value, along the y axis, equal to the generic RES penetration percentage yi, variable in the range [0-100], and by an abscissa value equal to the value of the duration time xi, along the x axis. The generic abscissa xi of a point represents the number of hours per year for which the RES penetration rate remains higher than the value indicated by the corresponding ordinate yi. As can be seen in the Figure, the RES penetration rate of the electricity mix is greater than 50% for about 30% of the hours a year, i.e., for the number of hours indicated by the abscissa of point A equal to 2596 h. The single penalty signal is obtained from the combination of the grid penalty signal and the penalty signal relating to surplus or deficit of renewable energy produced on site from the PV system of the district. The two signals converge into a single signal which has a low penalty period as long as one of the two signals indicates a low penalty.
For the evaluation of the environmental impact of the district's use phase, as in [11], the CO2,eq emissions associated with the import of electricity are calculated. To do this, the emission conversion factors, cel, for each type of energy source, expressed in [CO2,eq/kWh] and defined in [55,56], are used.
The carbon footprint of the electricity imported from the grid is obtained from the knowledge of the qualitative and quantitative hourly composition of the regional Figure 7. Duration curve of the penetration rate of energy from renewable sources in the regional electricity mix.
A generic point "i" on the duration curve is characterized by an ordinate value, along the y axis, equal to the generic RES penetration percentage y i , variable in the range [0-100], and by an abscissa value equal to the value of the duration time x i , along the x axis. The generic abscissa x i of a point represents the number of hours per year for which the RES penetration rate remains higher than the value indicated by the corresponding ordinate y i . As can be seen in the Figure, the RES penetration rate of the electricity mix is greater than 50% for about 30% of the hours a year, i.e., for the number of hours indicated by the abscissa of point A equal to 2596 h.
The single penalty signal is obtained from the combination of the grid penalty signal and the penalty signal relating to surplus or deficit of renewable energy produced on site from the PV system of the district. The two signals converge into a single signal which has a low penalty period as long as one of the two signals indicates a low penalty.
For the evaluation of the environmental impact of the district's use phase, as in [11], the CO 2,eq emissions associated with the import of electricity are calculated. To do this, the emission conversion factors, c el , for each type of energy source, expressed in [CO 2,eq /kWh] and defined in [55,56], are used.
The carbon footprint of the electricity imported from the grid is obtained from the knowledge of the qualitative and quantitative hourly composition of the regional electrical Solar 2023, 3 264 mix and from the use of the emission conversion factors. In mathematical terms and for each hour of the year, the amount of electricity in the electricity grid for the Sicily electricity zone, E(t'), is determined by the sum of the electricity produced and fed into the grid from each of the energy sources making up the electricity mix for that specific hour.
(P el,biomass (t) + P el, f ossil gas (t) + P el, f ossil oil (t) + P el,hydro pumped storage (t)+ P el,hydro run−o f −river (t) + P el,solar (t) + P el,wind onshore (t) + P el,other (t))dt (2) Consequently and according to Equation (3), the CO 2,eq intensity of the electricity imported from the grid, I CO 2 ,eq (t ), is calculated for each hour of the year using the specific conversion factors previously described.
[(P el,biomass (t)·c el,biomass (t)) + (P el, f ossil gas (t)·c el, f ossil gas (t)) +(P el, f ossil oil (t)·c el, f ossil oil (t)) + (P el,hydro pumped storage (t)·c el,hydro pumped storage (t)) +(P el,hydro run−o f −river (t)·c el,hydro run−o f −river (t)) + (P el,solar (t)·c el,solar (t)) +(P el,wind onshore (t)·c el,wind onshore (t)) + [(P el,other (t)·c el,other (t))]dt (3) Figure 8 further describes, for the 1st of January, the emission profile of the electrical mix associated to the electricity grid. The emission profile, expressed in ton CO 2,eq /MWh, represents for each time step the quantity of CO 2,eq emissions produced per MWh of electricity produced in that hour from the electricity mix and present in the electricity grid (Equation (4)).
(CO 2,eq emissions)Emission Pro f ile(t) = I CO 2 ,eq (t) Solar 2023, 3, FOR PEER REVIEW 12 electrical mix and from the use of the emission conversion factors. In mathematical terms and for each hour of the year, the amount of electricity in the electricity grid for the Sicily electricity zone, E(t'), is determined by the sum of the electricity produced and fed into the grid from each of the energy sources making up the electricity mix for that specific hour.
Consequently and according to Equation (3), the CO2,eq intensity of the electricity imported from the grid, I , (t'), is calculated for each hour of the year using the specific conversion factors previously described. (3) Figure 8 further describes, for the 1st of January, the emission profile of the electrical mix associated to the electricity grid. The emission profile, expressed in ton CO2,eq/MWh, represents for each time step the quantity of CO2,eq emissions produced per MWh of electricity produced in that hour from the electricity mix and present in the electricity grid (Equation (4)). ( ) = I 2, (t) ( ) (4) Figure 8. Composition of the regional electricity mix associated to the electricity grid and CO2,eq emission profile. Example for 1 January.
For the evaluation of the economic impact of the energy flexibility strategies, as in [11], the operating costs associated with the import of electricity from the electricity grid Figure 8. Composition of the regional electricity mix associated to the electricity grid and CO 2,eq emission profile. Example for 1 January.
For the evaluation of the economic impact of the energy flexibility strategies, as in [11], the operating costs associated with the import of electricity from the electricity grid are calculated. For the economic calculation, the historical hourly data of the electricity price disclosed by the Italian electricity market operator [54], for the year 2022, are used.
The operating energy costs are calculated according to Equation (5)  Operating energy costs = T=8760 h t=0 [P el,i (t) · c el,i (t)]dt (5) To quantify the change from periods hp to periods lp, the flexibility factor FF is used. FF varies between −1 (consumption occurs only in hp periods) and +1 (consumption occurs in lp periods). FF (emissions) is used when low emissions periods are considered as lp periods and is linked to the objective of reducing the building's operational emissions. On the other hand, FF (res) refers to the objective of improving the self-consumption of energy from local renewable sources in prosumer buildings and the periods lp constitute the time steps in which the production exceeds the load. To evaluate the interaction with the electricity grid, the self-consumption factor (γ s ) and the solar factor (γ L ) are used, whose formulation, except for energy and storage losses, is shown in Table 2.
The γ L reports on the degree of energy coverage with solar energy generated on site, while γ s on the amount of local energy production self-consumed simultaneously by the building. Table 2. KPIs used for energy and flexibility analysis.

Results and Discussion
This section shows the results of the scenario analysis which can be summarized in the following:

•
The calibration of the model on the basis of real measured data; • The analysis of the thermo-physical behavior and energy consumption of the base case (existing configuration of the district) in a dynamic regime and with a 15 min time step; • The analysis of the results of the base PED scenario (PED configuration without the use of specific algorithms for activating the energy flexibility of the district) in terms of energy-environment and interaction with the electricity grid; • The description and discussion of the results of the flexibility scenarios, PED I and PED II, through analysis of the grid interaction, monitored KPIs, balancing of energy flows within the district and study of the dynamic behavior in the 15 min time step; • Comparison of the scenarios examined and discussion of the energy-environmental and economic benefits and impacts due to flexible control.

Calibration of the Model and Dynamic Analysis
The district has been simulated in its current state, obtaining monthly deviations for each building in the range [+10%, −10%] compared to the measured values of electricity consumption. Figure 9 shows the calibration results for the entire district on a monthly basis. The gray error bars represent the range [+10%, −10%] for each monthly value of the measured energy consumption, while the two trends represent the profile of the measured energy consumption data and the profile of the energy demand simulation results of the model. for heating due to the climate of the place and the high internal loads in office or restaurant buildings. On the other hand, as mentioned in Section 2, part of the commercial buildings is more operational in the summer period, which is the most touristy of the year in the study area.
As for the environmental impact of the district's use phase, the operational CO2eq emissions are equal to 33.37 tons CO2eq per year. FF (emissions) is equal to −0.47, which indicates that the energy demand occurs mostly during the hp periods.  The distribution of the annual electricity consumption of the district by commercial building and according to energy uses is shown Figure 10.
All the energy services used have been taken into account as follows: heating, cooling, electrical appliances (for offices, kitchens, etc.), interior lighting and lighting in the exterior area of the cafeteria, restaurant and pizzeria. The district presents a variable electricity demand profile throughout the year with higher values in the summer months. This is due on the one hand to the greater amount of energy consumption for cooling than for heating due to the climate of the place and the high internal loads in office or restaurant buildings. On the other hand, as mentioned in Section 2, part of the commercial buildings is more operational in the summer period, which is the most touristy of the year in the study area.
As for the environmental impact of the district's use phase, the operational CO 2eq emissions are equal to 33.37 tons CO 2eq per year. FF (emissions) is equal to −0.47, which indicates that the energy demand occurs mostly during the hp periods. Figures 11 and 12 show, for a few typical days used as examples and for one of the rooms of the building cluster (one of the offices of the office building, called "Office 1", the dynamics with 15 min time steps during the winter and summer conditions. Specifically, the Figures show, on the one hand, the dynamic trends of electricity consumption for space air-conditioning, electrical equipment and for space lighting; the main heat fluxes involved in the heat balance, on the other hand, such as heat loads due to infiltration, solar radiation, heat requirements for space air-conditioning; and finally, the trend of the PMV comfort variable and that of the air temperature and the mean surface temperature. As Figure 11 shows, as the external temperature decreases, the energy requirement for cooling during office working hours decreases (Day 3 compared to Day 1) compatibly with the internal load transmitted by the occupants (which derives from a variable degree of occupation over time), and unless the solar gain increases due to a higher value of global and total solar radiation, as for Day 2. As a result of the dynamic analysis of all thermal zones, the greatest electricity consumption for cooling occurs in zones with the highest internal loads such as for the "Office 1", while the needs are lower in the case of the lounge area of the Solar 2023, 3 267 restaurant building. This is due both to the low value of internal thermal loads deriving from the equipment and to the presence of an internal curtain and a large external fixed structure which is located in front of the window openings. On the other hand, the internal microclimate of some areas such as the kitchen of the restaurant building and the pizzeria and the area of the pizza oven, is strongly conditioned by the high value of internal loads and little by external climatic forces.  Figures 11 and 12 show, for a few typical days used as examples and for one of the rooms of the building cluster (one of the offices of the office building, called "Office 1", the dynamics with 15 min time steps during the winter and summer conditions. Specifically, the Figures show, on the one hand, the dynamic trends of electricity consumption for space air-conditioning, electrical equipment and for space lighting; the main heat fluxes involved in the heat balance, on the other hand, such as heat loads due to infiltration, solar radiation, heat requirements for space air-conditioning; and finally, the trend    Similar considerations can be formulated for the other zones. As Figure 12 suggests, the lack of thermal insulation causes high heat losses through the building envelope during the hours of operation of the space heating system and causes a sharp decrease in the internal air temperature when the system is switched off at the end of the working day. This downward trend determines a peak demand for heating during the first hour of the following day. Furthermore, as shown in the image, the thermal comfort conditions for the occupants could be improved due to PMV values < −0.7, indicating a prevalence of air conditioning hours in the IV comfort category [51].

Redesign in a PED Perspective
This section summarizes the main results of the redevelopment of the district through the energy efficiency of the building envelope and the on-site integration of solar energy plants for electricity generation. Thermal insulation through the use of additional thicknesses of glass wool (6,8,14, cm per building component) determines compliance with the transmittance limit values, as indicated in Table 3. Table 3. Transmittance values before energy retrofitting (U*), limit (U lim ) and after retrofitting (U**). As regards the visualization of the dynamic behavior of the district after the insulation of the building envelope, Figures 13 and 14 are shown as an example.

Building
From the comparison of the trends ante-retrofit and post-retrofit, it can be seen that the following is the case:

•
As visible also from the PMV profile, the thermal comfort conditions have improved during the occupation time; this tendency is confirmed by the annual values reported in Table 4. In particular, as shown in Figure 11, the PMV value is close to zero in some hours of the day (Comfort Category I), for example, between 10:00 and 12:00. In the same hours in the existing configuration of the district to which Figure 9 refers, the PMV trend instead reached values close to −2, indicating a low level of thermal comfort (Comfort Category IV).

•
The energy demand for space heating is about halved. As can be seen in Figure 11, the insulation of the building envelope determines a decrease in the internal air temperature of the thermal zone used as an example, which is more delayed over time and a reduction in the heating load peaks compared to the reference case.

•
Regarding the cooling season, for the days displayed in the graph, the energy consumption for cooling has slightly increased, while the air temperature profile is on average higher in the hours the air-conditioning system is switched off due to the higher internal loads, caused by the lower heat transmission through the building envelope. The minus sign (−) indicates a decrease compared to the existing case; conversely, the plus sign indicates (+) an increase.    Figure 15 shows the distribution of the annual electricity consumption of the district by energy uses. Overall, the simulated model post-retrofit results in an annual electricity consumption of 121.45 MWh. Total energy consumption has not decreased significantly compared to the base case due to the increase in electricity demand for cooling from 25.19% to 28% of the total. On the contrary, the contribution of heating to the total demand for electricity decreases from 11.25% to 5.90%. In the PED scenario, a photovoltaic (PV) plant of the size 83.7 kWp (279 panels, each with an area equal to 1.63 m 2 and a nominal power of 300 Wp installed on the roof of the examined buildings) is also included in the energy layout.
As for the simulation results, the total electricity production is equal to 134.65 MWh/y. Figure 16 shows the monthly load and generation trend for the period of one year.  In the PED scenario, a photovoltaic (PV) plant of the size 83.7 kW p (279 panels, each with an area equal to 1.63 m 2 and a nominal power of 300 W p installed on the roof of the examined buildings) is also included in the energy layout.
As for the simulation results, the total electricity production is equal to 134.65 MWh/y. Figure 16 shows the monthly load and generation trend for the period of one year. In the PED scenario, a photovoltaic (PV) plant of the size 83.7 kWp (279 panels, each with an area equal to 1.63 m 2 and a nominal power of 300 Wp installed on the roof of the examined buildings) is also included in the energy layout.
As for the simulation results, the total electricity production is equal to 134.65 MWh/y. Figure 16 shows the monthly load and generation trend for the period of one year.   The PED model has a positive annual energy balance of 12.90 MWh and an annual self-consumption of energy equal to 59.44 MWh. The use phase of the cluster of buildings implies a value of operational emissions equal to 19.52 tons CO 2eq /y, resulting in an annual reduction of emissions of 41.50% compared to the base case.

Comparison of PED Scenarios and Contribution of Energy Flexibility
This section summarizes the main results of the RBC-type energy flexibility strategies and presents a comparison of results between the different scenarios developed. Figure 17 shows the dynamic profiles for two winter days used as an example of the local PV electricity production, the electricity demand for space heating both in the PED scenario and in the PED I scenario, and the penalty signal (green areas indicate low penalty periods, while orange areas represent high penalty periods) based on the definition of lp periods as the time step of self-produced energy surplus and vice versa as hp periods-those of deficit of local generation with respect to the energy demand. In addition, Figure 18 shows the dynamic profiles for two summer days used as an example of the local PV electricity production, the electricity demand for space cooling both in the PED scenario and in the PED I scenario, and the penalty signal. As shown in the Figures, the effect of the flexible control I determines a certain degree of load shifting from the hp periods towards those of low penalty. Considering the flexible space heating control (Figure 17), the energy consumption profile in the PED I case is above that of the base PED scenario during the lp periods due to the excess pre-heating of the buildings. Conversely, in the subsequent high penalty time steps, the electricity demand profile in the PED I case is below that of the base PED case, i.e., in the PED I scenario, a decrease in the need for space heating is observed as a rebound effect. For example, during the low penalty 8:00-13:00 on 27 February represented in Figure 17, the electrical power required in the PED I flexibility scenario is greater than that which occurs in the PED base case of about 30-40% in each time phase, due to the upwards modulation of the space-heating set point. As is visible, this causes as a rebound effect a decrease in the space heating demand in the high penalty hours (e.g., between 13:00 and 18:00) and a reduction in peak loads. A close-up of the areas of the graph where load shifting also occurs, but the graphics limit their display, is provided in the Figures. In quantitative terms and taking the first day (27 February) as an example, the daily energy consumption increases very slightly from the value of 92.11 kWh/day to 92.85 kWh/day, while the share of global consumption that occurs during lp periods increases from 38.10 kWh to 46.64 kWh. Consequently, the energy shifted from the hp periods to the lp periods is equal to 8.54 kWh. The peak load for space heating is reduced from 20.68 kW to 16.29 kW. Instead, in the case of the control algorithm which operates according to rule II (PED II scenario) and for the same day of the year, the shifted energy is greater and equal to 16 kWh and the peak load value is equal to 17.35 kW.
Considering the comparison of dynamic profiles for the two summer days (27-28 June) taken as an example, for the PED and PED-I scenario (Figure 18), it can be seen that during the lp periods the profile of the energy consumption for space cooling in the flexibility scenario exceeds that of the PED base case, due to the excess pre-cooling by exploiting the renewable energy produced on site. As a consequence, in the following hours of high penalty, e.g., between 17:00 and 21:30, there is a significant reduction in the cooling demand, which translates into a decrease in the use of energy with a higher CO 2eq intensity, through the import of electricity from the grid, and in the dependence on the electricity grid, which translates into economic and environmental benefits. Furthermore, as visible in the Figure, the flexible control does not generate an increase in the peak loads, but reduces them, contributing to lower average peak load values.
Globally, Table 5 provides information on the annual variation of the KPIs examined as the scenario considered varies. As can be seen from the FF values, the energy flexibility improves in scenarios I and II in terms of load shifting. This is also confirmed by the trend of annual energy self-consumption that varies from 59.44 MWh in the PED scenario to 65 and 69 MWh in cases I and II, respectively, while annual imports of electricity are reduced from 62 to 58 and 55. 26 MWh, and exports also reduced from 75 to 69.68 and 65. 49 MWh. The trend is also confirmed in the values of γ S e γ L , reported in the Table, and from the variation in the mapping during the year to the variation of the scenario considered, shown in Figure 19.      In fact, as can be seen in Figure 16, going from the basic PED scenario to the PED II scenario, some areas change their color from yellow/green to red, indicating an increase in the self-consumption factor (γ ) which represents an increase in the amount of local energy production self consumed simultaneously by the district. This occurs, for example, between days 300 and 360, corresponding to the months of November and December between 8:00 amd16:00, or for example in the month of October and all the others clearly visible between 8:00-12:00, and also in the rest of the hours of availability of local energy generation.
Regarding the environmental impact of the strategies, considering FF (emissions), the annual rate of energy consumption that occurs during the low penalty periods increases by 7% in scenario I, and by 12% in scenario II, compared to the PED scenario.
The impact of the use phase of the district is equal to 18.41 and to 17.39 tons CO2eq/y in the PED I and PED II scenario, respectively. From an economic point of view, in the redesign scenarios that include the activation of the energy flexibility of the thermal building mass, the operating costs related to energy are reduced by 50% compared to the existing base case and by approximately 12% compared to the PED base case.  In fact, as can be seen in Figure 16, going from the basic PED scenario to the PED II scenario, some areas change their color from yellow/green to red, indicating an increase in the self-consumption factor (γ s ) which represents an increase in the amount of local energy production self consumed simultaneously by the district. This occurs, for example, between days 300 and 360, corresponding to the months of November and December between 8:00 and 16:00, or for example in the month of October and all the others clearly visible between 8:00-12:00, and also in the rest of the hours of availability of local energy generation.
Regarding the environmental impact of the strategies, considering FF (emissions), the annual rate of energy consumption that occurs during the low penalty periods increases by 7% in scenario I, and by 12% in scenario II, compared to the PED scenario.
The impact of the use phase of the district is equal to 18.41 and to 17.39 tons CO 2eq /y in the PED I and PED II scenario, respectively. From an economic point of view, in the redesign scenarios that include the activation of the energy flexibility of the thermal building mass, the operating costs related to energy are reduced by 50% compared to the existing base case and by approximately 12% compared to the PED base case.
As in previous applications, e.g., [11,31,43], the implementation of algorithms for the flexible management of the air conditioning system achieves good performance of the order of 10-20% reduction in emissions and operating costs, even in the case where the penalty signal is based on the availability of renewable energy produced within the confines of the PED in the Mediterranean climate, as in [58], with results in line also from the point of view of the energy-environmental impact of building retrofitting. Figure 20 shows the evolution of the PED balance and the reduction in operational CO 2eq emissions per year, compared to the existing base case in the scenarios analyzed. In this case, the application of flexibility strategies does not significantly affect the PED balance, understood as a mere numerical subtraction value between energy generation and consumption, but it does contribute substantially to improving the energy-environmental efficiency of the district with an acceptable impact on peak loads. Solar 2023, 3, FOR PEER REVIEW 27 As in previous applications, e.g., [11,31,43], the implementation of algorithms for the flexible management of the air conditioning system achieves good performance of the order of 10-20% reduction in emissions and operating costs, even in the case where the penalty signal is based on the availability of renewable energy produced within the confines of the PED in the Mediterranean climate, as in [58], with results in line also from the point of view of the energy-environmental impact of building retrofitting. Figure 20 shows the evolution of the PED balance and the reduction in operational CO2eq emissions per year, compared to the existing base case in the scenarios analyzed. In this case, the application of flexibility strategies does not significantly affect the PED balance, understood as a mere numerical subtraction value between energy generation and consumption, but it does contribute substantially to improving the energy-environmental efficiency of the district with an acceptable impact on peak loads.

Conclusions
This paper presents the energy retrofitting from a PED perspective of a building district located in the Mediterranean area in order to evaluate its energy-environmental behavior in a dynamic regime, on the one hand, and to study the energy flexibility potential of the district in relation to the implementation of some strategies in the other.
Some scenarios based on the analysis of energy rehabilitation, integration of solar energy and activation of energy flexibility are described in this paper. Results are discussed in terms of interaction with the electricity grid, operational CO2eq emissions, some flexibility KPIs, the analysis of the energy flows and the PED energy balance.
The findings show that the district retrofitting allows to achieve the PED status, determining a reduction in the air conditioning needs of about 50% and an improvement in the thermal comfort conditions of the occupants (percentage variation in the number of hours corresponding to the Comfort Categories IV, compared to the existing configuration of the district, on average equal to −13%.) The joint action of energy efficiency strategies (insulation of the building envelope and use of solar energy) and energy flexibility improves the environmental sustainability of the district and the balance of energy flows. In fact, when the flexible control logics of

Conclusions
This paper presents the energy retrofitting from a PED perspective of a building district located in the Mediterranean area in order to evaluate its energy-environmental behavior in a dynamic regime, on the one hand, and to study the energy flexibility potential of the district in relation to the implementation of some strategies in the other.
Some scenarios based on the analysis of energy rehabilitation, integration of solar energy and activation of energy flexibility are described in this paper. Results are discussed in terms of interaction with the electricity grid, operational CO 2eq emissions, some flexibility KPIs, the analysis of the energy flows and the PED energy balance.
The findings show that the district retrofitting allows to achieve the PED status, determining a reduction in the air conditioning needs of about 50% and an improvement in the thermal comfort conditions of the occupants (percentage variation in the number of hours corresponding to the Comfort Categories IV, compared to the existing configuration of the district, on average equal to −13%.) The joint action of energy efficiency strategies (insulation of the building envelope and use of solar energy) and energy flexibility improves the environmental sustainability of the district and the balance of energy flows. In fact, when the flexible control logics of the space air conditioning system are taken into account in the PED, an additional margin of reduction in operational CO 2eq emissions and an increase in self-consumption of energy of approximately 10% is achieved, improving the contemporaneity between generation and load. Furthermore, from the point of view of the economic impact on the use phase of the district, the activation of energy flexibility contributes a further margin of about 12% of economic savings for the purchase of energy, with a positive impact on peak loads.
However, given that the thermal insulation of the building envelope has determined a significant increase in energy consumption for cooling, it should also be noted that adaptation to the transmittance limit values imposed by current legislation does not always achieve optimal performance in terms of energy efficiency, especially in regions with a Mediterranean climate and particularly in buildings with high internal loads, such as restaurants.
As for the energy flexibility analysis and as indicated by the energy flexibility KPIs, the implementation of RBC algorithms for the flexible control determines a significant load shifting from the high penalty periods towards those of low penalty. This determines the activation of the energy flexibility of the district and of the thermal mass, e.g., by means of programmed pre-heating of the rooms and the consequent storage of energy. The approach contributes to the self-sufficiency of the positive energy district and the simultaneity of energy demand and on-site renewable energy generation. As a result, the operational emissions of the district vary from the base value of 33.37 tons CO 2eq /y to 19.52 tons CO 2eq /y in the scenario based on the integration of solar energy systems and energy efficiency measures, and to 17.39 tons CO 2eq /y when the demand-side energy flexibility is also activated.
It should be noted that these findings are achieved due to the automatic flexible control which, unlike the installation of an energy storage device, does not imply additional installation costs in the design phase, nor an increase in the embodied emissions of the system. However, due to the induced temperature variations, thermal comfort could be jeopardized. Therefore, the need for a comfort analysis for each of the rooms should be prioritized in order to avoid conditions of discomfort for the occupants and, indeed, guide the algorithm in the choice of control logics that operate according to the direction of improvement of comfort.
On the other hand, since the impact of energy efficiency and energy flexibility strategies also varies depending on the use of buildings, an analysis at both the disaggregated and aggregated district level could be useful to move towards optimized solutions.
As for the PED energy balance, although the activation of energy flexibility has caused an appreciable improvement in all the grid interaction KPIs and a significant increase in FFs, the energy balance understood as a mere numerical value is not greatly affected by the effect of flexible control and is reduced to the increase in flexibility.
Therefore, the importance of a broad and deep analysis of energy flows and flexibility KPIs also arises since a partial analysis or based on the mere evaluation of the PED energy balance could lead to misleading conclusions.
Regarding the limitations of this paper, it should be noted that although the economic impact of the implementation of the flexibility strategies investigated in this research work has been evaluated (with respect to both the existing base case and the PED base case in which they are not applied), it does not provide a detailed overview of the costs due to the retrofitting of buildings and to life cycle costs, as these are outside the scope of the paper. These aspects will be dealt with in detail in future research outputs which aim to investigate the economic-social and environmental sustainability of redesign approaches from a PED perspective.
In conclusion, the research results of this work translate into a series of lessons learned that can be extrapolated to similar contexts in the Mediterranean area and stimulate considerations for future research outlooks. In particular, future perspectives should focus on the following: (a) a multi-criteria approach aimed at activating energy flexibility in PEDs, (b) an in-depth analysis of occupant comfort in order to investigate possible significant impacts, and (c) the development of a holistic design framework for PEDs that builds elements of energy flexibility and sustainability (environmental, economic and social).