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.
I find working with workspace objects (EnergyPlus measures) more difficult than OpenStudio measures. Could you convert the library to JSON (or epJSON) so that it could be used in an OS measure?
I would take your IDF library, create a script to import the IDF into OS and manipulate them inside OpenStudio. That way you will have access to all the nice methods for the
ZoneHVACTerminalUnitVariableRefrigerantFlow
object. Currently, I do the same to manipulate a catalog of manufacturer indoor units inside OpenStudio.@Luis Lara does importing
ZoneHVACTerminalUnitVariableRefrigerantFlow
objects from an IDF work? It doesn't look like they're reverse translated... https://github.com/NREL/OpenStudio/tr...I tried importing this IDF example file (https://github.com/NREL/EnergyPlus/bl...) with OS 2.8.0 but it returned a message saying that it was not imported:
AirConditioner:VariableRefrigerantFlow named VRF Heat Pump
ZoneTerminalUnitList named VRF Heat Pump TU List
ZoneHVAC:TerminalUnit:VariableRefrigerantFlow named TU1
ZoneHVAC:TerminalUnit:VariableRefrigerantFlow named TU2
ZoneHVAC:TerminalUnit:VariableRefrigerantFlow named TU4
So it looks like it is not possible to import them automatically.
So, I know that the reverse translator cannot do much more than a few curves. That is why I am going to getString, getDouble, getInt straight from the IDF file. The whole approach has worked fine for me on may occasions. The issue is that the
line is very selective in what it loads. It catches most getDouble and getInt items just fine, and many getString items as well. However, in this instance, it specifically does not catch the cooling coil, heating coil or supply fan names.