A fast and effective method for modelling and optimizing district heating systems in the Modelica language


  • Haoran Li
  • Juan Hou
  • Natasa Nord




Modelica language, district heating system model, optimal operation, optimal control


A district heating system is a centralized energy system that supplies heat to end users such as buildings and industrial facilities. This centralized system may have multiple heat sources, a complex distribution network, and a large number of end users. Moreover, the heat distribution and utilization processes entail tumultuous thermal dynamics. Therefore, modelling and optimizing such a system generally demands arduous labour and necessitates powerful computing resources. To overcome these difficulties, this study introduced a fast and effective method for modelling and optimizing district heating systems using the Modelica language. Firstly, a simplified district heating system model was developed. This simplified model lumped all the end-users into a single thermal pinot with critical physical constraints. Meanwhile, the distribution network was simplified into two pipelines: supply and return. In addition, a one-dimensional discrete model was used to describe the behaviours of water tank thermal energy storage. Other essential components, like central and distributed heat sources, were modelled using basic mass and energy balance equations. Afterwards, two optimization frameworks were formulated, which incorporated the developed system model: a long-term optimal operation framework aimed at a yearly level open-loop optimization with a two-hour resolution, and a model predictive control framework aimed at a daily level close-loop optimization with a one-hour resolution. The proposed method was tested numerically on a university campus district heating system in Norway on a personal computer. Model validation showed that the proposed modelling approach could capture the key characteristics of the studied system. Optimization results demonstrated the effectiveness of the proposed optimization frameworks both for the long-term and short-term optimization.