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

Revision history [back]

click to hide/show revision 1
initial version

import ZoneHVACTerminalUnitVariableRefrigerantFlow from IDF file

I have a question specific to OpenStudio::Model::ZoneHVACTerminalUnitVariableRefrigerantFlow in OpenStudio 2.8.0.

Let's say I have an .IDF file that is organized as a library for ZoneHVACTerminalUnitVariableRefrigerantFlow units. That is to say, it has all the parameters for various ZoneHVACTerminalUnitVariableRefrigerantFlow, as well as for their respective supply fans, cooling coils and heating coils in a single file in IDF format.

I can get such a file pulled into an OpenStudio measure as follows:

library_file = OpenStudio::Workspace::load("#{File.dirname(__FILE__)}/resources/vrf_indoor_units_library.idf").get

Then I can do the following, provided I know the name library_vrf_indoor_unit_name for one of the library entries:

if not library_vrf_indoor_unit_name.empty?
  library_object = "ZoneHVAC_TerminalUnit_VariableRefrigerantFlow"
  library_check = library_file.getObjectByTypeAndName(library_object.to_IddObjectType, library_vrf_indoor_unit_name)
end

To get to the individual elements, I could then, for example, do the following:

if library_check.is_initialized then
  library_strings = library_check.get


  if not library_strings.getString(6).get.empty? then
    if library_strings.getString(6).get == "autosize" then
      model_vrf_indoor_unit.autosizeSupplyAirFlowRateDuringHeatingOperation()
    else
      model_vrf_indoor_unit.setSupplyAirFlowRateDuringHeatingOperation(library_strings.getDouble(6).get)
    end
  end


  if not library_strings.getString(11).get.empty? then
    model_schedule = availabilityschedule(runner, model, library_strings.getString(11).get)
    model_vrf_indoor_unit.setSupplyAirFanOperatingModeSchedule(model_schedule)
  end


  if not library_strings.getString(18).get.empty? then
    model_cooling_coil = modelcoolingcoil(runner, model, library_file, library_strings.getString(18).get)
    model_vrf_indoor_unit.setCoolingCoil(model_cooling_coil)
  end
end

It turns out that library_strings.getString(6).get (and others not show above) is indeed recognized and read properly. However, neither library_strings.getString(11).get nor library_strings.getString(18).get are recognized and read. The same is true, for example, for library_strings.getString(14).get (supply fan) and library_strings.getString(20).get (heating coil).

I just want to make sure I am doing this right and have justification to develop a workaround, and that I am not misinterpreting this, so that there may be another way to actually capture library_strings.getString(11,14,18,20).get without the need for a workaround.

Thank you.

import ZoneHVACTerminalUnitVariableRefrigerantFlow from IDF file

I have a question specific to OpenStudio::Model::ZoneHVACTerminalUnitVariableRefrigerantFlow in OpenStudio 2.8.0.

Let's say I have an .IDF file that is organized as a library for ZoneHVACTerminalUnitVariableRefrigerantFlow units. That is to say, it has all the parameters for various ZoneHVACTerminalUnitVariableRefrigerantFlow, as well as for their respective supply fans, cooling coils and heating coils in a single file in IDF format.

I can get such a file pulled into an OpenStudio measure as follows:

library_file = OpenStudio::Workspace::load("#{File.dirname(__FILE__)}/resources/vrf_indoor_units_library.idf").get

Then I can do the following, provided I know the name library_vrf_indoor_unit_name for one of the library entries:

if not library_vrf_indoor_unit_name.empty?
  library_object = "ZoneHVAC_TerminalUnit_VariableRefrigerantFlow"
  library_check = library_file.getObjectByTypeAndName(library_object.to_IddObjectType, library_vrf_indoor_unit_name)
end

To get to the individual elements, I could then, for example, do the following:

if library_check.is_initialized then
  library_strings = library_check.get


  if not library_strings.getString(6).get.empty? then
    if library_strings.getString(6).get == "autosize" then
      model_vrf_indoor_unit.autosizeSupplyAirFlowRateDuringHeatingOperation()
    else
      model_vrf_indoor_unit.setSupplyAirFlowRateDuringHeatingOperation(library_strings.getDouble(6).get)
    end
  end


  if not library_strings.getString(11).get.empty? then
    model_schedule = availabilityschedule(runner, model, library_strings.getString(11).get)
    model_vrf_indoor_unit.setSupplyAirFanOperatingModeSchedule(model_schedule)
  end


  if not library_strings.getString(18).get.empty? then
    model_cooling_coil = modelcoolingcoil(runner, model, library_file, library_strings.getString(18).get)
    model_vrf_indoor_unit.setCoolingCoil(model_cooling_coil)
  end
end

It turns out that library_strings.getString(6).get (and others not show above) is indeed recognized and read properly. However, neither library_strings.getString(11).get nor library_strings.getString(18).get are recognized and read. The same is true, for example, for library_strings.getString(14).get (supply fan) and library_strings.getString(20).get (heating coil).

I just want to make sure I am doing this right and have justification to develop a workaround, and that I am not misinterpreting this, so that there may be another way to actually capture library_strings.getString(11,14,18,20).get without the need for a workaround.

Thank you.