Coverage for bim2sim/plugins/PluginAixLib/bim2sim_aixlib/examples/e2_complex_project_hvac_aixlib.py: 0%
14 statements
« prev ^ index » next coverage.py v7.6.12, created at 2025-03-12 17:09 +0000
« prev ^ index » next coverage.py v7.6.12, created at 2025-03-12 17:09 +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_complex_hvac_aixlib():
10 """Run an HVAC simulation with the AixLib backend with a complex IFC.
12 First the project directory and location of the HVAC IFC file are specified.
13 Then, we create a bim2sim project with the AixLib backend. Simulation type
14 settings are set, in this case we set threshold of fuzzy search a bit lower,
15 to reduce the amount of decisions. Afterwards the project is
16 executed via the ConsoleDecisionHandler which takes answers for upcoming
17 decisions via command line input.
18 """
20 # Create a temp directory for the project, feel free to use a "normal"
21 # directory
22 project_path = Path(
23 tempfile.TemporaryDirectory(
24 prefix='bim2sim_example_complex_aixlib').name)
26 # Set path of ifc for hydraulic domain with the fresh downloaded test models
27 ifc_paths = {
28 IFCDomain.hydraulic:
29 Path(bim2sim.__file__).parent.parent /
30 'test/resources/hydraulic/ifc/'
31 'DigitalHub_Gebaeudetechnik-HEIZUNG_v2.ifc',
32 }
33 # Create a project including the folder structure for the project with
34 project = Project.create(project_path, ifc_paths, 'aixlib')
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.mos')
41 # Set fuzzy threshold to 0.5 to reduce the number of decisions (this is
42 # IFC-file specific and needs to be evaluated by the user
43 project.sim_settings.fuzzy_threshold = 0.5
45 # Run the project with the ConsoleDecisionHandler. This allows interactive
46 # input to answer upcoming questions regarding the imported IFC.
47 run_project(project, ConsoleDecisionHandler())
49# Following the answers for the decisions are listed for documentation:
50# 'HVAC-ThreeWayValve',
51# 'HVAC-Pipe',
52# 'HVAC-HeatPump',
53# 'HVAC-Valve',
54# True *13,
55# TODO: following are not up2date
56# True * 4
57# efficiency: 0.95
58# flow_temperature: 70
59# nominal_power_consumption: 200
60# return_temperature: 50
61# following multiple
62# return_temperature: 50
63# (body_mass: 15, heat_capacity: 10) * 7
66if __name__ == '__main__':
67 run_example_complex_hvac_aixlib()