bim2sim.plugins.PluginComfort.bim2sim_comfort.task package

Submodules

bim2sim.plugins.PluginComfort.bim2sim_comfort.task.create_result_df module

class bim2sim.plugins.PluginComfort.bim2sim_comfort.task.create_result_df.CreateResultDF(playground)

Bases: CreateResultDF

This ITask creates a result dataframe for EnergyPlus Comfort BEPS.

Args:

idf: eppy idf

Returns:

df_final: final dataframe that holds only relevant data, with generic bim2sim names and index in form of MM/DD-hh:mm:ss

format_dataframe(df_original: DataFrame, zone_dict: dict) DataFrame

Formats the dataframe to generic bim2sim output structure.

This function:
  • adds the space GUIDs to the results

  • selects only the selected simulation outputs from the result

Args:

df_original: original dataframe directly taken from simulation zone_dict: dictionary with all zones, in format {GUID : Zone Usage}

Returns:

df_final: converted dataframe in bim2sim result structure

reads: Tuple[str] = ('idf', 'sim_results_path', 'elements', 'df_finals')
run(idf: ~geomeppy.idf.IDF, sim_results_path: ~pathlib.Path, elements: dict, df_finals: dict[slice(<class 'str'>, <class 'pandas.core.frame.DataFrame'>, None)])

Create a result DataFrame for EnergyPlus BEPS results.

This function transforms the EnergyPlus simulation results to the general result data format used in this bim2sim project. The simulation results stored in the EnergyPlus result file ( “eplusout.csv”) are shifted by one hour to match the simulation results of the modelica simulation. Afterwards, the simulation results are formatted to match the bim2sim dataframe format.

Args:

idf (IDF): eppy idf sim_results_path (Path): path to the simulation results from

EnergyPlus

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

holds preprocessed elements including space boundaries.

Returns:

df_finals (dict): dictionary in the format dict[str(project name): pd.DataFrame], final dataframe that holds only relevant data, with generic bim2sim names and index in form of MM/DD-hh:mm:ss

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

bim2sim.plugins.PluginComfort.bim2sim_comfort.task.ep_comfort_settings module

Export EnergyPlus Comfort Settings.

This module includes all functions for exporting Comfort Settings as EnergyPlus Input files (idf). Geometric preprocessing (includes EnergyPlus specific space boundary enrichment) and EnergyPlus Input File export must be executed before this module.

class bim2sim.plugins.PluginComfort.bim2sim_comfort.task.ep_comfort_settings.ComfortSettings(playground)

Bases: ITask

Create Comfort Settings for an EnergyPlus Input file.

Task to create Comfort Settings for an EnergyPlus Input file.

add_comfort_to_people_enrichment(idf: IDF, elements, use_dynamic_clothing=False)

Add comfort parameters to people objects in CreateIdf.

This method adds comfort parameters to people objects to the input eppy idf. Args:

idf: eppy idf elements: bim2sim elements use_dynamic_clothing: True if dynamic clothing (ASHRAE 55)

should be activated

add_comfort_to_people_manual(idf: IDF, elements, use_dynamic_clothing=False)

Manually add comfort parameters to people objects in CreateIdf.

This method manually adds comfort parameters to people objects to the input eppy idf. Args:

idf: eppy idf elements: bim2sim elements use_dynamic_clothing: True if dynamic clothing (ASHRAE 55)

should be activated

static add_comfort_variables(idf: IDF)

Add output variables for comfort measures to the input IDF file.

Args:

idf: eppy idf

static define_comfort_usage_dict()

Define a new set of comfort parameters per use condition.

This method defines hardcoded schedules for clothing, air velocity and work efficiency. Check values for applicability of these parameters. The resulting json file is written to bim2sim_comfort/assets/comfort_usage.json.

reads: Tuple[str] = ('elements', 'idf', 'sim_results_path')
static remove_duplicate_names(idf: IDF)

Test for duplicate idfobject names and remove objects.

EnergyPlus requires unique naming for IdfObjects, otherwise, the simulation crashes. To increase the robustness of the implementation, the idf is tested for duplicate names and duplicate objects are removed. This decreases the accuracy of the model, so the logging should be evaluated carefully for duplicate objects. With a suitable IFC input model quality, no duplicate names should be found.

Args:

idf: eppy idf

static remove_empty_zones(idf: IDF)

Remove empty zones and zonegroups from idf.

Depending on the quality of the input ifc and their space boundaries, empty thermal zones may be created (or be left after corrections) in the resulting idf. This raises errors in thermal comfort simulation. This method evaluates if a thermal zone has surfaces in idf, and removes the zone from zonelists and zonegroups.

Args:

idf: eppy idf

run(elements: dict, idf: IDF, sim_results_path: Path)

Execute all methods to export comfort parameters to idf.

Execute all methods to export comfort parameters to idf. Args:

elements: bim2sim elements idf: eppy idf sim_results_path (Path): path to simulation results.

static set_day_week_year_limit_schedule(idf: IDF, schedule: list[float], schedule_name: str, limits_name: str = 'Any Number')

Set day, week and year schedule (hourly).

This function sets an hourly day, week and year schedule.

Args:

idf: idf file object schedule: list of float values for the schedule (e.g.,

temperatures, loads)

schedule_name: str limits_name: str, defaults set to ‘Any Number’

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

bim2sim.plugins.PluginComfort.bim2sim_comfort.task.ep_comfort_visualization module

Visualize EnergyPlus Comfort Results.

This module includes all functions for visualization of Comfort Results. Geometric preprocessing (includes EnergyPlus specific space boundary enrichment), EnergyPlus Input File export and EnergyPlus simulation must be executed before this module.

class bim2sim.plugins.PluginComfort.bim2sim_comfort.task.ep_comfort_visualization.ComfortVisualization(playground)

Bases: ITask

Visualize Comfort Results of an EnergyPlus Simulation.

Task to Visualize EnergyPlus Comfort Measures.

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

Execute all methods to visualize comfort results.

static visualize_calendar(df, year='', color_only=False, save_as='', construction='', skip_legend=False, add_title=False)
static visualize_comfort(spaces, mean_temp_df)

bim2sim.plugins.PluginComfort.bim2sim_comfort.task.ep_load_idf module

class bim2sim.plugins.PluginComfort.bim2sim_comfort.task.ep_load_idf.LoadIdf(playground)

Bases: ITask

Load the IDF file of an EnergyPlus Simulation.

Task to Load an IDF file from a previous BIM2SIM execution from project directory.

run(workflow)

Execute all methods to load an existing IDF file.

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

bim2sim.plugins.PluginComfort.bim2sim_comfort.task.plot_comfort_results module

class bim2sim.plugins.PluginComfort.bim2sim_comfort.task.plot_comfort_results.PlotComfortResults(playground)

Bases: PlotBEPSResults

apply_en16798_to_all_zones(df, zone_dict, export_path, use_NA=True)

Generate EN 16798 diagrams for all thermal zones.

Args:

df: input dataframe zone_dict: zone name dictionary export_path: export path for result plots use_NA: use national appendix (Germany)

Returns:

dataframe holding the adaptive comfort categories, dataframe holding the comfort categories for occupied hours, dataframe holding the number of occupied hours per category

apply_en16798_to_single_zone(df, zone_dict, export_path, zone_guid, use_NA=True)

Generate EN 16798 diagrams for a single thermal zones.

Args:

df: input dataframe zone_dict: zone name dictionary export_path: export path for result plots zone_guid: GUID of zone that should be analyzed use_NA: use national appendix (Germany)

Returns:

dataframe holding the adaptive comfort categories, dataframe holding the comfort categories for occupied hours, dataframe holding the number of occupied hours per category

calc_exceeded_temperature_hours(df, reference, limit)

Calculate temperature exceeding occurrence.

Returns a tuple, consisting of the number of timesteps that exceed the limit and the sum of all differences exceeding the limit.

Args:

df: temperature dataframe reference: reference temperature value limit: limit temperature based on reference value

Returns:

num_timesteps_exceeding, sum_difference_exceeding_limit

final = True
get_exceeded_temperature_hours(df, min_limit, max_limit, ref_value)

Get all entries of the dataframe where temperature is exceeded. Args:

df: original dataframe min_limit: minimum temperature limit max_limit: maximum temperature limit ref_value: reference temperature

Returns:

df with all entries below the min_limit, df_with all entries above the max_limit

limited_local_comfort_DIN16798_NA(df, elements, export_path, occupied=True)

Calculate a limited local comfort using surface temperatures from EnergyPlus and limits from DIN EN 16798-1 (National Appendix). Args:

df: result dataframe elements: bim2sim elements export_path: export path for result plots and data occupied: True if only occupied states should be evaluated

Returns:

plot_en16798_adaptive_count_NA(df, guid, room_name, export_path)

Plot EN 16798 German National Appendix for a single thermal zone.

Apply limits of German National Appendix.

static plot_new_en16798_adaptive_count(df, guid, room_name, export_path)

Plot EN 16798 diagram for thermal comfort categories for a single thermal zone.

static pmv_plot(df, save_path, file_name)
reads: Tuple[str] = ('df_finals', 'sim_results_path', 'ifc_files', 'elements')
static rename_duplicates(dictionary)
rename_zone_usage(zone_dict, zone_dict_ifc_names, rename_keys, sim_results_path, rename_duplicates=False)
run(df_finals: dict, sim_results_path: Path, ifc_files: List[Path], elements: dict)

Plots the results for BEPS simulations.

This holds pre configured functions to plot the results of the BEPS simulations with the EnergyPlus-based PluginComfort .

Args:
df_finals: dict of final results where key is the building name and

value is the dataframe holding the results for this building

sim_results_path: base path where to store the plots ifc_files: bim2sim IfcFileClass holding the ifcopenshell ifc instance elements (dict): Dictionary of building elements.

static table_bar_plot_16798(df, export_path, tag='', normalize=True, unit='', unit_name='', y_scale='linear')

Create bar plot with a table below for EN 16798 thermal comfort.

This function creates a bar plot with a table below along with the thermal comfort categories according to EN 16798. This table considers all hours of the day, not only the occupancy hours.

static visualize_calendar(calendar_df, export_path, year='', color_only=False, save=True, save_as='', construction='', skip_legend=False, add_title=False, figsize=[7.6, 8], zone_dict=None, resample_type='mean', guid='')
static visualize_heatmap(df, col, export_path, save_as='', add_title=False, save=True, zone_dict='', year='', color_categories='', guid='')

Visualize heatmap of Fanger PMV. Args:

df: Input dataframe with PMV data col: PMV column export_path: plot export path save_as: prefix for saving files add_title: True if title should be added to plot save: True if plot should be saved instead of displayed zone_dict: dictionary to rename the space names year: string to add the value of the year color_categories: select ‘PMV’, ‘PPD’. Standard heatmap is applied if left blank guid: plot individual space GUID

Returns: