![]() | 1 | initial version |
TL;DR: You don't have to define your own PlantEquipmentOperation schemes. The issue is that you do not have any supply equipment on the source loop...
You also have a variety of other problems.
Remove heating_hp.addToNode(hw_inlet)
and cooling_hp.addToNode(cw_inlet)
, you are already calling
heating_loop.addSupplyBranchForComponent(heating_hp)
cooling_loop.addSupplyBranchForComponent(cooling_hp)
You are missing setting the SizingPlant parameters such as design loop temperature, design temperature difference, and loop type.
You are missing a pump on all loops.
You probably want to set both HeatPumpWaterToWaterEquationFit Heating/Cooling as being Companions to each other. And you probably want to set some parameters on them (COP, might end up needing to hardsize some stuff)
Here is a working example that shows the API, I repurposed this: https://github.com/NREL/OpenStudio-resources/blob/develop/model/simulationtests/heatpump_plantloop_eir.rb
###############################################################################
# M A K E S O M E L O O P S #
###############################################################################
############### HEATING / COOLING (LOAD) LOOPS ###############
hw_loop = OpenStudio::Model::PlantLoop.new(model)
hw_loop.setName('Hot Water Loop Air Source')
hw_loop.setMinimumLoopTemperature(10)
hw_temp_f = 140
hw_delta_t_r = 20 # 20F delta-T
hw_temp_c = OpenStudio.convert(hw_temp_f, 'F', 'C').get
hw_delta_t_k = OpenStudio.convert(hw_delta_t_r, 'R', 'K').get
hw_temp_sch = OpenStudio::Model::ScheduleRuleset.new(model)
hw_temp_sch.defaultDaySchedule.addValue(OpenStudio::Time.new(0, 24, 0, 0), hw_temp_c)
hw_stpt_manager = OpenStudio::Model::SetpointManagerScheduled.new(model, hw_temp_sch)
hw_stpt_manager.addToNode(hw_loop.supplyOutletNode)
sizing_plant = hw_loop.sizingPlant
sizing_plant.setLoopType('Heating')
sizing_plant.setDesignLoopExitTemperature(hw_temp_c)
sizing_plant.setLoopDesignTemperatureDifference(hw_delta_t_k)
# Pump
hw_pump = OpenStudio::Model::PumpVariableSpeed.new(model)
hw_pump_head_ft_h2o = 60.0
hw_pump_head_press_pa = OpenStudio.convert(hw_pump_head_ft_h2o, 'ftH_{2}O', 'Pa').get
hw_pump.setRatedPumpHead(hw_pump_head_press_pa)
hw_pump.setPumpControlType('Intermittent')
hw_pump.addToNode(hw_loop.supplyInletNode)
chw_loop = OpenStudio::Model::PlantLoop.new(model)
chw_loop.setName('Chilled Water Loop Air Source')
chw_loop.setMaximumLoopTemperature(98)
chw_loop.setMinimumLoopTemperature(1)
chw_temp_f = 44
chw_delta_t_r = 10.1 # 10.1F delta-T
chw_temp_c = OpenStudio.convert(chw_temp_f, 'F', 'C').get
chw_delta_t_k = OpenStudio.convert(chw_delta_t_r, 'R', 'K').get
chw_temp_sch = OpenStudio::Model::ScheduleRuleset.new(model)
chw_temp_sch.defaultDaySchedule.addValue(OpenStudio::Time.new(0, 24, 0, 0), chw_temp_c)
chw_stpt_manager = OpenStudio::Model::SetpointManagerScheduled.new(model, chw_temp_sch)
chw_stpt_manager.addToNode(chw_loop.supplyOutletNode)
sizing_plant = chw_loop.sizingPlant
sizing_plant.setLoopType('Cooling')
sizing_plant.setDesignLoopExitTemperature(chw_temp_c)
sizing_plant.setLoopDesignTemperatureDifference(chw_delta_t_k)
# Pump
pri_chw_pump = OpenStudio::Model::HeaderedPumpsConstantSpeed.new(model)
pri_chw_pump.setName('Chilled Water Loop Primary Pump Air Source')
pri_chw_pump_head_ft_h2o = 15
pri_chw_pump_head_press_pa = OpenStudio.convert(pri_chw_pump_head_ft_h2o, 'ftH_{2}O', 'Pa').get
pri_chw_pump.setRatedPumpHead(pri_chw_pump_head_press_pa)
pri_chw_pump.setMotorEfficiency(0.9)
pri_chw_pump.setPumpControlType('Intermittent')
pri_chw_pump.addToNode(chw_loop.supplyInletNode)
############ C O N D E N S E R S I D E ##################
cw_loop = OpenStudio::Model::PlantLoop.new(model)
cw_loop.setName('Condenser Water Loop Water Source')
cw_loop.setMaximumLoopTemperature(100)
cw_loop.setMinimumLoopTemperature(3)
cw_loop.setPlantLoopVolume(1.0)
cw_temp_sizing_f = 102 # CW sized to deliver 102F
cw_delta_t_r = 10 # 10F delta-T
cw_temp_sizing_c = OpenStudio.convert(cw_temp_sizing_f, 'F', 'C').get
cw_delta_t_k = OpenStudio.convert(cw_delta_t_r, 'R', 'K').get
sizing_plant = cw_loop.sizingPlant
sizing_plant.setLoopType('Condenser')
sizing_plant.setDesignLoopExitTemperature(cw_temp_sizing_c)
sizing_plant.setLoopDesignTemperatureDifference(cw_delta_t_k)
cw_pump = OpenStudio::Model::PumpVariableSpeed.new(model)
cw_pump.setName('Condenser Water Loop Pump Water Source')
cw_pump_head_ft_h2o = 60.0
cw_pump_head_press_pa = OpenStudio.convert(cw_pump_head_ft_h2o, 'ftH_{2}O', 'Pa').get
cw_pump.setRatedPumpHead(cw_pump_head_press_pa)
cw_pump.addToNode(cw_loop.supplyInletNode)
groundHX = OpenStudio::Model::GroundHeatExchangerVertical.new(model)
# THe default isn't the same as the E+ example file (and apparently wrong)
groundHX.setUTubeDistance(5.1225E-02)
cw_loop.addSupplyBranchForComponent(groundHX)
ground_temp = OpenStudio::Model::SiteGroundTemperatureDeep.new(model)
ground_temp.setAllMonthlyTemperatures(
[13.03, 13.03, 13.13, 13.30, 13.43, 13.52, 13.62, 13.77, 13.78, 13.55, 13.44, 13.20]
)
spm_ground = OpenStudio::Model::SetpointManagerFollowGroundTemperature.new(model)
spm_ground.setControlVariable('Temperature')
spm_ground.setOffsetTemperatureDifference(0.0)
spm_ground.setMaximumSetpointTemperature(80.0)
spm_ground.setMinimumSetpointTemperature(10.0)
spm_ground.setReferenceGroundTemperatureObjectType('Site:GroundTemperature:Deep')
spm_ground.addToNode(cw_loop.supplyOutletNode)
###############################################################
###############################################################################
# W A T E R S O U R C E H P #
###############################################################################
plhp_watersource_htg = OpenStudio::Model::HeatPumpWaterToWaterEquationFitHeating.new(model)
plhp_watersource_clg = OpenStudio::Model::HeatPumpWaterToWaterEquationFitCooling.new(model)
plhp_watersource_htg.setName('Heat Pump Plant Loop EIR Heating - WaterSource')
plhp_watersource_htg.setCompanionCoolingHeatPump(plhp_watersource_clg)
# No: you can't do it! We enforce the condenserType <=> secondaryPlantLoop relationship.
# Instead when you call addDemandBranchForComponent(plhp_watersource_clg)
# It will switch it to WaterSource
# plhp_watersource_htg.setCondenserType('WaterSource')
HARDSIZE = false
if HARDSIZE
plhp_watersource_htg.setReferenceLoadSideFlowRate(0.005)
plhp_watersource_htg.setReferenceSourceSideFlowRate(0.002)
plhp_watersource_htg.setRatedHeatingCapacity(80000)
plhp_watersource_htg.setReferenceCoefficientofPerformance(3.5)
plhp_watersource_htg.setSizingFactor(1)
end
plhp_watersource_htg.heatingCapacityCurve.setName('Heating CapCurve Water Source')
plhp_watersource_htg.heatingCompressorPowerCurve.setName('Heating CompPower Water Source')
plhp_watersource_clg.setName('Heat Pump Plant Loop EIR Cooling - WaterSource')
plhp_watersource_clg.setCompanionHeatingHeatPump(plhp_watersource_htg)
# plhp_watersource_clg.setCondenserType('WaterSource')
if HARDSIZE
plhp_watersource_clg.setReferenceLoadSideFlowRate(0.005)
plhp_watersource_clg.setReferenceSourceSideFlowRate(0.003)
plhp_watersource_clg.setRatedCoolingCapacity(400000)
plhp_watersource_clg.setReferenceCoefficientofPerformance(3.5)
plhp_watersource_clg.setSizingFactor(1)
plhp_watersource_clg.coolingCapacityCurve.setName('Cooling CapCurve Water Source')
plhp_watersource_clg.coolingCompressorPowerCurve.setName('Cooling CompPower Water Source')
end
hw_loop.addSupplyBranchForComponent(plhp_watersource_htg)
chw_loop.addSupplyBranchForComponent(plhp_watersource_clg)
# This switches them to 'WaterSource' condenser type
cw_loop.addDemandBranchForComponent(plhp_watersource_htg)
cw_loop.addDemandBranchForComponent(plhp_watersource_clg)