Coverage for bim2sim/plugins/PluginEnergyPlus/bim2sim_energyplus/examples/e2_complex_project_energyplus.py: 0%

29 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-03-12 17:09 +0000

1import tempfile 

2from pathlib import Path 

3 

4import bim2sim 

5from bim2sim import Project 

6from bim2sim.kernel.decision.decisionhandler import DebugDecisionHandler 

7from bim2sim.utilities.types import IFCDomain, LOD 

8 

9 

10def run_example_complex_building_energyplus(): 

11 """Run a building performance simulation with PluginEnergyPlus. 

12 

13 This example creates a BEPS simulation model and performs the simulation 

14 in Dymola based on the DigitalHub IFC using PluginTEASER. 

15 """ 

16 # Create a temp directory for the project, feel free to use a "normal" 

17 # directory 

18 project_path = Path( 

19 tempfile.TemporaryDirectory(prefix='bim2sim_example1').name) 

20 

21 # Set the ifc path to use and define which domain the IFC belongs to 

22 ifc_paths = { 

23 IFCDomain.arch: 

24 Path(bim2sim.__file__).parent.parent / 

25 'test/resources/arch/ifc/FM_ARC_DigitalHub_with_SB89.ifc', 

26 } 

27 

28 # Create a project including the folder structure for the project with 

29 # teaser as backend and no specified workflow (default workflow is taken) 

30 project = Project.create(project_path, ifc_paths, 'energyplus') 

31 

32 # specify simulation settings (please have a look at the documentation of 

33 # all under concepts/sim_settings 

34 

35 # Set the install path to your EnergyPlus installation according to your 

36 # system requirements 

37 # project.sim_settings.ep_install_path = 'C://EnergyPlusV9-4-0/' 

38 

39 # combine spaces to thermal zones based on their usage 

40 # use cooling 

41 project.sim_settings.cooling_tz_overwrite = True 

42 project.sim_settings.setpoints_from_template = True 

43 project.sim_settings.run_full_simulation = True 

44 

45 # overwrite existing layer structures and materials based on templates 

46 project.sim_settings.layers_and_materials = LOD.low 

47 # specify templates for the layer and material overwrite 

48 project.sim_settings.construction_class_walls = 'iwu_heavy' 

49 project.sim_settings.construction_class_windows = \ 

50 'Alu- oder Stahlfenster, Waermeschutzverglasung, zweifach' 

51 

52 # set weather file data 

53 project.sim_settings.weather_file_path = ( 

54 Path(bim2sim.__file__).parent.parent / 

55 'test/resources/weather_files/DEU_NW_Aachen.105010_TMYx.epw') 

56 # Run a simulation directly with dymola after model creation 

57 

58 # Select results to output: 

59 project.sim_settings.sim_results = [ 

60 "heat_demand_total", "cool_demand_total", 

61 "heat_demand_rooms", "cool_demand_rooms", 

62 "heat_energy_total", "cool_energy_total", 

63 "heat_energy_rooms", "cool_energy_rooms", 

64 "operative_temp_rooms", "air_temp_rooms", "air_temp_out", 

65 "internal_gains_machines_rooms", "internal_gains_persons_rooms", 

66 "internal_gains_lights_rooms", 

67 "heat_set_rooms", 

68 "cool_set_rooms" 

69 ] 

70 project.sim_settings.prj_use_conditions = (Path( 

71 bim2sim.__file__).parent.parent / 

72 "test/resources/arch/custom_usages/" 

73 "UseConditionsFM_ARC_DigitalHub.json") 

74 project.sim_settings.prj_custom_usages = (Path( 

75 bim2sim.__file__).parent.parent / 

76 "test/resources/arch/custom_usages/" 

77 "customUsagesFM_ARC_DigitalHub_with_SB89.json") 

78 # create plots based on the results after simulation 

79 project.sim_settings.create_plots = True 

80 

81 # # Run the project with pre configured answers for decisions 

82 space_boundary_genenerator = 'Other' 

83 handle_proxies = (*(None,) * 12,) 

84 construction_year = 2015 

85 answers = (space_boundary_genenerator, 

86 *handle_proxies, 

87 construction_year) 

88 handler = DebugDecisionHandler(answers) 

89 handler.handle(project.run()) 

90 

91 

92if __name__ == '__main__': 

93 run_example_complex_building_energyplus()