NREL / OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
https://www.openstudio.net/
Other
494 stars 188 forks source link

`ZoneCapacitanceMultiplier:ResearchSpecial` GUID appears in IDF #5068

Closed shorowit closed 7 months ago

shorowit commented 8 months ago

Issue overview

If you use the ZoneCapacitanceMultiplierResearchSpecial object in your model, a GUID appears in the IDF for the Name field.

For example:

ZoneCapacitanceMultiplier:ResearchSpecial,
  {ad7fbff4-780c-44c5-829c-d078f3a9990a}, !- Name
  ,                                       !- Zone or ZoneList Name
  1,                                      !- Temperature Capacity Multiplier
  15,                                     !- Humidity Capacity Multiplier
  ,                                       !- Carbon Dioxide Capacity Multiplier
  ;                                       !- Generic Contaminant Capacity Multiplier

Details

Environment

Some additional details about your environment for this issue (if relevant):

jmarrec commented 7 months ago

I don't understand how it's possible: https://github.com/NREL/OpenStudio/blob/5de13e37adc429fce907e3c061ee86f4cdf171a9/src/energyplus/ForwardTranslator/ForwardTranslateZoneCapacitanceMultiplierResearchSpecial.cpp#L20-L28

I haven't been able to reproduce with 3.7.0:

m = OpenStudio::Model::exampleModel
zc = m.getZoneCapacitanceMultiplierResearchSpecial
ft = OpenStudio::EnergyPlus::ForwardTranslator.new
w = ft.translateModel(m)
puts w.getObjectsByType('ZoneCapacitanceMultiplier:ResearchSpecial')
ZoneCapacitanceMultiplier:ResearchSpecial,
  Zone Capacitance Multiplier Research Special, !- Name
  ,                                       !- Zone or ZoneList Name
  ,                                       !- Temperature Capacity Multiplier
  ,                                       !- Humidity Capacity Multiplier
  ,                                       !- Carbon Dioxide Capacity Multiplier
  ;                                       !- Generic Contaminant Capacity Multiplier
shorowit commented 7 months ago

Hmm, this was 3 weeks ago and I've forgotten what I was doing when I noticed this. You're right that the code sure makes it seem like this can't happen. I'll close this and reopen in the future (with more details) if I see it again.

shorowit commented 7 months ago

... and I figured it out right after I closed it. It happens when I do model.addObjects and end up with multiple ZoneCapacitanceMultiplierResearchSpecial objects in the model. I see the code above says it is a unique object even though E+ allows you to have multiple and assign these to a Zone or ZoneList, I guess because OpenStudio doesn't allow zone assignments. I don't know how OpenStudio is supposed to handle unique objects during model.addObjects, maybe it's simply up to the user to avoid it.

Anyway, that's how it happens. I'm going to reopen the issue, but feel free to close if it's an edge case or working as expected.

jmarrec commented 7 months ago

Can you give me an example of the code you use (/why you do it) that calls model.addObjects?

Is ModelMerger a potential alternative for you?

shorowit commented 7 months ago

When we model an entire residential multifamily building, we create an OSM for each dwelling unit (which may have the ZoneCapacitanceMultiplier:ResearchSpecial object) and then merge them down into a single OSM at the end. I wasn't actually aware of ModelMerger, thanks for pointing it out. Maybe it can simplify some of our code.

In any case, this issue is pretty minor, it's probably not worth the effort to try to address. I'm just going to close it.