Class: OpenStudio::Model::Model
- Inherits:
-
Object
- Object
- OpenStudio::Model::Model
- Defined in:
- lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb,
lib/openstudio-standards/hvac_sizing/Siz.Model.rb,
lib/openstudio-standards/btap/btap.model.rb
Overview
open the class to add methods to size all HVAC equipment
Instance Method Summary collapse
-
#applySizingValues ⇒ Object
Takes the values calculated by the EnergyPlus sizing routines and puts them into all objects model in place of the autosized fields.
-
#autosize ⇒ Object
Changes all hard-sized HVAC values to Autosized.
-
#coil_cooling_fuels(cooling_coil) ⇒ Object
Get the cooling fuel type of a cooling coil.
-
#coil_heating_fuels(heating_coil) ⇒ Object
Get the heating fuel type of a heating coil.
-
#eliminate_all_design_specification_outdoor_air ⇒ Object
This method removes all design specification OA from model.
-
#eliminate_all_electric_loads ⇒ Object
This method removes elec loads from model.
-
#eliminate_all_lighting_loads ⇒ Object
This method removes light loads from model.
-
#eliminate_all_loads ⇒ Object
This method removes all space loads from model.
-
#eliminate_all_people_loads ⇒ Object
Elimination Methods This method removes people loads from the model.
-
#eliminate_all_space_infiltration_design_flow_rates ⇒ Object
This method removes infiltration from model..
-
#getAutosizedValue(object, value_name, units) ⇒ Object
A helper method to get component sizes from the model returns the autosized value as an optional double.
-
#getAutosizedValueFromEquipmentSummary(object, table_name, value_name, units) ⇒ Object
A helper method to get component sizes from the Equipment Summary of the TabularDataWithStrings Report returns the autosized value as an optional double.
-
#output_fan_report(csv_path = nil) ⇒ Array of Hash
Helper function to output the fan power for each fan in the model Todo: output actual bhp and allowable bhp for systems 3-4 and 5-8 Todo: remove maybe later?.
- #perform_load_elimination_analysis(folder = Dir.pwd) ⇒ Object
-
#plant_loop_cooling_fuels(plant_loop) ⇒ Object
Get the cooling fuel type of a plant loop Do not search for the fuel used for heat rejection on the condenser loop.
-
#plant_loop_heating_fuels(plant_loop) ⇒ Object
Get the heating fuel type of a plant loop @Todo: If no heating equipment is found, check if there’s a heat exchanger, or a WaterHeater:Mixed or stratified that is connected to a heating source on the demand side.
-
#scale_all_people_loads(factor) ⇒ Object
Scale Global Changes.
-
#scale_electrical_loads(model, factor) ⇒ Object
This method will scale electrical loads.
-
#scale_electrical_loads_schedule(a_coef, b_coef, c_coef, time_shift = nil, time_sign = nil) ⇒ Object
This method will scale electrical loads schedule.
-
#scale_inflitration_loads(factor) ⇒ Object
This method will scale infiltration loads.
-
#scale_lighting_loads(factor) ⇒ Object
This method will scale lighting loads.
-
#scale_lighting_loads_schedule(a_coef, b_coef, c_coef, time_shift = nil, time_sign = nil) ⇒ Object
This method will scale lighting loads schedule.
-
#scale_oa_loads(factor) ⇒ Object
This method will scale Outdoor Air loads.
-
#scale_people_loads_schedule(a_coef, b_coef, c_coef, time_shift = nil, time_sign = nil) ⇒ Object
This method will scale people loads schedule.
- #set_all_ext_roof_conductances_to(conductance) ⇒ Object
- #set_all_ext_skylight_conductances_to(conductance) ⇒ Object
-
#set_all_ext_wall_conductances_to(conductance) ⇒ Object
Set global changes.
- #set_all_ext_windows_and_door_conductances_to(conductance) ⇒ Object
- #set_all_ground_floor_conductances_to(conductance) ⇒ Object
- #set_all_ground_wall_conductances_to(conductance) ⇒ Object
-
#set_all_inflitration_rates(setDesignFlowRate, setFlowperSpaceFloorArea, setFlowperExteriorSurfaceArea, setAirChangesperHour) ⇒ String
This method will set the infiltration magnitude.
-
#zone_airloop_cooling_fuels(zone) ⇒ Object
Get the cooling fuels for a zones airloop.
-
#zone_airloop_heating_fuels(zone) ⇒ Object
Get the heating fuels for a zones airloop.
-
#zone_equipment_cooling_fuels(zone) ⇒ Object
Get the cooling fuels for a zone.
-
#zone_equipment_heating_fuels(zone) ⇒ Object
Get the heating fuels for a zone @ return [Array<String>] an array of fuels.
Instance Method Details
#applySizingValues ⇒ Object
Takes the values calculated by the EnergyPlus sizing routines and puts them into all objects model in place of the autosized fields. Must have previously completed a run with sql output for this to work.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/openstudio-standards/hvac_sizing/Siz.Model.rb', line 69 def applySizingValues # Ensure that the model has a sql file associated with it if self.sqlFile.empty? OpenStudio::logFree(OpenStudio::Error, 'openstudio.model.Model', 'Failed to apply sizing values because model is missing sql file containing sizing results.') return false end # TODO Sizing methods for these types of equipment are # currently only stubs that need to be filled in. self.getAirConditionerVariableRefrigerantFlows.sort.each {|obj| obj.applySizingValues} self.getAirLoopHVACUnitaryHeatCoolVAVChangeoverBypasss.sort.each {|obj| obj.applySizingValues} self.getAirLoopHVACUnitarySystems.sort.each {|obj| obj.applySizingValues} self.getAirTerminalSingleDuctConstantVolumeCooledBeams.sort.each {|obj| obj.applySizingValues} self.getAirTerminalSingleDuctConstantVolumeFourPipeInductions.sort.each {|obj| obj.applySizingValues} self.getAirTerminalSingleDuctConstantVolumeReheats.sort.each {|obj| obj.applySizingValues} self.getAirTerminalSingleDuctSeriesPIUReheats.sort.each {|obj| obj.applySizingValues} self.getAirTerminalSingleDuctVAVHeatAndCoolNoReheats.sort.each {|obj| obj.applySizingValues} self.getAirTerminalSingleDuctVAVHeatAndCoolReheats.sort.each {|obj| obj.applySizingValues} self.getBoilerSteams.sort.each {|obj| obj.applySizingValues} self.getCoilCoolingDXVariableRefrigerantFlows.sort.each {|obj| obj.applySizingValues} self.getCoilCoolingWaterToAirHeatPumpEquationFits.sort.each {|obj| obj.applySizingValues} self.getCoilHeatingWaterToAirHeatPumpEquationFits.sort.each {|obj| obj.applySizingValues} self.getCoilHeatingDesuperheaters.sort.each {|obj| obj.applySizingValues} self.getCoilHeatingDXVariableRefrigerantFlows.sort.each {|obj| obj.applySizingValues} self.getCoilWaterHeatingDesuperheaters.sort.each {|obj| obj.applySizingValues} self.getCoolingTowerTwoSpeeds.sort.each {|obj| obj.applySizingValues} self.getCoolingTowerVariableSpeeds.sort.each {|obj| obj.applySizingValues} self.getEvaporativeCoolerDirectResearchSpecials.sort.each {|obj| obj.applySizingValues} self.getEvaporativeCoolerIndirectResearchSpecials.sort.each {|obj| obj.applySizingValues} self.getEvaporativeFluidCoolerSingleSpeeds.sort.each {|obj| obj.applySizingValues} self.getHeatExchangerFluidToFluids.sort.each {|obj| obj.applySizingValues} self.getHumidifierSteamElectrics.sort.each {|obj| obj.applySizingValues} self.getZoneHVACBaseboardConvectiveElectrics.sort.each {|obj| obj.applySizingValues} self.getZoneHVACBaseboardConvectiveWaters.sort.each {|obj| obj.applySizingValues} self.getZoneHVACFourPipeFanCoils.sort.each {|obj| obj.applySizingValues} self.getZoneHVACHighTemperatureRadiants.sort.each {|obj| obj.applySizingValues} self.getZoneHVACIdealLoadsAirSystems.sort.each {|obj| obj.applySizingValues} self.getZoneHVACLowTemperatureRadiantElectrics.sort.each {|obj| obj.applySizingValues} self.getZoneHVACLowTempRadiantConstFlows.sort.each {|obj| obj.applySizingValues} self.getZoneHVACLowTempRadiantVarFlows.sort.each {|obj| obj.applySizingValues} self.getZoneHVACPackagedTerminalAirConditioners.sort.each {|obj| obj.applySizingValues} self.getZoneHVACPackagedTerminalHeatPumps.sort.each {|obj| obj.applySizingValues} self.getZoneHVACTerminalUnitVariableRefrigerantFlows.sort.each {|obj| obj.applySizingValues} self.getZoneHVACWaterToAirHeatPumps.sort.each {|obj| obj.applySizingValues} # Zone equipment # Air terminals self.getAirTerminalSingleDuctParallelPIUReheats.sort.each {|obj| obj.applySizingValues} self.getAirTerminalSingleDuctVAVReheats.sort.each {|obj| obj.applySizingValues} self.getAirTerminalSingleDuctUncontrolleds.sort.each {|obj| obj.applySizingValues} # AirLoopHVAC components self.getAirLoopHVACs.sort.each {|obj| obj.applySizingValues} self.getSizingSystems.sort.each {|obj| obj.applySizingValues} # Fans self.getFanConstantVolumes.sort.each {|obj| obj.applySizingValues} self.getFanVariableVolumes.sort.each {|obj| obj.applySizingValues} self.getFanOnOffs.sort.each {|obj| obj.applySizingValues} # Heating coils self.getCoilHeatingElectrics.sort.each {|obj| obj.applySizingValues} self.getCoilHeatingGass.sort.each {|obj| obj.applySizingValues} self.getCoilHeatingGasMultiStages.sort.each {|obj| obj.applySizingValues} self.getCoilHeatingWaters.sort.each {|obj| obj.applySizingValues} self.getCoilHeatingDXSingleSpeeds.sort.each {|obj| obj.applySizingValues} self.getCoilHeatingDXMultiSpeeds.sort.each {|obj| obj.applySizingValues} # Cooling coils self.getCoilCoolingDXSingleSpeeds.sort.each {|obj| obj.applySizingValues} self.getCoilCoolingDXTwoSpeeds.sort.each {|obj| obj.applySizingValues} self.getCoilCoolingWaters.sort.each {|obj| obj.applySizingValues} self.getCoilCoolingDXMultiSpeeds.sort.each {|obj| obj.applySizingValues} # Outdoor air self.getControllerOutdoorAirs.sort.each {|obj| obj.applySizingValues} self.getHeatExchangerAirToAirSensibleAndLatents.sort.each {|obj| obj.applySizingValues} # PlantLoop components self.getPlantLoops.sort.each {|obj| obj.applySizingValues} # Pumps self.getPumpConstantSpeeds.sort.each {|obj| obj.applySizingValues} self.getPumpVariableSpeeds.sort.each {|obj| obj.applySizingValues} # Heating equipment self.getBoilerHotWaters.sort.each {|obj| obj.applySizingValues} # Cooling equipment self.getChillerElectricEIRs.sort.each {|obj| obj.applySizingValues} # Condenser equipment self.getCoolingTowerSingleSpeeds.sort.each {|obj| obj.applySizingValues} # Controls self.getControllerWaterCoils.sort.each {|obj| obj.applySizingValues} # VRF components # Refrigeration components return true end |
#autosize ⇒ Object
Changes all hard-sized HVAC values to Autosized
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/openstudio-standards/hvac_sizing/Siz.Model.rb', line 177 def autosize # TODO Sizing methods for these types of equipment are # currently only stubs that need to be filled in. self.getAirConditionerVariableRefrigerantFlows.sort.each {|obj| obj.autosize} self.getAirLoopHVACUnitaryHeatCoolVAVChangeoverBypasss.sort.each {|obj| obj.autosize} self.getAirLoopHVACUnitarySystems.sort.each {|obj| obj.autosize} self.getAirTerminalSingleDuctConstantVolumeCooledBeams.sort.each {|obj| obj.autosize} self.getAirTerminalSingleDuctConstantVolumeFourPipeInductions.sort.each {|obj| obj.autosize} self.getAirTerminalSingleDuctConstantVolumeReheats.sort.each {|obj| obj.autosize} self.getAirTerminalSingleDuctSeriesPIUReheats.sort.each {|obj| obj.autosize} self.getAirTerminalSingleDuctVAVHeatAndCoolNoReheats.sort.each {|obj| obj.autosize} self.getAirTerminalSingleDuctVAVHeatAndCoolReheats.sort.each {|obj| obj.autosize} self.getBoilerSteams.sort.each {|obj| obj.autosize} self.getCoilCoolingDXMultiSpeeds.sort.each {|obj| obj.autosize} self.getCoilCoolingDXVariableRefrigerantFlows.sort.each {|obj| obj.autosize} self.getCoilCoolingWaterToAirHeatPumpEquationFits.sort.each {|obj| obj.autosize} self.getCoilHeatingWaterToAirHeatPumpEquationFits.sort.each {|obj| obj.autosize} self.getCoilHeatingGasMultiStages.sort.each {|obj| obj.autosize} self.getCoilHeatingDesuperheaters.sort.each {|obj| obj.autosize} self.getCoilHeatingDXVariableRefrigerantFlows.sort.each {|obj| obj.autosize} self.getCoilWaterHeatingDesuperheaters.sort.each {|obj| obj.autosize} self.getCoolingTowerTwoSpeeds.sort.each {|obj| obj.autosize} self.getCoolingTowerVariableSpeeds.sort.each {|obj| obj.autosize} self.getEvaporativeCoolerDirectResearchSpecials.sort.each {|obj| obj.autosize} self.getEvaporativeCoolerIndirectResearchSpecials.sort.each {|obj| obj.autosize} self.getEvaporativeFluidCoolerSingleSpeeds.sort.each {|obj| obj.autosize} self.getHeatExchangerFluidToFluids.sort.each {|obj| obj.autosize} self.getHumidifierSteamElectrics.sort.each {|obj| obj.autosize} self.getZoneHVACBaseboardConvectiveElectrics.sort.each {|obj| obj.autosize} self.getZoneHVACBaseboardConvectiveWaters.sort.each {|obj| obj.autosize} self.getZoneHVACFourPipeFanCoils.sort.each {|obj| obj.autosize} self.getZoneHVACHighTemperatureRadiants.sort.each {|obj| obj.autosize} self.getZoneHVACIdealLoadsAirSystems.sort.each {|obj| obj.autosize} self.getZoneHVACLowTemperatureRadiantElectrics.sort.each {|obj| obj.autosize} self.getZoneHVACLowTempRadiantConstFlows.sort.each {|obj| obj.autosize} self.getZoneHVACLowTempRadiantVarFlows.sort.each {|obj| obj.autosize} self.getZoneHVACPackagedTerminalAirConditioners.sort.each {|obj| obj.autosize} self.getZoneHVACPackagedTerminalHeatPumps.sort.each {|obj| obj.autosize} self.getZoneHVACTerminalUnitVariableRefrigerantFlows.sort.each {|obj| obj.autosize} self.getZoneHVACWaterToAirHeatPumps.sort.each {|obj| obj.autosize} # Zone equipment # Air terminals self.getAirTerminalSingleDuctParallelPIUReheats.sort.each {|obj| obj.autosize} self.getAirTerminalSingleDuctVAVReheats.sort.each {|obj| obj.autosize} self.getAirTerminalSingleDuctUncontrolleds.sort.each {|obj| obj.autosize} # AirLoopHVAC components self.getAirLoopHVACs.sort.each {|obj| obj.autosize} self.getSizingSystems.sort.each {|obj| obj.autosize} # Fans self.getFanConstantVolumes.sort.each {|obj| obj.autosize} self.getFanVariableVolumes.sort.each {|obj| obj.autosize} self.getFanOnOffs.sort.each {|obj| obj.autosize} # Heating coils self.getCoilHeatingElectrics.sort.each {|obj| obj.autosize} self.getCoilHeatingGass.sort.each {|obj| obj.autosize} self.getCoilHeatingWaters.sort.each {|obj| obj.autosize} self.getCoilHeatingDXSingleSpeeds.sort.each {|obj| obj.autosize} # Cooling coils self.getCoilCoolingDXSingleSpeeds.sort.each {|obj| obj.autosize} self.getCoilCoolingDXTwoSpeeds.sort.each {|obj| obj.autosize} self.getCoilCoolingWaters.sort.each {|obj| obj.autosize} # Outdoor air self.getControllerOutdoorAirs.sort.each {|obj| obj.autosize} self.getHeatExchangerAirToAirSensibleAndLatents.sort.each {|obj| obj.autosize} # PlantLoop components self.getPlantLoops.sort.each {|obj| obj.autosize} # Pumps self.getPumpConstantSpeeds.sort.each {|obj| obj.autosize} self.getPumpVariableSpeeds.sort.each {|obj| obj.autosize} # Heating equipment self.getBoilerHotWaters.sort.each {|obj| obj.autosize} # Cooling equipment self.getChillerElectricEIRs.sort.each {|obj| obj.autosize} # Condenser equipment self.getCoolingTowerSingleSpeeds.sort.each {|obj| obj.autosize} # Controls self.getControllerWaterCoils.sort.each {|obj| obj.autosize} # VRF components # Refrigeration components return true end |
#coil_cooling_fuels(cooling_coil) ⇒ Object
Get the cooling fuel type of a cooling coil
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb', line 198 def coil_cooling_fuels(cooling_coil) fuels = [] # Get the object type obj_type = cooling_coil.iddObjectType.valueName.to_s case obj_type when 'OS_Coil_Cooling_DX_MultiSpeed' 'Electricity' when 'OS_Coil_Cooling_DX_SingleSpeed' fuels << 'Electricity' when 'OS_Coil_Cooling_DX_TwoSpeed' fuels << 'Electricity' when 'OS_Coil_Cooling_DX_TwoStageWithHumidityControlMode' fuels << 'Electricity' when 'OS_Coil_Cooling_DX_VariableRefrigerantFlow' fuels << 'Electricity' when 'OS_Coil_Cooling_DX_VariableSpeed' fuels << 'Electricity' when 'OS_Coil_Cooling_WaterToAirHeatPump_EquationFit' fuels << 'Electricity' when 'OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeed_EquationFit' fuels << 'Electricity' when 'OS_CoilSystem_Cooling_DX_HeatExchangerAssisted' fuels << 'Electricity' when 'OS_CoilSystem_Cooling_Water_HeatExchangerAssisted' fuels << 'Electricity' when 'OS_HeatPump_WaterToWater_EquationFit_Cooling' fuels << 'Electricity' when 'OS_Refrigeration_AirChiller' fuels << 'Electricity' when 'OS_Coil_Cooling_CooledBeam' cooling_coil = cooling_coil.to_CoilCoolingCooledBeam.get if cooling_coil.plantLoop.is_initialized fuels += self.plant_loop_cooling_fuels(cooling_coil.plantLoop.get) end when 'OS_Coil_Cooling_LowTemperatureRadiant_ConstantFlow' cooling_coil = cooling_coil.to_CoilCoolingLowTempRadiantConstFlow.get if cooling_coil.plantLoop.is_initialized fuels += self.plant_loop_cooling_fuels(cooling_coil.plantLoop.get) end when 'OS_Coil_Cooling_LowTemperatureRadiant_VariableFlow' cooling_coil = cooling_coil.to_CoilCoolingLowTempRadiantVarFlow.get if cooling_coil.plantLoop.is_initialized fuels += self.plant_loop_cooling_fuels(cooling_coil.plantLoop.get) end when 'OS_Coil_Cooling_Water' cooling_coil = cooling_coil.to_CoilCoolingWater.get if cooling_coil.plantLoop.is_initialized fuels += self.plant_loop_cooling_fuels(cooling_coil.plantLoop.get) end else OpenStudio::logFree(OpenStudio::Debug, 'openstudio.sizing.Model', "No cooling fuel types found for #{obj_type}") end return fuels.uniq.sort end |
#coil_heating_fuels(heating_coil) ⇒ Object
Get the heating fuel type of a heating coil
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb', line 132 def coil_heating_fuels(heating_coil) fuels = [] # Get the object type obj_type = heating_coil.iddObjectType.valueName.to_s case obj_type when 'OS_Coil_Heating_DX_MultiSpeed' fuels << 'Electricity' when 'OS_Coil_Heating_DX_SingleSpeed' fuels << 'Electricity' when 'OS_Coil_Heating_DX_VariableRefrigerantFlow' fuels << 'Electricity' when 'OS_Coil_Heating_DX_VariableSpeed' fuels << 'Electricity' when 'OS_Coil_Heating_Desuperheater' fuels << 'Electricity' when 'OS_Coil_Heating_Electric' fuels << 'Electricity' when 'OS_Coil_Heating_Gas' fuels << 'NaturalGas' when 'OS_Coil_Heating_Gas_MultiStage' fuels << 'NaturalGas' when 'OS_Coil_Heating_Water' heating_coil = heating_coil.to_CoilHeatingWater.get if heating_coil.plantLoop.is_initialized fuels += self.plant_loop_heating_fuels(heating_coil.plantLoop.get) end when 'OS_Coil_Heating_Water_BaseboardRadiant' heating_coil = heating_coil.to_CoilHeatingWaterBaseboardRadiant.get if heating_coil.plantLoop.is_initialized fuels += self.plant_loop_heating_fuels(heating_coil.plantLoop.get) end when 'OS_Coil_Heating_WaterToAirHeatPump_EquationFit' fuels << 'Electricity' heating_coil = heating_coil.to_CoilHeatingWaterToAirHeatPumpEquationFit.get if heating_coil.plantLoop.is_initialized fuels += self.plant_loop_heating_fuels(heating_coil.plantLoop.get) end when 'OS_Coil_Heating_WaterToAirHeatPump_VariableSpeedEquationFit' fuels << 'Electricity' heating_coil = heating_coil.to_CoilHeatingWaterToAirHeatPumpVariableSpeedEquationFit.get if heating_coil.plantLoop.is_initialized fuels += self.plant_loop_heating_fuels(heating_coil.plantLoop.get) end when 'OS_Coil_Heating_LowTemperatureRadiant_ConstantFlow' heating_coil = heating_coil.to_CoilHeatingLowTempRadiantConstFlow.get if heating_coil.plantLoop.is_initialized fuels += self.plant_loop_heating_fuels(heating_coil.plantLoop.get) end when 'OS_Coil_Heating_LowTemperatureRadiant_VariableFlow' heating_coil = heating_coil.to_CoilHeatingLowTempRadiantVarFlow.get if heating_coil.plantLoop.is_initialized fuels += self.plant_loop_heating_fuels(heating_coil.plantLoop.get) end when 'OS_Coil_WaterHeating_AirToWaterHeatPump' fuels << 'Electricity' when 'OS_Coil_WaterHeating_Desuperheater' fuels << 'Electricity' else OpenStudio::logFree(OpenStudio::Debug, 'openstudio.sizing.Model', "No heating fuel types found for #{obj_type}") end return fuels.uniq.sort end |
#eliminate_all_design_specification_outdoor_air ⇒ Object
This method removes all design specification OA from model.
643 644 645 646 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 643 def eliminate_all_design_specification_outdoor_air() self.getDesignSpecificationOutdoorAirs.sort.each {|item| item.remove} return self end |
#eliminate_all_electric_loads ⇒ Object
This method removes elec loads from model.
634 635 636 637 638 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 634 def eliminate_all_electric_loads() self.getElectricEquipments.sort.each {|item| item.remove} self.getElectricEquipmentDefinitions.sort.each {|item| item.remove} return self end |
#eliminate_all_lighting_loads ⇒ Object
This method removes light loads from model.
625 626 627 628 629 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 625 def eliminate_all_lighting_loads() self.getLightss.sort.each {|item| item.remove} self.getLightsDefinitions.sort.each {|item| item.remove} return self end |
#eliminate_all_loads ⇒ Object
This method removes all space loads from model.
659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 659 def eliminate_all_loads() conductance = 0.200 #self.set_all_ext_wall_conductances_to(conductance) #self.set_all_ext_roof_conductances_to(conductance) #self.set_all_ground_floor_conductances_to(conductance) #self.set_all_ground_wall_conductances_to(conductance) #self.set_all_ext_windows_and_door_conductances_to(conductance) #self.set_all_ext_skylight_conductances_to(conductance) self.eliminate_all_people_loads self.eliminate_all_lighting_loads self.eliminate_all_electric_loads self.eliminate_all_design_specification_outdoor_air self.eliminate_all_space_infiltration_design_flow_rates self.eliminate_all_space_infiltration_design_flow_rates return self end |
#eliminate_all_people_loads ⇒ Object
Elimination Methods This method removes people loads from the model.
616 617 618 619 620 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 616 def eliminate_all_people_loads() self.getPeoples.sort.each {|people| people.remove} self.getPeopleDefinitions.sort.each {|people| people.remove} return self end |
#eliminate_all_space_infiltration_design_flow_rates ⇒ Object
This method removes infiltration from model..
651 652 653 654 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 651 def eliminate_all_space_infiltration_design_flow_rates() self.getSpaceInfiltrationDesignFlowRates.sort.each {|item| item.remove} return self end |
#getAutosizedValue(object, value_name, units) ⇒ Object
A helper method to get component sizes from the model returns the autosized value as an optional double
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/openstudio-standards/hvac_sizing/Siz.Model.rb', line 280 def getAutosizedValue(object, value_name, units) result = OpenStudio::OptionalDouble.new name = object.name.get.upcase object_type = object.iddObject.type.valueDescription.gsub('OS:','') # Special logic for two coil types which are inconsistently # uppercase in the sqlfile: object_type = object_type.upcase if object_type == 'Coil:Cooling:WaterToAirHeatPump:EquationFit' object_type = object_type.upcase if object_type == 'Coil:Heating:WaterToAirHeatPump:EquationFit' object_type = 'Coil:Heating:GasMultiStage' if object_type == 'Coil:Heating:Gas:MultiStage' object_type = 'Coil:Heating:Fuel' if object_type == 'Coil:Heating:Gas' sql = self.sqlFile if sql.is_initialized sql = sql.get #SELECT * FROM ComponentSizes WHERE CompType = 'Coil:Heating:Gas' AND CompName = "COIL HEATING GAS 3" AND Description = "Design Size Nominal Capacity" query = "SELECT Value FROM ComponentSizes WHERE CompType='#{object_type}' AND CompName='#{name}' AND Description='#{value_name.strip}' AND Units='#{units}'" val = sql.execAndReturnFirstDouble(query) if val.is_initialized result = OpenStudio::OptionalDouble.new(val.get) else # TODO: comment following line (debugging new HVACsizing objects right now) # OpenStudio::logFree(OpenStudio::Warn, "openstudio.model.Model", "QUERY ERROR: Data not found for query: #{query}") end else OpenStudio::logFree(OpenStudio::Error, 'openstudio.model.Model', 'Model has no sql file containing results, cannot lookup data.') end return result end |
#getAutosizedValueFromEquipmentSummary(object, table_name, value_name, units) ⇒ Object
A helper method to get component sizes from the Equipment Summary of the TabularDataWithStrings Report returns the autosized value as an optional double
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
# File 'lib/openstudio-standards/hvac_sizing/Siz.Model.rb', line 325 def getAutosizedValueFromEquipmentSummary(object, table_name, value_name, units) result = OpenStudio::OptionalDouble.new name = object.name.get.upcase sql = self.sqlFile if sql.is_initialized sql = sql.get #SELECT * FROM ComponentSizes WHERE CompType = 'Coil:Heating:Gas' AND CompName = "COIL HEATING GAS 3" AND Description = "Design Size Nominal Capacity" query = "Select Value FROM TabularDataWithStrings WHERE ReportName = 'EquipmentSummary' AND TableName = '#{table_name}' AND RowName = '#{name}' AND ColumnName = '#{value_name}' AND Units = '#{units}'" val = sql.execAndReturnFirstDouble(query) if val.is_initialized result = OpenStudio::OptionalDouble.new(val.get) else # TODO: comment following line (debugging new HVACsizing objects right now) # OpenStudio::logFree(OpenStudio::Warn, "openstudio.model.Model", "QUERY ERROR: Data not found for query: #{query}") end else OpenStudio::logFree(OpenStudio::Error, 'openstudio.model.Model', 'Model has no sql file containing results, cannot lookup data.') end return result end |
#output_fan_report(csv_path = nil) ⇒ Array of Hash
Helper function to output the fan power for each fan in the model Todo: output actual bhp and allowable bhp for systems 3-4 and 5-8 Todo: remove maybe later?
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 |
# File 'lib/openstudio-standards/hvac_sizing/Siz.Model.rb', line 365 def output_fan_report(csv_path = nil) table = [] # Deal with all the constant volume fans self.getFanConstantVolumes.each do |fan| row = {:name=>fan.name.to_s, :type=>'Constant Volume', :rated_w_per_cfm=>fan.rated_w_per_cfm.round(2), :air_loop=>'', :hvac_component=>'', :zone_hvac_component=>''} if fan.airLoopHVAC.is_initialized row[:air_loop] = fan.airLoopHVAC.get.name.to_s elsif fan.containingHVACComponent.is_initialized row[:hvac_component] = fan.containingHVACComponent.get.name.to_s elsif fan.containingZoneHVACComponent.is_initialized row[:zone_hvac_component] = fan.containingZoneHVACComponent.get.name.to_s end # Add to table table << row end # Deal with all the constant volume fans self.getFanVariableVolumes.each do |fan| row = {:name=>fan.name.to_s, :type=>'Variable Volume', :rated_w_per_cfm=>fan.rated_w_per_cfm.round(2), :air_loop=>'', :hvac_component=>'', :zone_hvac_component=>''} if fan.airLoopHVAC.is_initialized row[:air_loop] = fan.airLoopHVAC.get.name.to_s elsif fan.containingHVACComponent.is_initialized row[:hvac_component] = fan.containingHVACComponent.get.name.to_s elsif fan.containingZoneHVACComponent.is_initialized row[:zone_hvac_component] = fan.containingZoneHVACComponent.get.name.to_s end # Add to table table << row end # Deal with all the constant volume fans self.getFanOnOffs.each do |fan| row = {:name=>fan.name.to_s, :type=>'On Off', :rated_w_per_cfm=>fan.rated_w_per_cfm.round(2), :air_loop=>'', :hvac_component=>'', :zone_hvac_component=>''} if fan.airLoopHVAC.is_initialized row[:air_loop] = fan.airLoopHVAC.get.name.to_s elsif fan.containingHVACComponent.is_initialized row[:hvac_component] = fan.containingHVACComponent.get.name.to_s elsif fan.containingZoneHVACComponent.is_initialized row[:zone_hvac_component] = fan.containingZoneHVACComponent.get.name.to_s end # Add to table table << row end # If a csv path is given, output if !csv_path.nil? && !table.first.nil? CSV.open(csv_path, "wb") do |csv| csv << table.first.keys # adds the attributes name on the first line table.each do |hash| csv << hash.values end end end return table end |
#perform_load_elimination_analysis(folder = Dir.pwd) ⇒ Object
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 173 def perform_load_elimination_analysis(folder = Dir.pwd) #remove hvac and only use ideal loads. model = self.clone(true).to_Model BTAP::Resources::HVAC::clear_all_hvac_from_model(model) model.getThermalZones.sort.each {|zone| zone.setUseIdealAirLoads(true)} conductance = 0.200 models = Array.new() #Add baseline models << {:name => 'baseline', :model => model} #Add copies of model with elimination of a characteristic. models << {:name => 'elim_ext_wall', :model => model.clone(true).to_Model} =begin models << {:name => 'elim_ext_roof', :model => model.clone(true).to_Model.set_all_ext_roof_conductances_to(conductance)} models << {:name => 'elim_ground_floor', :model => model.clone(true).to_Model.set_all_ground_floor_conductances_to(conductance)} models << {:name => 'elim_ground_wall', :model => model.clone(true).to_Model.set_all_ground_wall_conductances_to(conductance)} models << {:name => 'elim_win_doors', :model => model.clone(true).to_Model.set_all_ext_windows_and_door_conductances_to(conductance)} models << {:name => 'elim_skylights', :model => model.clone(true).to_Model.set_all_ext_skylight_conductances_to(conductance)} models << {:name => 'elim_people', :model => model.clone(true).to_Model.eliminate_all_people_loads} models << {:name => 'elim_lighting', :model => model.clone(true).to_Model.eliminate_all_lighting_loads} models << {:name => 'elim_plug_loads', :model => model.clone(true).to_Model.eliminate_all_electric_loads} models << {:name => 'elim_outdoor_air', :model => model.clone(true).to_Model.eliminate_all_design_specification_outdoor_air} models << {:name => 'elim_infiltration', :model => model.clone(true).to_Model.eliminate_all_space_infiltration_design_flow_rates} models << {:name => 'elim_all_loads', :model => model.clone(true).to_Model.eliminate_all_loads} =end #Get a handle for the baseline. baseline = models.find {|model| model[:name] == 'baseline' } #Create a result hash. result = Hash.new() models.each do |model| #run each model in its own folder. success = model_run_simulation_and_log_errors(model[:model], "#{folder}/#{model[:name]}") #Run the qa-qc method to get all the results. qa_qc = BTAP::perform_qaqc(model[:model]) #Store total energy in the hash model[:total_end_uses_gj_per_m2] = qa_qc[:end_uses_eui][:total_end_uses_gj_per_m2] #This assumes that the baseline is always the first in the hash. unless model[:name] = 'baseline' result[model[:name]] = model[:total_end_uses_gj_per_m2] / baseline[:total_end_uses_gj_per_m2] end end return result end |
#plant_loop_cooling_fuels(plant_loop) ⇒ Object
Get the cooling fuel type of a plant loop Do not search for the fuel used for heat rejection on the condenser loop.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb', line 88 def plant_loop_cooling_fuels(plant_loop) fuels = [] # Get the cooling fuels for all supply components # on this plant loop. plant_loop.supplyComponents.each do |component| # Get the object type obj_type = component.iddObjectType.valueName.to_s case obj_type when 'OS_Chiller_Absorption' fuels << 'NaturalGas' OpenStudio::logFree(OpenStudio::Warn, 'openstudio.sizing.Model', "Assuming NaturalGas as fuel for absorption chiller.") when 'OS_Chiller_Absorption_Indirect' fuels << 'NaturalGas' OpenStudio::logFree(OpenStudio::Warn, 'openstudio.sizing.Model', "Assuming NaturalGas as fuel for absorption chiller indirect.") when 'OS_Chiller_Electric_EIR' fuels << 'Electricity' when 'OS_CoolingTower_SingleSpeed' fuels << 'Electricity' when 'OS_CoolingTower_TwoSpeed' fuels << 'Electricity' when 'OS_CoolingTower_VariableSpeed' fuels << 'Electricity' when 'OS_DistrictCooling' fuels << 'DistrictCooling' when 'OS_EvaporativeFluidCooler_SingleSpeed' fuels << 'Electricity' when 'OS_EvaporativeFluidCooler_TwoSpeed' fuels << 'Electricity' when 'OS_FluidCooler_SingleSpeed' fuels << 'Electricity' when 'OS_FluidCooler_TwoSpeed' fuels << 'Electricity' when 'OS_Node', 'OS_Pump_ConstantSpeed', 'OS_Pump_VariableSpeed', 'OS_Connector_Splitter', 'OS_Connector_Mixer', 'OS_Pipe_Adiabatic' # To avoid extraneous debug messages else #OpenStudio::logFree(OpenStudio::Debug, 'openstudio.sizing.Model', "No cooling fuel types found for #{obj_type}") end end return fuels.uniq.sort end |
#plant_loop_heating_fuels(plant_loop) ⇒ Object
Get the heating fuel type of a plant loop @Todo: If no heating equipment is found, check if there’s a heat exchanger, or a WaterHeater:Mixed or stratified that is connected to a heating source on the demand side
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb', line 16 def plant_loop_heating_fuels(plant_loop) fuels = [] # Get the heating fuels for all supply components # on this plant loop. plant_loop.supplyComponents.each do |component| # Get the object type obj_type = component.iddObjectType.valueName.to_s case obj_type when 'OS_Boiler_HotWater' component = component.to_BoilerHotWater.get fuels << component.fuelType when 'OS_Boiler_Steam' component = component.to_BoilerHotWater.get fuels << component.fuelType when 'OS_DistrictHeating' fuels << 'DistrictHeating' when 'OS_HeatPump_WaterToWater_EquationFit_Heating' fuels << 'Electricity' when 'OS_SolarCollector_FlatPlate_PhotovoltaicThermal' fuels << 'SolarEnergy' when 'OS_SolarCollector_FlatPlate_Water' fuels << 'SolarEnergy' when 'OS_SolarCollector_IntegralCollectorStorage' fuels << 'SolarEnergy' when 'OS_WaterHeater_HeatPump' fuels << 'Electricity' when 'OS_WaterHeater_Mixed' component = component.to_WaterHeaterMixed.get # Check if the heater actually has a capacity (otherwise it's simply a Storage Tank) if component.heaterMaximumCapacity.empty? || component.heaterMaximumCapacity.get != 0 # If it does, we add the heater Fuel Type fuels << component.heaterFuelType end # @Todo: not sure about whether it should be an elsif or not # Check the plant loop connection on the source side if component.secondaryPlantLoop.is_initialized fuels += self.plant_loop_heating_fuels(component.secondaryPlantLoop.get) end when 'OS_WaterHeater_Stratified' component = component.to_WaterHeaterStratified.get # Check if the heater actually has a capacity (otherwise it's simply a Storage Tank) if component.heaterMaximumCapacity.empty? || component.heaterMaximumCapacity.get != 0 # If it does, we add the heater Fuel Type fuels << component.heaterFuelType end # @Todo: not sure about whether it should be an elsif or not # Check the plant loop connection on the source side if component.secondaryPlantLoop.is_initialized fuels += self.plant_loop_heating_fuels(component.secondaryPlantLoop.get) end when 'OS_HeatExchanger_FluidToFluid' hx = component.to_HeatExchangerFluidToFluid.get cooling_hx_control_types = ["CoolingSetpointModulated", "CoolingSetpointOnOff", "CoolingDifferentialOnOff", "CoolingSetpointOnOffWithComponentOverride"] cooling_hx_control_types.each {|x| x.downcase!} if !cooling_hx_control_types.include?(hx.controlType.downcase) && hx.secondaryPlantLoop.is_initialized fuels += self.plant_loop_heating_fuels(hx.secondaryPlantLoop.get) end when 'OS_Node', 'OS_Pump_ConstantSpeed', 'OS_Pump_VariableSpeed', 'OS_Connector_Splitter', 'OS_Connector_Mixer', 'OS_Pipe_Adiabatic' # To avoid extraneous debug messages else #OpenStudio::logFree(OpenStudio::Debug, 'openstudio.sizing.Model', "No heating fuel types found for #{obj_type}") end end return fuels.uniq.sort end |
#scale_all_people_loads(factor) ⇒ Object
Scale Global Changes
504 505 506 507 508 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 504 def scale_all_people_loads(factor) self.getPeoples.sort.each do |item| item.setMultiplier(item.multiplier * factor) end end |
#scale_electrical_loads(model, factor) ⇒ Object
This method will scale electrical loads.
562 563 564 565 566 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 562 def scale_electrical_loads(model, factor) self.getElectricEquipments.sort.each do |item| item.setMultiplier(item.multiplier * factor) end end |
#scale_electrical_loads_schedule(a_coef, b_coef, c_coef, time_shift = nil, time_sign = nil) ⇒ Object
This method will scale electrical loads schedule.
576 577 578 579 580 581 582 583 584 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 576 def scale_electrical_loads_schedule(a_coef, b_coef, c_coef, time_shift = nil, time_sign = nil) self.getElectricEquipments.sort.each do |item| BTAP::Resources::Schedules::modify_schedule!(self, item.schedule, a_coef, b_coef, c_coef, time_shift, time_sign) end end |
#scale_inflitration_loads(factor) ⇒ Object
This method will scale infiltration loads.
603 604 605 606 607 608 609 610 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 603 def scale_inflitration_loads(factor) self.getSpaceInfiltrationDesignFlowRates.sort.each do |infiltration_load| infiltration_load.setDesignFlowRate(infiltration_load.designFlowRate.get * factor) unless infiltration_load.designFlowRate.empty? infiltration_load.setFlowperSpaceFloorArea(infiltration_load.flowperSpaceFloorArea.get * factor) unless infiltration_load.flowperSpaceFloorArea.empty? infiltration_load.setFlowperExteriorSurfaceArea(infiltration_load.flowperExteriorSurfaceArea.get * factor) unless infiltration_load.flowperExteriorSurfaceArea.empty? infiltration_load.setAirChangesperHour(infiltration_load.airChangesperHour.get * factor) unless infiltration_load.airChangesperHour.empty? end end |
#scale_lighting_loads(factor) ⇒ Object
This method will scale lighting loads.
533 534 535 536 537 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 533 def scale_lighting_loads(factor) self.getLightss.sort.each do |item| item.setMultiplier(item.multiplier * factor) end end |
#scale_lighting_loads_schedule(a_coef, b_coef, c_coef, time_shift = nil, time_sign = nil) ⇒ Object
This method will scale lighting loads schedule.
547 548 549 550 551 552 553 554 555 556 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 547 def scale_lighting_loads_schedule(a_coef, b_coef, c_coef, time_shift = nil, time_sign = nil) model.getLightss.sort.each do |item| #Do an in-place modification of the schedule. BTAP::Resources::Schedules::modify_schedule!(self, item.schedule, a_coef, b_coef, c_coef, time_shift, time_sign) end end |
#scale_oa_loads(factor) ⇒ Object
This method will scale Outdoor Air loads.
590 591 592 593 594 595 596 597 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 590 def scale_oa_loads(factor) self.getDesignSpecificationOutdoorAirs.sort.each do |oa_def| oa_def.setOutdoorAirFlowperPerson(oa_def.outdoorAirFlowperPerson * factor) unless oa_def.isOutdoorAirFlowperPersonDefaulted oa_def.setOutdoorAirFlowperFloorArea(oa_def.outdoorAirFlowperFloorArea * factor) unless oa_def.isOutdoorAirFlowperFloorAreaDefaulted oa_def.setOutdoorAirFlowRate(oa_def.outdoorAirFlowRate * factor) unless oa_def.isOutdoorAirFlowRateDefaulted oa_def.setOutdoorAirFlowAirChangesperHour(oa_def.outdoorAirFlowAirChangesperHour * factor) unless oa_def.isOutdoorAirFlowAirChangesperHourDefaulted end end |
#scale_people_loads_schedule(a_coef, b_coef, c_coef, time_shift = nil, time_sign = nil) ⇒ Object
This method will scale people loads schedule.
518 519 520 521 522 523 524 525 526 527 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 518 def scale_people_loads_schedule(a_coef, b_coef, c_coef, time_shift = nil, time_sign = nil) model.getPeoples.sort.each do |item| #Do an in-place modification of the schedule. BTAP::Resources::Schedules::modify_schedule!(self, item.schedule, a_coef, b_coef, c_coef, time_shift, time_sign) end end |
#set_all_ext_roof_conductances_to(conductance) ⇒ Object
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 263 def set_all_ext_roof_conductances_to(conductance) #Set conductances to needed values in construction set if possible. self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index| BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!( self, "Sensitivity Def Cnst Set #{index}", default_construction_set, nil, nil, 1/conductance, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ) end #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type. self.getPlanarSurfaces.sort.each {|item| item.resetConstruction} #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil) return self end |
#set_all_ext_skylight_conductances_to(conductance) ⇒ Object
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 431 def set_all_ext_skylight_conductances_to(conductance) #Set conductances to needed values in construction set if possible. self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index| BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!( self, "Sensitivity Def Cnst Set #{index}", default_construction_set, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 1/conductance, nil, nil, nil, nil, nil, nil, nil, nil ) end #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type. self.getPlanarSurfaces.sort.each {|item| item.resetConstruction} #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil) return self end |
#set_all_ext_wall_conductances_to(conductance) ⇒ Object
Set global changes
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 221 def set_all_ext_wall_conductances_to(conductance) #Set conductances to needed values in construction set if possible. self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index| BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!( self, "Sensitivity Def Cnst Set #{index}", default_construction_set, 1/conductance, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ) end #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type. self.getPlanarSurfaces.sort.each {|item| item.resetConstruction} #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil) return self end |
#set_all_ext_windows_and_door_conductances_to(conductance) ⇒ Object
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 389 def set_all_ext_windows_and_door_conductances_to(conductance) #Set conductances to needed values in construction set if possible. self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index| BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!( self, "Sensitivity Def Cnst Set #{index}", default_construction_set, nil, nil, nil, nil, nil, nil, 1/conductance, nil, nil, 1/conductance, nil, nil, 1/conductance, 1/conductance, nil, nil, 1/conductance, nil, nil, nil, nil, nil, nil, nil, nil, nil ) end #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type. self.getPlanarSurfaces.sort.each {|item| item.resetConstruction} #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil) return self end |
#set_all_ground_floor_conductances_to(conductance) ⇒ Object
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 347 def set_all_ground_floor_conductances_to(conductance) #Set conductances to needed values in construction set if possible. self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index| BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!( self, "Sensitivity Def Cnst Set #{index}", default_construction_set, nil, nil, nil, nil, 1/conductance, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ) end #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type. self.getPlanarSurfaces.sort.each {|item| item.resetConstruction} #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil) return self end |
#set_all_ground_wall_conductances_to(conductance) ⇒ Object
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 305 def set_all_ground_wall_conductances_to(conductance) #Set conductances to needed values in construction set if possible. self.getDefaultConstructionSets.sort.each_with_index do |default_construction_set, index| BTAP::Resources::Envelope::ConstructionSets::customize_default_surface_construction_set_rsi!( self, "Sensitivity Def Cnst Set #{index}", default_construction_set, nil, nil, nil, 1/conductance, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ) end #sets all surfaces to use default constructions sets except adiabatic, where it does a hard assignment of the interior wall construction type. self.getPlanarSurfaces.sort.each {|item| item.resetConstruction} #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces(self, nil) return self end |
#set_all_inflitration_rates(setDesignFlowRate, setFlowperSpaceFloorArea, setFlowperExteriorSurfaceArea, setAirChangesperHour) ⇒ String
This method will set the infiltration magnitude.
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 |
# File 'lib/openstudio-standards/btap/btap.model.rb', line 481 def set_all_inflitration_rates(setDesignFlowRate, setFlowperSpaceFloorArea, setFlowperExteriorSurfaceArea, setAirChangesperHour) table = "name,infiltration_method,infiltration_design_flow_rate,infiltration_flow_per_space,infiltration_flow_per_exterior_area,infiltration_air_changes_per_hour\n" self.getSpaceInfiltrationDesignFlowRates.sort.each do |infiltration_load| infiltration_load.setAirChangesperHour(setAirChangesperHour) unless setAirChangesperHour.nil? infiltration_load.setDesignFlowRate(setDesignFlowRate) unless setDesignFlowRate.nil? infiltration_load.setFlowperSpaceFloorArea(setFlowperSpaceFloorArea) unless setFlowperSpaceFloorArea.nil? infiltration_load.setFlowperExteriorSurfaceArea(setFlowperExteriorSurfaceArea) unless setFlowperExteriorSurfaceArea.nil? table << infiltration_load.name.get.to_s << "," table << infiltration_load.designFlowRateCalculationMethod << "," infiltration_load.airChangesperHour.empty? ? ach = "NA" : ach = infiltration_load.airChangesperHour.get infiltration_load.designFlowRate.empty? ? dfr = "NA" : dfr = infiltration_load.designFlowRate.get infiltration_load.flowperSpaceFloorArea.empty? ? fsfa = "NA" : fsfa = infiltration_load.flowperSpaceFloorArea.get infiltration_load.flowperExteriorSurfaceArea.empty? ? fesa = "NA" : fesa = infiltration_load.flowperExteriorSurfaceArea.get table << "#{ach},#{dfr},#{fsfa},#{fesa}\n" end return table end |
#zone_airloop_cooling_fuels(zone) ⇒ Object
Get the cooling fuels for a zones airloop
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 |
# File 'lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb', line 448 def zone_airloop_cooling_fuels(zone) fuels = [] # Get the air loop that serves this zone air_loop = zone.airLoopHVAC if air_loop.empty? return fuels end air_loop = air_loop.get # Find fuel types of all equipment # on the supply side of this airloop. air_loop.supplyComponents.each do |component| # Get the object type obj_type = component.iddObjectType.valueName.to_s case obj_type when 'OS_AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypass' component = component.to_AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.get fuels += self.coil_cooling_fuels(component.coolingCoil) when 'OS_AirLoopHVAC_UnitaryHeatPump_AirToAir' component = component.to_AirLoopHVACUnitaryHeatPumpAirToAir.get fuels += self.coil_cooling_fuels(component.coolingCoil) when 'OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeed' component = component.to_AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.get fuels += self.coil_cooling_fuels(component.coolingCoil) when 'OS_AirLoopHVAC_UnitarySystem' component = component.to_AirLoopHVACUnitarySystem.get if component.coolingCoil.is_initialized fuels += self.coil_cooling_fuels(component.coolingCoil.get) end when 'OS_EvaporativeCooler_Direct_ResearchSpecial' fuels << 'Electricity' when 'OS_EvaporativeCooler_Indirect_ResearchSpecial' fuels << 'Electricity' when 'OS_Coil_Cooling_DX_MultiSpeed' fuels += self.coil_cooling_fuels(component) when 'OS_Coil_Cooling_DX_SingleSpeed' fuels += self.coil_cooling_fuels(component) when 'OS_Coil_Cooling_DX_TwoSpeed' fuels += self.coil_cooling_fuels(component) when 'OS_Coil_Cooling_DX_TwoStageWithHumidityControlMode' fuels += self.coil_cooling_fuels(component) when 'OS_Coil_Cooling_DX_VariableRefrigerantFlow' fuels += self.coil_cooling_fuels(component) when 'OS_Coil_Cooling_DX_VariableSpeed' fuels += self.coil_cooling_fuels(component) when 'OS_Coil_Cooling_WaterToAirHeatPump_EquationFit' fuels += self.coil_cooling_fuels(component) when 'OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeed_EquationFit' fuels += self.coil_cooling_fuels(component) when 'OS_CoilSystem_Cooling_DX_HeatExchangerAssisted' fuels += self.coil_cooling_fuels(component) when 'OS_CoilSystem_Cooling_Water_HeatExchangerAssisted' fuels += self.coil_cooling_fuels(component) when 'OS_Coil_Cooling_Water' fuels += self.coil_cooling_fuels(component) when 'OS_HeatPump_WaterToWater_EquationFit_Cooling' fuels += self.coil_cooling_fuels(component) when 'OS_Node', 'OS_Fan_ConstantVolume', 'OS_Fan_VariableVolume', 'OS_AirLoopHVAC_OutdoorAirSystem' # To avoid extraneous debug messages else #OpenStudio::logFree(OpenStudio::Debug, 'openstudio.sizing.Model', "No heating fuel types found for #{obj_type}") end end return fuels.uniq.sort end |
#zone_airloop_heating_fuels(zone) ⇒ Object
Get the heating fuels for a zones airloop
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 |
# File 'lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb', line 383 def zone_airloop_heating_fuels(zone) fuels = [] # Get the air loop that serves this zone air_loop = zone.airLoopHVAC if air_loop.empty? return fuels end air_loop = air_loop.get # Find fuel types of all equipment # on the supply side of this airloop. air_loop.supplyComponents.each do |component| # Get the object type obj_type = component.iddObjectType.valueName.to_s case obj_type when 'OS_AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypass' component = component.to_AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.get fuels += self.coil_heating_fuels(component.heatingCoil) when 'OS_AirLoopHVAC_UnitaryHeatPump_AirToAir' component = component.to_AirLoopHVACUnitaryHeatPumpAirToAir.get fuels += self.coil_heating_fuels(component.heatingCoil) when 'OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeed' component = component.to_AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.get fuels += self.coil_heating_fuels(component.heatingCoil) when 'OS_AirLoopHVAC_UnitarySystem' component = component.to_AirLoopHVACUnitarySystem.get if component.heatingCoil.is_initialized fuels += self.coil_heating_fuels(component.heatingCoil.get) end when 'OS_Coil_Heating_DX_MultiSpeed' fuels += self.coil_heating_fuels(component) when 'OS_Coil_Heating_DX_SingleSpeed' fuels += self.coil_heating_fuels(component) when 'OS_Coil_Heating_DX_VariableSpeed' fuels += self.coil_heating_fuels(component) when 'OS_Coil_Heating_Desuperheater' fuels += self.coil_heating_fuels(component) when 'OS_Coil_Heating_Electric' fuels += self.coil_heating_fuels(component) when 'OS_Coil_Heating_Gas' fuels += self.coil_heating_fuels(component) when 'OS_Coil_Heating_Gas_MultiStage' fuels += self.coil_heating_fuels(component) when 'OS_Coil_Heating_Water' fuels += self.coil_heating_fuels(component) when 'OS_Coil_Heating_WaterToAirHeatPump_EquationFit' fuels += self.coil_heating_fuels(component) when 'OS_Coil_Heating_WaterToAirHeatPump_VariableSpeed_EquationFit' fuels += self.coil_heating_fuels(component) when 'OS_Coil_WaterHeating_AirToWaterHeatPump' fuels += self.coil_heating_fuels(component) when 'OS_Coil_WaterHeating_Desuperheater' fuels += self.coil_heating_fuels(component) when 'OS_Node', 'OS_Fan_ConstantVolume', 'OS_Fan_VariableVolume', 'OS_AirLoopHVAC_OutdoorAirSystem' # To avoid extraneous debug messages else #OpenStudio::logFree(OpenStudio::Debug, 'openstudio.sizing.Model', "No heating fuel types found for #{obj_type}") end end return fuels.uniq.sort end |
#zone_equipment_cooling_fuels(zone) ⇒ Object
Get the cooling fuels for a zone
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb', line 339 def zone_equipment_cooling_fuels(zone) fuels = [] # Get the cooling fuels for all zone HVAC equipment zone.equipment.each do |equipment| # Get the object type obj_type = equipment.iddObjectType.valueName.to_s case obj_type when 'OS_AirTerminal_SingleDuct_ConstantVolume_CooledBeam' equipment = equipment.to_AirTerminalSingleDuctConstantVolumeCooledBeam.get fuels += self.coil_cooling_fuels(equipment.coilCoolingCooledBeam) when 'OS_AirTerminal_SingleDuct_ConstantVolume_FourPipeInduction' equipment = equipment.to_AirTerminalSingleDuctConstantVolumeFourPipeInduction.get if equipment.coolingCoil.is_initialized fuels += self.coil_cooling_fuels(equipment.coolingCoil.get) end when 'OS_ZoneHVAC_FourPipeFanCoil' equipment = equipment.to_ZoneHVACFourPipeFanCoil.get fuels += self.coil_cooling_fuels(equipment.coolingCoil) when 'OS_ZoneHVAC_LowTemperatureRadiant_ConstantFlow' equipment = equipment.to_ZoneHVACLowTempRadiantConstFlow.get fuels += self.coil_cooling_fuels(equipment.coolingCoil) when 'OS_ZoneHVAC_LowTemperatureRadiant_VariableFlow' equipment = equipment.to_ZoneHVACLowTempRadiantVarFlow.get fuels += self.coil_cooling_fuels(equipment.coolingCoil) when 'OS_Refrigeration_AirChiller' fuels << 'Electricity' when 'OS_ZoneHVAC_IdealLoadsAirSystem' fuels << 'DistrictCooling' when 'OS_ZoneHVAC_PackagedTerminalAirConditioner' fuels << 'Electricity' when 'OS_ZoneHVAC_PackagedTerminalHeatPump' fuels << 'Electricity' when 'OS_ZoneHVAC_TerminalUnit_VariableRefrigerantFlow' fuels << 'Electricity' else OpenStudio::logFree(OpenStudio::Debug, 'openstudio.sizing.Model', "No cooling fuel types found for #{obj_type}") end end return fuels.uniq.sort end |
#zone_equipment_heating_fuels(zone) ⇒ Object
Get the heating fuels for a zone @ return [Array<String>] an array of fuels
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 |
# File 'lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb', line 257 def zone_equipment_heating_fuels(zone) fuels = [] # Get the heating fuels for all zone HVAC equipment zone.equipment.each do |equipment| # Get the object type obj_type = equipment.iddObjectType.valueName.to_s case obj_type when 'OS_AirTerminal_SingleDuct_ConstantVolume_FourPipeInduction' equipment = equipment.to_AirTerminalSingleDuctConstantVolumeFourPipeInduction.get fuels += self.coil_heating_fuels(equipment.heatingCoil) when 'OS_AirTerminal_SingleDuct_ConstantVolume_Reheat' equipment = equipment.to_AirTerminalSingleDuctConstantVolumeReheat.get fuels += self.coil_heating_fuels(equipment.reheatCoil) when 'OS_AirTerminal_SingleDuct_InletSideMixer' # TODO when 'OS_AirTerminal_SingleDuct_ParallelPIUReheat' equipment = equipment.to_AirTerminalSingleDuctParallelPIUReheat.get fuels += self.coil_heating_fuels(equipment.reheatCoil) when 'OS_AirTerminal_SingleDuct_SeriesPIUReheat' equipment = equipment.to_AirTerminalSingleDuctSeriesPIUReheat.get fuels += self.coil_heating_fuels(equipment.reheatCoil) when 'OS_AirTerminal_SingleDuct_VAVHeatAndCool_Reheat' equipment = equipment.to_AirTerminalSingleDuctVAVHeatAndCoolReheat.get fuels += self.coil_heating_fuels(equipment.reheatCoil) when 'OS_AirTerminal_SingleDuct_VAV_Reheat' equipment = equipment.to_AirTerminalSingleDuctVAVReheat.get fuels += self.coil_heating_fuels(equipment.reheatCoil) when 'OS_ZoneHVAC_Baseboard_Convective_Water' equipment = equipment.to_ZoneHVACBaseboardConvectiveWater.get fuels += self.coil_heating_fuels(equipment.heatingCoil) when 'OS_ZoneHVAC_Baseboard_RadiantConvective_Water' equipment = equipment.to_ZoneHVACBaseboardRadiantConvectiveWater.get fuels += self.coil_heating_fuels(equipment.heatingCoil) when 'OS_ZoneHVAC_FourPipeFanCoil' equipment = equipment.to_ZoneHVACFourPipeFanCoil.get fuels += self.coil_heating_fuels(equipment.heatingCoil) when 'OS_ZoneHVAC_LowTemperatureRadiant_ConstantFlow' equipment = equipment.to_ZoneHVACLowTempRadiantConstFlow.get fuels += self.coil_heating_fuels(equipment.heatingCoil) when 'OS_ZoneHVAC_LowTemperatureRadiant_VariableFlow' equipment = equipment.to_ZoneHVACLowTempRadiantVarFlow.get fuels += self.coil_heating_fuels(equipment.heatingCoil) when 'OS_ZoneHVAC_UnitHeater' equipment = equipment.to_ZoneHVACUnitHeater.get fuels += self.coil_heating_fuels(equipment.heatingCoil) when 'OS_ZoneHVAC_UnitVentilator' equipment = equipment.to_ZoneHVACUnitVentilator.get if equipment.heatingCoil.is_initialized fuels += self.coil_heating_fuels(equipment.heatingCoil.get) end when 'OS_ZoneHVAC_Baseboard_Convective_Electric' fuels << 'Electricity' when 'OS_ZoneHVAC_Baseboard_RadiantConvective_Electric' fuels << 'Electricity' when 'OS_ZoneHVAC_HighTemperatureRadiant' equipment = equipment.to_ZoneHVACHighTemperatureRadiant.get fuels << equipment.fuelType when 'OS_ZoneHVAC_IdealLoadsAirSystem' fuels << 'DistrictHeating' when 'OS_ZoneHVAC_LowTemperatureRadiant_Electric' fuels << 'Electricity' when 'OS_ZoneHVAC_PackagedTerminalAirConditioner' equipment = equipment.to_ZoneHVACPackagedTerminalAirConditioner.get fuels += self.coil_heating_fuels(equipment.heatingCoil) when 'OS_ZoneHVAC_PackagedTerminalHeatPump' fuels << 'Electricity' when 'OS_ZoneHVAC_TerminalUnit_VariableRefrigerantFlow' fuels << 'Electricity' when 'OS_ZoneHVAC_WaterToAirHeatPump' # We also go check what fuel serves the loop on which the WSHP heating coil is equipment = equipment.to_ZoneHVACWaterToAirHeatPump.get fuels += self.coil_heating_fuels(equipment.heatingCoil) else OpenStudio::logFree(OpenStudio::Debug, 'openstudio.sizing.Model', "No heating fuel types found for #{obj_type}") end end return fuels.uniq.sort end |