Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

OpenStudio IDF->epJSON missing lcc_price_escalation_name attribute #4419

Closed
tijcolem opened this issue Aug 26, 2021 · 3 comments · Fixed by #4420
Closed

OpenStudio IDF->epJSON missing lcc_price_escalation_name attribute #4419

tijcolem opened this issue Aug 26, 2021 · 3 comments · Fixed by #4420

Comments

@tijcolem
Copy link
Collaborator

Issue overview

The OpenStudio IDF->epJSON translator works for all the idf examples specified in the test cases show here (https://github.com/NREL/OpenStudio/blob/develop/src/epjson/test/epJSONTranslator_GTest.cpp#L127-L391), which is very thorough and has good coverage, however, upon working with the OpenStudio-workflow gem to accommodate epJSON format, there appears to be missing attribute in the converted IDF>-epJSON when running the compact osw example file, which appears to related to the inclusion of the LifeCycleCost:UsePriceEscalation in the IDF file. This results in a missing attribute lcc_price_escalation_name that does not get included in the converted epJSON file. However, when running the energyplus IDF->epJSON, this attribute does get included.

Here is the EnergyPlus error when trying to run the OS converted epJSON file.

Program Version,EnergyPlus, Version 9.5.0-de239b2e5f, YMD=2021.08.26 12:19,
    ** Severe  ** <root>[LifeCycleCost:UsePriceEscalation][U.S. Avg  Commercial-Coal] - Missing required property 'lcc_price_escalation_name'.
    **  Fatal  ** Errors occurred on processing input file. Preceding condition(s) cause termination.
    ...Summary of Errors that led to program termination:
    ..... Reference severe error count=1
    ..... Last severe error=<root>[LifeCycleCost:UsePriceEscalation][U.S. Avg  Commercial-Coal] - Missing required property 'lcc_price_escalation_name'.
    ************* Warning:  Node connection errors not checked - most system input has not been read (see previous warning).
    ************* Fatal error -- final processing.  Program exited before simulations began.  See previous error messages.
    ************* EnergyPlus Warmup Error Summary. During Warmup: 0 Warning; 0 Severe Errors.
    ************* EnergyPlus Sizing Error Summary. During Sizing: 0 Warning; 0 Severe Errors.
    ************* EnergyPlus Terminated--Fatal Error Detected. 0 Warning; 1 Severe Errors; Elapsed Time=00hr 00min  0.24sec

This lcc_price_escalation_name does appear to be a required field as indicated in the Energy+.schema.epJSON

Current Behavior

When the attached idf.tar.gz is converted using OpenStudio IDF->epJSON and ran via EnergyPlus, it fails.

Expected Behavior

It should run.

Steps to Reproduce

1 ) Use the attached idf.tar.gz file and run the following ruby code below to generate an epJSON file.

 idf = OpenStudio::Workspace.load("in.idf")
 idf = idf.get
 model_epjson = OpenStudio::EPJSON::toJSONString(idf)
   File.open("in.epJSON", 'w') do |f|
     f << model_epjson.to_s
     begin
       f.fsync
     rescue StandardError
       f.flush
     end
   end

2 ) Try and run the the converted in.epJSON file using EnergyPlus

energyplus in.epJSON

The above should throw the missing attribute error as noted above.

If you use the energyplus build in IDF->epJSON converter, the converted epJSON file does have these attributes and it runs using energyplus. e.g.

energyplus --convert-only in.idf 
energyplus in.epJSON

Possible Solution

Include these missing attributes in the epJSON. I did this as a test manually and it worked fine.

Environment

OpenStudio Version: 3.2.2-alpha+0b7f7ab0b4
Platform: OSX 10.15.7

@tijcolem tijcolem added Triage Issue needs to be assessed and labeled, further information on reported might be needed component - epJSON severity - Normal Bug and removed Triage Issue needs to be assessed and labeled, further information on reported might be needed labels Aug 26, 2021
@jmarrec
Copy link
Collaborator

jmarrec commented Aug 27, 2021

@tijcolem this needs a custom mapping in the epJSONTranslator.

E+ uses a different field than 'Name' which is annoying because workspaceObject.name() fails to return a value. So we do name it 'Name' in our idd. Here's the diff Energy+.idd > OpenStudio.idd

LifeCycleCost:UsePriceEscalation,
-   A1,  \field LCC Price Escalation Name
+   A1,  \field Name

@jmarrec jmarrec self-assigned this Aug 27, 2021
jmarrec added a commit that referenced this issue Aug 27, 2021
Diff from E+ to OS ProposedEnergy+.idd, due to that fact that otherwise workspaceObject.name() returns uninitialized

```diff
LifeCycleCost:UsePriceEscalation,
-   A1,  \field LCC Price Escalation Name
+   A1,  \field Name
```
@tijcolem
Copy link
Collaborator Author

Thanks @jmarrec. I assume this would be the first custom map added as I didn't see any when looking through the epJSON code.

@jmarrec
Copy link
Collaborator

jmarrec commented Aug 27, 2021

There was one already, cf PR (for FluidProperties:Name)

tijcolem added a commit that referenced this issue Aug 31, 2021
Fix #4419 - custom mapping for LCC Use Price Escalation
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants