Energy Modeling

edited April 21 in General

Starting a new dedicated topic following our discussions :

quotes from Safely split an IFC

@Moult said:
@Cyril I just realised you mentioned energy model. I have a very hastily written half-baked completely incomplete Blender->gbXML exporter code here. Maybe it is useful to you. Maybe you can help write a fully featured one? You no doubt have much more experience in energy models and I have zero experience :)

Once we have a reliable gbXML workflow (by the way, gbXML spaces have an attribute that relate back to IFC spaces), that would be a huge benefit as people can then use Blender as an authoring tool for energy models.

@yorik said:
@Moult I think I could use your gbXML exporter quite easily in FreeCAD... Would you be interested in trying to make it Blender-independent? I'm thinking in FreeCAD it could be fed with a list of Arch Space objects. There is quite a lot that is geometry-dependant, but maybe we could isolate that as much as possible into separate methods, then in FreeCAD I can derive a new class from yours and reimplement the geometry-related functions

@Moult said:
@yorik Sure thing :) I haven't touched the code in a while and it currently is quite low on the to-do list, but gbXML expects a closed mesh polygon to represent a space (and from memory, only supports that, not like IFC which has 200 options :) ). Each face of the polygon represents a "surface". This is very simple in Blender and is isolated to the create_space function. As spaces are almost always very simple boxes / box-like closed shapes, this should also be very simple in FreeCAD :) Feel free to use it and please let us know when you do :)

Note on gbXML vs IFC (IfcRelSpaceBoundary)

IfcRelSpaceBoundaries have some advantages over gbXML. See also specialized IfcRelSpaceBoundary2ndLevel. gbXML is kind of the old way supported by almost any energy analysis software. Geometric generation process is almost the same for gbXML and IfcRelSpaceBoundaries. Adapt to local standard is hard with gbXML as it contains limited building information.

Current personnal progress

I am currently working on the other part of the process which is :

  1. Read an Ifc which contains IfcRelSpaceBoundary exported from any software (eg. Revit, ArchiCAD currently)
  2. Adapt or generate geometries for local standards. (which could become IfcRelSpaceBoundary level n in future according to discussions on building smart forum)
  3. Output information in simple and consistent manner for use in the energy analysis software

I'll give more detail soon.

I will be happy to work on gbXML/IfcRelSpaceBoundary generation as a team because I am not a geometry or algorithm master so I will need some help to avoid spending decades on this or get awful performances.

Side notes

  • I know that there is already energy analysis tools in Blender but I don't know how it works and if it is able to generate gbXML already. Cf. An Arch project showcase on FreeCAD forum
  • I know that LadyBug Tools already have tools related to gbXML and energy analysis. Investigate a little here is required to avoid reinventing wheel.
  • There is many scientific publication related to IfcRelSpaceBoundaries generation. I will post links on wiki for the ones publicly readable on web.
Tagged:
CGR

Comments

  • @Cyril that sounds fun! If I understand correctly, you are building an IFC to gbXML converter? Or are you building some way that software like EnergyPlus can read IFC with its benefits like IfcRelSpaceBoundary? If it is the latter, how does that work?

    I think investigating LadyBug tools is a very good idea - somehow bringing data from IFC into a format which could be plugged into LadyBug means that you could then use their entire suite of tools. Unfortunately I've never used their libraries :(

    Are you aware of any FOSS tool which currently can output an IFC capable for energy modeling now? If not, perhaps that's where @yorik and I can help?

  • @Moult I'd be interested in seeing if Homemaker IFC files could have this energy modelling info. What would it normally consist-of?

    Linking walls and spaces with IfcRelSpaceBoundary is fairly obvious, what about internal walls, floors and roofs? Ground floor slabs? I assume that thermal properties of walls, windows and doors can be set with a single U or R value? Or is this a property of the materials?

  • That is super interesting! I wasn't aware of the energy freecad workbench... indeed it seems an ifc file could contain everything a gbxml file needs:

    • spaces
    • relation to all boundary elements
    • boundary elements also inform materials and openings
      The main issue i think would be how to know which face of the space relates to which boundary wall? I think that info is necessary, no?
  • You don't need reinvent the wheel, search IFC2Modelica

    duncan
  • Thanks @ReD_CoDE ! From a bit of searching it seems that the original IFC2Modelica was never released open-source. However, another research paper did create an open source thing called BIM2Modelica which seems to do the same thing - here's the Github repo. @Cyril - you're the man qualified for energy analysis, does it look relevant and useful? If so, we can integrate it into Blender/FreeCAD.

  • edited June 2020

    @Moult yes, IFC2Modelica is a private academic repo
    If you research after a while will find a lot of interesting resources related to IFC/Ifc to Modelica and some important articles about accuracy challenges about spaces and zones
    For instance: https://pdfs.semanticscholar.org/6cd9/39a6ca65ff03c5267c9d916eb3a01b7a25a9.pdf

  • edited June 2020

    @Moult said:
    @Cyril that sounds fun! If I understand correctly, you are building an IFC to gbXML converter? Or are you building some way that software like EnergyPlus can read IFC with its benefits like IfcRelSpaceBoundary? If it is the latter, how does that work?

    IFC to a custom xml but not gbXML. As I said gbXML has some unwanted restrictions and complications.
    EnergyPlus don't read IFC directly. Another software translate IFC or gbXML to IDF to feed EnergyPlus.

    @Moult said:
    Are you aware of any FOSS tool which currently can output an IFC capable for energy modeling now? If not, perhaps that's where @yorik and I can help?

    Yes and no…
    You have Space Boundary Tool which is supposed to generate IfcRelSpaceBoundaries from an IFC but license is weird. It has a github fork.
    As I said in my previous post someone has presented a House project and energy analysis with FreeCad, Blender 3D and VI Suite on FreeCAD forum. VI Suite is an open source addon for Blender. Repository seems to be here.

    @brunopostle said:
    @Moult I'd be interested in seeing if Homemaker IFC files could have this energy modelling info. What would it normally consist-of?

    Linking walls and spaces with IfcRelSpaceBoundary is fairly obvious, what about internal walls, floors and roofs? Ground floor slabs? I assume that thermal properties of walls, windows and doors can be set with a single U or R value? Or is this a property of the materials?

    Internal wall, virtual boundary (eg. no wall between kitchen and living room). Many things are not obvious if you try to do it for real. :-D
    Materials handle λ values (thermal conductivity) etc… in Pset_MaterialThermal

    @ReD_CoDE said:
    You don't need reinvent the wheel, search IFC2Modelica

    I don't know any local standards which is certified with Modelica. So any Modelica only based workflow is not a valid solution. We need pragmatic solutions which can be adapted to feed local energy software certified for local standards.

    @Moult said:
    Thanks @ReD_CoDE ! From a bit of searching it seems that the original IFC2Modelica was never released open-source. However, another research paper did create an open source thing called BIM2Modelica which seems to do the same thing - here's the Github repo. @Cyril - you're the man qualified for energy analysis, does it look relevant and useful? If so, we can integrate it into Blender/FreeCAD.

    I have created an Energy Modeling wiki page referencing many scientific articles or conference papers including some algorithm comparison for boundaries generation (graph, ray, polyhedron etc…).

    Side note : I don't know where to reference this wiki page on main page. Also I noticed many spam pages in wiki history but only admin and sysop user can delete it.

    ReD_CoDECGRJesusbill
  • Wow, VI Suite with a "White-Sky" theme ;)
    Modelica opens some new doors to the future and also cause "parallel" simulation which was a wish for years

  • @Cyril said:
    I will be happy to work on gbXML/IfcRelSpaceBoundary generation as a team because I am not a geometry or algorithm master so I will need some help to avoid spending decades on this or get awful performances.

    @Cyril I would like to help on that.

    Jesusbill
  • @agonzalezesteve said:
    @Cyril I would like to help on that.

    Awesome !

    @agonzalezesteve said:
    I thought it could be a great chance to move to Blender BIM to enrich an IFC instead of an OpenStudio model and then translate to different open source engines to run energy or daylight simulations like Ladybug Tools, but with an open source 3D software.

    When I opened this discussion I didn't find this one where @Cyril links other topics. There is some development in progress where I could help? I leave you an example of what we do. I don't know Python but it's similar to Ruby and I learned coding in college with C++, so it won't be worse!

    I have just published source code of the BIMxBEM project I have been working on at CNPA. It is released under LGPL3.0. We should definitely have a talk. I am very interested to share our mutual experiences.

    agonzalezesteveduncanJesusbill
  • @agonzalezesteve I also think it's a great idea to allow BlenderBIM to bring in IFCs, enrich them (e.g by cleaning up or adding IfcRelSpaceBoundary), and then output to different engines. One example would be to output to gbXML for OpenStudio, and another would be to output to Honeybee-JSON for Ladybug Tools / Pollination. I've heard that Honeybee-JSON addresses many of the shortcomings of gbXML, so @Cyril would you like to investigate that instead of inventing a new XML type? I still think supporting gbXML is useful as a base case.

    Here's a utility I've started playing with, not sure what it will evolve into, which takes IfcSpaces which have wall thickness gaps between them, and offsets the space surfaces as necessary to the midpoint of the wall thickness: https://github.com/IfcOpenShell/IfcOpenShell/commit/eb0f2de197c94e18d6eed83e56351e1c189e07ed

    Original:

    After cleanup tool:

    agonzalezesteveJesusbillcarlopavJQL
  • I've created a page https://wiki.osarch.org/index.php?title=Learn_about_environmental_analysis as part of a category of 'Analysis & Simulation'. So anything useful people can add to that category or improve in those pages would be great. https://wiki.osarch.org/index.php?title=Category:Analysis_and_Simulation

    CyrilCGR
  • edited December 2020

    @Moult said:
    One example would be to output to gbXML for OpenStudio, and another would be to output to Honeybee-JSON for Ladybug Tools / Pollination. I've heard that Honeybee-JSON addresses many of the shortcomings of gbXML, so @Cyril would you like to investigate that instead of inventing a new XML type? I still think supporting gbXML is useful as a base case.

    I've checked gbXML and Honeybee schemas and I think that the gbXML has more information available for HVAC. But for only geometry they're really similar, so the same exporter could be used.

    Honeybee uses the OpenStudio translator, that is the only software verified, and its SDK is my everyday tool.

    @Cyril said:
    I have created an Energy Modeling wiki page referencing many scientific articles or conference papers including some algorithm comparison for boundaries generation (graph, ray, polyhedron etc…).

    From this resources I conclude that the problem consists in the following steps:

    • Error detection, where Ifc Clash Detection could be used.
    • Space boundaries, that is a geometric problem and I should use the clipper library.
    • Geometry simplification, Space Boundary Tool uses a Geometry Simplification Tool that I haven't found.

    @ReD_CoDE said:
    You don't need reinvent the wheel, search IFC2Modelica

    Once the space boundaries are set, there are some scripts available to translate it to an energy model:

    @Moult said:
    Here's a utility I've started playing with, not sure what it will evolve into, which takes IfcSpaces which have wall thickness gaps between them, and offsets the space surfaces as necessary to the midpoint of the wall thickness: https://github.com/IfcOpenShell/IfcOpenShell/commit/eb0f2de197c94e18d6eed83e56351e1c189e07ed

    @Moult I'll take a look it. In my case, I did just the opposite, substracting wall thickness in an energy model for computing the air volume properly.

  • @Moult said:
    I've heard that Honeybee-JSON addresses many of the shortcomings of gbXML, so @Cyril would you like to investigate that instead of inventing a new XML type?

    No worry. Idea was not to reinvent the wheel. The produced xml is very close to IFC specifications and represent a very tiny part of the code. We easily can output to a different format easily. Honeybee schema might works. Also keep in mind that every national standard has its own requirements so output requires some adjustments. From my talk with some energy simulation software developers gbXML is implemented in various manner depending on which software produce it and all required data cannot be stored in it without extending the schema and no authoring software would handle it.

    @agonzalezesteve said:
    I've checked gbXML and Honeybee schemas and I think that the gbXML has more information available for HVAC. But for only geometry they're really similar, so the same exporter could be used.

    I had a look too. With honeybee schema you can extend data for some object which is very useful for local standards specific data. Example with space boundaries. Definition in gbXML (SpaceBoundary) is not extensible but Honeybee schema definition is (Face) which is better for Switzerland requirement as we need geometry for both internal and external faces.

    Honeybee uses the OpenStudio translator, that is the only software verified, and its SDK is my everyday tool.

    I would like to talk about this too. Are these tools are certified for your national standards (Spain I assume as you are from Barcelona) ?

    From this resources I conclude that the problem consists in the following steps:

    • Error detection, where Ifc Clash Detection could be used.
    • Space boundaries, that is a geometric problem and I should use the clipper library.

    Clipper is apparently for 2D only. From my understanding of publications polyhedron approach is the most promising approach (CBIP revised). CGAL might have some interesting algorithm in this regard.
    One of my colleague wondered if Topologic could not help too. Seeing HomeMaker at july meetup I also wondered if @brunopostle work could not help too.

    • Geometry simplification, Space Boundary Tool uses a Geometry Simplification Tool that I haven't found.

    Where do you see reference to this ? I have found CGAL in dependencies but no mention to Geometry Simplification Tool. All mention to simplification in source code seems to reference CGAL.

  • @Cyril said:
    I had a look too. With honeybee schema you can extend data for some object which is very useful for local standards specific data. Example with space boundaries. Definition in gbXML (SpaceBoundary) is not extensible but Honeybee schema definition is (Face) which is better for Switzerland requirement as we need geometry for both internal and external faces.

    @Cyril what about the Surface object?

    @Cyril said:
    I would like to talk about this too. Are these tools are certified for your national standards (Spain I assume as you are from Barcelona) ?

    SG Save uses OpenStudio and it's certified here in Spain.

    @Cyril said:
    Clipper is apparently for 2D only.

    It's true, but since OpenStudio works with polyhedron, surfaces are always polygons and 2D clipping algorithms are enough.

    @Cyril said:
    Where do you see reference to this ? I have found CGAL in dependencies but no mention to Geometry Simplification Tool. All mention to simplification in source code seems to reference CGAL.

    Here you have some references:

  • It would be great if some of this information could be added to https://wiki.osarch.org/index.php?title=Energy_Modeling

    agonzalezesteve
  • edited December 2020

    @Cyril said:
    One of my colleague wondered if Topologic could not help too. Seeing HomeMaker at july meetup I also wondered if @brunopostle work could not help too.

    Yes Topologic (and Homemaker/Topologise too, I added ifcrelspaceboundary to all IFC output, but don't have any way to test it) is perfectly suited to generating this simplified geometry of spaces and boundaries, but only if you are using it to generate the building elements in the first place. The hard problem is taking a collection of random building elements (a typical IFC file) and assembling them into logical spaces and boundaries.

    Some ideas:

    1. The problem with identifying spaces is that elements may overlap or have small gaps between them. We could create a simplified intermediate model by converting all building elements into a voxel grid (maybe 5cm voxels).
    2. Then, by 'growing' solid voxels it should be possible to create contiguous zones that represent the approximate position of both the space and boundary elements.
    3. At this point you would know how many 'spaces' there are and can find 3d points that are entirely within each space.
    4. Then for each space you could use a raytracing approach to identify all the IFC building elements that bound it. Raytracing would be slow, perhaps this would be quicker if the building elements were represented by voxels at this point.
    5. [edit] For the voxel approach you would check the adjacent voxels for each 'space1' voxel, and if they are IFC wall, slab or roof, then that element can be linked as a boundary for 'space1' etc..
    Cyril
  • How about the collision detection features? Having a virtual-robot going through the building (raytrace like) and making a graph from the ifc space informations? It has to go through door which are always adjacent to another Space.. all the space having to be within the overall building envelope. Out of an IFC file , have a AI/ML that would build the topology of the building. Having this Tree/Graph/Topologiy of the IFC, it would be easy to build new simplified spaces.. One new generated Building would be used for the Static Engineer, the next one for Energy analysis, the next one for the light-designer and so on ... each simulation could have its own simplified IFC-basis. At some point this ML/AI would be good enough to even name the room functions (detect whether it is a bathroom or a floor..). This would also help to convert one ifc to another , like a compatibility filter between ArchiCAD/Revit or Dialux/DDS-CAD or whatever.. a dream..

  • The tools that translate IFC to gbXML or creates 2n level space boundaries require that spaces should be generated in the authoring BIM tool.

    An algorithm to generate space boundaries for building energy simulation references Dimensional reduction of 3D building models using graph theory and its application in building energy simulation
    for creating IfcSpace based on building elements and is used for CFD.

  • @brunopostle said:

    The hard problem is taking a collection of random building elements (a typical IFC file) and assembling them into logical spaces and boundaries.

    I don't think so. What if we take the polygons of IfcWalls, IfcSlabs and IfcRoofs and intersect them? The intersection doesn't belong to a 1st level space boundary. Then, if we do XOR of all polygons, two polygons that share and edge belong to the same IfcSpace. What do you think?

    The problem is that an extra IfcSpace with the building envelope will be created but is easy to remove because it is the one with the biggest volume.

    Should I extract the geometry using the bpy or ifcopenshell library? Once I have the polygons vertices we could use the pyclipper library.

  • @agonzalezesteve I'm thinking of the building models that I encounter, where you can't rely on elements fitting perfectly without gaps between them, I've rarely seen an airtight 3d model.

    Also, these Boolean operations are very unreliable even when you take care to align objects, you would have to draw everything overlapping, whereas ifc models tend to be drawn with zero overlap - exactly the sort of geometry that causes problems for Boolean operations.

  • @brunopostle said:
    @agonzalezesteve I'm thinking of the building models that I encounter, where you can't rely on elements fitting perfectly without gaps between them, I've rarely seen an airtight 3d model.

    Also, these Boolean operations are very unreliable even when you take care to align objects, you would have to draw everything overlapping, whereas ifc models tend to be drawn with zero overlap - exactly the sort of geometry that causes problems for Boolean operations.

    If models are drawn with zero overlap, they can be drawn without gaps too, isn't it? In the worst case two IfcSpace will be merged.

    @agonzalezesteve said:
    What if we take the polygons of IfcWalls, IfcSlabs and IfcRoofs and intersect them? The intersection doesn't belong to a 1st level space boundary. Then, if we do XOR of all polygons, two polygons that share and edge belong to the same IfcSpace.

    I attach a script that does that in txt, because I cannot upload a py file, and a test file in ifc with an IfcWall an two IfcSlabs. It's not perfect but it seems to work.

    If we decide to follow this worklow, I would need help to define IfcSpace and IfcRelSpaceBoundary.

  • I share with you a script that's able to find the geometry of 1st level IfcRelSpaceBoundary and group them by the IfcSpace they should belong to. I've done it in a geometric/abstract way and it's time to create the ifc objects but I don't know how to do it. Some help @Cyril @Moult?

    @Cyril said:
    Clipper is apparently for 2D only. From my understanding of publications polyhedron approach is the most promising approach (CBIP revised). CGAL might have some interesting algorithm in this regard.

    I ended up using the pyclipper library because gives less errors than CGAL.

    Cyril
  • @agonzalezesteve said:
    I share with you a script that's able to find the geometry of 1st level IfcRelSpaceBoundary and group them by the IfcSpace they should belong to. I've done it in a geometric/abstract way and it's time to create the ifc objects but I don't know how to do it. Some help @Cyril @Moult?

    Nice. We can meet to figure this out. pm me your availabilities or join chat and mention me to make sure I see notification.

  • @agonzalezesteve I checked IFC documentation further about IfcSpace. It propose a 2D geometry representation and 3 possible 3D geometry representation. It would be great to have generate both 2D and 3D representation. 2D representation would allow to compute area and it would also be great to be able to choose at which height it has to be computed as it varies from a country to another.
    I discussed with @Moult about 3D representation. Considering you are generating faces the Body Brep Geometry is probably the best way to go. He said that in IFC4 IfcPolygonalFaceSet is better (I think this is because definition is simpler and has a smaller size) but it doesn't exist in IFC2X3 so in this case IfcFacetedBrep should be used.
    There is an example of how to generate both in BlenderBIM addon source code :

    agonzalezesteve
  • may be too late..because you are on your way to succeed.. from London and Creta

Sign In or Register to comment.