Coverage for bim2sim/plugins/PluginEnergyPlus/bim2sim_energyplus/examples/e4_simple_rotated_project_energyplus.py: 0%
15 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-16 08:28 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-16 08:28 +0000
1import tempfile
2from pathlib import Path
4import bim2sim
5from bim2sim import Project, run_project, ConsoleDecisionHandler
6from bim2sim.utilities.types import IFCDomain
9def run_example_4():
10 """Run a building performance simulation with the EnergyPlus backend.
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. In this example, the building is
15 rotated by 180° clockwise.
16 """
17 # Create a temp directory for the project, feel free to use a "normal"
18 # directory
19 project_path = Path(
20 tempfile.TemporaryDirectory(prefix='bim2sim_example1').name)
22 # Set the ifc path to use and define which domain the IFC belongs to
23 ifc_paths = {
24 IFCDomain.arch:
25 Path(bim2sim.__file__).parent.parent /
26 'test/resources/arch/ifc/AC20-FZK-Haus.ifc',
27 }
29 # Create a project including the folder structure for the project with
30 # energyplus as backend
31 project = Project.create(project_path, ifc_paths, 'energyplus')
33 # set weather file data
34 project.sim_settings.weather_file_path = (
35 Path(bim2sim.__file__).parent.parent /
36 'test/resources/weather_files/DEU_NW_Aachen.105010_TMYx.epw')
37 # Set the install path to your EnergyPlus installation according to your
38 # system requirements
39 # project.sim_settings.ep_install_path = 'C://EnergyPlusV9-4-0/'
41 # run annual simulation for EnergyPlus
42 project.sim_settings.run_full_simulation = True
43 project.sim_settings.building_rotation_overwrite = 180
45 # Set other simulation settings, otherwise all settings are set to default
47 # Run the project with the ConsoleDecisionHandler. This allows interactive
48 # input to answer upcoming questions regarding the imported IFC.
49 run_project(project, ConsoleDecisionHandler())
52if __name__ == '__main__':
53 run_example_4()