Improving outdoor thermal comfort of a kindergarten by optimizing its building shape with genetic algorithm

. Thermally comfortable mircoclimate is essential for creating high-quality outdoor spaces that attract citizens and boost city vitality. Previous design efforts to improve outdoor thermal comfort were usually conducted at large scales, such as city scale, neighborhood scale, urban block scale. Few researchers focused on the building scale. This study proposes an optimization framework based on genetic algorithm to determine the building shape, orientation, and location during early design stage that reduces the overall thermal stress in the target outdoor space. Solar radiation and wind fields were simulated to obtain the outdoor Universal Thermal Climate Index (UTCI) as the performance indicator. The simulations were validated against the experimental data. This investigation applied the proposed optimization framework to design the outdoor space for a kindergarten under the climate of Tianjin and Shanghai, respectively. The results showed that optimization reduced the overall thermal stress. The most favourable kindergarten forms were suggested through optimization. This study supplements the inverse design of outdoor thermal comfort at building scale and provides suggestions to create comfortable urban outdoor spaces.


Introduction
Under rapid urbanization, it is essential to design high-quality outdoor spaces to attract people to the outdoors for the physical and mental health of citizens and the reduction of the usages of air conditioners and other electronic equipment [1]. A thermally comfortable microclimate is fundamental to a high-quality outdoor space [2], as increased vitality was usually observed under better microclimate [3]. Thus, it is necessary to take microclimate into consideration when designing urban outdoor spaces.
The effect of urban geometry on microclimate could be analyzed at multiple scales [4,5]. A lot of studies have been conducted at large scales such as city scale, neighborhood scale, urban block scale and so on [6][7][8][9]. However, very few studies focused on building scale that considers the impact of building form, including shape, height, orientation and location of the target building, etc., on the microclimate of its outdoor space in detail. Anisha et al. [10] and Beta et al. [11] investigated effects of building forms on microclimate, but they just considered a few simple and fundamental forms. To fully explore the effect of building forms on outdoor thermal comfort, a series of design scenarios for various building forms should be considered. Besides, they isolated the target site from surroundings and failed to precisely involve the impact of surrounding buildings on the microclimate of the target site.
In addition, considering the seasonal changes throughout a year, a design that improves thermal comfort in summer may cause discomfort in winter and vice versa. Therefore, an accurate and reliable design for improving the thermal comfort of outdoor space should consider the impact of seasonal changes. However, present outdoor thermal comfort studies mostly focused on the improvement of one season and paid little attention to other seasons [12,13].
Therefore, this study proposes a framework that inversely design the form of buildings with the objective to optimize the outdoor microclimate. The framework considers both the effect of surrounding buildings and seasonal changes. The numerical simulations of solar radiation and wind field were validated. Our investigation applies the proposed inverse design framework to design the outdoor space of a kindergarten for demonstration. Figure 1 illustrates the overall framework of the outdoor microclimate optimization, which consists of four parts: background input, microclimate simulation, performance evaluation, and genetic algorithm. The background input drives the microclimate simulation, the performance is evaluated according to the simulation results, and the optimization process efficiently searches for a set of design variables that achieve the best performance. The simulation and optimization were conducted in the Rhino -Grasshopper parametric modeling platform with the use of plug-ins such as Ladybug, Butterfly, and Galapagos [14]. Details of the simulation and optimization processes are covered in the following sections.

Background input
The background information can be categorized into morphological and meteorological inputs. Morphological inputs include the morphological features of the target buildings and the surroundings. The morphological features of the target building, including building location, shape, height, orientation, etc., can be refined into design variables. While setting up the design variables, constraints from building codes or actual demands are required to provide reasonable restrictions. Meteorological data are also necessary inputs because they provide boundary conditions to drive the microclimate simulation.

Microclimate simulations
Outdoor microclimate can be characterized by air temperature (T a ), relative humidity (RH), solar radiation, and wind speed (U). Air temperature and humidity are greatly determined by the local climate and usually have limited spatial variation, while the urban morphology can largely influence the distributions of wind speed and solar radiation. This study simulated the wind speed and radiation fields.
This study uses mean radiant temperature (T mrt) to denote the solar radiation field. Ladybug plug-in in Grasshopper calculates Tmrt as a combination of both long wave and short wave heat exchanges. The effect of long wave radiation is estimated using the MENEX model [15]. The short wave part of Tmrt is calculated using the Solarcal model proposed by Arens et al. [16]. Parameters of calculation were set according to ASHRAE standard 55 [17].
This study uses the Grasshopper plug-in Butterfly to simulate the wind field. The Atmospheric Boundary Layer (ABL) conditions [18] are prescribed at the inlet. BlockMesh and SnappyHexMesh tools in OpenFOAM are utilized together to generate mesh. The standard k-ε turbulence model is used and convergence can be obtained when all the scaled residuals reach a minimum of 10 -6 .

Performance evaluation
This study employed Universal thermal climate index (UTCI) [19] which is claimed to be applicable to a wide range of climates and locations to evaluate the outdoor thermal comfort [20]. The calculation of UTCI requires four input parameters: T a, Tmrt, RH and wind speed at 10 meters (U ref). U at z meters can be converted to Uref using Equation 1: Among the four parameters, Ta and RH can be obtained from Energy Plus Weather (EPW) weather file while the distributions of Tmrt and Uref are calculated according to section 2.1.2. The resulted UTCI is categorized into 10 thermal stress levels and the level of 9-26℃ is considered as no thermal stress. The thermal stress at time point m and spatial grid n is defined as the distance from the no thermal stress range 9-26℃: The objective of outdoor microclimate optimization is to reduce the overall thermal stress in the target outdoor space at specified times. With the thermal stress in Equation 2, the objective function (OF) is defined as the mean of the spatial and temporal thermal stress in Equation 3:

Genetic algorithm (GA)
This investigation used GA to identify the design variables for minimum thermal stress. As shown in Figure 1, the first step of genetic algorithm generates a set of random initial design variables for the individuals in the first population. Then, with background inputs, simulations are conducted to evaluate the performance by determining the OF value for each individual. The GA conducts selection, crossover, and mutation on the design variables of individuals by using the OF in the current generation to generate a new population. The optimization process stops when the optimal individual stayed the same for five consecutive generations or a maximum of 15 generations were performed. Galapagos plug-in in Grasshopper was used as the genetic algorithm optimization engine in this study. The size of the initial population was 30 individuals and the size of other generations was 10 individuals. In every evolutionary period, 20% of all individuals were selected. Blend Crossover [21] and Point Mutation [22] were employed to produce new individuals.

Validation of the solar radiation and wind speed simulations
Although numerical modelling offers flexibility, it entails uncertainties due to many approximations used. Therefore, it is necessary to validate the numerical simulations. The following details the validation of solar radiation and wind simulations by comparing the simulated results with the experimental data.

Solar radiation
In order to provide experimental data for the validation of solar radiation simulation, this study measured T mrt in the center of a six-story courtyard of a building in Tianjin University, China. In order to cover different seasons and meteorological conditions, measurements were conducted on August 13, 2018, October 24, 2018, February 28, 2019 and May 13, 2019. To avoid the rainy periods, measurements on August 13, 2018 was conducted from 10:00 a.m. to 15:00 p.m. The rest three measurements were performed from 8:00 a.m. to 15:00 p.m. Six-direction method [23] was used to calculate T mrt and the six directional short wave and long wave solar radiations were measured by short wave radiometer Kipp&Zonen and long wave radiometer CNR4 at the height of 1.1 m. The meteorological data to drive the simulation, including the T a , direct normal radiation (I dir ), diffuse horizontal radiation (I diff ), and horizontal infrared radiation (Ihor), was obtained from the nearest meteorological station. Figure 2 compares the simulated and measured Tmrt and the simulation accurately reflected the variation of the measurement with a R 2 of 0.92. The maximum difference between the simulated and measured data was 6.99 K at 14:00 p.m. on May 13, 2019. Compared with previous studies, the difference between simulated and measured Tmrt was within a reasonable range of discrepancy [24], and the accuracy of Ladybug tool to model the Tmrt was thus validated.

Wind speed
To validate the wind speed simulation, we used the experimental data from Case 1H by Tominaga et al. [25]. Tominaga et al. provided a dataset of the threedimensional (3D) turbulent flow over nine identical cubic buildings in an ABL wind tunnel. The simulated and measured wind velocity were compared in Figure 3 (H = 0.1m, UH = 3.1m/s). A good agreement between the simulated and measured data can be seen from Figure 3 with R 2 of 0.99 and root mean square error (RMSE) of 0.08. The maximum discrepancy of 0.26m/s appeared at the position of x/H = -0.6 because steady RANS simulation is not good at predicting the separation and recirculation in the downstream of buildings [26]. With reasonable overall accuracy, we validated the standard k-ε model in the Butterfly plugin in Rhino -Grasshopper for subsequent simulation of outdoor flow.

Case study
According to Chinese Code for Design of Nursery and Kindergarten Buildings [27], the general layout of kindergartens should include well-designed outdoor space in line with children's physiological and psychological characteristics. The optimization framework was applied to the inverse design of the outdoor thermal comfort of a kindergarten for demonstration.

General forms of kindergartens
In order to reasonably setup the design variables and constraints, we collected a list of kindergartens from a school information database in China [28] and randomly selected 120 samples of kindergarten to investigate. First, it was found that most of the main building of these kindergartens have three floors [27]. Then, 85.8% of the selected kindergartens were built within high-density residential areas, and only 14.2% of the kindergartens were located around relatively open crossroads. Single-building layout dominated the investigated kindergartens with a proportion of 66.1%, followed by 2-buildings sites with the proportion of 19.2%. Kindergartens with three or more buildings were very rare. The most frequent building form was the strip form with an emerging frequency of 43.7%, followed by L form, C form, ladder form, T form, branch form, H form, O form, and courtyard form ( Figure 4). The above analysis of the building forms and surroundings of kindergartens provided a foundation for the subsequent setup of a typical design case.

Surroundings, constraints, and design variables
According to the analysis, we decided to set the design in a high-density residential community. A rectangular site of 42 m x 38 m located in the middle of a typical community was selected as the construction site for the kindergarten. The site was surrounded by high-density residential buildings with height from 30 to 40 meters. To consider the influence of surrounding buildings on local microclimate, detailed building structures around the target space within a radius of at least 3L (L is the maximum dimension of the target space) should be modeled, according to Liu et al. [29]. Figure 5 shows the top and perspective views of the surrounding residential buildings. According to Standard for Kindergarten Construction [30], the plot ratio was limited to 0.6 and the number of floors was set to three with the floor height of 4 m. After the surroundings and constrains were determined, we started to generate the building on the construction site. Analysis shows that the majority of kindergartens only have one building, so we placed single building on the site. For the shape, we used the combination of three boxes with variable length, width, and orientation to represent the building since three boxes can easily create most building forms investigated. To start with, four values (0°, 90°, 180° and 360°) were provided for the rotation angle (α) of the building. When α = 0° or 180° (Figure 6 (a)), the position of the building could only be moved along the vertical central axis and L1 was the distance from the center of the middle box to the center of the site. When α = 90° or 270° (Figure 6 (b)), its position could be changed along the horizontal central axis and L2 was the distance. After determining the building orientation and position, the length and width of the middle box, x 1 and y 1 , was set and the area of the middle box (S1) was then determined. Because the whole building has limited floor area, the area of the second (S2) and third box (S3) could be distributed by specifying the area ratio (S2/(S2+S3)). Then the shape of the second and third box could be determined by their lengths, x2 and x3. Finally, to generate different building forms, the relative position of the three boxes is determined by the positions of the second and third boxes from the first box, y12, y13. The ranges and allowed change steps for the design variables are shown in Table 1.

Studied cities and their climate
In order to examine the effect of climate on microclimate optimization, we chose to design the kindergarten under the climate of Shanghai (30°40'N~31°53'N, 120°51'E~122°12'E) and Tianjin (38°33'N~40°15'N, 116°42'E~118°04'E). is located in the southern part of China. The annually mean Ta of Shanghai is about 16.9℃ monthly mean Ta of the hottest month July is about 27.5℃ and monthly mean Ta of the coldest month January is about 4.5℃. Tianjin (38°33'N~40°15'N, 116°42'E~118°04'E) is located in the northern part of China with an annual average Ta of 12.9℃. The hottest month July has a monthly average Ta of 26.1℃ and coldest month January has a monthly average T a of -2.4℃.
The outdoor activity of children in kindergarten is usually conducted at 15:00. Thus, this study used 15:00 as the time for microclimate evaluation and lasted for an hour. In addition, to comprehensively consider the effect of hot and cold conditions, this study used climate data from both summer and winter as inputs. To avoid vacations in July and January, June and December were selected as the time of study. The median values of meteorological parameters at 15:00 in the two months were selected for boundary conditions of microclimate simulations, as shown in Table 2.

Results
This section first presents the variation of OF to illustrate the effect of optimization. Then, the best solutions are shown to provide guidance for building design.  Figure 6, indicating that the thermal stress was reduced and thermal comfort condition was improved with optimization. The maximum and minimum values of OF in the Tianjin case were 6.53℃ and 5.37℃ occurred at generation 9 and 15, respectively, with a difference of 1.16 K. Figure 7 shows that under the Shanghai climate, the OF also showed a overall decreasing trend with the optimization. The maximum and minimum values of objective function were 3.57℃ and 2.87℃ at Generation 2 and 15, respectively, with a reduction of 0.70 K. Comparing Figure 6 and Figure 7 we could see that Shanghai case generally had lower thermal stress than that of Tianjin case.   On the simulated sunny days in Tianjin and Shanghai, the wind speed was relatively low and uniform in the high-density urban area and UTCI was mostly determined by solar radiation.

The best solutions
In Tianjin, the optimized kindergarten building was ladder form, located in the middle of the site with northsouth orientation. Heat stress account for 60% of the OF and cold stress account for 40% of the OF in Tianjin (Figure 8, Figure 9). So the heat stress in summer was given a little priority over cold stress in winter during optimization. From Figure 8 and Figure 9 we could see that the best solution cast big shadows in summer without blocking too much sunlight in winter.  In Shanghai, the best solution was ladder-shaped, located in the middle of the site and parallel to the width of the site. Cold stress account for just 13% of OF while heat stress account for 87% of OF in Shanghai ( Figure  10, Figure 11), so the best solution basically just considered the cooling effect in summer. From Figure  10 we could see that the best solution cast large shadows and formed a canyon with the north buildings in summer. The flow entered from the east and accelerated in the canyon. Also, the flow from the southeast was accelerated by the south edge of the target building. The high wind speed together with large shadows created a strong cooling effect in summer.

Discussion
In this section, we compared the effect of wind speed and solar radiation on outdoor thermal comfort since they are two key factors that lead to the spatial variations of thermal stress. Then, limitations and future studies are discussed for future improvement.

Comparing the effect of solar radiation and wind
In this study, solar radiation has greater contribution to outdoor thermal comfort than wind. This result corroborates the findings from other studies. Liu et al. [31] in Tianjin concluded that the effect of sun on outdoor thermal comfort was more than two times greater that of wind. Liu et al. [32] in Changsha found that solar radiation contributed more than wind speed to human outdoor thermal sensation. Xu et al. [33] investigated thermal comfort during winter in Xi'an and found that solar radiation had the most significant influence on the outdoor overall comfort among the microclimatic parameters. Moreover, wind speed simulation is more computationally intensive than estimation of solar radiation. Therefore, when computation resources are limited, the optimization of solar radiation should be given priority over wind.
However, the above "radiation over wind" principle cannot be applied universally. Although wind is less effective than solar radiation to improve outdoor thermal comfort in locations with rather low average wind speeds, as the wind speed increases, the effect of wind may be equal to that of solar radiation and even exceed it. For example, Brozovsky et al. [34] found that wind and sun can become equally effective in increasing outdoor thermal comfort when increasing inlet wind speed to 8m/s.

Limitations and future studies
Limitations in this study and some possible directions for further improvement are discussed below. Firstly, optimization took long time to complete, and wind speed simulation was the most time-consuming part in this process. In order to improve the optimization speed, we can replace the CFD module with Fast Fluid Dynamics (FFD) [35]. FFD is 50 times faster than CFD and could provide rapid and informative simulation of outdoor wind speed [36]. Besides, other design elements such as vegetation and water body in the outdoor space could be added to this framework in the future.

Conclusions
This study presented a simulation framework to optimize the spatially and temporally averaged outdoor thermal comfort during early building design stage. Then, the proposed framework was applied to optimize the outdoor thermal comfort of a kindergarten located in a high-density residential community under the climates of Tianjin and Shanghai. Analyses of optimization results led to the following conclusions: x The framework can be used to improve outdoor thermal comfort during building design. In Tianjin, optimization reduced the overall thermal stress from 6.53 ℃ to 5.37 ℃. In Shanghai, optimization reduced the overall thermal stress from 3.57 ℃ to 2.87 ℃. x The optimization considered both heat and cold stresses in Tianjin while in Shanghai, heat stress in summer was given priority over cold stress in winter. That's because cold stress and heat stress were comparable in Tianjin while heat stress was seven times stronger than cold stress in Shanghai under the simulated weather conditions. x Wind demonstrated more limited contributions than solar radiation during optimization because the wind speed distributions were relatively low and uniform with in high-density urban area.