Coverage for bim2sim/plugins/PluginComfort/bim2sim_comfort/examples/e1_simple_project_comfort_energyplus.py: 0%

22 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, run_project, ConsoleDecisionHandler 

6from bim2sim.utilities.types import IFCDomain, LOD 

7 

8 

9def run_example_1(): 

10 """Run a thermal comfort analysis with EnergyPlus backend. 

11 

12 This example runs a Thermal Comfort Analysis with the EnergyPlus backend. 

13 Specifies project directory and location of the IFC file. Then, it creates 

14 a bim2sim project with the Thermal Comfort backend that builds on the 

15 EnergyPlus backend. Workflow settings are specified (here, the zoning setup 

16 is specified to be with a full level of detail: each IfcSpace is 

17 represented by a single thermal Zone in EnergyPlus), before the project 

18 is executed with the previously specified settings. 

19 """ 

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

21 # directory 

22 project_path = Path(tempfile.TemporaryDirectory( 

23 prefix='bim2sim_comfort_e1').name) 

24 

25 # Get path of the IFC Building model that is used for this example 

26 ifc_paths = { 

27 IFCDomain.arch: 

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

29 'test/resources/arch/ifc/AC20-FZK-Haus.ifc' 

30 } 

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

32 # energyplus as backend and no specified workflow 

33 # (default workflow is taken) 

34 project = Project.create(project_path, ifc_paths, 'comfort') 

35 

36 # set weather file data 

37 project.sim_settings.weather_file_path = ( 

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

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

40 

41 # specified settings for workflows can be changed later as well 

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

43 project.sim_settings.layers_and_materials = LOD.low 

44 project.sim_settings.construction_class_walls = 'iwu_heavy' 

45 project.sim_settings.construction_class_windows = \ 

46 'Waermeschutzverglasung, dreifach' 

47 project.sim_settings.run_full_simulation = True 

48 project.sim_settings.setpoints_from_template = True 

49 project.sim_settings.add_window_shading = 'Exterior' 

50 project.sim_settings.cooling_tz_overwrite = False 

51 project.sim_settings.rename_plot_keys = True 

52 project.sim_settings.create_plots = True 

53 

54 # Run the project with the ConsoleDecisionHandler. This allows interactive 

55 # input to answer upcoming questions regarding the imported IFC. 

56 run_project(project, ConsoleDecisionHandler()) 

57 

58 

59if __name__ == '__main__': 

60 run_example_1()