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

35 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2025-10-01 10:24 +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 default=False, 

17 description='Whether to use CFD export for this simulation or not.', 

18 for_frontend=True 

19 ) 

20 split_bounds = BooleanSetting( 

21 default=False, 

22 description='Whether to convert up non-convex space boundaries or ' 

23 'not.', 

24 for_frontend=True 

25 ) 

26 add_shadings = BooleanSetting( 

27 default=True, 

28 description='Whether to add shading surfaces if available or not.', 

29 for_frontend=True 

30 ) 

31 split_shadings = BooleanSetting( 

32 default=False, 

33 description='Whether to convert up non-convex shading boundaries or ' 

34 'not.', 

35 for_frontend=True 

36 ) 

37 run_full_simulation = BooleanSetting( 

38 default=False, 

39 description='Choose simulation period.', 

40 for_frontend=True 

41 ) 

42 ep_version = ChoiceSetting( 

43 default='9-4-0', 

44 choices={ 

45 '9-2-0': 'EnergyPlus Version 9-2-0', 

46 '9-4-0': 'EnergyPlus Version 9-4-0', 

47 '22-2-0': 'EnergyPlus Version 22-2-0' # todo: Test latest version 

48 }, 

49 description='Choose EnergyPlus Version', 

50 for_frontend=True, 

51 any_string=True 

52 ) 

53 ep_install_path = PathSetting( 

54 default=Path('/usr/local/EnergyPlus-9-4-0/'), 

55 description='Choose EnergyPlus Installation Path', 

56 for_frontend=False, 

57 ) 

58 system_sizing = BooleanSetting( 

59 default=True, 

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

61 'or not.', 

62 for_frontend=True 

63 ) 

64 run_for_sizing_periods = BooleanSetting( 

65 default=False, 

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

67 'periods or not.', 

68 for_frontend=True 

69 ) 

70 run_for_weather_period = BooleanSetting( 

71 default=True, 

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

73 'file period or not.', 

74 for_frontend=True 

75 ) 

76 system_weather_sizing = ChoiceSetting( 

77 default='Typical', 

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

79 'sizing.', 

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

81 'sizing.', 

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

83 'option if neither SummerExtreme nor ' 

84 'SummerTypical days are available in weather ' 

85 'file.'}, 

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

87 'DesignDays, extreme weather periods, typical weather ' 

88 'periods. Default=Typical (i.e., apply system sizing for ' 

89 'typical summer/winter days). ' 

90 ) 

91 weather_file_for_sizing = PathSetting( 

92 default=None, 

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

94 'sizing in EnergyPlus', 

95 for_frontend=True, 

96 mandatory=False 

97 ) 

98 enforce_system_sizing = BooleanSetting( 

99 default=False, 

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

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

102 'instead of autosizing.', 

103 for_frontend=True 

104 ) 

105 solar_distribution = ChoiceSetting( 

106 default='FullExterior', 

107 choices={ 

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

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

110 'distribution' 

111 }, 

112 description='Choose solar distribution.', 

113 for_frontend=True 

114 ) 

115 add_window_shading = ChoiceSetting( 

116 default=None, 

117 choices={ 

118 None: 'Do not add window shading', 

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

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

121 }, 

122 description='Choose window shading.', 

123 for_frontend=True, 

124 ) 

125 output_format = ChoiceSetting( 

126 default='CommaAndHTML', 

127 choices={ 

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

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

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

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

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

133 'CommaAndHTML': 'Output format CommaAndHTML', 

134 'TabAndHTML': 'Output format TabAndHTML', 

135 'XMLAndHTML': 'Output format TabAndHTML', 

136 'All': 'All output formats.', 

137 }, 

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

139 for_frontend=True 

140 ) 

141 unit_conversion = ChoiceSetting( 

142 default='JtoKWH', 

143 choices={ 

144 'None': 'No unit conversions', 

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

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

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

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

149 'equivalent.' 

150 }, 

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

152 for_frontend=True 

153 ) 

154 output_keys = ChoiceSetting( 

155 default=['output_outdoor_conditions', 'output_zone_temperature', 

156 'output_zone', 'output_infiltration', 'output_meters'], 

157 choices={ 

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

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

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

161 'operative temperature.', 

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

163 'level.', 

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

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

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

167 }, 

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

169 multiple_choice=True, 

170 for_frontend=True 

171 ) 

172 correct_space_boundaries = BooleanSetting( 

173 default=True, 

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

175 for_frontend=True 

176 ) 

177 close_space_boundary_gaps = BooleanSetting( 

178 default=True, 

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

180 'additional 2b space boundaries.', 

181 for_frontend=True 

182 ) 

183 add_natural_ventilation = BooleanSetting( 

184 default=True, 

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

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

187 for_frontend=True 

188 ) 

189 hvac_off_at_night = BooleanSetting( 

190 default=False, description='Disable all HVAC systems at night from ' 

191 '10pm to 6am.' 

192 ) 

193 control_operative_temperature = BooleanSetting( 

194 default=False, description='Use operative temperature instead of air ' 

195 'temperature for zonal temperature control.' 

196 ) 

197 ventilation_demand_control = ChoiceSetting( 

198 default=None, 

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

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

201 'schedule.'}, 

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

203 'controlled. Default is None. ' 

204 ) 

205 outdoor_air_economizer = ChoiceSetting( 

206 default='NoEconomizer', 

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

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

209 'applied based on the differential ' 

210 'dry bulb temperature.', 

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

212 'applied based on the differential ' 

213 'enthalpy.'}, 

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

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

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

217 '"NoEconomizer".' 

218 ) 

219 heat_recovery_type = ChoiceSetting( 

220 default='Enthalpy', 

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

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

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

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

225 'mechanical ventilation.' 

226 ) 

227 heat_recovery_sensible = NumberSetting( 

228 default=0.8, min_value=0, max_value=1, 

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

230 'Default: 0.8.' 

231 ) 

232 heat_recovery_latent = NumberSetting( 

233 default=0.7, min_value=0, max_value=1, 

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

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

236 ) 

237 outdoor_air_per_person = NumberSetting( 

238 default=7, 

239 min_value=0, max_value=25, 

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

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

242 ) 

243 outdoor_air_per_area = NumberSetting( 

244 default=0.7, min_value=0, max_value=10, 

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

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

247 'emission buildings.' 

248 ) 

249 residential = BooleanSetting( 

250 default=False, description='Choose True to use residential settings ' 

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

252 'False for non-residential houses.' 

253 ) 

254 natural_ventilation_approach = ChoiceSetting( 

255 default="Simple", 

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

257 choices={ 

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

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

260 } 

261 )