Coverage for bim2sim/plugins/PluginOpenFOAM/bim2sim_openfoam/task/add_comfort.py: 0%
16 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
1from bim2sim.tasks.base import ITask
2import sys
3import os
4from butterfly import decomposeParDict as decPD
5import pathlib
8class AddOpenFOAMComfort(ITask):
9 """This ITask adds the openfoam comfort settings.
10 """
12 reads = ('openfoam_case',)
13 touches = ()
15 def __init__(self, playground):
16 super().__init__(playground)
18 def run(self, openfoam_case):
19 if not self.playground.sim_settings.add_comfort:
20 return
21 openfoam_case.comfortDict = {
22 'comfort1': {
23 'type': 'comfort',
24 'libs': '( "libfieldFunctionObjects.dll" )',
25 'clothing': openfoam_case.current_zone.clothing_persons
26 + openfoam_case.current_zone.surround_clo_persons,
27 'metabolicRate':
28 openfoam_case.current_zone.activity_degree_persons,
29 'writeControl': 'writeTime',
30 'writeInterval': '1'}}
31 openfoam_case.controlDict.values['functions'].update(
32 openfoam_case.comfortDict)
34 openfoam_case.controlDict.save(openfoam_case.openfoam_dir)