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

Changing the idd file for energyplus measures

asked 2018-07-26 17:22:39 -0500

mldichter's avatar

updated 2018-08-11 11:54:19 -0500

I tried modifying the Energy+.idd files in two locations to customize the field values of an object created in an energyplus measure. The two idd files I modified are
C:\openstudio-2.6.0\EnergyPlus\Energy+.idd
and
C:\EnergyPlusV8-9-0\Energy+.idd

As an example, I choose to modify the "Outdoor Air Equipment List Name" of the AirLoopHVAC:OutdoorAirSystem object.

AirLoopHVAC:OutdoorAirSystem,
  DOAS OA System,                         !- Name
  DOAS OA System Controllers,             !- Controller List Name
  DOAS OA System Equipment,               !- Outdoor Air Equipment List Name
  DOAS Availability Managers;             !- Availability Manager List Name

I attempted to write this object to the idf file using

  string_object = "
AirLoopHVAC:OutdoorAirSystem,
  DOAS OA System,                         !- Name
  DOAS OA System Controllers,             !- Controller List Name
  ,                                       !- Outdoor Air Equipment List Name
  DOAS Availability Managers;             !- Availability Manager List Name
      "
  idfObject = OpenStudio::IdfObject::load(string_object)
  object = idfObject.get
  wsObject = workspace.addObject(object)

but the "DOAS OA System Equipment" object hadn't been defined yet, meaning assigning "DOAS OA System Equipment" to the "Outdoor Air Equipment List Name" would be invalid since the referenced object doesn't exist yet. So the idf file contained this instead

AirLoopHVAC:OutdoorAirSystem,
  DOAS OA System,                         !- Name
  DOAS OA System Controllers,             !- Controller List Name
  ,                                       !- Outdoor Air Equipment List Name
  DOAS Availability Managers;             !- Availability Manager List Name

So I modified the AirLoopHVAC:OutdoorAirSystem portion of the Energy+.idd file in both locations.

AirLoopHVAC:OutdoorAirSystem,
       \memo Outdoor air subsystem for an AirLoopHVAC. Includes an outdoor air mixing box and
       \memo optional outdoor air conditioning equipment such as heat recovery, preheat, and precool
       \memo coils. From the perspective of the primary air loop the outdoor air system is treated
       \memo as a single component.
       \min-fields 3
   A1, \field Name
       \required-field
       \type alpha
       \reference-class-name validBranchEquipmentTypes
       \reference validBranchEquipmentNames
   A2, \field Controller List Name
       \note Enter the name of an AirLoopHVAC:ControllerList object.
       \required-field
       \type object-list
       \object-list ControllerLists
   A3, \field Outdoor Air Equipment List Name
       \note Enter the name of an AirLoopHVAC:OutdoorAirSystem:EquipmentList object.
       \required-field
       \type object-list
       \object-list AirLoopOAEquipmentLists
   A4; \field Availability Manager List Name
       \note Enter the name of an AvailabilityManagerAssignmentList object.
       \type object-list
       \object-list SystemAvailabilityManagerLists

changing the A3 field to

   A3, \field Outdoor Air Equipment List Name
       \note Enter the name of an AirLoopHVAC:OutdoorAirSystem:EquipmentList object.
       \required-field
       \type alpha

The change showed up in the IDFEditor as the required orange color when the field is blank was gone, but the measure still failed to put "DOAS OA System Equipment" in the A3 field since the "DOAS OA System Equipment" object hadn't been defined yet.

So if the idd file for openstudio and the different idd file energyplus don't control the behavior for energyplus measures modifying objects, what does?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2018-11-14 13:37:46 -0500

mldichter's avatar

In a related question

https://unmethours.com/question/34887...

@rraustad's answer
...The problem here is that the last 2 versions of E+ no longer read the idd at runtime and changing these characteristics of objects in the idd does not take effect unless the program is compiled (i.e., you will not be able to correct it by only changing the idd). Compiling the program will create a new Energy+.schema.epJSON file which is read during program execution. The plan is to eventually remove the idd file and use only JSON format.

So looks like the equivalent of changing the idd file for ruby measures is not such an easy fix anymore.

edit flag offensive delete link more

Comments

But should still work as long as the idd is distributed.

rraustad's avatar rraustad  ( 2018-11-14 21:38:42 -0500 )edit

@rraustad Correct! Relevant energyplus github issue.

https://github.com/NREL/EnergyPlus/is...

EnergyPlus IDD changes do not normally propogate into OpenStudio until after the next official EnergyPlus release, which would be v9.1 planned for March 2019.

mldichter's avatar mldichter  ( 2018-11-19 15:04:49 -0500 )edit
1

answered 2018-11-14 14:16:14 -0500

It is okay to set the "Outdoor Air Equipment List Name" input field to "DOAS OA System Equipment" before the corresponding outdoor air equipment list object is created. EnergyPlus doesn't care if the outdoor air equipment list is defined above or below the outdoor air system that references the equipment list. You'll just need to be sure that this measure or another measure eventually does add an outdoor air equipment list object with the same "DOAS OA System Equipment" name. You could also use a variable within this measure (oa_equip_list_name, for example) to be applied in both places of the model.

string_object = "
AirLoopHVAC:OutdoorAirSystem,
  DOAS OA System,                          !- Name
  DOAS OA System Controllers,         !- Controller List Name
  #{oa_equip_list_name},                 !- Outdoor Air Equipment List Name
  DOAS Availability Managers;           !- Availability Manager List Name

AirLoopHVAC:OutdoorAirSystem:EquipmentList,
  #{oa_equip_list_name},                  !- Name
  HeatExchanger:AirToAir:FlatPlate,  !- Component 1 Object Type
  OA Heat Recovery 1;                       !- Component 1 Name
      "
  idfObject = OpenStudio::IdfObject::load(string_object)
  object = idfObject.get
  wsObject = workspace.addObject(object)

Note that #{variable} is how you insert a variable within a string. I would recommend reviewing the EnergyPlus Measures section of OpenStudio's Measure Writing Guide for more details.

edit flag offensive delete link more

Comments

@Aaron Boranian I currently use the workspace.addObjects() function, plural. The major disadvantage of is every time energyplus updated an object the measure created, which was likely to happen in air loops, then none of the objects would be added. These were difficult to debug. Most recently this happened with the RunPeriod object changing from energyplus 8.9 to 9.0 version. My workspace.addObjects() line in my measure added nothing at all to the idf because the RunPeriod object was deemed invalid.

Do you know how to force workspace.addObject() to add an invalid object field?

mldichter's avatar mldichter  ( 2018-11-14 16:32:25 -0500 )edit

@Aaron Boranian This is also a problem with adding a Fan:SystemModel object name to a Branch object field because openstudio currently considers that invalid, which is really messing with my automatic model generation. See

https://unmethours.com/question/34887...

This one is a big problem because there is no easy way to fix it, for me at least. I'm told I'd have to recompile openstudio, which is a bit out of my league.

mldichter's avatar mldichter  ( 2018-11-14 16:34:10 -0500 )edit

@Aaron Boranian What I'd really like is the ability to force a measure to insert any string in any field of any object in the idf file, and then looking at the idf file to determine which added objects are invalid or invalid. This is similar to the top of

https://unmethours.com/question/32993...

where I was having trouble with adding objects in the correct order.

mldichter's avatar mldichter  ( 2018-11-14 16:42:04 -0500 )edit
mldichter's avatar mldichter  ( 2018-11-14 16:56:49 -0500 )edit

There are three related issues in the NREL/EnergyPlus github and NREL/openstudio-standards github.

https://github.com/NREL/EnergyPlus/is...

https://github.com/NREL/openstudio-st...

https://github.com/NREL/openstudio-st...

mldichter's avatar mldichter  ( 2018-11-14 17:15:33 -0500 )edit

Your Answer

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

Add Answer

Careers

Question Tools

3 followers

Stats

Asked: 2018-07-26 17:22:39 -0500

Seen: 471 times

Last updated: Nov 14 '18