Designing for Sustainability: Two-Stage Optimisation of Envelope Efficiency and Photovoltaic–Battery Sizing for a Moroccan Residential Building.
, Bouthayna Slimani1, Hassan zahboune1, Smail Zouggar1, Mohamed Laarbi Elhafyani1, Taoufik Ouchbel1, Nikola Matak2, Ven Rajlić2Abstract
Moroccan buildings remain electricity-intensive despite ambitious renewable-electricity targets, and household energy economics are shaped by tariff design and export limitations. This study develops a two-stage optimisation framework that couples genetic-algorithm envelope optimisation (DesignBuilder/EnergyPlus) with a dispatch-constrained mixed-integer linear programme that co-optimises rooftop photovoltaic and battery capacities and hourly operation over 8,760 h under Morocco’s time-of-use tariff, a no-grid-to-battery charging rule, and export constraints. For a representative dwelling in Oujda, envelope upgrades reduce annual space-conditioning electricity demand by 26.9%. Under self-consumption with unpaid exports, the cost-optimal design shifts from 8.0 kW photovoltaic without storage (self-supply ratio 46.4%) to 10.4 kW photovoltaic with 11.8 kWh storage (self-supply ratio 76.6%), reducing annual total cost by 18.6%. When paid exports are enabled under a 20% annual quota, the optimum becomes 10.9 kW photovoltaic with 13.5 kWh storage (self-supply ratio 81.3%) and annual total cost decreases by 9.8% through surplus value recovery. Capacity sweeps confirm diminishing marginal returns: beyond the optima, additional capacity increasingly converts into curtailment or low-value surplus, increasing annual total cost and the levelized cost of electricity. A policy grid over export remuneration and permitted export share identifies a regime transition at a 70% export allowance, beyond which photovoltaic capacity reaches a stable plateau and optimal storage requirements decrease as the economic driver shifts from time shifting toward direct surplus sales. The results support an efficiency-first, then optimal-sized photovoltaic-plus-storage strategy and highlight the importance of bankable export remuneration and broader time-of-use participation for improving household economics.