Coverage for bim2sim/plugins/PluginOpenFOAM/bim2sim_openfoam/examples/e10_openfoam_furniture_DH.py: 0%
28 statements
« prev ^ index » next coverage.py v7.10.7, created at 2025-10-01 10:24 +0000
« prev ^ index » next coverage.py v7.10.7, created at 2025-10-01 10:24 +0000
1import tempfile
2from pathlib import Path
4import bim2sim
5from bim2sim import Project, run_project, ConsoleDecisionHandler
6from bim2sim.kernel.decision.decisionhandler import DebugDecisionHandler
7from bim2sim.utilities.types import IFCDomain
10def run_example_8():
11 """Run a building performance simulation with the EnergyPlus backend.
13 This example runs a BPS with the EnergyPlus backend. Specifies project
14 directory and location of the IFC file. Then, it creates a bim2sim
15 project with the EnergyPlus backend. Simulation settings are specified
16 (EnergyPlus location needs to be specified according to your system,
17 other settings are set to default if not specified otherwise),
18 before the project 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(
23 tempfile.TemporaryDirectory(prefix='bim2sim_openfoam10_').name)
25 # Set the ifc path to use and define which domain the IFC belongs to
26 ifc_paths = {
27 IFCDomain.arch:
28 Path(bim2sim.__file__).parent.parent /
29 'test/resources/arch/ifc/FM_ARC_DigitalHub_with_SB89.ifc',
30 }
32 # Create a project including the folder structure for the project with
33 # energyplus as backend
34 project = Project.create(project_path, ifc_paths, 'openfoam')
35 project.sim_settings.prj_custom_usages = (Path(
36 bim2sim.__file__).parent.parent /
37 "test/resources/arch/custom_usages/"
38 "customUsagesFM_ARC_DigitalHub_with_SB89.json")
39 # set weather file data
40 project.sim_settings.weather_file_path = (
41 Path(bim2sim.__file__).parent.parent /
42 'test/resources/weather_files/DEU_NW_Aachen.105010_TMYx.epw')
43 # Set the install path to your EnergyPlus installation according to your
44 # system requirements
45 project.sim_settings.ep_install_path = 'C://EnergyPlusV9-4-0/'
47 # run annual simulation for EnergyPlus
48 # project.sim_settings.run_full_simulation = True
50 # Set other simulation settings, otherwise all settings are set to default
51 project.sim_settings.cfd_export = True
52 project.sim_settings.select_space_guid = '3GmoJyFk9FvAnea6mogixJ'
53 # project.sim_settings.select_space_guid = '2RSCzLOBz4FAK$_wE8VckM'
54 # project.sim_settings.simulation_time = 11
55 project.sim_settings.run_meshing = False
56 project.sim_settings.run_cfd_simulation = False
57 project.sim_settings.add_heating = True
58 # project.sim_settings.add_floorheating = True
59 # project.sim_settings.add_airterminals = True
60 project.sim_settings.add_furniture = True
61 project.sim_settings.add_people = True
62 project.sim_settings.people_amount = 50
63 project.sim_settings.furniture_setting = 'Concert'
64 project.sim_settings.furniture_orientation = 'long_side'
65 project.sim_settings.furniture_amount = 200
66 answers = ('Other', *(None,)*12, 2015)
67 # project.sim_settings.simulation_type = 'transient'
68 # project.sim_settings.inlet_type = 'SimpleStlDiffusor'
69 # project.sim_settings.outlet_type = 'SimpleStlDiffusor'
70 # project.sim_settings.outlet_type = 'None'
71 # Run the project with the ConsoleDecisionHandler. This allows interactive
72 # input to answer upcoming questions regarding the imported IFC.
73 run_project(project, DebugDecisionHandler(answers))
76if __name__ == '__main__':
77 run_example_8()