Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
1

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

asked 2016-08-16 10:46:52 -0600

jugonzal07's avatar

updated 2017-08-05 08:08:11 -0600

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-08-16 16:26:17 -0600

updated 2016-08-16 16:29:32 -0600

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.

edit flag offensive delete link more

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 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

2 followers

Stats

Asked: 2016-08-16 10:46:52 -0600

Seen: 160 times

Last updated: Aug 16 '16