Coverage for bim2sim/plugins/PluginEnergyPlus/bim2sim_energyplus/sim_settings.py: 0%

36 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-10-17 11:04 +0000

1from pathlib import Path 

2 

3from bim2sim.sim_settings import BuildingSimSettings, BooleanSetting, \ 

4 ChoiceSetting, PathSetting, NumberSetting 

5 

6 

7class EnergyPlusSimSettings(BuildingSimSettings): 

8 """Defines simulation settings for EnergyPlus Plugin. 

9 

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 = PathSetting( 

60 value=Path('/usr/local/EnergyPlus-9-4-0/'), 

61 description='Choose EnergyPlus Installation Path', 

62 for_frontend=False, 

63 ) 

64 system_sizing = BooleanSetting( 

65 value=True, 

66 description='Whether to do system sizing calculations in EnergyPlus ' 

67 'or not.', 

68 for_frontend=True 

69 ) 

70 run_for_sizing_periods = BooleanSetting( 

71 value=False, 

72 description='Whether to run the EnergyPlus simulation for sizing ' 

73 'periods or not.', 

74 for_frontend=True 

75 ) 

76 run_for_weather_period = BooleanSetting( 

77 value=True, 

78 description='Whether to run the EnergyPlus simulation for weather ' 

79 'file period or not.', 

80 for_frontend=True 

81 ) 

82 system_weather_sizing = ChoiceSetting( 

83 value='Typical', 

84 choices={'Typical': 'SummerTypical and WinterTypical for system ' 

85 'sizing.', 

86 'Extreme': 'SummerExtreme and WinterExtreme for system ' 

87 'sizing.', 

88 'DesignDay': 'DesignDay for system sizing. Choose this ' 

89 'option if neither SummerExtreme nor ' 

90 'SummerTypical days are available in weather ' 

91 'file.'}, 

92 description='Choose whether to perform the system sizing for ' 

93 'DesignDays, extreme weather periods, typical weather ' 

94 'periods. value=Typical (i.e., apply system sizing for ' 

95 'typical summer/winter days). ' 

96 ) 

97 weather_file_for_sizing = PathSetting( 

98 value=None, 

99 description='Path to the weather file that should be used for system ' 

100 'sizing in EnergyPlus', 

101 for_frontend=True, 

102 mandatory=False 

103 ) 

104 enforce_system_sizing = BooleanSetting( 

105 value=False, 

106 description='Choose True if you want to enforce HVAC Sizing to sizing ' 

107 'period settings (limit heating and cooling capacity) ' 

108 'instead of autosizing.', 

109 for_frontend=True 

110 ) 

111 solar_distribution = ChoiceSetting( 

112 value='FullExterior', 

113 choices={ 

114 'FullExterior': 'Full exterior solar distribution', 

115 'FullInteriorAndExterior': 'Full interior and exterior solar ' 

116 'distribution' 

117 }, 

118 description='Choose solar distribution.', 

119 for_frontend=True 

120 ) 

121 add_window_shading = ChoiceSetting( 

122 value=None, 

123 choices={ 

124 None: 'Do not add window shading', 

125 'Interior': 'Add an interior shade in EnergyPlus', 

126 'Exterior': 'Add an exterior shade in EnergyPlus', 

127 }, 

128 description='Choose window shading.', 

129 for_frontend=True, 

130 ) 

131 output_format = ChoiceSetting( 

132 value='CommaAndHTML', 

133 choices={ 

134 'Comma': 'Output format Comma (.csv)', 

135 'Tab': 'Output format Tab (.tab)', 

136 'Fixed': 'Output format Fixed (.txt)', 

137 'HTML': 'Output format HTML (.htm)', 

138 'XML': 'Output format XML (.xml)', 

139 'CommaAndHTML': 'Output format CommaAndHTML', 

140 'TabAndHTML': 'Output format TabAndHTML', 

141 'XMLAndHTML': 'Output format TabAndHTML', 

142 'All': 'All output formats.', 

143 }, 

144 description='Choose output format for result files.', 

145 for_frontend=True 

146 ) 

147 unit_conversion = ChoiceSetting( 

148 value='JtoKWH', 

149 choices={ 

150 'None': 'No unit conversions', 

151 'JtoKWH': 'Convert Joule into kWh (1/3600000)', 

152 'JtoMJ': 'Joule converted into Megajoule (1/1000000)', 

153 'JtoGJ': 'Joule converted into Gigajoule', 

154 'InchPound': 'Convert all tabular values to common Inch-Pound ' \ 

155 'equivalent.' 

156 }, 

157 description='Choose unit conversion for result files.', 

158 for_frontend=True 

159 ) 

160 output_keys = ChoiceSetting( 

161 value=['output_outdoor_conditions', 'output_zone_temperature', 

162 'output_zone', 'output_infiltration', 'output_meters'], 

163 choices={ 

164 'output_outdoor_conditions': 'Add outputs for outdoor conditions.', 

165 'output_internal_gains': 'Add output for internal gains.', 

166 'output_zone_temperature': 'Add output for zone mean and ' 

167 'operative temperature.', 

168 'output_zone': 'Add heating and cooling rates and energy on zone ' 

169 'level.', 

170 'output_infiltration': 'Add output for zone infiltration.', 

171 'output_meters': 'Add heating and cooling meters.', 

172 'output_dxf': 'Output a dxf of the building geometry.', 

173 }, 

174 description='Choose groups of output variables (multiple choice).', 

175 multiple_choice=True, 

176 for_frontend=True 

177 ) 

178 correct_space_boundaries = BooleanSetting( 

179 value=True, 

180 description='Apply geometric correction to space boundaries.', 

181 for_frontend=True 

182 ) 

183 close_space_boundary_gaps = BooleanSetting( 

184 value=True, 

185 description='Close gaps in the set of space boundaries by adding ' 

186 'additional 2b space boundaries.', 

187 for_frontend=True 

188 ) 

189 add_natural_ventilation = BooleanSetting( 

190 value=True, 

191 description='Add natural ventilation to the building. Natural ' 

192 'ventilation is not available when cooling is activated.', 

193 for_frontend=True 

194 ) 

195 hvac_off_at_night = BooleanSetting( 

196 value=False, description='Disable all HVAC systems at night from ' 

197 '10pm to 6am.' 

198 ) 

199 control_operative_temperature = BooleanSetting( 

200 value=False, description='Use operative temperature instead of air ' 

201 'temperature for zonal temperature control.' 

202 ) 

203 ventilation_demand_control = ChoiceSetting( 

204 value=None, 

205 choices={None: 'No demand control for mechanical ventilation.', 

206 'OccupancySchedule': 'Demand control based on occupancy ' 

207 'schedule.'}, 

208 description='Choose if mechanical ventilation should be demand ' 

209 'controlled. Default is None. ' 

210 ) 

211 outdoor_air_economizer = ChoiceSetting( 

212 value='NoEconomizer', 

213 choices={'NoEconomizer': 'No outdoor air economizer is applied.', 

214 'DifferentialDryBulb': 'The outdoor air economizer is ' 

215 'applied based on the differential ' 

216 'dry bulb temperature.', 

217 'DifferentialEnthalpy': 'The outdoor air economizer is ' 

218 'applied based on the differential ' 

219 'enthalpy.'}, 

220 description='Choose which type of outdoor air economizer should be ' 

221 'applied to reduce cooling loads by an increased outdoor ' 

222 'air flow if cooling loads can be reduced. Default is ' 

223 '"NoEconomizer".' 

224 ) 

225 heat_recovery_type = ChoiceSetting( 

226 value='Enthalpy', 

227 choices={'Enthalpy': 'Use Enthalpy Heat Recovery.', 

228 'Sensible': 'Use Sensible Heat Recovery.', 

229 'None': 'No Heat Recovery'}, 

230 description='Choose which type of heat recovery should be applied for ' 

231 'mechanical ventilation.' 

232 ) 

233 heat_recovery_sensible = NumberSetting( 

234 value=0.8, min_value=0, max_value=1, 

235 description='Choose the sensible heat recovery effectiveness. ' 

236 'Default: 0.8.' 

237 ) 

238 heat_recovery_latent = NumberSetting( 

239 value=0.7, min_value=0, max_value=1, 

240 description='Choose the latent heat recovery effectiveness. Only ' 

241 'applicable if heat_recovery_type="Enthalpy". Default: 0.7.' 

242 ) 

243 outdoor_air_per_person = NumberSetting( 

244 value=7, 

245 min_value=0, max_value=25, 

246 description='Outdoor air per person in l/s. Defaults to 7 l/s ' 

247 'according to DIN EN 16798-1, Category II.' 

248 ) 

249 outdoor_air_per_area = NumberSetting( 

250 value=0.7, min_value=0, max_value=10, 

251 description='Outdoor air per floor area in l/s. Defaults to 0.7 l/(s ' 

252 'm2) according to DIN EN 16798-1, Category II for low ' 

253 'emission buildings.' 

254 ) 

255 residential = BooleanSetting( 

256 value=False, description='Choose True to use residential settings ' 

257 'for natural ventilation (DIN4108-2), ' 

258 'False for non-residential houses.' 

259 ) 

260 natural_ventilation_approach = ChoiceSetting( 

261 value="Simple", 

262 description='Choose calculation approach for natural ventilation.', 

263 choices={ 

264 "Simple": "use simplified ventilation based on TEASER templates.", 

265 "DIN4108": "use DIN4108-2 for natural ventilation." 

266 } 

267 )