Parametric Urban Optimization by Balancing Energy Performance and Environmental Quality
Introduction
Morocco, like many developing nations, has long faced a difficult balancing act. On one hand, the country has a massive housing deficit over 1.8 million units, and a national commitment to producing 150,000 new homes each year. On the other hand, Morocco imports 97% of its energy, and the building sector alone consumes 34% of the nation’s total final energy, with residential buildings accounting for 27% of that figure. For years, social housing policy prioritized affordability above all else, leaving energy efficiency and environmental quality as secondary concerns. But as the kingdom pushes toward its 2030 energy plan which emphasizes renewable energy production and improved consumption efficiency, the rules are changing.
This is the context for a recent parametric urban optimization study that focuses on balancing energy performance and environmental quality in residential buildings across four distinct Moroccan climates: Agadir, Driouch, Marrakech, and Meknes. The study’s core aim was to develop a rational, repeatable design methodology that minimizes energy demand in social housing complexes without driving up construction costs. By using parametric design tools and simulation engines, the researchers explored nearly 6,000 iterations per climate zone, examining how factors like building typology, orientation, distance between buildings, and window-to-wall ratio (WWR) affect annual energy consumption, load matching index (LMI), and spatial daylight autonomy (sDA).
What makes this approach particularly relevant is its focus on passive urban optimization strategies, design moves that require little to no additional investment but can dramatically improve a building’s thermal and lighting performance. For real estate developers operating under tight margins, this is not just an academic exercise; it’s a practical pathway to compliance with Morocco’s first thermal regulation for construction (TRCM) while still delivering affordable housing.
Methodology: Automating the Search for Optimal Urban Forms
The methodology behind this urban optimization study is rooted in parametric design, a process that allows designers to automate the generation and evaluation of many design variants. The researchers used Grasshopper, a visual programming environment within Rhino 3D, to generate urban optimization forms and enrich them with both fixed and variable inputs. Fixed parameters included construction materials, heating and cooling setpoints (20°C for heating, 26°C for cooling), internal loads (lighting at 10 W/m², occupancy at 1.8 people/m², equipment at 10 W/m²), and detailed weekday schedules reflecting typical Moroccan family behavior. Variable inputs included building typology, orientation, WWR (varied separately for each facade), and distance between buildings.
Simulations were run using Honeybee and Ladybug tools, which link directly to EnergyPlus for thermal calculations and Radiance for daylighting analysis. The Colibri library was used to manage discrete iterations and record all outputs into Excel spreadsheets. In total, 5,994 iterations were completed for each of the four climate regions. That level of granularity is important because it allows researchers to move beyond generic advice “orient buildings north-south” or “use medium-sized windows” and instead offer climate-specific, data-backed recommendations.
The Four Climates: Why Location Changes Everything
Morocco’s thermal zoning map divides the country into multiple zones, and this study selected four cities that represent very different challenges. Agadir, on the Atlantic coast, has an oceanic climate with mild seasonal variation. It enjoys the highest proportion of “warm days” neither too hot nor too cold where passive strategies can work effectively without active heating or cooling. Driouch, in the northeast, has the highest number of hot days (minimum temperatures above 20°C) but also the second-highest number of cold days.
Its summers are humid, and nighttime temperatures often stay above 20°C, limiting the effectiveness of ventilative cooling. Marrakech, inland and semi-arid, has strong seasonal and daily temperature swings, low average wind speeds, and excellent potential for evaporative cooling. Meknes has a mild but long heating-dominated period, sunny weather with high direct solar radiation, and relatively cool summer nights.
These differences matter enormously for parametric urban optimization. A building typology that works beautifully in Agadir might fail in Driouch. The same WWR that balances daylight and thermal load in Marrakech could cause overheating in Meknes. This is precisely why the study’s iterative, simulation-driven approach is so valuable: it replaces guesswork with evidence.
Key Inputs: Typology, Orientation, WWR, and Spacing
The study of urban optimization examined multiple building typologies, including slab blocks oriented east-west and north-south, assembled blocks, scattered courtyard arrangements, and courtyard blocks with different configurations. Typology is the first and most fundamental design decision in any construction project, and its interaction with local climate cannot be overstated. Orientation was treated as a discrete variable, with the researchers paying special attention to how each facade’s exposure affects overall performance. The WWR was parametrized per facade, recognizing that south-facing windows in a hot, dry climate behave very differently from north-facing ones. Distance between buildings was also analyzed as an independent variable, since spacing affects natural ventilation, shading, and the reduction of exposed surface area.
Importantly, all simulations assumed no active cooling or heating systems in the base case, in line with Moroccan social housing law, which does not mandate their installation. Instead, energy demand was evaluated using an ideal HVAC system to establish a baseline. Photovoltaic production was considered only for rooftops facade-integrated PV was deemed too expensive for the affordable housing market. Because Moroccan law currently prevents feeding excess solar energy back into the grid, the study used a monthly Load Matching Index rather than an annual balance. This is a more realistic metric for social housing, where seasonal mismatches between production and demand cannot be smoothed over a full year.
Outputs: Energy Demand, Load Matching, and Daylight Autonomy
Three main outputs guided the analysis. First, annual energy consumption per square meter, filtered against TRCM thresholds for each urban optimization climate zone. Second, the Load Matching Index, which compares monthly energy generation (from rooftop PV) to monthly consumption. Third, Spatial Daylight Autonomy, which measures whether a space receives adequate natural light during typical operating hours, in this case, 8:00 to 18:00, reflecting the reality that many Moroccan social housing households have one stay-at-home parent.
These outputs are not independent. Increasing window area improves sDA but can drive up cooling loads. Reducing the spacing between buildings lowers land use but may block natural ventilation and daylight. Adding PV panels improves LMI but adds cost. The parametric approach allows designers to see these trade-offs clearly and choose solutions that balance competing goals rather than optimizing one at the expense of others.
Results: What the Data Showed
After filtering the 5,994 iterations per city against TRCM requirements, clear patterns emerged. In Agadir, the urban optimisation of the most flexible climate, several typologies performed well, including scattered courtyard arrangements, assembled blocks, and east-west oriented slabs. Energy consumption per square meter per year ranged from about 30 to 36 kWh/m², well within the local threshold of 40 kWh/m². Load matching indexes were generally high, often above 79%, reflecting Agadir’s consistent solar resource and mild temperatures. Daylight autonomy varied widely, from around 22% in some configurations to over 72% in others, highlighting the importance of WWR and orientation.
Driouch proved much more challenging. The available data in the summary table shows a single complying result for one typology, with an energy consumption of 41.31 kWh/m² against a threshold of 46 kWh/m². The load matching index was negative, indicating serious mismatches between monthly production and demand. Daylight autonomy was relatively high at 83%, but that came at a cost. The researchers strongly recommended integrating patio devices into building blocks in Driouch to improve thermal performance without sacrificing light.
Marrakech, with its harsh summers and wide temperature swings, required careful balancing. Energy consumption among complying results ranged from about 49 to 58 kWh/m², all under the local threshold of 61 kWh/m². Load matching was solid, between 69% and 80%, but daylight autonomy varied dramatically from 16% in a poorly configured slab to 82% in a well-designed courtyard arrangement. The study emphasized the importance of shading, natural ventilation driven by temperature differences (since wind speeds are low), and the strategic urban optimization use of patios to maximize light while controlling heat.
Meknes offered more flexibility than Driouch or Marrakech but less than Agadir. Energy consumption ranged from about 25 to 45 kWh/m², with one typology assembled blocks with a specific orientation achieving an impressive 25.38 kWh/m² against a threshold of 48 kWh/m². Load matching was strong, often above 78%, and daylight autonomy reached nearly 88% in the best configuration. The researchers recommended avoiding south and southwest exposures where possible, using patios to enhance natural lighting, and favoring scattered courtyard or assembled block typologies.
Discussion: Lessons for Designers and Developers
Perhaps the most important finding is that in all four climates, slab blocks oriented west-east performed poorly. The reason is straightforward: excessive exposure of the south facade in a dry, hot environment leads to overheating and high cooling loads. This is a simple but powerful lesson for parametric urban optimization: orientation is not just about north-south alignment; it is about understanding how each facade interacts with the sun’s path and the local microclimate.
Another key insight is that within the same climate region, different urban optimization forms produced similar load matching indexes and annual energy consumption. That means designers have real flexibility. They are not locked into a single “optimal” typology; they can choose among several good options based on site constraints, density requirements, or aesthetic preferences without sacrificing energy performance. This is a practical finding that developers can act on immediately.
Daylighting, however, is another story. Urban optimization forms with patios consistently enabled better natural lighting regardless of climate. That does not mean every project should include a patio; there are cost and density implications, but it does mean that when daylight autonomy is a priority (and in social housing, it should be), courtyard-based typologies are worth the extra design effort.
Recommendations by City
For Agadir, where thermal stress is low, the study recommends scattered courtyard arrangements, assembled blocks, and east-west assembled blocks. The climate urban optimization allows for medium openings (20-40% WWR) and promotes natural ventilation through openings oriented to the west-southwest and east-northeast.
For Driouch, the recommendation is clear: add patio devices to building blocks. The climate’s high humidity, frequent hot nights, and substantial diffuse solar radiation make passive cooling difficult, but patios help create shaded, ventilated microclimates.
For Marrakech, balance is everything. Use thick, massive walls with phase shifts over eight hours. Keep openings medium (20-40%) and orient them to promote natural ventilation. Exploit evaporative cooling potential, which is high due to the large difference between dry bulb and wet bulb temperatures. Use patios either per block or for the whole complex to maximize natural lighting while supporting air movement.
For Meknes, protect against south and southwest orientations, maximize natural lighting through patios, and consider scattered courtyard or assembled block typologies. The climate’s sunny, high-direct-radiation character means shading is critical, but massive walls and roofs can help shift thermal loads away from occupied hours.
Conclusion: A Methodology, Not a Final Answer
The researchers are careful not to overclaim. Their methodology is not conclusive in itself; it is a framework for analysis that must be followed by context-specific energy simulations urban optimization and production estimates. But within that humble framing lies real value. For a country like Morocco, where social housing demand is high, energy imports are a strategic vulnerability, and construction budgets are tight, any tool that helps designers make better passive-design decisions is worth adopting.
The parametric urban optimization approach demonstrated in this study balancing energy performance and environmental quality across four very different climates, offers a replicable model. It shows that even under the constraints of affordability, it is possible to improve thermal comfort, reduce energy demand, and enhance natural lighting. The key is to stop treating urban optimization form as an aesthetic or purely economic decision and start treating it as a climate-responsive, data-informed choice. For Moroccan social housing, that shift cannot come soon enough.