1

Issues writing HPWH open studio measure-- object attributes not being passed to OS

I'm writing a measure to add a HPWH to a zone and allowing users to specify a few of the heat pump water heater's (HPWH) parameters. Below is a code snippet showing how I'm currently specifying these attributes and adding the HPWH to the zone.

    hpwh = OpenStudio::Model::WaterHeaterHeatPump.new(model, hpwh_coil, water_heater, hpwh_fan,\
                                                      compressor_temp_setpoint_schedule,\
                                                      inlet_air_mixture_fraction_schedule)
    hpwh.setName('Heat Pump Water Heater')
    hpwh.setInletAirHumiditySchedule(inlet_air_humidity_schedule)
    hpwh.setInletAirTemperatureSchedule(inlet_air_temp_schedule)
    hpwh.setCompressorAmbientTemperatureSchedule(compressor_ambient_temp_schedule)

    #if packaged system
    if @location == 'Conditioned space'
      hpwh.setCompressorLocation('Zone')
      hpwh.setInletAirConfiguration('ZoneAirOnly')
      hpwh.setParasiticHeatRejectionLocation('Zone')
    else#if split system
      hpwh.setCompressorLocation('Outdoors')
      hpwh.setInletAirConfiguration('OutdoorAirOnly')
      hpwh.setParasiticHeatRejectionLocation('Outdoors')
    end

    hpwh.addToThermalZone(zone)

Issue/Question: Fields set by the if 'location== 'Conditioned space'' block are not getting passed over into OS. I ran a debugger and HPWH object seems to have these attributes set correctly, but when I go into OS, the compressor location is set to 'Zone' and inlet air configuration to 'ZoneAirOnly':

Screenshot from debugger

image description

Anybody have some thoughts as to why that might be? The rest of the fields (e.g. name, schedules) all came out correct.

Useful links:

Link to Documentation for HPWH

jugonzal07's avatar
681
jugonzal07
asked 2016-08-16 10:46:52 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2017-08-05 08:08:11 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

2

It appears that when you call addToThermalZone on the HPWH, OpenStudio assumes sets the compressor location, etc, to be zone-based. This happens here in the source code.

To fix this, try moving the line hpwh.addToThermalZone(zone) into the if block.

ericringold's avatar
10.6k
ericringold
answered 2016-08-16 16:26:17 -0500, updated 2016-08-16 16:29:32 -0500
edit flag offensive 0 remove flag delete link

Comments

Thanks Eric,

This is definitely the issue. I'll definitely peek at the source code in the future! I wasn't able to get your suggestion to work, but I was able to get it working this way (much uglier than I would like!). If any ruby guys know of a better way to directly edit the reference to the HPWH in the model, let me know, but this is how I grappled with it AFTER adding the HPWH to the zone.

model.getWaterHeaterHeatPumpByName(hpwh_name).get.setCompressorLocation('Outdoors')
model.getWaterHeaterHeatPumpByName(hpwh_name).get.setInletAirConfiguration('OutdoorAirOnly')
jugonzal07's avatar jugonzal07 (2016-08-17 10:51:30 -0500) edit
add a comment see more comments