This Repository contains an open source toolchain which generates Modelica building models from BIM models based on the IFC format. It uses the GUI and the software infrastructure of CoTeTo for simplifying the code generation process.
The BIM2Modelica software package is available under the terms of the BSD 3-Clause License. A copy of the license is available at BIM2Modelica/LICENSE.md.
The template based code generation tool CoTeTo is used as the software framework for the entire tool chain from the IFC file to the Modelica building model. All the intermediate steps from
- reading and checking an IFC file,
- storing the building data in a data structure up to
- generating a building model based on a Mako template
is summarized in one CoTeTo code generator (a short introduction into the generator package concept of CoTeTo you can find under CoTeTo/Generators/README.md).
At the moment one code generator for Modelica multi-zone building models which can read the IFC 2X3 format and generates code for the Modelica BuildingSystems BuildingSystem library is realized.
This software module reads and analyses the IFC files for thermal simulation purposes. Therefore, features of the Python package IfcOpenShell and the Python package OCC are used.
A flexible Mako template for Modelica multi-zone building models generates the Modelica code for thermal building models with a flexible geometry, number of zones, building constructions and boundary conditions (weather data, building use).
A set of IFC test models in the IFC2x3 format is part of the BIM2Modelica repository.
This folder includes the generated Modelica models correspondent to the IFC2X3 test models.
-
Clone or download CoTeTo (https://github.com/UdK-VPT/CoTeTo.git)
-
Install CoTeTo on your machine.
-
Copy the folder with the respective code generator (https://github.com/UdK-VPT/BIM2Modelica/tree/master/CoTeTo_Generators/IFC_MultiZoneBuildings_Modelica) in the folder CoTeTo/Generators.
-
Start the GUI of CoTeTo and select the generator of your interest, in this case
IFC_MultiZoneBuildings_Modelica
.
-
Select the IFC input file (e.g. BIM2Modelica/IFC/IFC2X3/UdKB_Test_Cases/OneZone.ifc)
-
Name the output model name (e.g. OneZone) and press Generate.
-
As a result three files (OneZone.mo, OneZone_StateVariables.cs and OneZone_BuildingModel.cs) are generated.
-
Open the generated .mo-File in your Modelica simulation environment and simulate it.
For example, you can do this with the Open Source simulation tool JModelica (as explained here):