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

14 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 

7 

8 

9def run_example_1(): 

10 """Run a building performance simulation with the EnergyPlus backend. 

11 

12 This example runs a BPS with the EnergyPlus backend. Specifies project 

13 directory and location of the IFC file. Then, it creates a bim2sim 

14 project with the EnergyPlus backend. Simulation settings are specified 

15 (EnergyPlus location needs to be specified according to your system, 

16 other settings are set to default if not specified otherwise), 

17 before the project is executed with the previously specified settings. 

18 """ 

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

20 # directory 

21 project_path = Path( 

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

23 

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

25 ifc_paths = { 

26 IFCDomain.arch: 

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

28 'test/resources/arch/ifc/AC20-FZK-Haus.ifc', 

29 } 

30 

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

32 # energyplus as backend 

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

34 

35 # set weather file data 

36 project.sim_settings.weather_file_path = ( 

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

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

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

40 # system requirements 

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

42 

43 # run annual simulation for EnergyPlus 

44 project.sim_settings.run_full_simulation = True 

45 

46 # Set other simulation settings, otherwise all settings are set to default 

47 

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

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

50 run_project(project, ConsoleDecisionHandler()) 

51 

52 

53if __name__ == '__main__': 

54 run_example_1()