Coverage for bim2sim / plugins / PluginEnergyPlus / bim2sim_energyplus / sim_settings.py: 0%
36 statements
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-18 09:34 +0000
« prev ^ index » next coverage.py v7.13.0, created at 2025-12-18 09:34 +0000
1from pathlib import Path
3from bim2sim.sim_settings import BuildingSimSettings, BooleanSetting, \
4 ChoiceSetting, PathSetting, NumberSetting
7class EnergyPlusSimSettings(BuildingSimSettings):
8 """Defines simulation settings for EnergyPlus Plugin.
10 This class defines the simulation settings for the EnergyPlus Plugin. It
11 inherits all choices from the BuildingSimulation settings. EnergyPlus
12 specific settings are added here, such as simulation control parameters
13 and export settings.
14 """
15 cfd_export = BooleanSetting(
16 value=False,
17 description='Whether to use CFD export for this simulation or not.',
18 for_frontend=True
19 )
20 split_bounds = BooleanSetting(
21 value=False,
22 description='Whether to convert up non-convex space boundaries or '
23 'not.',
24 for_frontend=True
25 )
26 add_shadings = BooleanSetting(
27 value=True,
28 description='Whether to add shading surfaces if available or not.',
29 for_frontend=True
30 )
31 add_hash = BooleanSetting(
32 value=False,
33 description='Whether to add a hash as a comment at the first line of'
34 'IDF file for IFC-to-IDF tracking or not.',
35 for_frontend=False
36 )
37 split_shadings = BooleanSetting(
38 value=False,
39 description='Whether to convert up non-convex shading boundaries or '
40 'not.',
41 for_frontend=True
42 )
43 run_full_simulation = BooleanSetting(
44 value=False,
45 description='Choose simulation period.',
46 for_frontend=True
47 )
48 ep_version = ChoiceSetting(
49 value='9-4-0',
50 choices={
51 '9-2-0': 'EnergyPlus Version 9-2-0',
52 '9-4-0': 'EnergyPlus Version 9-4-0',
53 '22-2-0': 'EnergyPlus Version 22-2-0' # todo: Test latest version
54 },
55 description='Choose EnergyPlus Version',
56 for_frontend=True,
57 any_string=True
58 )
59 # ep_install_path is instantiated without validation using BaseModel.model_construct
60 # to enable linux path as default value for CI pipeline
61 ep_install_path = PathSetting.model_construct(
62 value=Path('/usr/local/EnergyPlus-9-4-0/'),
63 description='Choose EnergyPlus Installation Path',
64 for_frontend=False,
65 )
66 system_sizing = BooleanSetting(
67 value=True,
68 description='Whether to do system sizing calculations in EnergyPlus '
69 'or not.',
70 for_frontend=True
71 )
72 run_for_sizing_periods = BooleanSetting(
73 value=False,
74 description='Whether to run the EnergyPlus simulation for sizing '
75 'periods or not.',
76 for_frontend=True
77 )
78 run_for_weather_period = BooleanSetting(
79 value=True,
80 description='Whether to run the EnergyPlus simulation for weather '
81 'file period or not.',
82 for_frontend=True
83 )
84 system_weather_sizing = ChoiceSetting(
85 value='Typical',
86 choices={'Typical': 'SummerTypical and WinterTypical for system '
87 'sizing.',
88 'Extreme': 'SummerExtreme and WinterExtreme for system '
89 'sizing.',
90 'DesignDay': 'DesignDay for system sizing. Choose this '
91 'option if neither SummerExtreme nor '
92 'SummerTypical days are available in weather '
93 'file.'},
94 description='Choose whether to perform the system sizing for '
95 'DesignDays, extreme weather periods, typical weather '
96 'periods. value=Typical (i.e., apply system sizing for '
97 'typical summer/winter days). '
98 )
99 weather_file_for_sizing = PathSetting(
100 value=None,
101 description='Path to the weather file that should be used for system '
102 'sizing in EnergyPlus',
103 for_frontend=True,
104 mandatory=False
105 )
106 enforce_system_sizing = BooleanSetting(
107 value=False,
108 description='Choose True if you want to enforce HVAC Sizing to sizing '
109 'period settings (limit heating and cooling capacity) '
110 'instead of autosizing.',
111 for_frontend=True
112 )
113 solar_distribution = ChoiceSetting(
114 value='FullExterior',
115 choices={
116 'FullExterior': 'Full exterior solar distribution',
117 'FullInteriorAndExterior': 'Full interior and exterior solar '
118 'distribution'
119 },
120 description='Choose solar distribution.',
121 for_frontend=True
122 )
123 add_window_shading = ChoiceSetting(
124 value=None,
125 choices={
126 None: 'Do not add window shading',
127 'Interior': 'Add an interior shade in EnergyPlus',
128 'Exterior': 'Add an exterior shade in EnergyPlus',
129 },
130 description='Choose window shading.',
131 for_frontend=True,
132 )
133 output_format = ChoiceSetting(
134 value='CommaAndHTML',
135 choices={
136 'Comma': 'Output format Comma (.csv)',
137 'Tab': 'Output format Tab (.tab)',
138 'Fixed': 'Output format Fixed (.txt)',
139 'HTML': 'Output format HTML (.htm)',
140 'XML': 'Output format XML (.xml)',
141 'CommaAndHTML': 'Output format CommaAndHTML',
142 'TabAndHTML': 'Output format TabAndHTML',
143 'XMLAndHTML': 'Output format TabAndHTML',
144 'All': 'All output formats.',
145 },
146 description='Choose output format for result files.',
147 for_frontend=True
148 )
149 unit_conversion = ChoiceSetting(
150 value='JtoKWH',
151 choices={
152 'None': 'No unit conversions',
153 'JtoKWH': 'Convert Joule into kWh (1/3600000)',
154 'JtoMJ': 'Joule converted into Megajoule (1/1000000)',
155 'JtoGJ': 'Joule converted into Gigajoule',
156 'InchPound': 'Convert all tabular values to common Inch-Pound ' \
157 'equivalent.'
158 },
159 description='Choose unit conversion for result files.',
160 for_frontend=True
161 )
162 output_keys = ChoiceSetting(
163 value=['output_outdoor_conditions', 'output_zone_temperature',
164 'output_zone', 'output_infiltration', 'output_meters'],
165 choices={
166 'output_outdoor_conditions': 'Add outputs for outdoor conditions.',
167 'output_internal_gains': 'Add output for internal gains.',
168 'output_zone_temperature': 'Add output for zone mean and '
169 'operative temperature.',
170 'output_zone': 'Add heating and cooling rates and energy on zone '
171 'level.',
172 'output_infiltration': 'Add output for zone infiltration.',
173 'output_meters': 'Add heating and cooling meters.',
174 'output_dxf': 'Output a dxf of the building geometry.',
175 },
176 description='Choose groups of output variables (multiple choice).',
177 multiple_choice=True,
178 for_frontend=True
179 )
180 correct_space_boundaries = BooleanSetting(
181 value=True,
182 description='Apply geometric correction to space boundaries.',
183 for_frontend=True
184 )
185 close_space_boundary_gaps = BooleanSetting(
186 value=True,
187 description='Close gaps in the set of space boundaries by adding '
188 'additional 2b space boundaries.',
189 for_frontend=True
190 )
191 add_natural_ventilation = BooleanSetting(
192 value=True,
193 description='Add natural ventilation to the building. Natural '
194 'ventilation is not available when cooling is activated.',
195 for_frontend=True
196 )
197 hvac_off_at_night = BooleanSetting(
198 value=False, description='Disable all HVAC systems at night from '
199 '10pm to 6am.'
200 )
201 control_operative_temperature = BooleanSetting(
202 value=False, description='Use operative temperature instead of air '
203 'temperature for zonal temperature control.'
204 )
205 ventilation_demand_control = ChoiceSetting(
206 value=None,
207 choices={None: 'No demand control for mechanical ventilation.',
208 'OccupancySchedule': 'Demand control based on occupancy '
209 'schedule.'},
210 description='Choose if mechanical ventilation should be demand '
211 'controlled. Default is None. '
212 )
213 outdoor_air_economizer = ChoiceSetting(
214 value='NoEconomizer',
215 choices={'NoEconomizer': 'No outdoor air economizer is applied.',
216 'DifferentialDryBulb': 'The outdoor air economizer is '
217 'applied based on the differential '
218 'dry bulb temperature.',
219 'DifferentialEnthalpy': 'The outdoor air economizer is '
220 'applied based on the differential '
221 'enthalpy.'},
222 description='Choose which type of outdoor air economizer should be '
223 'applied to reduce cooling loads by an increased outdoor '
224 'air flow if cooling loads can be reduced. Default is '
225 '"NoEconomizer".'
226 )
227 heat_recovery_type = ChoiceSetting(
228 value='Enthalpy',
229 choices={'Enthalpy': 'Use Enthalpy Heat Recovery.',
230 'Sensible': 'Use Sensible Heat Recovery.',
231 'None': 'No Heat Recovery'},
232 description='Choose which type of heat recovery should be applied for '
233 'mechanical ventilation.'
234 )
235 heat_recovery_sensible = NumberSetting(
236 value=0.8, min_value=0, max_value=1,
237 description='Choose the sensible heat recovery effectiveness. '
238 'Default: 0.8.'
239 )
240 heat_recovery_latent = NumberSetting(
241 value=0.7, min_value=0, max_value=1,
242 description='Choose the latent heat recovery effectiveness. Only '
243 'applicable if heat_recovery_type="Enthalpy". Default: 0.7.'
244 )
245 outdoor_air_per_person = NumberSetting(
246 value=7,
247 min_value=0, max_value=25,
248 description='Outdoor air per person in l/s. Defaults to 7 l/s '
249 'according to DIN EN 16798-1, Category II.'
250 )
251 outdoor_air_per_area = NumberSetting(
252 value=0.7, min_value=0, max_value=10,
253 description='Outdoor air per floor area in l/s. Defaults to 0.7 l/(s '
254 'm2) according to DIN EN 16798-1, Category II for low '
255 'emission buildings.'
256 )
257 residential = BooleanSetting(
258 value=False, description='Choose True to use residential settings '
259 'for natural ventilation (DIN4108-2), '
260 'False for non-residential houses.'
261 )
262 natural_ventilation_approach = ChoiceSetting(
263 value="Simple",
264 description='Choose calculation approach for natural ventilation.',
265 choices={
266 "Simple": "use simplified ventilation based on TEASER templates.",
267 "DIN4108": "use DIN4108-2 for natural ventilation."
268 }
269 )