modelDetailedHouse10

Speeding up the code

Extends from DetailedHouse9 (Adding CO2-controlled ventilation).

Information

The previous examples present a rather good computational performance. However, the computation time can significantly increase for larger simulation time due to frequent on/off switching of the heat pump. This effect causes a lot of fast transients that force the solver to take small steps, which takes a lot of time.

Fortunately, many tricks can be used to speed up the solver. The fundamental principle is to remove small time constants from the problem. The example in IDEAS.Examples.Tutorial.DetailedHouse.DetailedHouse10 implements changes that cause the simulation to become almost 3 times faster. By systematically removing fast time constants, the solver can be switched to a simpler method, such as Euler integration, with a fixed time step of 20 seconds.

It is important to note the trade-off between computation time and simulation accuracy when choosing an integration method. While the Euler method is generally much faster than implicit solvers such as Dassl, it is also less accurate, especially for stiff or highly dynamic systems. Using smaller Euler time steps increases simulation accuracy but also increases computation time, whereas larger time steps decrease computation time at the expense of accuracy. Therefore, careful consideration is needed when selecting the solver and time step size, balancing the need for speed and the desired level of accuracy in the simulation results.

These are modest improvements since this small example model behaves rather well. However, for large models, the difference in computation time when using Euler integration can become a factor 1000. The modifications however require a bit of knowledge about solvers and the models that you are using, including some of the more advanced parameters. To learn more about this, we refer to [1, 2, 3].

References

    [1] F. Jorissen, M. Wetter, and L. Helsen. Simulation Speed Analysis and Improvements of Modelica Models for Building Energy Simulation. In 11th International Modelica Conference, Paris, 2015. doi: 10.3384/ecp1511859
    [2] F. Jorissen, M. Wetter, and L. Helsen. Simplifications for hydronic system models in Modelica. Journal of Building Performance Simulation, 11:6, 639-654, 2018. doi: 10.1080/19401493.2017.1421263
    [3] F. Jorissen. Toolchain for Optimal Control and Design of Energy Systems in Buildings. PhD Thesis, KU Leuven, 2018.

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.Lengthl (from DetailedHouse5)8Zone length
Modelica.Units.SI.Lengthw (from DetailedHouse5)4Zone width
Modelica.Units.SI.Lengthh (from DetailedHouse5)2.8Zone height

Components

TypeNameDefaultDescription
IDEAS.BoundaryConditions.SimInfoManagersim (from DetailedHouse5)
IDEAS.Buildings.Components.RectangularZoneTemplaterecZon (from DetailedHouse5)Northern part of the zone
IDEAS.Buildings.Components.RectangularZoneTemplaterecZon1 (from DetailedHouse5)Southern part of the zone
IDEAS.Fluid.HeatPumps.ScrollWaterToWaterheaPum (from DetailedHouse6)Heat pump model, rescaled for low thermal powers
IDEAS.Fluid.HeatExchangers.Radiators.RadiatorEN442_2rad (from DetailedHouse6)Radiator for zone 1
IDEAS.Fluid.HeatExchangers.Radiators.RadiatorEN442_2rad1 (from DetailedHouse6)Radiator for zone 2
IDEAS.Fluid.Actuators.Valves.TwoWayTRVval (from DetailedHouse6)Thermostatic valve for first zone
IDEAS.Fluid.Movers.FlowControlled_dppumEmi (from DetailedHouse6)Circulation pump of the heat emission (radiator) side of the circuit
IDEAS.Fluid.Sources.Boundary_pTbou (from DetailedHouse6)Cold water source for heat pump
IDEAS.Fluid.Actuators.Valves.TwoWayTRVval1 (from DetailedHouse6)Thermostatic valve for second zone
IDEAS.Fluid.Movers.FlowControlled_dppumPri (from DetailedHouse6)Circulation pump at the primary (evaporator) side of the heat pump
Modelica.Blocks.Sources.IntegerConstantheaPumOn (from DetailedHouse6)Heat pump is on
Modelica.Blocks.Continuous.IntegratorEEl (from DetailedHouse6)Electrical energy meter with conversion to kWh
IDEAS.Fluid.Sensors.TemperatureTwoPortsenTemSup (from DetailedHouse6)Supply water temperature sensor
IDEAS.Fluid.Sources.Boundary_pTbou1 (from DetailedHouse6)Cold water source for heat pump
IDEAS.Fluid.Storage.Stratifiedtan (from DetailedHouse6)Buffer tank for avoiding excessive heat pump on/off switches
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensorsenTan (from DetailedHouse6)Temperature sensor of tank volume
IDEAS.Fluid.Movers.FlowControlled_dppumSec (from DetailedHouse6)Circulation pump at the secondary (condenser) side of the heat pump
Modelica.Blocks.Logical.Hysteresishys (from DetailedHouse7)Hysteresis controller
Modelica.Blocks.Math.BooleanToRealbooToRea (from DetailedHouse7)Conversion to real control signal
IDEAS.Fluid.Actuators.Dampers.PressureIndependentvavSup (from DetailedHouse9)Supply VAV for first zone
IDEAS.Fluid.Actuators.Dampers.PressureIndependentvavSup1 (from DetailedHouse9)Supply VAV for second zone
IDEAS.Fluid.Actuators.Dampers.PressureIndependentvavRet (from DetailedHouse9)Return VAV for first zone
IDEAS.Fluid.Actuators.Dampers.PressureIndependentvavRet1 (from DetailedHouse9)Return VAV for second zone
IDEAS.Fluid.Movers.FlowControlled_dpfanSup (from DetailedHouse9)Supply fan
IDEAS.Fluid.Movers.FlowControlled_dpfanRet (from DetailedHouse9)Return fan
IDEAS.Fluid.HeatExchangers.ConstantEffectivenesshex (from DetailedHouse9)Heat exchanger with constant heat recovery effectivity
IDEAS.Controls.Continuous.LimPIDconPID (from DetailedHouse9)
IDEAS.Controls.Continuous.LimPIDconPID1 (from DetailedHouse9)
Modelica.Blocks.Sources.ConstantppmSet (from DetailedHouse9)
IDEAS.Fluid.Sources.OutsideAiroutAir (from DetailedHouse9)Source model that takes properties from SimInfoManager

Contents

NameDescription
HeavyWallNoWoodprotectedBESTEST heavy wall with idealized wood layer

Revisions

  • April 14, 2025, by Anna Dell'Isola and Lone Meertens:
    Update and restructure IDEAS tutorial models. See #1374 and #1389.
  • October 30, 2024, by Lucas Verleyen:
    Updates according to IBPSA.
    See #1383 (and IBPSA, #1926).
  • September 18, 2019 by Filip Jorissen:
    First implementation for the IDEAS crash course.