Multi-Variable Optimization of Building Thermal Design Using Genetic Algorithms

The building sector is one of the largest energy consumers in the world, comprising about 40% of the total energy consumption in numerous countries. Early design decisions have a significant impact on the energy performance of buildings. The paper presents the multi-variable optimization of the selected design parameters in a single-family building in temperate climate conditions. The influence of four types of windows, their size, building orientation, insulation of external wall, roof and ground floor and infiltration on the life cycle costs (LCC) is analyzed. Optimal selection of the design parameters is carried out using genetic algorithms by coupling the building performance simulation program EnergyPlus with optimization environment. The simulations were conducted for seven optimization cases. The analysis is performed for two variants of a building with heating and cooling systems and with a heating system only. Depending on the analyzed case, the life cycle costs decreased from 7% to 34% LCC value of the reference building. In the case of temperate climate, the building optimization (in terms of heat demand only) substantially reduces the heating costs, yet the summer thermal comfort conditions deteriorate significantly.


Introduction
Energy consumption in buildings accounts for a considerable part of the total worldwide energy consumption. According to the literature, in developed and developing countries it constitutes about 40% of the total energy consumption [1][2][3][4][5][6][7][8]. Residential buildings are responsible for a major part of the energy consumption of the building sector [9]. Therefore, as energy consumption is rapidly increasing due to the population growth, urbanization and industrialization, energy conservation in buildings has become an important part of national energy strategies in multiple countries [10]. This led to the development of building energy efficiency regulations. These regulations introduce a minimum of energy efficiency requirements that need to be met by all new buildings and retrofitted buildings [11]. An example of such regulations is the Energy Performance of Buildings Directive (EPBD) [12] in Europe (implemented as a regulation at a national level in EU Member States).
In many cases those requirements call for higher insulation performance for all envelope building surfaces and the most effective thermal insulating glazing systems, characterized by low solar transmittance [13]. However, increasing a building's thermal energy efficiency can be achieved not only by increasing insulation thickness and installing high performance windows. Several other design parameters have a significant effect on heating and cooling thermal loads of buildings, such as a building shape and orientation, wall and roof construction, window sizes and shading, as well as the authors also analyzed the building in several locations. The objective function of the studies was to minimize the life cycle costs.
Some researches apply multi-objective [2,5,6,25,26,[36][37][38][39][40] or multi-criterion [41,42] optimization models. In the study conducted by Ascione et al. [39], a procedure that combines EnergyPlus simulation and a genetic algorithm was implemented to determine the best solutions for the HVAC system control in a residential building. The objective of this study was to minimize the primary energy demand and investment cost. Azari et al. [40] utilized a multi-objective optimization algorithm to explore optimum building envelope design with respect to energy use and life cycle contribution to the impacts on the environment in a low-rise office building in Seattle. The simulation tool eQuest was used to assess the operational energy use. A hybrid genetic algorithm and artificial neural net-works was used for the optimization.
The optimization of the insulation thickness of a house considering both economic and environmental concerns is presented by Carreras et al. [36]. The authors proposed a systematic framework for the design of buildings that combines a rigorous objective reduction method with a surrogate optimization model. In turn, Ascione et al. [26] proposed a new multi-stage framework for cost-optimal analysis by multi-objective optimization and artificial neural networks, called CASA. A genetic algorithm and EnergyPlus simulation allowed to select recommended retrofit packages by minimizing energy consumption and thermal discomfort. The same energy simulation software and a heuristic algorithm was used by Mostavi et al. [38]. The effect of 65 different building construction materials was analyzed by the authors. The multi-objective design optimization model to minimize life cycle cost and life cycle emission, and maximize occupant satisfaction level in a typical commercial building was developed.
Optimization of building energy performance is more complex in the case of temperate climates (Mediterranean or continental). While in some cold regions only heating energy consumption is usually considered, the temperate climate makes it essential to consider both heating and cooling energy uses. Varying some parameters of the building over their ranges of practical values can have counterproductive effects on heating and cooling energy consumptions. It is evident, for example, that an insulated building envelope helps in reducing heating demand. But in summer, the outdoor night temperature being lower than the required indoor temperature, uninsulated walls allow leading to the reduction of air-conditioning need [29]. Therefore, in climates where both heating and cooling throughout the year are required, the optimization of the design parameters in buildings should take into account the cost of both heating and cooling.
The paper presents the multi-variable optimization of chosen design parameters in a single-family building in Polish climate conditions. Poland is located in transitional climate (between continental and Atlantic climates) with relatively cold winters and warm summers. Throughout a year external temperature varies from approximately −20 • C to over +30 • C. In order to provide thermal comfort for their occupants, such external conditions require buildings to be both heated and cooled. Although the amount of energy consumed in detached houses built nowadays is much lower than in older ones, they still consume a considerable portion of energy. In Poland, for heating, it is about 37% [43].
The influence of four types of windows, their size, building orientation, insulation of external walls, roof and ground floor and intensity of infiltration on annual energy consumption is analyzed in the paper. Optimal selection of these parameters for reduction the life cycle costs was carried out by the tool which combines the optimization method (genetic algorithms) and the dynamic building simulation program (EnergyPlus), in which both internal and external loads were taken into consideration.
Polish investors argue that high initial investment (above the required standard) pays off in the long run when using a building. The paper aims to determine optimum solutions that will enable maximum energy and economic benefits during the lifetime of the building. Regrettably, no papers exist which analyze the problem in question for Polish temperate climate conditions. The vast majority of models are optimized for warmer climates (Mediterranean or warm). Additionally, many of the above quoted papers used grand simplifications: thermal zones included several rooms or the analyses only one zone, the same casual gains assumed in the whole building, window size defined by the window-to-wall ratio. In this study a detailed analysis of the selected building using self-adaptive genetic algorithm has been performed. The rooms are modeled as separate zones with scheduled casual gains. The constructed algorithm individually selects optimum values from discreet sets for each design variable as well as automatically selects an external wall for a window in each room. Only such an algorithm enables to determine optimum design solutions for the optimized building.

Methods
Multi-variable optimizations by coupling the building performance simulation program with optimization environment using a genetic algorithms (GAs) were performed to determine the best path to minimize life cycle costs while reducing the energy use of a typical single-family house in Poland.
The energy modelling tool EnergyPlus [44], which allows integrated calculations of the transfer of mass and energy inside the building, taking into account heating and air-conditioning systems and the strategy of control was used for simulation of the heating and cooling demand. In addition, EnergyPlus makes it possible to carry out parallel simulations and consequently to accelerate the optimization process. The multi-zone model, containing all the heated and unheated rooms, was built in a simulation program. For simplicity's sake, the rooms without external walls (a hall and a bathroom) were joined into one zone. Internal heat gains were assumed according to the literature [45,46] for occupants, two computers, a TV set and kitchen equipment and lighting. An hourly schedule for the presence of occupants and for the use of lighting and equipment was adopted in each room ( Table 1). The duration of the lighting operation (10 W/m 2 ) was additionally dependent on the solar radiation (according to climatic data). The simulations were performed using reference weather data for Katowice [47]. The simulations were run with a fifteen-minute time step. In the model there is the ground floor. The method of ground heat transfer modelling affect internal temperature, and consequently heating and cooling demand in a building. It was confirmed in the study performed by Mateus et al. [48]. In our paper a simplified 1-D conduction ground model ("Site ground temperature: building surface" [44]) was introduced to the simulation model. Monthly profile of ground temperature was imported from ESP-r program (see Section 2.5). Such a simplification had little influence on the final results (life cycle cost, energy saving) since the difference between the reference and optimized building in the study was analyzed and the same assumption was taken into account in any cases.
The genetic algorithm method and all procedures to exchange data between the simulation and the optimization tool were implemented in MATLAB (R2017a, The MathWorks Inc., Natick, MA, USA) language. Figure 1 shows the structure of the simulation and optimization environment.

Building Description
The single-family detached house without a cellar and with unused attic was chosen for the research. The ground floor of the building is shown on Figure 2. Table 2 summarizes the basic characteristics of the reference building. The house has four bedrooms and an open space kitchen and a living room. The building is air conditioned (split system) and equipped with a hot water central heating system. A natural gas boiler is utilized to generate the hot water supplied to radiators. The cooling set point is kept at 24 °C and heating set point at 20 °C during the whole year. The building uses natural ventilation only. In

Building Description
The single-family detached house without a cellar and with unused attic was chosen for the research. The ground floor of the building is shown on Figure 2. Table 2 summarizes the basic characteristics of the reference building.

Building Description
The single-family detached house without a cellar and with unused attic was chosen for the research. The ground floor of the building is shown on Figure 2. Table 2 summarizes the basic characteristics of the reference building. The house has four bedrooms and an open space kitchen and a living room. The building is air conditioned (split system) and equipped with a hot water central heating system. A natural gas boiler is utilized to generate the hot water supplied to radiators. The cooling set point is kept at 24 °C and heating set point at 20 °C during the whole year. The building uses natural ventilation only. In The house has four bedrooms and an open space kitchen and a living room. The building is air conditioned (split system) and equipped with a hot water central heating system. A natural gas boiler is utilized to generate the hot water supplied to radiators. The cooling set point is kept at 24 • C and heating set point at 20 • C during the whole year. The building uses natural ventilation only. In Poland, the minimum ventilation air flow is set by PN-83/B-03430/Az3:2000 standard [49]. For the analyzed house such minimum air flow is 120 m 3 /h (it is about 0.3 air change per hour). But according to other Polish standard PN-EN 12831:2006 [50] for the calculation of the design heat load, the air change rate in residential buildings should amount to 0.5 h −1 . Therefore, this value is taken as the base value for the calculation. For infiltration simulation "Design Flow Rate" model [44] was chosen, which is based on environmental conditions modifying a design flow rate. The design flow rate is modified by temperature differences and wind speed.

Design Variables
In optimization analysis the most common design options available in Poland are chosen as design variables. A brief description of these variables is presented below:

•
Glazing type characterized by three parameters of the glazing, i.e., heat transfer coefficient (U), solar heat gain coefficient (SHGC) and visible transmittance (Tvis). The optimization was performed for four different types of glazing (Table 3). In the Table 4 the reference value (bold characters) and cost of the glass are shown. • Windows area (glazing + frame) defined by the sixteen discrete value of windows size (Table 4).
Depending on the size of the window the frame surface is automatically calculated for each window.  (Table 4).  All possible values of the design variables are summarized in Table 4. Glazing systems were prepared with using Window 7.4 software [51]. Glass types were chosen from the Saint Gobain Glass library [52].
Newly-constructed buildings in Poland must meet Technical Conditions [53]. The partitions' structure (Table 2) in a reference building (RB) (which will be used in the comparison) was determined so that heat transfer coefficients of external partitions would be according to these requirements. The details of insulation thickness in the partitions are specified in Table 4. Technical Conditions [53] also specify the minimum ratio of glazed area of the windows to the floor area of the rooms they are located in. It should be minimum 1:8. Such a minimum glass area in the analyzed building is 14.4 m 2 .
In the reference building the glazing area amounts to 15.7 m 2 . The overestimated value results from the adopted assumptions: there are all windows in each room (Figure 2), they have the same surface area and are selected from the allowable options (Table 4). Figure 2 shows the windows' dimensions in the reference building (they are the overall dimensions with a frame).

Economic Analysis
Objective functions are the selected simulation results which vary depending on the parametric input combinations, and are the values to be minimized by the optimization algorithm. The simulation-optimization environment can consider a various objective function to perform the optimization analysis. In this study, the cost function is selected as the life cycle cost (LCC).
According to Hasan et al. [31], "the life-cycle cost LCC is the sum of the present value of investment and operating costs for the building and service systems, including those related to maintenance and replacement, over a specified lifespan".
In terms of economic benefits of energy retrofits, life cycle cost analysis is one of the most common tools used to compare the initial investments and the future benefits of retrofit alternatives in building energy efficiency. LCC, which sums all costs during a certain period of time, provides a criterion for finding the best solution, when the LCC is as low as possible [54].
During a building lifetime the economic factors, e.g., the inflation rate, can change, which affects the discount rate and hence affects the time value of money. The choice of a discounting rate has a large impact on the LCC results [55]. A review of LCC in residential building projects revealed that the discount rate ranged from 2% to 8%. However, it is highlighted that the selection of an appropriate discount rate is the major challenge in LCC [56].
Typically, the widely accepted building lifetime is 25-50 years [15,26,30]. In this paper, the analysis period and building life cycle is considered to be 30 years, according to European Commission Delegated Regulation and its Guidelines for residential buildings [12,57]. The lifespan of a new PCV window is about 30 years [58], the lifespan of the other analyzed components is longer [59] therefore replacement costs have not been taken into account in this study.
In the study life cycle cost was defined by Equation (1). The investment costs of the analyzed design variables have been used for calculations. The remaining investment costs are equal in each case and do not affect the optimization result. Only extra investment costs involved in the reference building that result from the changes introduced in each optimization option have been analyze: where dIC-the differences between sum of investment cost for implementing all the design and operating features in the reference and optimized case of the building. In this study it is the cost (material and labour) of external walls, ceiling and floor insulation, cost of windows and external walls structural material. Table 4 provides the cost data for various design and operating options. EC-the annual energy cost (heating and cooling) to maintain indoor temperature within the building for the selected design, from Equation (2), a-discount factor which takes into account the effect of inflation and escalation of energy price: where Q H -annual heating demand, kWh; Q C -annual cooling demand, kWh; η H -annual efficiency of heating system; η C -annual efficiency of cooling system; P H(gas) -price of energy from natural gas, according to the applicable tariffs; P C(el.) -price of electrical energy, according to the applicable tariffs. For calculating the operational energy, the energy prices and its escalation rates were obtained. The discount factor was calculated from Equation (3) [31,32,60]: where r e is the real interest rate including the effect of escalation of energy price, and N is the number of years under study. The real interest rate is calculated from: where r is the real interest rate and e is the escalation in energy price. The real interest rate r is calculated from: where i is the nominal interest rate and f is the inflation rate.
The following data are assumed for the LCC calculations:

Optimization Algorithm
The energy performance of a building depends on a great number of parameters and is further influenced by external conditions and internal gains. In order to improve the energy performance of a building the correct parameters should be determined, which requires the right optimization tool. Bearing in mind a great number of variables which can be combined we might end up facing a vast number of combinations while the building itself will not be so complex. It is of vital importance to choose the right tool to solve such a complex problem [29].
Genetic algorithm (GA) [62] is a popular meta-heuristic method that is particularly well suited for the optimal design problems and has been proved to be a good method to solve large scale and combinatorial optimization problems [5]. The advantages of GAs, as well as population-based meta-heuristic algorithms, are the ability to deal with discrete set of design variables, no need for derivatives of objective functions, and the global convergence. GAs are search algorithms based on ideas of natural selection and genetics (selection, crossover, mutation). Although GAs do not guarantee finding the global optimum, they have become advanced optimization tool for a wide range of problems. GAs were further applied in a number of the papers quoted in the introduction of this paper [2,5,14,15,[29][30][31][32][33]35,36,38,[40][41][42].
Due to their stochastic nature, GAs are faced with two problems: the optimizing capability and convergence speed. To improve the efficiency of GAs, self-adaptive genetic algorithm method (SGA) based on fuzzy arithmetic was applied. SGA was applied simultaneously in the selection of chromosomes and to control basic parameters of genetic algorithm.
The following were applied in the SGA: self-adaptive rank-based roulette wheel selection with power scaling (k), • self-adaptive uniform crossover with probability (P c ), • self-adaptive mutation realized by adding some number (S) to or subtracting it from mutated gene with probability (P m ).
GA tries to maintain appropriate balance between exploitation and exploration. On the one hand, good solution should be improved-exploitation, and on the other hand, new solution should also search new regions of potential extremes-exploration. The correct balance is maintained with the use of appropriate parameters (among others mentioned above: k, P c , S, P m ) entered into the algorithm. In a classic GA all these parameters are fixed and defined before the start of the algorithm. In SGA these parameters are calculated automatically during the run of the algorithm. These parameters depend on many factors (in this paper adopted: chromosomes diversity, the stage of the simulation and the number of generations with no improvement in results) and relationships between these factors and parameters and their impact on optimizing capability and convergence speed of genetic algorithm are very complex. The lack of precise mathematical formulas between input and output variables is the reason why fuzzy logic was used to calculate these parameters. The use of fuzzy control system in SGA significantly accelerates the convergence of the algorithm and improves results as shown in the studies of Grygierek [63,64]. Therefore this type of GA was used in the optimization process. All detailed information about a fuzzy logic controller (membership function, rule base, defuzzification method) was presented in the article [64].
Fifty individuals and eighty populations were assumed in the simulations. A relatively small number of individuals and populations is a compromise between the simulation duration and the quality of the obtained results.

Model Validation
Prior to the main research (optimization), numerical verification of the constructed model was performed. The hourly, daily and the annual heating and cooling demand for building were verified. The results obtained in EnergyPlus program for the reference building were compared to the results obtained in an alternative energy simulation program: ESP-r [65]. The ESP-r software and energy multizone models were repeatedly validated with experimental data by the authors [66][67][68]. In both programs the models are based on the same assumptions.
The numerical verification regarding heating and cooling demand makes the results of the simulation calculations reliable-relative difference is small. Figure 3a,b present the comparison of hourly variation of heating and cooling demand for the building obtained by simulations using EnergyPlus and ESP-r for the selected periods of the year. Figure 3c presents comparison and percentage differences for daily values of heating and cooling demand during the whole year. The percentage difference is calculated from Equation (6): Energies 2017, 10, 1570 10 of 20

Model Validation
Prior to the main research (optimization), numerical verification of the constructed model was performed. The hourly, daily and the annual heating and cooling demand for building were verified. The results obtained in EnergyPlus program for the reference building were compared to the results obtained in an alternative energy simulation program: ESP-r [65]. The ESP-r software and energy multizone models were repeatedly validated with experimental data by the authors [66][67][68]. In both programs the models are based on the same assumptions.
The numerical verification regarding heating and cooling demand makes the results of the simulation calculations reliable-relative difference is small. Figure 3a,b present the comparison of hourly variation of heating and cooling demand for the building obtained by simulations using EnergyPlus and ESP-r for the selected periods of the year. Figure 3c presents comparison and percentage differences for daily values of heating and cooling demand during the whole year. The percentage difference is calculated from Equation (6): The courses are characterized by large convergence. Correlation coefficients are very high and reach 0.99 for hourly and daily values. For daily values for 77% of the time, the difference does not exceed 5%, and for 94% of the time-10%. For hourly values it is, respectively 80% and 95% of time. The difference in annual energy demand (heating + cooling) calculated in both programs is 8%. The results obtained from EnergyPlus are mostly higher, however similar results were obtained in others studies [69]. Based on this analysis it can be stated that the presented model is characterized by sufficient accuracy and can be used for thermal calculations of the building.   The courses are characterized by large convergence. Correlation coefficients are very high and reach 0.99 for hourly and daily values. For daily values for 77% of the time, the difference does not exceed 5%, and for 94% of the time-10%. For hourly values it is, respectively 80% and 95% of time. The difference in annual energy demand (heating + cooling) calculated in both programs is 8%. The results obtained from EnergyPlus are mostly higher, however similar results were obtained in others studies [69]. Based on this analysis it can be stated that the presented model is characterized by sufficient accuracy and can be used for thermal calculations of the building.

Results
Simulations were conducted for seven cases. Table 5 presents the optimized design variables for each case. As a cooling system in detached houses has not yet become a standard (in Poland neither), additional simulations for a building without a cooling system were also conducted (cases with WC extension). The result analysis will be carried out for individual cases.
The results will be compared to the reference building. This is the building which complies with the Polish law [53] for newly-constructed buildings. The design variables for the building have been specified in Table 4. The aim of the simulations is to determine whether higher investments costs that improve the thermal performance of a building are cost-effective for an investor. The analysis does not include a beneficial influence of reduced energy consumption on natural environment protection. Table 6 presents heating and cooling demand and LCC values for the reference building.

Cases 1 and 2 (Optimization of Windows Area and Windows Area + Azimuth)
In case 1 the window area was optimized for each glazing type. Additionally, the orientation of the building in case 2 was optimized. It was assumed that there must be at least one window in each of the rooms and two windows in the living room. In the simulations it was assumed that the minimum glazing area is at least 1:8 of the floor area in the room (according to Technical Conditions [53]). The glazing area was calculated automatically in optimization program depending on the total area of the window.
The optimal results for four window types are shown in Tables 7 and 8 for cases 1 and 2 respectively. Furthermore, they present the best result for cases WC. These tables list LCC costs, heating and cooling demand and saving for optimal results of design variables and for each glazing type. The best result (minimal LCC) has been bolded (it does not include cases WC). It can be seen that for glazing G10, G08 and G06, G05, the same values for design variables were obtained in cases with and without cooling. Exactly the same windows and orientation of the building were chosen.

Building with Cooling
Maximum LCC savings for cases 1 and 2 amount to 5.9% and 6.8% respectively (window G06). They are relatively small ones, 2% bigger than the savings for window G10 (also used in the RB). In this case (G10), the performance improvement was due to the reduction in the total window area and an increase in the windows size on the southern side (different assumptions regarding the location of the windows for the RB and optimal buildings). One can notice that the optimum results for the windows with higher U value (G10, G07) are achieved when a total window area complies with the one specified in Technical Conditions [53]. When analyzing the results for G06 and G05, it can be observed that it is not right to cling on to the minimum value given in Technical Conditions. For example, in case 1 the surface area of glazing (G06, G05) accounts for 130% of the minimum permissible value.
The reduction of the energy costs is obtained by the proper location of the windows in the building, not by reducing their area. In this case the windows that face the south account for 55% of all windows. The biggest energy savings of 8.6% and 9.0% respectively have been achieved for a window G05 (cases 1 and 2). The high price of such windows, however, makes LCC worse than in windows G06 or even G07 (the most expensive windows). A significantly larger cooling demand can be observed in those two windows, which is the result of a high SHGC value. As in the case of the analyzed building, the costs of 1 kWh of cooling are approximately twice as low as 1 kWh heating costs, overall (LCC) better results are obtained. The optimization of a building orientation gives approximately 1% in LCC savings as well as a slightly lower heat demand.

Building without Cooling
In the case of WC 13.3% and 15.5% in LCC savings were achieved as well as 19.5% and 23.4% savings in energy demand for cases 1 and 2 respectively. The optimum results were obtained for the most expensive G07 window. Furthermore, best results were obtained for the window surface area that amount to 158% (case 1WC) and 182% (case 2WC) of the required minimum according to Technical Conditions [53]. The high SHGC value of window G07 increases solar gains as a result leads to lower heat demand. A deeply-rooted belief held by investors that windows of the smallest surface area and U value need to be chosen, is misguided. In case of WC buildings the energy consumption was largely determined by SGHC value.

Cases 3 and 4 (Optimization of Insulations and Insulations + Azimuth)
In the following cases the insulation of external walls (IEW), ground floor (IGF) and ceiling to unheated attic (ICA) was optimized. Table 9 presents the optimum design variables and optimum LCC results as well as energy demand for the building with and without cooling.
The optimized design building features allow for the building with cooling to reduce the LCC value by approximately 11% and energy demand by approximately 18%. The orientation optimization improves the results by less than 1%. The benefits in case of WC are considerably bigger: 20% and 35% respectively. As it might have been expected, thicker insulation is optimum for WC. The cost of insulation appears to be the only limitation when increasing the insulation thickness. In case of a building with cooling, thicker insulation increases cooling demand. The optimization of the isolation itself gives 5% more in savings than the optimization of windows only. 3.3. Cases 5 and 6 (Optimization of Glazing Type, Windows Area and Insulations (5) + Azimuth (6)) Table 10 shows the optimum results for these cases.

Building with Cooling
LCC savings in both cases amount to approximately 16%, and energy demand for cases 5 and 6, 25% and 27% respectively. As in the previous cases, the orientation optimization brought little benefit (0.5%). The optimum insulation thickness yield values that are identical with the ones in cases 3 and 4. As the previous optimizations show, the right choice of insulation gives a better result than windows' optimization.
The comparison of optimum windows and the results for cases 1 and 2 shows that the window area in the analyzed options is significantly smaller (windows G06 and G05). Additionally, the insulated building is characterized by low heat demand, so in these cases the windows with low SHGC values were chosen (G05 and G06) so that solar gains would be insignificant (less cooling). The low U value further limits the heat demand, and a small window area-the initial investment costs.

Building without Cooling
In this case LCC savings amount to 30%. Compared to the building with cooling, the insulation thickness of the floor was increased and the windows were replaced by G07 windows (high SHGC value). One can also notice that the windows area is considerably larger. All the changes were meant to maximize solar gains and consequently, to reduce heat demand. The heating demand for the optimum case 5WC amounts to 82% of the heating demand for the optimum case 5. In case of 6WC the value is much lower, only 78%.
Such an optimization option results in a drastic indoor temperature rise in the summer. The simulations showed that the indoor temperature without additional ventilation in case 6WC exceeds 30 • C (on average in the rooms with windows) during about 30% of the year, which means all the period from the end of May till the beginning of September. The maximum temperature recorded in the living room is 43 • C. It shows that the considerable energy benefits were obtained at the expense of thermal comfort during summer season. The indoor temperature above 30 • C in the living room of the reference building occurs only about 2% of the time. This time period does not exceed 0.5% of the year in other rooms. The maximum indoor temperature is almost 10 K lower when compared to 6WC.

Case 7 (All Variable)
This case shows how important is infiltration for heating demand in Polish climate (temperate, transitional). LCC savings amount to 34% and 50% respectively for cases 7 and 7WC ( Table 10). The optimum results of design variables are consistent with the results obtained in 6 and 6WC, thus the result conclusions are the same as previously described. As expected, the lowest possible infiltration rate of 0.3 h −1 is optimal. Lowering infiltration rates by 0.2 h −1 in well-insulated buildings (cases 6 and 7) results in lowering LCC by 21%, and total heat demand by 30%.
As it has already been mentioned, air change rate of 0.3 h −1 is only the minimum acceptable air exchange in the analyzed building resulting from Polish ventilation standard PN-83/B-03430/Az3: 2000 [49]. Thus, in this case energy savings were obtained at the expense of deteriorated indoor air quality. There is a conflict between energy savings and indoor air quality. The research on ventilation and its impact on indoor air quality and energy consumption was carried out, inter alia, in the studies by Ferdyn-Grygierek [70] and Popiołek and Ferdyn-Grygierek [71]. The subject is widely discussed in the paper Gennaro et al. [72]. The investment costs should not be considered only from an economical point of view but most importantly, form occupants' point of view as well as their health and comfort. The presented model does not account for this particular aspect. It requires further research that will employ, inter alia, the different objective function in the optimization model.

Summary
Proper design of the external partitions of buildings, such as windows, walls, ground floor and roof, prevents excessive heat loss in winter as well as too high heat gains from the sun in summer. The location and climate of Poland determine the need to heat buildings for a significant part of the year, typically from September to May. The demand for cooling constitutes a smaller part of the total energy demand. In the analyzed building, depending on the optimization case, the cooling demand amounts to about 11-32% of the heating demand. But for smaller infiltration in a building, cooling demand is even 45% of heating demand.
The study showed that the investment above the Polish required standard is cost-effective during the lifetime of the building. Depending on the analyzed case, as the results of the optimization, the life cycle costs in building with cooling and heating systems decrease from about 700 € to over 3800 € (Table 11). It is from 7% to 34% LCC value of the reference building. The optimal design variables for all cases with heating and cooling systems are summarized in Table 11.
A reduction of air exchange in the building with well-insulated external partitions to the minimum permitted by regulations allows for considerable reductions in heating costs (in the analyzed building by about 30%). The need for cooling, however, rises by about 16%. Air exchange optimization control in a building may become an inexpensive way to reduce heating costs, which we will consider in our future research.
The simulation results for the analyzed building may be applied to every detached house in a similar climate. However, in order to achieve maximum LCC reduction such complex and time-consuming calculations need to be performed for each building separately.

Conclusions
The paper presents the methodology and the tool aimed at supporting the choice of economically effective building solutions. The detailed multi-zone model of a building and the gains that are attributed to the relevant zones contributed to maximize the obtained results (reduced LCC). In many works on this subject, the size of the windows is determined only by the ratio of their area to the façade area [15]. The window optimization tool built in this study analyses each window separately and allows to remove windows that overstate the energy consumption.
The conducted research and analyses allowed the elaboration of the following main conclusions: 1.
The cheapest way to reduce the energy consumption for heating and cooling is to locate windows on the southern side of the building. This applies especially to rooms with smaller internal gains.

2.
Selecting windows should not be based solely on the heat transfer coefficient (which is a widespread practice with investors). Solar optical properties of windows also significantly affect the cost of the energy consumption, especially in case without cooling system.

3.
The optimum glazing area for buildings with cooling is highly dependent on external walls insulation. The simulation results showed that the windows area varies from the minimum norm value to 130% of this value. In order to achieve minimum LCC in a building without cooling (WC), the windows area should be tens of percent larger than the requirements set out in the Standards. 4.
In case of limited investment costs optimization regarding only insulation of external partitions is more effective than optimization of windows only (due to LCC). In the analyzed building it is 5%.

5.
When determining the design parameters of a building in transitional climates, both cooling and heating costs should be considered. The optimization of a building from the heating point of view greatly reduces heating costs, however, the thermal comfort in summer deteriorates dramatically. 6.
One should make decisions about having or not having a cooling system installed prior to determining optimum qualities of a building. Without a cooling system, apart from life cycle cost, extra objective functions e.g., a thermal comfort index need to be employed.
The developed simulation environment can also be used to optimize other building parameters. The simulation environment can easily be extended to other types of buildings. In further research the optimization environment will be used to optimize air exchange control in a building, where increasing/reducing the number of air exchanges depending on the heating and cooling needs will be possible. This environment will also be used for multi-objective optimization where the objective function will be the cost of energy consumption and thermal comfort indices which are, as mentioned, of great importance in buildings without a cooling system.