bim2sim.tasks.bps package

Submodules

bim2sim.tasks.bps.combine_tz module

class bim2sim.tasks.bps.combine_tz.CombineThermalZones(playground)

Bases: ITask

Combine thermal zones to reduce the amount of thermal zones.

As the zoning of simulation models is a time-consuming task we decided to automate it with the tasks. This task will combine multiple thermal zones into one zone based on the criteria selected in the simulation type settings and the decisions made. We do this by giving the user multiple criteria to select from:

  • External/Internal

  • Orientation

  • Usage

  • Window to wall ratio

combine_tzs_based_on_criteria(thermal_zones: list, elements: dict)

groups together all the thermal zones based on selected criteria (answer)

static combine_tzs_to_one_zone(thermal_zones, elements)

groups together all the thermal zones as one building

static discard_1_element_groups(grouped)

discard 1 element group, since a group only makes sense if it has more than 1 thermal zone

static external_orientation_group(value)

locates external orientation value on one of two groups: * S-W * N-E

static glass_percentage_group(value)

locates glass percentage value on one of four groups based on Norm DIN_V_18599_1 * 0-30% * 30-50% * 50-70% * 70-100%

classmethod group_by_external_orientation(thermal_zones: list) dict

groups together the thermal zones based on external_orientation criterion

classmethod group_by_glass_percentage(thermal_zones: list) dict

groups together the thermal zones based on glass percentage criterion

classmethod group_by_is_external(thermal_zones: list) dict

groups together the thermal zones based on is_external criterion

classmethod group_by_is_neighbor(thermal_zones: list) dict

groups together the thermal zones based on is_neighbor criterion

classmethod group_by_usage(thermal_zones: list) dict

groups together the thermal zones based on usage criterion

classmethod group_grouped_tz(grouped_thermal_zones: dict, group_function) dict

groups together thermal zones, that were already grouped in previous steps

static group_not_grouped_tz(grouped_thermal_zones: dict, thermal_zones)

groups together thermal zones, that are not already grouped in previous steps based on Norm DIN_V_18599_1

classmethod group_thermal_zones_by_is_external(thermal_zones: list)

groups together the thermal zones based on mixed criteria: * is_external

classmethod group_thermal_zones_by_is_external_and_orientation(thermal_zones: list)

groups together the thermal zones based on mixed criteria * is_external * orientation criteria

classmethod group_thermal_zones_by_is_external_orientation_and_usage(thermal_zones: list)

groups together the thermal zones based on mixed criteria: * is_external * usage * orientation criteria

classmethod group_thermal_zones_by_usage(thermal_zones: list)

groups together the thermal zones based on mixed criteria * usage

classmethod group_thermal_zones_by_use_all_criteria(thermal_zones: list)

groups together the thermal zones based on mixed criteria: * is_external * usage * external_orientation * glass percentage * neighbors criterion * not grouped tz

reads: Tuple[str] = ('elements',)
run(elements)

Run tasks.

bim2sim.tasks.bps.disaggr_creation module

class bim2sim.tasks.bps.disaggr_creation.DisaggregationCreationAndTypeCheck(playground)

Bases: ITask

Disaggregation of elements, run() method holds detailed information.

create_disaggregation_with_type_correction(element, sbs: list[SpaceBoundary]) BPSProductWithLayers

Creates a disaggregation for an element including type correction.

Args:

element (BPSProductWithLayers): The element to disaggregate. sbs (list[SpaceBoundary]): List of space boundaries associated with

the element.

Returns:
BPSProductWithLayers: The disaggregated element with the correct

type.

get_corrected_door_type(element, sbs) Type[InnerDoor] | Type[OuterDoor] | None

Gets the correct door type based on space boundary information.

Args:

element (BPSProductWithLayers): The element to check. sbs (list[SpaceBoundary]): List of space boundaries associated with

the element.

Returns:

type: The correct door type or None if not applicable.

get_corrected_slab_type(element, sbs)

Gets the correct slab type based on space boundary information.

Args:

element (BPSProductWithLayers): The element to check. sbs (list[SpaceBoundary]): List of space boundaries associated with

the element

Returns:

type: The correct wall type or None if not applicable.

get_corrected_wall_type(element, sbs) Type[InnerWall] | Type[OuterWall] | None

Gets the correct wall type based on space boundary information.

Args:

element (BPSProductWithLayers): The element to check. sbs (list[SpaceBoundary]): List of space boundaries associated with

the element.

Returns:

type: The correct wall type or None if not applicable.

reads: Tuple[str] = ('elements',)
run(elements)

Disaggregates building elements based on their space boundaries.

This task disaggregates the building elements like walls, slabs etc. based on their SpaceBoundaries. This is needed for two reasons: 1. If e.g. a BaseSlab in IFC is modeled as one element for whole

building but only parts of this BaseSlab have contact to ground, we can split the BaseSlab based on the space boundary information into single parts that hold the correct boundary conditions and material layer information in the later simulation.

  1. In TEASER we use CombineThermalZones Task to combine multiple

ThermalZone elements into AggregatedThermalZones to improve simulation speed and accuracy. For this we need to split all elements into the parts that belong to each ThermalZone.

This Task also checks and corrects the type of the non disaggregated elements based on their SpaceBoundary information, because sometimes the predefined types in IFC might not be correct.

Args:

elements (dict): Dictionary of building elements to process.

type_correction_not_disaggregation(element, sbs: list[SpaceBoundary])

Performs type correction for non disaggregated elements.

Args:

element (BPSProductWithLayers): The element to correct. sbs (list[SpaceBoundary]): List of space boundaries associated with

the element.

bim2sim.tasks.bps.enrich_material module

class bim2sim.tasks.bps.enrich_material.EnrichMaterial(playground)

Bases: ITask

Enriches material properties that were recognized as invalid LOD.layers = Medium & Full

create_layer_set_from_template(element_template: dict, material_template: dict) LayerSet

Create layer set from template including layers and materials.

static create_material_from_template(material_template: dict) Material

Creates a material from template.

create_new_layer_sets_and_materials(elements: dict, element_templates: dict, material_template: dict)

Create a new layer set including layers and materials.

This creates a completely new layer set, including the relevant layers and materials. Materials are only created once, even if they occur in multiple layer sets/layers. Additionally, some information on element level are overwritten with data from the templates, like inner_convection etc.

static enrich_element_data_from_template(element_template: dict) dict

Get all element level enrichment data from templates.

static get_material_templates(attrs: dict | None = None) dict

get dict with the material templates and its respective attributes

get_templates(elements: dict) object

Get templates for elements and materials.

Args:

elements: dict[guid: element] of bim2sim elements

Returns:
element_templates (dict): Holds enrichment templates for each
Building with layer set information and material reference for

different BPSProducts

material_templates (dict): Holds information about physical

attributes for each material referenced in the element_templates

get_templates_for_buildings(buildings: list, sim_settings: BuildingSimSettings) dict

Return template for each building based on year of construction.

mapping_templates_bim2sim = {'Floor': ['InnerFloor', 'InnerFloorDisaggregated'], 'GroundFloor': ['GroundFloor', 'GroundFloorDisaggregated'], 'InnerDoor': ['InnerDoor', 'InnerDoorDisaggregated'], 'InnerWall': ['InnerWall', 'InnerWallDisaggregated'], 'OuterDoor': ['OuterDoor', 'OuterDoorDisaggregated'], 'OuterWall': ['OuterWall', 'OuterWallDisaggregated'], 'Roof': ['Roof'], 'Window': ['Window']}
reads: Tuple[str] = ('elements',)
run(elements: dict)

Enriches materials and layer sets of building elements.

Enrichment data in the files MaterialTemplates.json and TypeBuildingElements.json is taken from TEASER. The underlying data comes from IWU data. For more detailed information please review TEASER code documentation: https://rwth-ebc.github.io/TEASER//master/docs/index.html

bim2sim.tasks.bps.enrich_use_cond module

class bim2sim.tasks.bps.enrich_use_cond.EnrichUseConditions(playground)

Bases: ITask

Enriches Use Conditions of thermal zones based on decisions and translation of zone names

classmethod enrich_usages(pattern_usage: dict, thermal_zones: Dict[str, ThermalZone]) Dict[str, ThermalZone]

Sets the usage of the given thermal_zones and enriches them.

Looks for fitting usages in assets/enrichment/usage based on the given usage of a zone in the IFC. The way the usage is obtained is described in the ThermalZone classes attribute “usage”. The following data is taken into account:

commonUsages.json: typical translations for the existing usage data customUsages<prj_name>.json: project specific translations that can

be stored for easier simulation.

Args:

pattern_usage: Dict with custom and common pattern thermal_zones: dict with tz elements guid as key and the element itself as value

Returns:

final_usages: key: str of usage type, value: ThermalZone element

static list_decision_usage(tz: ThermalZone, choices: list) ListDecision

decision to select an usage that matches the zone name

Args:

tz: bim2sim ThermalZone element choices: list of possible answers

Returns:

usage_decision: ListDecision to find the correct usage

load_usage(tz: ThermalZone)

loads the usage of the corresponding ThermalZone.

Loads the usage from the statistical data in assets/enrichment/usage.

Args:

tz: bim2sim ThermalZone element

static office_usage(tz: ThermalZone) str | list

function to determine which office usage is best fitting”

The used enrichment for usage conditions come from DIN 18599-10. This standard offers 3 types of office usages: * Single office (1 workplace) * Group office (2 - 6 workplaces) * Open open offices (> 6 workplaces)

Based on the standards given medium occupancy density the following area sections are defined. * Single office < 14 m2 * Group office [14m2; 70 m2]

(70 m² is lower bound from open plan office)

  • Open plan office > 70 m²

Args:

tz: bim2sim thermalzone element

Returns

matching usage as string or a list of str of no fitting usage could be found

reads: Tuple[str] = ('elements',)
run(elements: dict)

Enriches Use Conditions of thermal zones.

Enrichment data in the files commonUsages.json and UseConditions.json is taken from TEASER. The underlying data comes from DIN 18599-10 and SIA 2024.

static set_heating_cooling(tz_elements: dict, sim_settings)

set cooling and heating values based on simulation settings

static value_processing(value)

bim2sim.tasks.bps.plot_results module

class bim2sim.tasks.bps.plot_results.PlotBEPSResults(playground)

Bases: ITask

Class for plotting results of BEPS.

This class provides methods to create various plots including time series and bar charts for energy consumption and temperatures.

static create_color_mapping(min_val: float, max_val: float, med_val: float, sim_results_path: Path, storey_guid: str)

Create a colormap from blue to red and save it as an SVG file.

Args:

min_val (float): Minimum value for the colormap range. max_val (float): Maximum value for the colormap range. med_val (float): medium value for the colormap range. sim_results_path (Path): Path to the simulation results file. storey_guid (str): GUID of storey to create color mapping for.

Returns:

LinearSegmentedColormap: Created colormap object.

final = True
static get_color_for_value(value, min_val, max_val, cmap)

Get the color corresponding to a value within the given colormap.

Args:

value (float): Value for which the corresponding color is requested. min_val (float): Minimum value of the colormap range. max_val (float): Maximum value of the colormap range. cmap (LinearSegmentedColormap): Colormap object.

Returns:
str: Hexadecimal representation of the color corresponding to the

value.

static plot_dataframe(df: DataFrame, save_path: Path | None = None, file_name: str | None = None, plot_title: str = '', legend_title: str = '', x_axis_title: str = '', y_axis_title: str = '', file_type='svg', rename_columns_dict: dict = {}, logo: bool = True, window: int = 12, fig_size: Tuple[int, int] = (10, 6), dpi: int = 300) None

Plot data from dataframe in one plot.

Parameters:

df (pd.DataFrame): DataFrame containing the data to plot. save_path (Optional[Path]): Path to save the plot as a PDF file. file_name (str): file name for the new plot plot_title (str): title of the plot. legend_title (str): title of legend. x_axis_title (str): title of x-axis. y_axis_title (str): title of y-axis. file_type (str): file type for figure export. Defaults to “svg” rename_columns_dict (dict): Dictionary to rename columns logo (bool): Whether to include a logo in the plot. window (int): Rolling window size for smoothing the data. fig_size (Tuple[int, int]): Size of the figure. dpi (int): Dots per inch for the plot resolution.

static plot_demands_bar(df: DataFrame, save_path: Path | None = None, logo: bool = True, total_label: bool = True, fig_size: Tuple[int, int] = (10, 6), dpi: int = 300, title: str | None = None) None

Plot monthly energy consumption as bar chart.

Args:

df (pd.DataFrame): DataFrame containing energy consumption data. save_path (Optional[Path]): Path to save the plot. If None, the

plot will be displayed.

logo (bool): Whether to add a logo to the plot. total_label (bool): Whether to add total energy labels to the

legend.

fig_size (Tuple[int, int]): Figure size in inches. dpi (int): Dots per inch for the figure. title (Optional[str]): Title of the plot.

static plot_demands_time_series(df: DataFrame, demand_type: List[str], save_path: Path | None = None, logo: bool = True, total_label: bool = True, window: int = 12, fig_size: Tuple[int, int] = (10, 6), dpi: int = 300, title: str | None = None) None

Plot time series of energy demands.

Args:

df (pd.DataFrame): DataFrame containing demand data. demand_type (List[str]): List of demand types to plot (“Heating” and/or “Cooling”). save_path (Optional[Path]): Path to save the plot. If None, the plot will be displayed. logo (bool): Whether to add a logo to the plot. total_label (bool): Whether to add total energy labels to the legend. window (int): Window size for rolling mean calculation. fig_size (Tuple[int, int]): Figure size in inches. dpi (int): Dots per inch for the figure. title (Optional[str]): Title of the plot.

plot_floor_plan_with_results(df: DataFrame, elements, result_str, ifc_file: IfcFileClass, plot_path: Path, min_space_area: float = 2, area_specific: bool = True)

Plot a floor plan colorized based on specific heat demand.

The plot colors each room based on the specific heat demand, while blue is the color for minimum heat demand and red for maximum.

Args:

df (DataFrame): The DataFrame containing sim result data. elements (dict[guid: element]): dict hat holds bim2sim elements result_str (str): one of sim_results settings that should be

plotted. Currently, always max() of this is plotted.

ifc_file (IfcFileClass): bim2sim IfcFileClass object. plot_path (Path): Path to store simulation results. min_space_area (float): minimal area in m² of a space that should

be taken into account for the result calculation in the plot.

area_specific (bool): True if result_str values should be divided

by area to get valuer per square meter.

TODO: this is currently not working for aggregated zones. Combined zones, how to proceed:

  • All rooms in the combined zone are given the same color and

    the same value

  • Rooms need names in the plot

  • Legend in the margin showing which room name belongs to which

    zone

Generally revise: - Unit in the color mapping plot and in the plot for numerical

values

static plot_multiple_temperatures(df: DataFrame, save_path: Path | None = None, logo: bool = True, window: int = 12, fig_size: Tuple[int, int] = (10, 6), dpi: int = 300) None

Plot multiple temperature series in one plot.

Parameters:

df (pd.DataFrame): DataFrame containing the temperature data to plot. save_path (Optional[Path]): Path to save the plot as a PDF file. logo (bool): Whether to include a logo in the plot. window (int): Rolling window size for smoothing the data. fig_size (Tuple[int, int]): Size of the figure. dpi (int): Dots per inch for the plot resolution.

static plot_temperatures(df: DataFrame, data: str, save_path: Path | None = None, logo: bool = True, window: int = 12, fig_size: Tuple[int, int] = (10, 6), dpi: int = 300) None

Plot temperatures.

plot_thermal_discomfort()
plot_total_consumption(df: DataFrame, plot_path: Path) None

Plot total consumption for heating and cooling.

Args:

df (pd.DataFrame): DataFrame containing consumption data. plot_path (Path): Path to save the plots.

reads: Tuple[str] = ('df_finals', 'sim_results_path', 'ifc_files', 'elements')
run(df_finals: dict, sim_results_path: Path, ifc_files: List[Path], elements: dict) None

Run the plotting process for BEPS results.

Args:
df_finals (dict): Dictionary of DataFrames containing final

simulation results.

sim_results_path (Path): Path to save simulation results. ifc_files (List[Path]): List of IFC file paths. elements (dict): Dictionary of building elements.

static save_or_show_plot(save_path: Path | None, dpi: int, format: str = 'pdf') None

Save or show the plot depending on whether a save path is provided.

Args:
save_path (Optional[Path]): Path to save the plot. If None, the

plot will be displayed.

dpi (int): Dots per inch for the saved figure. format (str): Format to save the figure in.

bim2sim.tasks.bps.sb_2b_generation module

class bim2sim.tasks.bps.sb_2b_generation.AddSpaceBoundaries2B(playground)

Bases: ITask

Fill gaps in set of space boundary per space with 2B space boundaries.

static create_2b_space_boundaries(faces: list[TopoDS_Face], space_obj: ThermalZone) dict[slice(<class 'str'>, <class 'bim2sim.elements.bps_elements.SpaceBoundary2B'>, None)]

Create new 2b space boundaries.

Create a new 2b space boundary for each face in the list and assign it to the space instance.

Args:

faces: list of TopoDS_Face space_obj: ThermalZone instance

Returns:

dict[guid: SpaceBoundary2B]

reads: Tuple[str] = ('elements',)
run(elements: dict) dict

Create 2b space boundaries to fill gaps in spaces.

This task generates space boundaries of type 2b to fill gaps in the space surrounding space boundaries. The resulting set of space boundaries forms a watertight shape.

Args:
elements (dict): dictionary in the format dict[guid: element],

holds preprocessed elements including space boundaries.

Returns:
elements (dict): dictionary in the format dict[guid: element],

holds preprocessed elements including space boundaries and generated 2b space boundaries.

touches: Tuple[str] = ('elements',)

bim2sim.tasks.bps.sb_correction module

Geometric Correction of Space Boundaries.

This module contains all functions for geometric preprocessing of the BIM2SIM Elements that are relevant for exporting EnergyPlus Input Files and other BPS applications. Geometric preprocessing mainly relies on shape manipulations with OpenCascade (OCC). This module is prerequisite for the BIM2SIM PluginEnergyPlus. This module must be executed before exporting the EnergyPlus Input file.

class bim2sim.tasks.bps.sb_correction.CorrectSpaceBoundaries(playground)

Bases: ITask

Advanced geometric preprocessing for Space Boundaries.

This class includes all functions for advanced geometric preprocessing required for high level space boundary handling, e.g., required by EnergyPlus export. See detailed explanation in the run function below.

add_and_split_bounds_for_shadings(elements: dict, add_shadings: bool, split_shadings: bool)

Add and split shading boundaries.

Enrich elements by space boundaries related to an ExternalSpatialElement if shadings are to be added in the energyplus workflow.

Args:

elements: dict[guid: element] add_shadings: True if shadings shall be added split_shadings: True if shading boundaries should be split in

non-convex boundaries

static create_copy_of_space_boundary(bound: SpaceBoundary) SpaceBoundary

Create a copy of a SpaceBoundary instance.

This function creates a copy of a space boundary and deletes the cached properties bound_center and bound_normal. These properties are recomputed at the next usage of this attribute. This function can be used when the original geometry of the space boundary is modified. The new SpaceBoundary has its own unique guid.

Args:

bound: SpaceBoundary

create_new_convex_bounds(convex_shapes: list[TopoDS_Shape], bound: SpaceBoundary | SpaceBoundary2B, related_bound: SpaceBoundary | None = None)

Create new convex space boundaries.

This function creates new convex space boundaries from non-convex space boundary shapes. As for heat transfer the corresponding boundaries need to have same surface area and same number of vertices, corresponding boundaries must be split up the same way. Thus, the bound itself and the corresponding boundary (related_bound) are treated equally here.

Args:

convex_shapes: List[convex TopoDS_Shape] bound: either SpaceBoundary or SpaceBoundary2B related_bound: None or SpaceBoundary (as SpaceBoundary2B do not have a related_bound)

static fix_surface_orientation(elements: dict)

Fix orientation of space boundaries.

Fix orientation of all surfaces but openings by sewing followed by disaggregation. Fix orientation of openings afterwards according to orientation of parent bounds.

Args:

elements: dict[guid: element]

static move_children_to_parents(elements: dict)

Move child space boundaries to parent boundaries.

In some IFC, the opening boundaries of external wall boundaries are not coplanar. This function moves external opening boundaries to related parent boundary (e.g. wall).

Args:

elements: dict[guid: element]

reads: Tuple[str] = ('elements',)
run(elements)

Geometric preprocessing for BPS.

This module contains all functions for geometric preprocessing of the BIM2SIM Elements that are relevant for exporting BPS Input Files within the Plugins EnergyPlus, Comfort and TEASER. This geometric preprocessing mainly relies on shape manipulations with OpenCascade (OCC). This task starts with linking the space boundaries to the dictionary of elements. Additionally, geometric preprocessing operations are executed, like moving opening elements to their parent surfaces ( unless they are already coplanar), the surface orientation of space boundaries are fixed, and non-convex boundaries are fixed.

Args:
elements (dict): dictionary in the format dict[guid: element],

Dictionary of elements generated in previous IFC-based setup and enrichment tasks. In this task, the elements are enriched with the geometric preprocessed space_boundary items.

space_boundaries (dict): dictionary in the format dict[guid:

SpaceBoundary], dictionary of IFC-based space boundary elements.

split_non_convex_bounds(elements: dict, split_bounds: bool)

Split non-convex space boundaries.

This function splits non-convex shapes of space boundaries into convex shapes. Convex shapes may be required for shading calculations in Energyplus.

Args:

elements: dict[guid: element] split_bounds: True if non-convex space boundaries should be split up

into convex shapes.

split_non_convex_shadings(elements: dict, spatial_bounds: list[SpaceBoundary])

Split non_convex shadings to convex shapes.

Args:

elements: dict[guid: element] spatial_bounds: list of SpaceBoundary, that are connected to an

ExternalSpatialElement

bim2sim.tasks.bps.sb_creation module

class bim2sim.tasks.bps.sb_creation.CreateSpaceBoundaries(playground)

Bases: ITask

Create space boundary elements from ifc.

See run function for further information on this module.

static add_bounds_to_elements(elements: dict, space_boundaries: dict[str, SpaceBoundary])

Add space boundaries to elements.

This function adds those space boundaries from space_boundaries to elements. This includes all space boundaries included in space_boundaries, which bound an IfcSpace. The space boundaries which have been excluded during the preprocessing in the kernel are skipped by only considering boundaries from the space_boundaries dictionary.

Args:

elements: dict[guid: element] space_boundaries: dict[guid: SpaceBoundary]

static connect_element_to_zone(thermal_zone: ThermalZone, bound_element: IFCBased)

Connects related building element and corresponding thermal zone.

This function connects a thermal zone and its IFCBased related building elements.

Args:

thermal_zone: ThermalZone bound_element: BIM2SIM IFCBased element

connect_space_boundaries(space_boundary: SpaceBoundary, relating_space: ThermalZone, elements: dict[str, IFCBased])

Connect space boundary with relating space.

Connects resulting space boundary with the corresponding relating space (i.e., ThermalZone) and related building element (if given).

Args:

space_boundary: SpaceBoundary relating_space: ThermalZone (relating space) elements: dict[guid: element]

static get_opening_boundary(this_boundary: SpaceBoundary, this_space: ThermalZone, opening_elem: Window | Door, max_wall_thickness=0.3) SpaceBoundary | None

Get related opening boundary of another space boundary.

This function returns the related opening boundary of another space boundary.

Args:

this_boundary: current element of SpaceBoundary this_space: ThermalZone element opening_elem: BIM2SIM element of Window or Door. max_wall_thickness: maximum expected wall thickness in the building.

Space boundaries of openings may be displaced by this distance.

Returns:

opening_boundary: Union[SpaceBoundary, None]

get_parents_and_children(sim_settings: BaseSimSettings, boundaries: list[SpaceBoundary], elements: dict, opening_area_tolerance=0.01) dict[str, SpaceBoundary]

Get parent-children relationships between space boundaries.

This function computes the parent-children relationships between IfcElements (e.g. Windows, Walls) to obtain the corresponding relationships of their space boundaries.

Args:

sim_settings: BIM2SIM EnergyPlus simulation settings boundaries: list of SpaceBoundary elements elements: dict[guid: element] opening_area_tolerance: Tolerance for comparison of opening areas.

Returns:

bound_dict: dict[guid: element]

Get related opening elements of current building element.

This function returns all opening elements of the current related building element which is related to the current space boundary.

Args:

bound_element: BIM2SIM building element (e.g., Wall, Floor, …) elements: dict[guid: element]

Returns:

related_opening_elems: list of Window and Door elements

instantiate_space_boundaries(entities_dict: dict, elements: dict, finder: ~bim2sim.elements.mapping.finder.TemplateFinder, create_external_elements: bool, ifc_units: dict[str, <pint.registry.UnitRegistry object at 0x7fa102dfeb90>]) List[RelationBased]

Instantiate space boundary ifc_entities.

This function instantiates space boundaries using given element class. Result is a list with the resulting valid elements.

Args:

entities_dict: dict of Ifc Entities (as str) elements: dict[guid: element] finder: BIM2SIM TemplateFinder create_external_elements: bool, True if external spatial elements

should be considered for space boundary setup

ifc_units: dict of IfcMeasures and Unit (ureg)

Returns:

list of dict[guid: SpaceBoundary]

reads: Tuple[str] = ('ifc_files', 'elements')
static reassign_opening_bounds(this_boundary: SpaceBoundary, opening_boundary: SpaceBoundary, bound_element: Element, drop_list: dict[str, SpaceBoundary], max_wall_thickness=0.3, angle_tolerance=0.1) tuple[SpaceBoundary, dict[str, SpaceBoundary]]

Fix assignment of parent and child space boundaries.

This function reassigns the current opening bound as an opening boundary of its surrounding boundary. This function only applies if the opening boundary has the same surface area as the assigned parent surface. HACK: Some space boundaries have inner loops which are removed for vertical bounds in calc_bound_shape (elements.py). Those inner loops contain an additional vertical bound (wall) which is “parent” of an opening. EnergyPlus does not accept openings having a parent surface of same size as the opening. Thus, since inner loops are removed from shapes beforehand, those boundaries are removed from “elements” and the openings are assigned to have the larger boundary as a parent.

Args:

this_boundary: current element of SpaceBoundary opening_boundary: current element of opening SpaceBoundary (

related to BIM2SIM Window or Door)

bound_element: BIM2SIM building element (e.g., Wall, Floor, …) drop_list: dict[str, SpaceBoundary] with SpaceBoundary elements

that have same size as opening space boundaries and therefore should be dropped

max_wall_thickness: maximum expected wall thickness in the building.

Space boundaries of openings may be displaced by this distance.

angle_tolerance: tolerance for comparison of surface normal angles.

Returns:
rel_bound: New parent boundary for the opening that had the same

geometry as its previous parent boundary

drop_list: Updated dict[str, SpaceBoundary] with SpaceBoundary

elements that have same size as opening space boundaries and therefore should be dropped

static remove_elements_without_sbs(elements)

Remove elements that hold no Space Boundaries.

Those elements are usual not relevant for the simulation.

run(ifc_files, elements)

Run tasks.