Abstract
Courtyards, long used as a passive climate-control element in vernacular housing, are increasingly reinterpreted in modern residential design, yet their quantified impact on energy use and comfort remains poorly documented. This study investigates how courtyard design affects energy efficiency and thermal comfort in villas across five hot and warm climates: Cairo, Riyadh, Gizan, Miami, and Sevilla. Using nearly 29,000 parametric simulations, design variables (geometry, window-to-wall ratio (WWR), glazing, insulation, and orientation) were systematically tested. Random Forest models achieved R2 > 0.99 for both annual cooling demand and discomfort hours, with Shapley Additive explanations (SHAP) analysis revealing variable importance. Results show that compact courtyards with low WWR, external insulation, and high-performance glazing reduce cooling demand under 75 kWh/m2 year. In contrast, elongated courtyards with higher WWR reduce discomfort to under 70 h annually in hot-dry climates, though often at the cost of increased cooling demand in hot-humid regions. Courtyard dimensions accounted for less than 3% of outcome variance, compared with > 40% for WWR and insulation. This study combines large-scale simulation with interpretable machine learning to quantify courtyard performance across climates. The findings provide climate-specific, evidence-based design guidance and demonstrate a pathway toward performance-based building codes that integrate courtyard design for hot regions.
Supplementary Information
The online version contains supplementary material available at 10.1038/s41598-025-32297-z.
Keywords: Machine learning, Courtyard design, Thermal comfort, Energy efficiency, Climate-responsive, Residential villa
Subject terms: Climate sciences, Energy science and technology, Engineering, Environmental sciences
Introduction
Problem statement
Across hot and warm regions, courtyard housing has historically reconciled microclimate control with privacy, organizing family life around an inward-facing void that filters sun, air, and views. Contemporary work reframes this legacy as a bioclimatic–biophilic strategy: new “generations” of courtyard buildings leverage the court as a healthy-living nucleus that improves natural ventilation and daylight while structuring secure, inward views to vegetation and sky—thereby enhancing perceived comfort and everyday well-being without compromising seclusion1. Regional studies show how traditional privacy logics and spatial hierarchies (e.g., Najdi and Maghrebi precedents) can be reinterpreted for modern lifestyles, sustaining visual privacy while upgrading environmental performance2,3. Complementary daylight studies indicate that well-proportioned courts and calibrated apertures can raise daylight availability and visual comfort in hot-dry contexts while limiting glare—reinforcing the court’s role as a device for quality views and interior amenity aligned with cultural expectations of privacy4.
Escalating energy demand and climate change have intensified pressures on the built environment, with buildings responsible for roughly one-third of global final energy demand in 2022; in parallel, space-cooling demand is among the fastest-growing end uses worldwide, particularly in hot and warm regions5. In parts of the Middle East and North Africa (MENA), rising temperatures and rapid urbanization are driving structurally high cooling loads, with residential air-conditioning alone reaching ~ 70% of household electricity in Saudi Arabia and contributing substantially to summer peaks across the Gulf6,7. These trends underscore a strategic need for climate-responsive design that can provide everyday well-being considering cooling energy. Across hot and warm climates, internal courtyards have long served as culturally embedded spatial devices that enable privacy while mediating microclimate through shading, air-movement, and heat-sink effects8,9. Quantitative studies—ranging from field and numerical analyses in hot-dry contexts to parametric, multi-climate simulations—consistently indicate that courtyard geometry and enclosure characteristics can reduce indoor overheating and cooling demand, contingent on climatic fit and configuration10. Yet, rigorous evaluations that treat courtyards alongside other envelope and geometric variables (e.g., window-to-wall ratio, glazing, insulation, and orientation) remain comparatively limited, especially at scale.
Over the hot and warm regions of the world, the coverage, scope, and enforcement of building energy regulations remain uneven, limiting the diffusion of passive cooling and climate-appropriate residential morphologies such as courtyards. A recent regional review for the Eastern Mediterranean and Middle East (EMME) documents fragmented governance and diverse regulation of building performance, with limited harmonization and uneven implementation across countries11. In global perspective, reviews emphasize that adoption does not guarantee impact; implementation and compliance remain persistent bottlenecks, particularly in developing economies12. These findings underscore the need for quantitative, climate-specific evidence that can inform modernized codes and performance-oriented guidance for courtyard-based housing in hot and warm climates. Recent comparative simulations for large residential developments in Riyadh and Cairo likewise show that regional residential energy-code packages for Egypt and Saudi Arabia can markedly curb climate-driven growth in cooling demand, yet they still do not explicitly address courtyard morphology as a passive design parameter13.
Across the regions examined in this study, semi-closed, inward-facing courtyard dwellings remain a characteristic component of the contemporary residential stock. In Saudi Arabia and the broader Gulf, typological surveys document the continued prevalence of courtyard-based villas and compounds in both historic districts and new suburban developments, where inward-oriented plans and open-to-sky courts are actively reinterpreted to balance privacy, ventilation, and solar exposure14. In Egypt and other hot-arid North African settings, courtyard houses and courtyard blocks persist as recurring residential forms and are routinely adopted in simulation and optimization studies evaluating cooling performance in cities such as Cairo and Al-Kharga15. Mediterranean contexts including Seville maintain internal courtyards as integral spatial and environmental elements in social-housing estates, with field studies confirming their role in moderating indoor conditions16. Similarly, warm-humid regions in Latin America, such as Colima, continue to use courtyard dwellings as reference models for assessing thermal performance and residential adaptation strategies17. Collectively, this evidence supports the use of a semi-closed, open-to-sky courtyard villa as a representative archetype for residential design across hot and warm climates, enabling broader parametric exploration grounded in a widely observed morphological type.
Modern prediction needs in hot and warm climates involve nonlinear, high-dimensional interactions among geometry, envelope, and climate that are poorly captured by conventional, correlation-driven or linear approaches. Machine learning (ML) offers higher predictive capacity for building energy and comfort by modeling complex relations and interactions across variables18,19. Equally important, interpretable ML has matured to provide transparent variable influence at scale, enabling inquiry of how parameters such as window-to-wall ratio, glazing, insulation, and orientation shape outcomes20,21. Yet, despite these advances, scaled, interpretable ML applications remain limited for courtyard-based residential typologies in hot and warm climates, where cooling dominates and design spaces include multiple, interacting parameters.
Research aims and objectives
The scope of this study is to evaluate the impact of courtyard design parameters on the energy performance and thermal comfort of residential villas across five hot and warm climatic contexts, using large-scale parametric simulations and interpretable machine learning, with the goal of providing evidence-based design guidance for sustainable architecture. The focus is on passive architectural design variables, as these can be embedded into codes and design guidelines without relying on future technology shifts. This study aims to quantify how courtyard design parameters affect the energy performance and thermal comfort of residential villas across different hot and warm climates. The specific objectives are:
To evaluate the influence of key courtyard design parameters (geometry, window-to-wall ratio (WWR), glazing, insulation, and orientation) on annual cooling energy use and thermal comfort.
To identify the trade-offs between energy efficiency and comfort across five representative climates.
To apply interpretable machine-learning models (Random Forest with SHAP analysis) to determine the relative importance of design variables in each climate.
To develop climate-specific, evidence-based design guidance for courtyard-integrated residential buildings that can inform performance-based building codes.
Literature review
Evidence on internal courtyards as microclimatic and socio-spatial devices—mediating heat, air movement, daylight, privacy, and views in hot and warm regions—is first synthesized. These mechanisms are then situated within escalating cooling pressures and peak-load risks that elevate the value of passive, morphology-led design. Quantitative findings on envelope and geometric variables most relevant to courtyard housing (window-to-wall ratio, glazing composition, insulation placement, plan proportions, and aperture orientation) are consolidated, with emphasis on their interactions and climate dependence. The policy gap—uneven adoption and enforcement of climate-appropriate provisions that rarely codify morphology-based cooling—is outlined to underscore practical barriers to diffusion. Finally, interpretable machine-learning methods are reviewed as tools for modelling nonlinear, high-dimensional relations among form, fabric, and climate, thereby motivating a simulation- and data-driven approach to derive climate-specific guidance.
Internal courtyards: mechanisms and quantitative evidence
Internal courtyards have historically structured residential life in hot and warm regions by reconciling climatic moderation with socio-cultural expectations of privacy, concentrating family life around an inward-facing void while screening public exposure2. Contemporary research reframes the courtyard as a bioclimatic–biophilic device that organizes high-quality inward views to sky and vegetation, buffers noise and pollution, and supports everyday well-being through shaded, ventilated, semi-outdoor space1. Complementary daylight studies in hot-dry contexts indicate that well-proportioned courts and calibrated apertures can enhance daylight availability within interior zones while maintaining visual privacy through inward orientation22. Empirical evaluations in occupied housing report improved perceived comfort alongside measurable energy benefits when courtyards are actively integrated into design and operation (≈ 20% energy improvement reported for Mediterranean social housing)4. Collectively, recent evidence positions the courtyard as quality-of-life infrastructure—linking thermal moderation, view quality, daylight, and privacy—within a robust spatial framework for climate-responsive residential design.
Quantitative studies increasingly confirm that courtyard geometry can deliver measurable cooling benefits when proportioned and oriented appropriately. A multi-case simulation in Building and Environment showed that tuning courtyard aspect ratio and enclosure parameters reduced annual cooling demand by ~ 8–18%, with performance sensitive to geometric ratios and exposure (i.e., not monotonic) (Seville/Mediterranean context).23 In a hot-dry Egyptian city, a Scientific Reports study using DesignBuilder found that placement (e.g., south-west façade) and length-to-width ratio ≈ 2.5:1, aligned with a north–south long axis, yielded ~ 18–19% energy savings versus a reference layout, illustrating how orientation and geometry interact to modulate cooling loads (Fig. 1)24. Field-to-simulation work in schools similarly reports that courtyard orientation and shading strategy drive indoor temperature and cooling load differences in hot-arid settings, reinforcing the importance of solar exposure control at the courtyard aperture25.
Fig. 1.
Courtyard placement typologies in Arab-heritage residential layouts24.
Evidence from warm-humid climates is more nuanced, highlighting that courtyards are not universally cooling unless carefully configured. A parametric study of traditional courtyard houses in Colima (warm-humid) found that larger/wider courtyards can increase daytime solar heat gains; while average operative temperature changes across the whole dwelling were modest, east–west long-axis orientation produced lower heat gains and window-operation schedules materially affected nighttime comfort (≈ 1.1 °C reduction when openings were managed from 23:00–11:00). These results emphasize the role of orientation and operability in humid regimes.26 Complementary work shows that vegetation within courtyards can improve outdoor thermal comfort and reduce cooling needs in hot-arid educational settings, aligning with the evapotranspirative mechanism and offering a design lever where enclosure changes are constrained27. Across studies, the interaction between courtyard form and envelope variables is a recurring theme. Where window-to-wall ratio (WWR) and glazing are high, the courtyard’s microclimate can either amplify or offset solar and conductive gains depending on aperture distribution and glazing properties; conversely, well-shaded courtyards paired with selective glazing and appropriate insulation placement tend to deliver the largest reductions in cooling demand. Recent empirical-simulation papers point to orientation-WWR-glazing couplings as decisive for peak and annual cooling outcomes, motivating factorial analyses that treat these variables jointly rather than singly23,24.
In summary, contemporary evidence indicates that courtyards can reduce cooling energy and overheating when geometry, orientation, and envelope are tuned to climate; benefits on the order of ~ 10–20% in annual cooling demand are achievable in hot-arid/Mediterranean cases, whereas warm-humid contexts require tighter control of solar exposure, ventilation pathways, and operability to avoid unintended heat gains. This pattern, benefits contingent on configuration × climate × envelope, supports the need for large-scale, multi-variable, simulation-driven assessments of courtyard design, as pursued in the present study26.
Cooling pressures in hot/warm climates
Cooling demand is accelerating as both urbanization and warming intensify thermal stress, particularly across hot and warm regions. In 2022, the buildings sector accounted for ~ 34% of global final energy demand and ~ 37% of energy- and process-related CO₂ emissions, underscoring the scale at which space-conditioning decisions shape energy and emissions trajectories5, check Fig. 2. Recent climate analyses show that moving from 1.5 to 2.0 °C of global warming produces marked increases in cooling degree days (CDDs), with African and MENA countries experiencing some of the largest absolute rises; even historically temperate nations face sharp relative growth in cooling needs, indicating a widespread shift in climatic baselines for building operation28. Parallel projections highlight substantial inequalities in residential air-conditioning (AC) access and use through 2050: while aggregate cooling electricity demand increases, a large share of heat-exposed populations remains without adequate AC access, concentrating both health risks and peak-load impacts in vulnerable geographies29.
Fig. 2.
Building-sector shares of total final energy consumption in 2022 (left) and of global energy and process emissions in 2022 (right)5.
These global dynamics are amplified in hot-arid and hot-humid contexts where cooling already dominates electricity use. In the Gulf region, for example, residential AC can account for around 70% of electricity demand in peak summer conditions—illustrating the structural coupling between climate severity, AC penetration, and grid stress7. Such conditions elevate the salience of climate-responsive morphology and envelope design, because incremental shifts in solar gains, ventilation potential, or thermal storage can translate directly into system-level energy and peak-load outcomes. Taken together, the evidence indicates that cooling-focused, climate-specific guidance is no longer a niche concern but a central requirement for residential design in hot and warm climates, motivating rigorous, quantitative assessments of how form and fabric choices mediate energy use and thermal comfort under warming scenarios28.
Envelope and geometry variables in hot/warm contexts
In cooling-dominated climates, early-stage envelope/geometry choices, window-to-wall ratio (WWR), glazing specification, insulation configuration, orientation, and plan proportions, govern sensible and solar gains and their diurnal timing. Their effects are strongly interactional (e.g., WWR × glazing × orientation), so results reported for a single variable often shift with context. Recent simulation studies and measurements provide quantitative guidance that is directly relevant to courtyard houses in hot and warm regions. WWR and glazing. Across Mediterranean-type hot summers, optimizing WWR by façade can materially reduce energy use intensity. For low-rise residential blocks in Sulaimaniyah, recommended WWRs were ≈ 65% (south, east), ≈ 95% (north), and ≈ 30% (west), with orientation-specific EUI reductions of ~ 1–15 kWh m⁻2 year⁻1 when tuned appropriately30. In a humid-temperate case using DesignBuilder, adjusting window proportions also yielded measurable annual energy differences, underscoring the sensitivity of results to façade and climate31. Beyond area, glazing build-up matters: field measurements and simulation show that replacing air with ~ 90% argon in double glazing improves center-of-glass U-value by > 5%, and combining argon with low-E and multi-pane units can deliver ~ 15–20% insulation gains; conversely, argon leakage over time measurably degrades U-values and raises loads32. Finally, the performance distribution of WWR choices is affected by occupant behavior and orientation; stochastic modeling indicates that larger WWRs can increase heating demand and discomfort probabilities in cold seasons, highlighting the need to evaluate WWR jointly with climate and use profiles33.
Recent work in hot–arid Saudi contexts highlights that code-driven envelope upgrades, particularly higher wall and roof insulation standards, can moderate climate change sensitivity by lowering residential cooling demand by up to ~ 25% under future scenarios13. These results reinforce that envelope specifications—when codified and climate-adapted—offer substantial leverage in reducing energy use intensity, complementing design-stage variables such as WWR, glazing, and orientation. Recent simulation work in warm, humid contexts shows that coupling façade design with adaptive shading and airflow control can reduce cooling energy use by up to ~ 20% compared to static envelope configurations under similar geometry assumptions. This underscores how envelope and geometry strategies must be integrated with dynamic control (e.g. shading, ventilation) to fully exploit potential gains in hot/warm climates34.
For hot climates, the placement of insulation relative to thermal mass influences peak cooling and daily load shifting. A finite-element comparison for Saudi arid conditions found that with a single insulation layer, external insulation generally outperformed internal insulation for total energy and peak demand because it preserves internal mass for heat storage and dampening35. Complementary experimental and review evidence in warm regions points to substantial savings from raising envelope R-values (walls/roofs), while noting diminishing returns and the importance of night ventilation and solar control when insulation levels are high36,37. At the component scale, a fuzzy MCDM framework applied to a modern vernacular house demonstrated how DesignBuilder/EnergyPlus simulations can be combined with technical, environmental, economic, and social criteria to select optimal passive wall materials—identifying cinder concrete as the best-performing option with modest but measurable reductions in cooling/heating loads and CO₂ emissions relative to a traditional wall assembly38, also Chanda and Biswas [2025] coupled DesignBuilder/EnergyPlus simulations with experiment and a fuzzy-oriented multi-criteria decision-making (MCDM) framework to rank 28 vernacular roof form–material combinations against environmental, technical, economic, and social criteria, identifying a Dutch roof with tin sheeting as the most robust option despite only modest (~ 1–2%) energy differences between alternatives. This illustrates how simulation outputs for envelope elements can be embedded into broader decision frameworks that go beyond energy-only performance39.
Orientation alone can swing total annual energy by large margins in hot/arid and mixed Afghan climates—optimal azimuths varied by zone, with best cases saving ~ 26–49% versus the worst orientations in a controlled modular study40. At the building-form scale, optimizing the dimensional ratio together with orientation decreased residential energy use in a humid-temperate city; an east–west-oriented plan with an elongated 1:4 ratio reduced consumption by ~ 16% versus a 1:1 baseline in DesignBuilder simulations41. These results reinforce that plan geometry and façade azimuth co-determine the useful solar exposure and cross-ventilation potential—critical levers when integrating an internal courtyard whose openings and shading devices add further directional selectivity.
Data-driven and interpretable machine learning in building performance
Data-driven models capture nonlinear, high-dimensional relations among geometry, envelope, operation, and climate that are difficult for linear methods to represent. Recent reviews document the maturity of machine-learning approaches across time scales and targets (e.g., energy, comfort, peaks), while stressing rigorous validation and transparent workflows18. In parallel, interpretable ML (XAI), notably model-agnostic tools such as SHAP, provides global and local attributions that reveal how design variables (e.g., WWR, glazing, insulation placement, orientation) shape predictions, addressing black-box concerns and improving auditability for architectural decision-making20. Applications in residential contexts demonstrate these benefits in practice. Using large household datasets, tree-based models with SHAP have been used to predict consumption and rank drivers across dwelling types, turning heterogeneous inputs into actionable guidance21. Ensemble learning with XAI likewise improves electricity-use forecasting while preserving interpretability of feature effects42. Together, the evidence supports ML + XAI as a suitable methodological frame for cooling-focused, envelope-and-geometry analyses in hot/warm climates, where interactions and context effects are pronounced.
Methodology
This study employs a two-stage, data-driven workflow that links validated building performance simulation with supervised machine learning to derive climate-specific guidance for internal-courtyard residential design. In Stage I, a field-validated archetype, the semi-closed courtyard villa located in Almalga neighborhood, Riyadh that is described in “Case study model validation and calibration”, was simulated in DesignBuilder v.7.3. After calibration against measured energy consumption, this model served as a robust baseline for the full-factorial parametric study across five hot and warm climates. The design parameters included plan dimensions (length, width), envelope characteristics (construction/insulation placement, glazing type), window-to-wall ratio (WWR), and courtyard orientation. This factorial experiment yielded nearly 29,000 valid simulations, generating annual metrics for cooling energy intensity (kWh m−2 year) and thermal discomfort hours.
Stage II analyzes the assembled database to extract prescriptive design signals. First, for each city and for each objective independently, the research identifies the single configuration that minimizes the metric of interest (comfort-optimal and energy-optimal solutions). Second, per-city regression models were trained to learn outcome–design relationships and to quantify the relative influence of variables. Random-forest baselines are adopted for their robustness on mixed tabular data; model skill is assessed via k-fold cross-validation, and interpretability is provided through essential feature importance, permutation checks, and, where appropriate, SHAP analysis (“Machine learning framework, validation, and implementation”). Outputs are reported as (a) tables of per-city optima and (b) per-city variable-influence visualizations, enabling direct comparison between comfort-driven and energy-driven prescriptions. The workflow is implemented in a reproducible Python/Google Colab environment that mirrors the stages above as demonstrated in Fig. 3.
Fig. 3.
Methodology workflow.
Case study model validation and calibration
Prior to conducting the large-scale parametric simulations, a real-life residential villa located in Riyadh (Saudi Arabia) was selected as the reference archetype for this study. The villa features a semi-closed, C-shaped plan organized around a simi closed internal courtyard measuring 12 × 9 m with a floor-to-floor height of 3.6 m. The courtyard is exposed to the sky and surrounded by living, dining, and reception spaces on the ground floor, with bedrooms and secondary living areas distributed on the upper levels, forming a continuous inward-facing void that facilitates daylight and ventilation.
The building envelope and HVAC systems were modeled according to the actual construction drawings and specifications provided by the owner. (Fig. 4). External walls consisted of 2 cm cement mortar (inside) + 20 cm concrete block + 2 cm cement mortar (outside), without insulation. Fenestration used single, blue-coated glazing in aluminum frames, and space cooling was provided by split air-conditioning units with no mechanical ventilation or external air intake, all the operational inputs are demonstrated in Table 1.
Fig. 4.
Architectural drawings provided by villa owner.
Table 1.
Operational inputs for simulation.
| Parameters | Value | Parameters | Value |
|---|---|---|---|
| Density of occupants | 0.0188 people/m2 | Clothing factors |
Winter: 1.00 Summer: 0.5- |
| Schedule of occupancy | Domestic schedule 24\7 | Floor no | 3 |
| Density of lighting power | 2.5 w/m2.100 lx | Metabolic factors | 0.90 |
| Ventilation system | HVAC cooling over 28 | Cooling set point | 24 °C:28 °C (setback) |
| Rate of infiltration (air changes/hour) | 0.8 ACH | Domestic hot water | Standalone water heater powered by grid electricity (11.4 L/day—COP = 0.850) |
To ensure the reliability of the model, DesignBuilder (EnergyPlus engine) simulations of monthly total electricity consumption were compared with measured utility bills for the period January–December 2024, the results are summarized in Fig. 5. Model-calibration accuracy followed ASHRAE Guideline 14, where two statistics were computed from the twelve monthly measured (Mi) and simulated (Si) electricity totals, and (M) is the mean of measured electricity loads, with n = 12, ∑Mi = 94,707.16 kWh, ∑Si = 94,569.94 kWh, and M = 7892 kWh, the calculation results were demonstrated in Table 2.
Fig. 5.
Comparison between monthly simulated energy consumption (DesignBuilder) and actual recorded electricity-bill data (January–December 2024).
Table 2.
Calibration statistics results.
| Calibration statistic | Result (%) | ASHRAE guideline 14 limit |
|---|---|---|
![]() |
+ 2.18% | ≤ ± 10% |
![]() |
7.92% | ≤ 30% |
Both values fall well within the monthly calibration thresholds recommended by ASHRAE Guideline 14 (NMBE ≤ 10%, CV(RMSE) ≤ 30%), confirming that the simulated model accurately reproduces measured energy performance. This field-validated model thus provides a high-fidelity baseline for the subsequent full-factorial parametric simulations and machine-learning analyses described in “Archetype, boundary conditions, and climates”.
Archetype, boundary conditions, and climates
To illustrate Stage I of the methodology, the computational experiments build upon the field-validated Riyadh villa archetype described in “Case study model validation and calibration”, a semi-closed courtyard dwelling modeled and calibrated against measured energy consumption before parametric expansion. The courtyard is conceived as the dwelling’s bioclimatic nucleus, with openings arranged to enable cross/stack ventilation and controlled solar access only through the courtyard. Based on literature review, Parametric factors alter the courtyard plan proportions (length, width), envelope specification (insulation placement; glazing type), window-to-wall ratio (WWR) by façade, and courtyard orientation, check Fig. 6 and Table 3. Variations in length and width change the gross floor area; performance reporting therefore uses energy intensity (kWh m−2 year) and annual indoor thermal-discomfort hours, allowing comparisons across plans of different size.
Fig. 6.
Archetype and boundary conditions.
Table 3.
Archetype courtyard boundary conditions.
| Variables | Length (m) | Width (m) | Location climate zone | Courtyard orientation | Openings WWR % | glazing type | Construction/insulation |
|---|---|---|---|---|---|---|---|
| References | 23,41 | 24 | 10,43 | 26 | 30,33 | 32 | 35,36 |
| Iterations |
9 10 11 12 |
6 7 8 9 |
Miami 1A Riyadh 1B Gizan 2A Cairo 2A Sevilla 3A |
North East South West North-East South-East South-West North-West |
20% 40% 60% 80% 100% |
Sgl. Glazed Dbl Glazed Air filled Dbl Glazed Argon Filled |
No insulation (u-value = 0.872) XPS insulated internally fixed (U-value = 0.237) XPS insulated externally fixed (U-value = 0.237) |
To isolate the effects of form and fabric from operational noise, all boundary conditions were derived from the validated Riyadh archetype and held constant across all simulations: internal gains (people, equipment, lighting) and schedules, infiltration assumptions, HVAC/system type and control logic, and HVAC setpoints as defined in the base DesignBuilder model. Construction assemblies for each “construction profile” level differ only by insulation presence and placement (none/internal/external), with all other layers preserved; glazing options differ by unit build-up (single, double air-filled, double argon-filled) while frame properties and roughness parameters follow the base model. Surface optical properties (e.g., exterior absorptance) are fixed. These choices ensure that observed differences in outcomes derive from the parametric factors rather than from changes in occupancy or control assumptions.
The archetype is simulated in five cities representing warm/hot climate categories relevant to courtyard housing: Miami (1A), Riyadh (1B), Gizan (2A), Cairo (2B), and Sevilla (3A). These zone labels follow the ASHRAE climate-zone classification, where the numeral denotes temperature band (1 = very hot, 2 = hot, 3 = warm) and the suffix indicates moisture regime (A = humid, B = dry)43. Location-specific typical-year weather files are applied while all other inputs remain invariant, enabling attribution of performance differences to climate × design interactions. This set spans very hot-humid (Miami), hot-humid (Gizan), very hot-dry (Riyadh), hot-dry (Cairo), and warm-humid/Mediterranean (Sevilla) tendencies, providing a basis for city-specific prescriptions and for comparing the alignment (or divergence) between energy-optimal and discomfort-optimal configurations under distinct climatic drivers.
To construct the database, a full-factorial enumeration was executed in DesignBuilder, forming the Cartesian product of all discrete levels for each factor: Length (4 levels: 9–12 m) × Width (4 levels: 6–9 m) × Construction profile (3 levels: no insulation; internal XPS; external XPS) × WWR (5 levels: 20–40–60–80–100%) × Glazing (3 levels: 6 mm single; 6 mm double air-filled; 6 mm double argon-filled) × Courtyard opening orientation (8 compass points: N, NE, E, SE, S, SW, W, NW) × City (5 locations). This yielded 4 × 4 × 3 × 5 × 3 × 8 × 5 = 28,800 nominal simulations covering every combination of design and climate settings. After quality control (failed runs), 28,787 valid cases were retained. Because Length and Width co-determine courtyard plan area (A = L × W), outcomes are reported as annual energy intensity (kWh m−2 year) and annual indoor thermal-discomfort hours, enabling size-invariant comparisons and subsequent extraction of per-city optima and ML-based variable influence26.
Machine learning framework, validation, and implementation
To illustrate the structure and variability of the factorial dataset, parallel-coordinates plots were generated linking the input parameters (villa geometry, envelope specifications, and courtyard orientation) to the performance objectives of energy intensity and thermal discomfort. Each polyline represents a single simulation case, revealing the diversity of design combinations and the nonlinear interactions among variables. This visualization highlights the scale and complexity of the dataset prior to machine learning analysis (Figs. 7, 8).
Fig. 7.
Parallel-coordinates visualization to thermal discomfort.
Fig. 8.
Parallel-coordinates visualization to EUI.
The subsequent analysis employed a machine-learning framework to extract optimum configurations for each climatic context. Random Forest Regression (RFR) was implemented due to its robustness in handling high-dimensional, nonlinear datasets and its ability to provide interpretable variable importance. Two objectives were modeled independently: (i) minimization of total site energy use intensity (kWh/m2 year) and (ii) minimization of annual thermal discomfort hours. For each city, the optimum configuration was defined as the parameter set yielding the minimum predicted value of the respective objective.
Model training and validation followed an 80/20 data split with five-fold cross-validation. Model accuracy was assessed using the coefficient of determination (R2), mean absolute error (MAE), and root mean square error (RMSE). Variable importance was quantified using mean decrease in impurity, while SHAP (SHapley Additive exPlanations) analysis was applied for interpretability, enabling transparent attribution of variable contributions to prediction outcomes. Implementation and reproducibility were ensured by developing the workflow in Google Colab with Python, leveraging open-source libraries (Scikit-learn, SHAP, Pandas, and Matplotlib). All preprocessing, model training, and visualization scripts were version-controlled, facilitating reproducibility and scalability for future studies. The outputs include both optimum configurations for each climatic zone and variable importance rankings, which together provide actionable design guidance for courtyard-based residential villas.
Results
Global dataset overview
The simulation database revealed a wide spectrum of performance outcomes, with annual energy use intensity ranging between 56.4 and 142.1 kWh/m2 year and thermal discomfort hours between 40.6 and 1344.4. Mean values across the full set were 88.8 kWh/m2 year for energy and 517 h for discomfort, reflecting the breadth of variation generated by the factorial combinations of geometry, envelope, and climate, check Fig. 9. These results indicate that courtyard configuration can substantially alter residential performance, yet they also highlight a recurrent misalignment between the two objectives: configurations that minimized energy demand often produced elevated discomfort, whereas those that suppressed discomfort hours were generally associated with moderate or high energy consumption.
Fig. 9.
EUI and discomfort over different cities.
The box plot of discomfort hours reveals a clear hierarchy across climates (Fig. 10). Cairo performs most favorably, with the lowest median and interquartile range, indicating relatively consistent comfort performance under hot-dry conditions. Gizan follows with moderate medians and a narrower spread, suggesting that despite its humid climate, discomfort values are less variable across design options. Miami exhibits higher discomfort levels, with a median above 550 h and a wide distribution that extends to nearly 1000 h, underscoring the difficulty of achieving comfort in very hot-humid conditions. Riyadh shows considerable variability, spanning some of the lowest values across all cities but also a long upper tail, reflecting strong design sensitivity in very hot-dry climates. Sevilla records the highest discomfort overall, with both the median and interquartile range shifted upward, confirming that even in a warm-Mediterranean context, many configurations are unable to suppress overheating effectively.
Fig. 10.

Discomfort box analysis over cities.
The box plot of energy use intensity shows a different ordering (Fig. 11). Gizan emerges as the most efficient city, with the lowest median EUI (≈ 70 kWh/m2 year) and the tightest interquartile spread. Cairo and Sevilla occupy intermediate positions, both clustering around 80–90 kWh/m2 year, though Sevilla shows a broader distribution. Miami is less efficient, with medians approaching 100 kWh/m2 year, and Riyadh records the highest energy intensities, exceeding 100 kWh/m2 year in the median and extending above 140 kWh/m2 year, reflecting the heavy cooling burden in its very hot-dry context.
Fig. 11.

EUI box analysis over cities.
Taken together, the global dataset demonstrates that no single parameter dictates performance. Instead, outcomes emerge from coupled effects among geometry, envelope, and climate, underscoring the necessity of data-driven modeling. The divergence between energy- and comfort-optimal tendencies observed at the global scale provides a rationale for the subsequent per-city analyses, where context-specific prescriptions are extracted and contrasted.
Per-city optima
The factorial dataset allows identification of climate-specific optima for both energy efficiency and thermal comfort (Fig. 12). Tables 4 and 5 summarize the three best-performing configurations per city for each objective, providing a more robust picture than single minima. Each configuration is defined by court geometry (width, length), envelope specification (construction, glazing, WWR), and orientation, with the secondary performance metric reported for context.
Fig. 12.
Top-3 energy- and comfort-optimal configurations per city.
Table 4.
Top 3 energy-optimal configurations per city.
| City | EUI (kWh/m-2.yeas) | Discomfort (hr) | Width | Length | Construction | Glazing | WWR | Orientation |
|---|---|---|---|---|---|---|---|---|
| CAIRO | 71.4 | 125.9 | 6 | 9 | Insulation outside | Dbl. glazed Arg. filled | 20 | South |
| 71.4 | 127.1 | 6 | 9 | Insulation outside | Dbl. glazed Air filled | 20 | South | |
| 71.6 | 118.6 | 6 | 9 | Insulation inside | Dbl. glazed Arg. filled | 20 | South | |
| GIZAN | 56.4 | 540.2 | 6 | 9 | Insulation outside | Dbl. glazed Arg. filled | 20 | North |
| 56.4 | 540.5 | 6 | 9 | Insulation outside | Dbl. glazed Air filled | 20 | North | |
| 56.6 | 538.4 | 6 | 9 | Insulation outside | Dbl. glazed Air filled | 20 | North-East | |
| MIAMI | 78.2 | 984.2 | 6 | 9 | Insulation outside | Dbl. glazed Arg. filled | 20 | North |
| 78.2 | 983.1 | 6 | 9 | Insulation outside | Dbl. glazed Air filled | 20 | North | |
| 78.3 | 971.2 | 6 | 9 | Insulation outside | Dbl. glazed Air filled | 20 | North-East | |
| RIYADH | 81.4 | 263.8 | 6 | 9 | Insulation outside | Dbl. glazed Arg. filled | 20 | South |
| 81.5 | 265.4 | 6 | 9 | Insulation outside | Dbl. glazed Air filled | 20 | South | |
| 81.6 | 253.3 | 6 | 9 | Insulation inside | Dbl. glazed Arg. filled | 20 | South | |
| SEVILLA | 71.99 | 609.0 | 6 | 10 | Insulation outside | Dbl. glazed Arg. filled | 20 | South |
| 72.0 | 557.4 | 6 | 12 | Insulation outside | Dbl. glazed Arg. filled | 20 | South | |
| 72.02 | 575.9 | 6 | 11 | Insulation outside | Dbl. glazed Arg. filled | 20 | South |
Table 5.
Top 3 discomfort-optimal configurations per city.
| City | EUI (kWh/m-2.yeas) | Discomfort (hr) | Width | Length | Construction | Glazing | WWR | Orientation |
|---|---|---|---|---|---|---|---|---|
| CAIRO | 77.19 | 40.5 | 6 | 12 | Insulation outside | Dbl. glazed Arg. filled | 40 | South |
| 77.29 | 42.0 | 6 | 12 | Insulation outside | Dbl. glazed Air filled | 40 | South | |
| 77.59 | 42.6 | 6 | 12 | Insulation inside | Dbl. glazed Arg. filled | 40 | South | |
| GIZAN | 80.1 | 196.3 | 8 | 12 | Insulation outside | Dbl. glazed Arg. filled | 80 | East |
| 79.67 | 196.8 | 7 | 12 | Insulation outside | Dbl. glazed Arg. filled | 80 | South East | |
| 81.48 | 197.3 | 8 | 12 | Insulation outside | Dbl. glazed Arg. filled | 80 | South East | |
| MIAMI | 97.3 | 222.7 | 6 | 12 | Insulation outside | Dbl. glazed Arg. filled | 60 | South |
| 97.37 | 223.8 | 6 | 12 | Insulation outside | Dbl. glazed Air filled | 60 | South | |
| 98.85 | 225.2 | 7 | 12 | Insulation outside | Dbl. glazed Arg. filled | 60 | South | |
| RIYADH | 90.28 | 67.4 | 6 | 12 | Insulation inside | Dbl. glazed Arg. filled | 40 | South |
| 89.88 | 70.6 | 6 | 12 | Insulation outside | Dbl. glazed Arg. filled | 40 | South | |
| 90.48 | 70.7 | 6 | 12 | Insulation inside | Dbl. glazed Air filled | 40 | South | |
| SEVILLA | 79.9 | 263.9 | 6 | 12 | Insulation inside | Dbl. glazed Arg. filled | 80 | South |
| 79.15 | 270.6 | 6 | 12 | Insulation outside | Dbl. glazed Arg. filled | 80 | South | |
| 78.91 | 271.6 | 6 | 11 | Insulation inside | Dbl. glazed Arg. filled | 80 | South |
Across all climates, the lowest energy use intensities (EUI) consistently occurred in compact courtyard forms with small plan dimensions (6–9 m width, 9–10 m length), low window-to-wall ratios (20%), and external insulation. Glazing type also emerged as decisive, with double glazing (air- or argon-filled) dominating the top-ranked cases.
Hot-humid climates (Gizan, Miami): North-facing orientations yielded the lowest EUI, reflecting the need to minimize direct solar exposure in humid regimes. However, these configurations produced relatively high annual discomfort hours (≈ 500–980 h), indicating a trade-off.
Hot-dry climates (Cairo, Riyadh): South-facing compact courts were consistently energy-optimal. In Cairo, the best case achieved 71.4 kWh/m2 year with discomfort ≈127 h, while in Riyadh the minimum was 81.4 kWh/m2 year but with discomfort > 260 h, underscoring a divergence between energy and comfort.
Warm-Mediterranean climate (Sevilla): Optima favored slightly larger plans (6 × 10 m) with external insulation and argon glazing, oriented south. While the lowest EUI was 71.9 kWh/m2 year, discomfort exceeded 600 h, reflecting the less severe but still significant comfort penalties when optimizing for energy alone.
Overall, energy minima cluster tightly around compact, shaded, externally insulated geometries, but consistently at the expense of higher discomfort.
The lowest discomfort hours were achieved under contrasting conditions: elongated courtyards (length 12 m), higher WWR (40–80%), and double argon glazing. Unlike the energy optima, comfort minima sometimes favored internal insulation and orientations that maximized controlled solar and ventilation gains.
Cairo: Achieved the absolute lowest discomfort of the dataset (40.6 h) with a 6 × 12 m court, 40% WWR, argon glazing, and south orientation. Notably, this configuration also performed relatively well in energy terms (77.2 kWh/m2 year), indicating partial alignment of the two objectives in hot-dry contexts.
Riyadh: Discomfort minima also occurred at 6 × 12 m with 40% WWR and argon glazing, but required internal insulation, reducing discomfort to 67 h while energy rose to ≈ 90 kWh/m2 year.
Gizan and Miami: Larger WWR values (60–80%) and elongated courtyards drove discomfort reductions, but often at the cost of substantially higher EUI (> 90 kWh/m2 year). For instance, Gizan’s best comfort case (196 h) required 80% WWR and east orientation, doubling discomfort benefits relative to the energy optimum but raising energy demand.
Sevilla: Comfort minima favored internal insulation with elongated courts and high WWR (80%), achieving 263 h discomfort and ≈ 80 kWh/m2 year energy.
In summary, comfort optimization systematically diverged from energy optima, preferring longer courts and higher glazing ratios, with insulation placement (internal vs. external) becoming climate-dependent. However, Energy- and comfort-optimal cases overlap more closely, especially in Cairo where the comfort optimum is also relatively energy efficient. Divergence in humid climates (Miami, Gizan): Comfort reduction requires strategies that sharply increase energy demand, underscoring the difficulty of achieving simultaneous optima in these regions. Intermediate behavior in Sevilla: Comfort and energy optima partly align in absolute performance, though their design prescriptions differ (internal insulation vs. external). These contrasts reinforce the necessity of climate-specific guidance: whereas hot-dry contexts allow for relatively integrated prescriptions, humid climates pose intrinsic trade-offs between efficiency and comfort, requiring prioritization based on policy or occupant needs.
ML model performance
To evaluate the predictive capacity of machine learning for this dataset, Random Forest Regression models were trained independently for each city and for each objective (energy use intensity and discomfort hours). An 80/20 train–test split was applied, with models trained on the design parameters (geometry, WWR, glazing, insulation, and orientation) and validated against the simulation outputs. Predictive skill was assessed using the coefficient of determination (R2), mean absolute error (MAE), and root mean square error (RMSE).
The results confirm that Random Forest achieved very high accuracy across all climates and objectives (Table 6). For energy use intensity, R2 values consistently exceeded 0.99, with MAE below 0.7 kWh/m2 year and RMSE under 1.0. Discomfort-hour predictions were slightly less accurate but still robust, with R2 values between 0.991 and 0.995 and error magnitudes (MAE ≈ 5–13 h, RMSE ≈ 7–18 h) that are negligible relative to the full dataset range of 40–1344 h. Among the cities, Gizan and Cairo showed the tightest fits, reflecting their narrower distributions, while Riyadh and Sevilla exhibited marginally higher errors due to broader variability in outcomes. Miami achieved strong predictive performance despite its wider comfort distribution, indicating that the Random Forest framework successfully captured the nonlinear interactions of design and climate.
Table 6.
Random Forest model performance per city and objective.
| City | Objective | R2 | MAE | RMSE |
|---|---|---|---|---|
| Gizan | EUI | 0.996 | 0.37 kWh/m2 year | 0.55 kWh/m2·year |
| Discomfort | 0.994 | 5.10 h | 7.15 h | |
| Miami | EUI | 0.994 | 0.52 kWh/m2·year | 0.74 kWh/m2·year |
| Discomfort | 0.992 | 9.30 h | 13.75 h | |
| Cairo | EUI | 0.994 | 0.43 kWh/m2·year | 0.63 kWh/m2·year |
| Discomfort | 0.993 | 7.20 h | 10.85 h | |
| Riyadh | EUI | 0.995 | 0.61 kWh/m2·year | 0.89 kWh/m2·year |
| Discomfort | 0.991 | 12.40 h | 17.60 h | |
| Sevilla | EUI | 0.995 | 0.55 kWh/m2·year | 0.80 kWh/m2·year |
| Discomfort | 0.992 | 10.90 h | 15.10 h |
Overall, the predictive performance of the models provides a reliable basis for the interpretability analysis in “Variable importance and SHAP plots”. The consistently high R2 values and low error magnitudes indicate that Random Forest successfully learned the complex relationships among geometry, envelope, and climate, ensuring that the feature importance and SHAP attributions presented in the next section are statistically robust and generalizable.
Variable importance and SHAP plots
The feature-importance results derived from the Random Forest models provide a detailed picture of how design parameters shaped performance in each climate. The rankings underscore the climate-dependence of courtyard optimization and highlight the relative dominance of specific envelope and geometric variables.
In Cairo, discomfort outcomes were dominated by construction type (41%), followed by WWR (30%). Orientation (15%) and glazing (10%) had moderate contributions. For energy, WWR became the leading variable (60%), with construction second (21%). These findings suggest that in hot–dry Cairo, both WWR and insulation placement critically determine comfort and energy use, with glazing and orientation exerting secondary effects, check Fig. 13.
Fig. 13.
Energy and discomfort feature importance of Cairo.
In Riyadh, discomfort prediction was strongly driven by construction (58%), followed by WWR (23%), while glazing and orientation contributed about 10% and 7%, respectively. For energy, WWR dominated (56%), with construction also high at 29%. These dual influences indicate that in very hot–dry Riyadh, the interaction between WWR and insulation placement governs both energy demand and thermal comfort, check Fig. 14.
Fig. 14.
Energy and discomfort feature importance of Riyadh.
In Gizan, window-to-wall ratio (WWR) was overwhelmingly the strongest predictor for both discomfort (≈ 79%) and energy (≈ 87%). Orientation, glazing, and insulation placement had only minor influence, each contributing less than 7% to discomfort predictions and below 5% for energy. This result emphasizes that in humid-hot Gizan, façade WWR ratio largely dictates both comfort and energy outcomes, check Fig. 15.
Fig. 15.
Energy and discomfort feature importance of Gizan.
In Miami, WWR again led for both objectives, explaining 42% of discomfort variation and over 71% of energy. However, unlike Gizan, secondary variables played a larger role. Insulation placement accounted for nearly a quarter of discomfort prediction, while orientation explained about 19%, reflecting the importance of both insulation strategies and solar exposure control in very hot–humid contexts, check Fig. 16.
Fig. 16.
Energy and discomfort feature importance of Miami.
In Sevilla, insulation placement was again the leading predictor, with 52% of discomfort importance and nearly 60% for energy. Orientation was the next most important factor for discomfort (27%), whereas WWR explained 24% of energy outcomes. These results highlight the centrality of Insulation Placement assembly in the warm–Mediterranean context, but with orientation also playing a substantial role in shaping comfort, check Fig. 17.
Fig. 17.
Energy and discomfort feature importance of Sevilla.
Across all cities, geometric parameters (length, width, and derived area) consistently ranked lowest, typically contributing less than 3% of predictive power. This suggests that, within the proportional ranges tested, courtyard size ratios exert less influence than envelope and orientation factors. The combination of WWR, construction, and glazing emerges as the primary design space across climates, with orientation becoming decisive in humid regimes.
Taken together, the feature-importance profiles reveal three broad patterns. First, WWR dominates energy outcomes in nearly all cities, particularly Gizan, Miami, Cairo, and Riyadh. Second, insulation placement exerts greater influence on discomfort, especially in Cairo, Sevilla, and Riyadh, indicating the role of insulation placement in moderating diurnal swings. Third, orientation is critical in humid climates, most notably in Miami and Gizan, where exposure to solar radiation strongly determines performance. These findings reinforce the necessity of tailoring courtyard design prescriptions to climate, and they provide a robust basis for the SHAP analysis that follows, which clarifies the directional effects and thresholds of these variables.
Discussion and findings
Energy-comfort trade-off patterns
The combined analysis of simulation outcomes and machine-learning interpretations reveals a consistent divergence between energy-optimal and comfort-optimal courtyard configurations (Fig. 18). At the global level, energy use intensity is most effectively reduced by compact courts with low WWR values, external insulation, and selective glazing. These solutions minimize solar and conductive gains, yielding annual intensities below 75 kWh/m2 year in the best cases. However, such configurations frequently elevate discomfort hours, particularly in humid climates, as WWR limit ventilation and daylight availability. Conversely, minimizing discomfort requires elongated courts, intermediate to high WWR ratios, and in some contexts internal insulation, which collectively enhance air movement and daylight penetration. These comfort-oriented strategies can suppress discomfort hours to fewer than 70 in Cairo and Riyadh, but they typically increase energy use by 10–15 kWh/m2 year relative to the energy minima.
Fig. 18.
Energy use intensity vs. discomfort trade-off patterns per city.
The trade-off is especially pronounced in humid climates. In Miami and Gizan, discomfort-optimal solutions demand higher WWR and orientations that encourage cross-ventilation, but these same parameters raise cooling loads substantially, producing energy intensities in excess of 95 kWh/m2 year. In contrast, energy-optimal configurations in these cities achieve intensities below 80 kWh/m2 year but sustain discomfort hours above 500 h., underscoring the difficulty of reconciling the two objectives under persistent humidity and solar exposure. Hot-dry climates demonstrate greater alignment. In Cairo, the configuration that minimized discomfort (≈40 h) also produced relatively low energy demand (≈ 77 kWh/m2 year), suggesting that envelope and orientation strategies can be tuned to balance both objectives. Riyadh shows partial convergence, where comfort-oriented designs retain higher energy intensities than the minima but remain within an acceptable margin, reflecting the dual importance of glazing and insulation placement.
Mediterranean Sevilla illustrates an intermediate condition. Comfort optimization requires elongated forms with higher WWR, yet energy efficiency is governed by insulation placement and glazing specification. Here, the separation between the two objective optima is less extreme than in humid cities, but a clear divergence persists, with comfort reductions achieved at the expense of elevated energy use.
Overall, the results confirm that courtyard design inherently involves trade-offs between minimizing energy demand and maximizing comfort. The degree of divergence is strongly climate-dependent: humid regions exhibit structural incompatibility between the two objectives, hot-dry regions allow partial or full alignment, and Mediterranean contexts occupy an intermediate position. This finding underscores the importance of multi-objective design evaluation and the necessity for climate-adapted decision-making frameworks, rather than one-size-fits-all prescriptions.
Climate-specific prescriptions (humid vs. dry vs. mediterranean).
The comparative results across the five study cities highlight distinct sets of design prescriptions that are closely tied to climatic drivers. In very hot–humid contexts such as Miami and Gizan, orientation and WWR control dominate performance. Comfort can only be improved by opening the courts to cross-ventilation through higher WWR and favorable orientations, yet these strategies simultaneously raise cooling demand. As a result, prescriptions in humid climates must prioritize operability, shading, and possibly hybrid strategies that integrate vegetation or dynamic fenestration, since purely geometric or envelope adjustments yield limited dual benefits.
In very hot–dry climates, represented by Riyadh, and hot–dry climates such as Cairo, prescriptions focus on balancing WWR ratio and insulation placement. External insulation reduces energy intensity by limiting conductive gains, while internal insulation assists in moderating comfort swings when diurnal temperature variation is high. Cairo demonstrates that compact courts with modest WWR can achieve both low energy and low discomfort, making hot–dry contexts more receptive to integrated solutions. In Riyadh, however, the energy minima and comfort minima diverge, necessitating careful selection of glazing type and insulation placement to approach balanced performance.
In the warm–Mediterranean context of Sevilla, insulation placement dominates both comfort and energy performance, with orientation exerting additional influence on discomfort. Here, prescriptions emphasize the choice of envelope assemblies—such as high-performance glazing and optimized insulation—rather than large geometric adjustments. Courtyard proportions are less decisive, but tuning construction details provides measurable gains.
Across all climates, geometric factors (length, width, and area) showed consistently low importance, suggesting that within the tested range of dimensions, envelope variables carry greater weight. Therefore, prescriptions should emphasize windows design (WWR), glazing specification, and insulation placement, while geometry serves as a secondary lever. Orientation emerges as a decisive parameter only in humid contexts, where solar exposure and ventilation pathways dominate comfort outcomes.
These differentiated prescriptions underline the central claim of this study: courtyard design must be adapted to climate-specific drivers, rather than applied as a uniform typology. While certain global patterns are evident—such as the strong role of WWR and glazing—regional climates dictate which variables carry the greatest leverage, and hence where designers and policymakers should focus regulatory and design attention.
Implications for design codes
The findings carry direct implications for building codes and energy policies in hot and warm climates. Current regulatory frameworks across the Middle East, North Africa, and Mediterranean regions largely emphasize insulation values, equipment efficiency, and, in some cases, window-to-wall ratio. Courtyard morphology is rarely codified, despite its longstanding cultural and environmental role in residential design. The present results demonstrate that courtyard-related parameters, particularly WWR, glazing, orientation, and insulation placement, can shift annual energy demand by more than 20 kWh/m2 year and reduce discomfort hours by several hundred annually. These magnitudes are comparable to, or greater than, many envelope efficiency upgrades currently mandated by codes.
In this study, “compact” courtyards correspond to the configurations that systematically achieved the lowest energy use intensities across climates. These are characterized by small plan dimensions of 6–9 m in width and 9–10 m in length, yielding length-to-width ratios ≈1.0–1.5 and minimizing exposed envelope area for a given floor area (Table 4, Fig. 12). When combined with low courtyard WWR (≈ 20%) and external insulation, these compact courts delivered EUIs below 75 kWh/m2 year in all cities. By contrast, comfort-optimal solutions were associated with elongated courts (e.g., 6 × 12–8 × 12 m, length-to-width ≥ 1.7) and higher WWR (40–80%), which reduced discomfort hours but increased EUI by roughly 10–20 kWh/m2 year (Table 5, Fig. 18). These patterns support translating the results into preliminary, climate-specific code ranges. In very hot–dry and hot–dry contexts such as Riyadh and Cairo, courtyard WWR bands of 20–40% and courtyard aspect ratios in the range L/W ≈ 1.0–1.5 represent a robust energy-efficiency reference, while still allowing comfort-oriented variants at the upper end of this WWR band without pushing EUI beyond ≈ 80 kWh/m2 year. In very hot–humid and hot–humid contexts such as Miami and Gizan, energy-efficient envelopes require tighter WWR control (≈ 20–30%) on the most solar-exposed facades and double glazing, whereas higher WWR values (60–80%) should only be permitted when explicitly coupled with shading and ventilation strategies because they raise EUI above ≈ 90 kWh/m2 year.
Translating these thresholds into enforceable design codes also requires acknowledging practical barriers. In many urban settings, plot geometry, street layout, heritage constraints, or privacy requirements prevent the ideal orientations identified by the simulations (e.g., north- or north-east–oriented courts in humid climates, or consistently south-facing courts in dry climates). Rather than imposing rigid orientation clauses, codes can adopt compensatory provisions. For example, if the main courtyard axis deviates by more than ± 45° from the recommended orientation, compliance could be achieved by (a) reducing WWR by one step on the most solar-exposed façades (e.g., from 40 to 20%), (b) mandating external shading devices (overhangs, brise-soleil, pergolas, or recessed openings) that meet a minimum shading factor, or (c) requiring vertical greenery and high-albedo finishes in the courtyard to offset additional solar gains. Similarly, in dense contexts where compact courts are not feasible and more elongated proportions are unavoidable, codes can require intermediate WWR ranges (e.g., 40–60%) only when combined with enhanced shading or hybrid ventilation provisions, thereby preserving comfort benefits without uncontrolled energy penalties.
Beyond prescriptive metrics, the use of interpretable machine learning offers a pathway toward performance-based codes. By quantifying variable importance and climate-specific thresholds, regulators can move beyond one-size-fits-all rules and instead incorporate flexible targets that reflect local climatic realities. In practice, the thresholds for courtyard aspect ratio and WWR identified in this work could be embedded first as simple prescriptive tables by climate zone, and subsequently as performance-based compliance paths in which designers demonstrate that selected courtyard configurations achieve target EUI and discomfort bands. This would align building codes with the principles of climate-responsive design while providing measurable, evidence-based benchmarks. In parallel, the results highlight opportunities for voluntary rating systems and incentive schemes to explicitly acknowledge courtyard design as a contributor to both energy efficiency and thermal resilience. Embedding such evidence into policy would accelerate the diffusion of climate-adapted residential morphologies and extend the cultural relevance of courtyards into contemporary sustainable housing practice.
Methodological contribution
This study also contributes methodologically by demonstrating the integration of exhaustive simulation, supervised machine learning, and interpretability tools within a reproducible workflow. The factorial dataset—comprising nearly 29,000 cases—ensured that the full design space of courtyard geometry, orientation, glazing, insulation, and WWR was systematically explored across five representative climates. Training city-specific Random Forest regressors on this database produced models with R2 values exceeding 0.99, confirming that machine learning can faithfully capture the high-dimensional, nonlinear relationships between form, fabric, and climate.
The methodological novelty lies not only in the predictive accuracy but also in the interpretability of the models. By combining traditional feature-importance measures with SHAP-based attributions, the analysis moved beyond black-box predictions to identify clear, climate-specific drivers of energy and comfort performance. This dual approach provided both global rankings of variable importance and local, case-level insights into how design changes shift outcomes. Such transparency strengthens confidence in the applicability of machine learning for architectural decision-making and distinguishes this study from prior work that either relied on linear regression or treated machine learning as an opaque forecasting tool.
Another contribution is the reproducibility of the workflow. All scripts were developed in open-source Python and implemented in Google Colab, ensuring accessibility for researchers and practitioners. The pipeline—from simulation output to model training, validation, interpretability, and visualization—can be readily adapted to other building archetypes and climatic contexts. This open and scalable framework supports both academic research and professional practice by lowering barriers to the application of machine learning in performance-based design.
Taken together, the methodological approach illustrates how simulation-driven datasets and interpretable machine learning can be combined to deliver both robust predictions and actionable guidance. This hybrid methodology provides a transferable model for future studies seeking to bridge large-scale parametric exploration with climate-responsive design insights.
Conclusion
This study evaluated the performance of internal courtyards in residential villas across five representative climates—Cairo, Riyadh, Gizan, Miami, and Sevilla—through nearly 29,000 parametric simulations analyzed using Random Forest Regression and SHAP interpretability. The results provide climate-specific prescriptions for optimizing courtyard design in terms of energy use intensity and thermal comfort.
At the global scale, energy minima were consistently achieved by compact forms with low window-to-wall ratios, external insulation, and high-performance glazing. Conversely, comfort minima required elongated courts with intermediate to high WWR and, in certain contexts, internal insulation, underscoring the structural trade-off between efficiency and comfort. The magnitude and direction of this trade-off proved highly climate-dependent: humid climates revealed sharp incompatibilities, hot-dry contexts allowed partial or full alignment, and Mediterranean conditions displayed intermediate behavior. Feature-importance and SHAP analyses confirmed that WWR, glazing, and insulation placement dominate performance, with orientation decisive in humid contexts. Courtyard proportions exerted only secondary influence within the tested ranges. These insights reinforce the importance of aperture and envelope decisions in governing both energy and comfort outcomes.
Methodologically, the study demonstrates the value of integrating exhaustive parametric simulation with interpretable machine learning. The approach achieved exceptionally high predictive accuracy while delivering transparent rankings of design drivers, offering a transferable framework for other building archetypes and regions. The reproducible Colab-based workflow ensures accessibility for both researchers and practitioners.
In policy terms, the findings suggest that courtyard design parameters should be explicitly integrated into building codes and rating systems, as their influence on performance rivals that of conventional envelope prescriptions. By embedding courtyard evidence into regulatory and design frameworks, architects and policymakers can revive a culturally resonant form while simultaneously advancing energy efficiency and thermal resilience.
Future work should extend this methodology to dynamic occupancy patterns, advanced materials, and mixed-mode systems, as well as broader building typologies. Such efforts will further strengthen the evidence base for climate-responsive residential design and contribute to the ongoing transition toward sustainable, resilient housing in hot and warm regions.
Research limitations
While the study parametrically examined five major architectural variables (courtyard geometry, window-to-wall ratio, glazing type, insulation placement, and courtyard orientation) other potentially influential parameters such as external shading and overall shape coefficient were intentionally held constant. External shading devices were not included in parametric analysis because the field-validated Riyadh villa archetype used as the base model does not incorporate fixed shading elements. Preserving this baseline ensured consistency between the validated model and the expanded simulation set. Moreover, incorporating shading depth, projection ratio, or operability across multiple orientations would have substantially increased the factorial space and diminished the interpretability of the five primary variables evaluated across climates.
Similarly, the building shape coefficient was not treated as an independent variable because it is a derived property of the geometric parameters already included in the study. Introducing it explicitly would create redundancy and multicollinearity without adding explanatory value. Machine-learning results showed that geometry contributed less than 3% to predictive importance across climates, suggesting that variations in massing exert limited influence within the tested design bounds. Future work may incorporate dynamic shading strategies, adjustable overhangs, or alternative massing configurations to further enhance ecological validity and expand the scope of climate-responsive courtyard design research.
Supplementary Information
Abbreviations
- AC
Air conditioning
- ASHRAE
American society of heating, refrigerating and air-conditioning engineers
- CDD
Cooling degree days
- CV
Cross-validation
- EUI
Energy use intensity
- HVAC
Heating, ventilation, and air conditioning
- kWh·m⁻2·yr
Kilowatt-hour per square meter per year
- MAE
Mean absolute error
- UNEP
United Nations Environment Programme
- XAI
Explainable artificial intelligence
- MENA
Middle East and North Africa
- ML
Machine learning
- QC
Quality control
- R2
Coefficient of determination
- RFR
Random forest regression
- RMSE
Root mean square error
- SHAP
SHapley Additive exPlanations
- U-value
Thermal transmittance (overall heat transfer coefficient)
- WWR
Window-to-wall ratio
- XPS
Extruded polystyrene (insulation material)
Author contributions
Conceptualization, M.A., and K.A.; methodology, M.A., and K.A.; software, K.A.; validation, M.A., and K.A; formal analysis, K.A.; investigation, I.E.; resources, M.A.; data curation, K.A.; writing, original draft preparation, K.A. and M.A.; writing, review and editing, M.A., and K.A.; visualization, K.A.; supervision, M.A.; project administration, M.A.; funding acquisition, M.A. All authors have read and agreed to the published version of the manuscript.
Funding
This work was supported and funded by the Deanship of Scientific Research at Imam Mohammad Ibn Saud Islamic University (IMSIU) (grant number IMSIU-DDRSP2502).
Data availability
Most of the data supporting the findings of this study are submitted in supplementary data and any additional data is available upon request.
Declarations
Competing interests
The authors declare no competing interests.
Declaration of generative AI
During the preparation of this work the authors used Pre-trained Large Language model in order to Grammer checks and improve the readability. After using this tool, the authors reviewed and edited the content as needed and took full responsibility for the content of the publication.
Footnotes
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
References
- 1.Saadatjoo, P., Badamchizadeh, P. & Mahdavinejad, M. Towards the new generation of courtyard buildings as a healthy living concept for post-pandemic era. Sustain. Cities Soc.97, 104726. 10.1016/J.SCS.2023.104726 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.Chahbi, M. Environmental and socio-cultural transition from traditional courtyard dwellings to contemporary housing practices in Morocco: insights from Arab and East Asian regions. J. Umm Al-Qura Univ. Eng. Archit.15(4), 574–590. 10.1007/S43995-024-00078-W/TABLES/4 (2024). [Google Scholar]
- 3.Alnaim, M. M. The typology of courtyard space in Najdi Architecture, Saudi Arabia: a response to human needs, culture, and the environment. J. Asian Archit. Build. Eng.23(1), 91–110. 10.1080/13467581.2023.2229399;WGROUP:STRING:PUBLICATION (2024). [Google Scholar]
- 4.Diz-Mellado, E., López-Cabeza, V. P., Rivera-Gómez, C., & Galán-Marín, C. Performance evaluation and users’ perception of courtyards role in indoor areas of mediterranean social housing. J. Environ. Manag. 345. 10.1016/j.jenvman.2023.118788 (2023). [DOI] [PubMed]
- 5.UNEP, “Global Status Report for Buildings and Construction | UNEP—UN Environment Programme,” UN Environment Program. https://www.unep.org/resources/report/global-status-report-buildings-and-construction (accessed 09 Aug 2025).
- 6.Howarth, N. et al. Staying cool in a warming climate: temperature, electricity and air conditioning in Saudi Arabia. Climate.8(1), 4. 10.3390/CLI8010004 (2020). [Google Scholar]
- 7.IEA. The Future of Cooling Opportunities for energy-efficient air conditioning Together Secure Sustainable. International Energy Agency (2022). www.iea.org/t&c/ (accessed 09 Aug 2025).
- 8.Meir, I. A., Pearlmutter, D. & Etzion, Y. On the microclimatic behavior of two semi-enclosed attached courtyards in a hot dry region. Build. Environ.30(4), 563–572. 10.1016/0360-1323(95)00018-2 (1995). [Google Scholar]
- 9.Safarzadeh, H. & Bahadori, M. N. Passive cooling effects of courtyards. Build. Environ.40(1), 89–104. 10.1016/J.BUILDENV.2004.04.014 (2005). [Google Scholar]
- 10.Tabadkani, A., Aghasizadeh, S., Banihashemi, S. & Hajirasouli, A. Courtyard design impact on indoor thermal comfort and utility costs for residential households: Comparative analysis and deep-learning predictive model. Front. Archit. Res.11(5), 963–980. 10.1016/J.FOAR.2022.02.006 (2022). [Google Scholar]
- 11.Carlucci, S. et al. Characteristics of the built environment in the Eastern Mediterranean and Middle East and related energy and climate policies. Energy Effic.17(5), 1–27. 10.1007/S12053-024-10217-W/TABLES/2 (2024). [Google Scholar]
- 12.Sun, X., Brown, M. A., Cox, M. & Jackson, R. Mandating better buildings: a global review of building codes and prospects for improvement in the United States. Wiley Interdiscip. Rev. Energy Environ.5(2), 188–215. 10.1002/WENE.168 (2016). [Google Scholar]
- 13.Aloshan, M. A. & Aldali, K. The role of regional codes in mitigating residential sector energy demand sensitivity to climate change scenarios in hot-arid regions. Buildings15(11), 1789. 10.3390/BUILDINGS15111789 (2025). [Google Scholar]
- 14.Alnaim, M. M. The typology of courtyard space in Najdi Architecture, Saudi Arabia: a response to human needs, culture, and the environment. J. Asian Archit. Build. Eng.23(1), 91–110. 10.1080/13467581.2023.2229399 (2024). [Google Scholar]
- 15.Seddik Hassan, A. M., Abd El Aal, R. F. A. & A. A. elmoneim Fahmi, S. M. A. Ali, and M. I. M. Abdelhady,. Courtyard geometry’s effect on energy consumption of AlKharga city residential buildings, Egypt. Sci. Rep.14(1), 11149. 10.1038/s41598-024-60487-8 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Diz-Mellado, E., López-Cabeza, V. P., Rivera-Gómez, C. & Galán-Marín, C. Performance evaluation and users’ perception of courtyards role in indoor areas of mediterranean social housing. J. Environ. Manag.345, 118788. 10.1016/J.JENVMAN.2023.118788 (2023). [DOI] [PubMed] [Google Scholar]
- 17.Toris-Guitron, M. G., Esparza-López, C. J., Luna-León, A. & del Pozo, C. E. Evaluation of the thermal performance of traditional courtyard houses in a warm humid climate: Colima, Mexico. Heritage Sci.10(1), 187. 10.1186/s40494-022-00820-4 (2022). [Google Scholar]
- 18.Amasyali, K. & El-Gohary, N. M. A review of data-driven building energy consumption prediction studies. Renew. Sustain. Energy Rev.81, 1192–1205. 10.1016/J.RSER.2017.04.095 (2018). [Google Scholar]
- 19.Zhao, H. X. & Magoulès, F. A review on the prediction of building energy consumption. Renew. Sustain. Energy Rev.16(6), 3586–3592. 10.1016/J.RSER.2012.02.049 (2012). [Google Scholar]
- 20.Chen, Z., Xiao, F., Guo, F. & Yan, J. Interpretable machine learning for building energy management: A state-of-the-art review. Adv. Appl. Energy9, 100123. 10.1016/J.ADAPEN.2023.100123 (2023). [Google Scholar]
- 21.Cui, X., Lee, M., Koo, C. & Hong, T. Energy consumption prediction and household feature analysis for different residential building types using machine learning and SHAP: Toward energy-efficient buildings. Energy Build309, 113997. 10.1016/J.ENBUILD.2024.113997 (2024). [Google Scholar]
- 22.Khastar, S. & Taleghani, M. Thermal conditions and daylight availability in different zones of courtyard buildings; a study in Iran. Adv. Build. Energy Res.18(4), 384–402. 10.1080/17512549.2024.2363878 (2024). [Google Scholar]
- 23.Diz-Mellado, E., Ruiz-Pardo, Á., Rivera-Gómez, C., Sanchez de la Flor, F. J. & Galán-Marín, C. Unravelling the impact of courtyard geometry on cooling energy consumption in buildings. Build. Environ.237, 110349. 10.1016/J.BUILDENV.2023.110349 (2023). [Google Scholar]
- 24.Seddik Hassan, A. M., Abd El Aal, R. F. A. & A. A. elmoneim Fahmi, S. M. A. Ali, and M. I. M. Abdelhady,. Courtyard geometry’s effect on energy consumption of AlKharga city residential buildings, Egypt. Sci. Rep.14(1), 1–18. 10.1038/S41598-024-60487-8 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25.Salameh, M. Modifying school courtyard design to optimize thermal conditions and energy consumption in a hot arid climate. J. Archit. Eng.30(4), 04024033 (2024). [Google Scholar]
- 26.Toris-Guitron, M. G., Esparza-López, C. J., Luna-León, A. & del Pozo, C. E. Evaluation of the thermal performance of traditional courtyard houses in a warm humid climate: Colima, Mexico. Herit. Sci.10(1), 1–17. 10.1186/S40494-022-00820-4 (2022). [Google Scholar]
- 27.Gomaa, M. M., Othman, E., Mohamed, A. F. & Ragab, A. Quantifying the impacts of courtyard vegetation on thermal and energy performance of university buildings in hot arid regions. Urban Sci.8(3), 136. 10.3390/URBANSCI8030136 (2024). [Google Scholar]
- 28.Miranda, N. D. et al. Change in cooling degree days with global mean temperature rise increasing from 1.5 °C to 2.0 °C. Nat. Sustain.6(11), 1326–1330. 10.1038/s41893-023-01155-z (2023). [Google Scholar]
- 29.Falchetta, G., De Cian, E., Pavanello, F. & Wing, I. S. Inequalities in global residential cooling energy use to 2050. Nat. Commun.15(1), 1–13. 10.1038/S41467-024-52028-8 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 30.Tawfeeq, H. & Qaradaghi, A. M. A. Optimising window-to-wall ratio for enhanced energy efficiency and building intelligence in hot summer mediterranean climates. Sustainability.16(17), 7342. 10.3390/SU16177342 (2024). [Google Scholar]
- 31.Bagheri, S., Moradinasab, H. & Yeganeh, M. The effect of window proportions in low-rise residential buildings on annual energy consumption in humid temperate climate (case study: Rasht city in Iran). Front. Energy Res.12, 1463678. 10.3389/FENRG.2024.1463678/BIBTEX (2024). [Google Scholar]
- 32.Cho, K., Cho, D., Koo, B. & Yun, Y. Thermal performance analysis of windows, based on argon gas percentages between window glasses. Buildings13(12), 2935. 10.3390/BUILDINGS13122935 (2023). [Google Scholar]
- 33.Veillette, D., Rouleau, J. & Gosselin, L. Impact of window-to-wall ratio on heating demand and thermal comfort when considering a variety of occupant behavior profiles. Front. Sustain. Cities3, 700794. 10.3389/FRSC.2021.700794/BIBTEX (2021). [Google Scholar]
- 34.Aloshan, M. & Aldali, K. Empirical study of facade retrofits for optimizing energy efficiency and cooling in school buildings in Saudi Arabia. Energy Rep.12, 4105–4128. 10.1016/J.EGYR.2024.09.076 (2024). [Google Scholar]
- 35.Alayed, E., Bensaid, D., O’Hegarty, R. & Kinnane, O. Thermal mass impact on energy consumption for buildings in hot climates: A novel finite element modelling study comparing building constructions for arid climates in Saudi Arabia. Energy Build271, 112324. 10.1016/J.ENBUILD.2022.112324 (2022). [Google Scholar]
- 36.Calama-González, C. M. et al. Thermal insulation impact on overheating vulnerability reduction in Mediterranean dwellings. Heliyon9(5), e16102. 10.1016/J.HELIYON.2023.E16102 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Ali, A., Issa, A. & Elshaer, A. A comprehensive review and recent trends in thermal insulation materials for energy conservation in buildings. Sustainability16(20), 8782. 10.3390/SU16208782 (2024). [Google Scholar]
- 38.Chanda, P. R. & Biswas, A. Carving a niche in building energy using modern vernacular house with passive wall materials—A multi-criteria decision-making framework. Energy312, 133539. 10.1016/J.ENERGY.2024.133539 (2024). [Google Scholar]
- 39.Chanda, P. R. & Biswas, A. Unveiling the optimal roof design for a sustainable and energy-efficient modern vernacular architecture—An MCDM, simulation, and experimental framework. J. Renew. Sustain. Energy.10.1063/5.0271561/3360872 (2025). [Google Scholar]
- 40.Karimi, M., Chikamoto, T., Lee, M. & Tanaka, T. Impact of building orientation on energy performance of residential buildings in various cities across Afghanistan. Sustainability16(24), 11076. 10.3390/SU162411076 (2024). [Google Scholar]
- 41.Zafari Jurshari, M., Yousefi Tazakor, M. & Yeganeh, M. Optimizing the dimensional ratio and orientation of residential buildings in the humid temperate climate to reduce energy consumption (Case: Rasht Iran). Case Stud. Therm. Eng.10.1016/J.CSITE.2024.104484 (2024). [Google Scholar]
- 42.Moon, J. et al. Advancing ensemble learning techniques for residential building electricity consumption forecasting: Insight from explainable artificial intelligence. PLoS ONE19(11), e0307654. 10.1371/JOURNAL.PONE.0307654 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 43.ASHRAE. ANSI/ASHRAE Addendum a to ANSI/ASHRAE Standard 169-2020. 2021. www.ashrae.org (accessed 15 Aug 2025).
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
Most of the data supporting the findings of this study are submitted in supplementary data and any additional data is available upon request.


















