Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add Spawn option to report a list of supported output and actuator variables #2223

Closed
kbenne opened this issue Nov 6, 2020 · 27 comments · Fixed by #2324
Closed

Add Spawn option to report a list of supported output and actuator variables #2223

kbenne opened this issue Nov 6, 2020 · 27 comments · Fixed by #2324
Assignees
Labels
spawn Development for Spawn of EnergyPlus
Milestone

Comments

@kbenne
Copy link
Contributor

kbenne commented Nov 6, 2020

As part of this feature, also create a log file if an output variable name is requested that is not valid or unsupported.

@kbenne kbenne added the spawn Development for Spawn of EnergyPlus label Nov 6, 2020
@kbenne kbenne self-assigned this Nov 6, 2020
kbenne added a commit to NREL/Spawn that referenced this issue Nov 6, 2020
This option on spawn executable will output a json string of all
supported EnergyPlus output variables. The json structure also includes
the EnergyPlus and Modelica units corresponding to each variable.

ref lbl-srg/modelica-buildings#2223
@kbenne
Copy link
Contributor Author

kbenne commented Nov 6, 2020

spawn --output-vars reports this....

kbenne@Darth-Vader:~/Development/spawn$ ./build/cli/spawn  --output-vars
{
    "Electric Equipment Convective Heating Energy": {
        "energyplusUnit": "J",
        "modelicaUnit": "J"
    },
    "Electric Equipment Convective Heating Rate": {
        "energyplusUnit": "W",
        "modelicaUnit": "W"
    }, ...
}

@mwetter
Copy link
Member

mwetter commented Nov 12, 2020

@kbenne : Please let me know when this is ready for testing. It looks like you need to press the publish button as
https://spawn.s3.amazonaws.com/builds/Spawn-0.0.1-b3b0091383-Linux.tar.gz
is not available.

@kbenne
Copy link
Contributor Author

kbenne commented Nov 12, 2020

That is correct I did not publish the binaries, however I think the --output-vars feature is complete and fine to go ahead and take a look at.

The CI system built and tested this commit however, the artifacts only stay around in GitLab CI for about a day so they are no longer available for me to publish. I just requested a rebuild and scheduled them to publish. You can see that happening here.

https://gitlab.com/kylebenne/spawn/-/pipelines/212906796

@kbenne
Copy link
Contributor Author

kbenne commented Nov 12, 2020

builds are done and have posted.

No promises, but it would make sense to post a github badge when there is a package available on a particular commit. I'll try to make some time to do that.

@mwetter
Copy link
Member

mwetter commented Nov 13, 2020

Are you writing the unit strings, or do they come directly from EnergyPlus? If you write them, can you please change C to degC, W/m2-K to W/m2.K and Kg to kg? Otherwise let me know and I can do the text replace on my side.
See also https://lbl-srg.github.io/soep/softwareArchitecture.html#unit-system which is consistent with https://specification.modelica.org/master/unit-expressions.html.

@kbenne
Copy link
Contributor Author

kbenne commented Nov 13, 2020

I write them, so yes I can do that.

mwetter added a commit that referenced this issue Dec 5, 2020
mwetter added a commit that referenced this issue Dec 5, 2020
@mwetter
Copy link
Member

mwetter commented Dec 5, 2020

Once #2223 (comment) is addressed, the new binaries need to be committed. Otherwise all code is done to automatically update the list of output variables in Buildings.ThermalZones.EnergyPlus.UsersGuide.SupportedOutputVariables.
The development branch is issue2223_spawn_output_var_list.

@mwetter
Copy link
Member

mwetter commented Dec 17, 2020

@kbenne Can you please address #2223 (comment) so we can wrap up this item.

@kbenne
Copy link
Contributor Author

kbenne commented Jan 4, 2021

@mwetter done.

@mwetter
Copy link
Member

mwetter commented Jan 5, 2021

@kbenne : Is it normal that both mac builds are "stuck", see https://gitlab.com/kylebenne/spawn/-/pipelines?scope=all&page=1

@kbenne
Copy link
Contributor Author

kbenne commented Jan 5, 2021

@mwetter This is a low budget enterprise over here! While the linux and windows build system runs on Amazon VMs, the Mac is a humble repurposed laptop sitting on my desk. He decided to take a little nap over the holiday. I guess he figured I was on vacation so he should be too.

IMG_1901

@mwetter
Copy link
Member

mwetter commented Jan 6, 2021

We all need a nap sometime...
Now the tests on ubuntu on windows are failing (https://gitlab.com/kylebenne/spawn/-/pipelines/237250199), can you kick them on again. Looks like the build has been removed in the meantime.

@kbenne
Copy link
Contributor Author

kbenne commented Jan 6, 2021

Builds are done now.

mwetter added a commit that referenced this issue Jan 7, 2021
kbenne added a commit to NREL/Spawn that referenced this issue Jan 15, 2021
This is similar to --output-vars which reports the available output
variables.

The new option --actuators reports available actuators

ref lbl-srg/modelica-buildings#2223
@kbenne
Copy link
Contributor Author

kbenne commented Jan 15, 2021

@mwetter I'm tagging onto this issue to add --actuators.

kbenne@darth-vader:~/Development/spawn$ ./build/cli/spawn --actuators
[
    {
        "componentType": "Lights",
        "controlType": "Electric Power Level",
        "energyplusUnit": "W",
        "modelicaUnit": "W"
    },
   ...
]

Also, I have made a change to the --output-vars format. Previously the output was a dictionary where the keys were the output variable name. For actuators, there is no unique field that can serve as a key, so as you see in the example the actuators are reported as a simple array of objects.

I thought for consistency it made sense to flatten the --output-vars format to look the same as the --actuators format. So it is now the following....

kbenne@Darth-Vader:~/Development/spawn$ ./build/cli/spawn  --output-vars
[
    {
        "name":  "Electric Equipment Convective Heating Energy",
        "energyplusUnit": "J",
        "modelicaUnit": "J"
    },
       "name":  "Electric Equipment Convective Heating Rate",
        "energyplusUnit": "W",
        "modelicaUnit": "W"
    }, ...
]

If this is going to be a problem I can change it back, but I definitely prefer the consistency.

mwetter added a commit that referenced this issue Jan 18, 2021
@mwetter
Copy link
Member

mwetter commented Jan 18, 2021

@kbenne : I can update the scripts on my side for the new format. Please publish at https://gitlab.com/kylebenne/spawn/-/pipelines?scope=all&page=1 when you are done.

@mwetter mwetter reopened this Jan 18, 2021
@mwetter mwetter changed the title Add Spawn option to report a list of supported output variables Add Spawn option to report a list of supported output and actuator variables Jan 18, 2021
@mwetter
Copy link
Member

mwetter commented Mar 1, 2021

@kbenne : There is a discrepancy between what spawn --actuators outputs and what spawn requires.
From spawn --actuators I get the following:
image

But spawn requires

    "emsActuators": [
      {
        "variableName": "LIVING ZONE Lights",
        "componentType": "Lights",
        "controlType": "Electricity Rate",
        "unit": "W",
        "fmiName": "LIVING ZONE Lights_Lights"
      }

This is on branch issue2223_spawn_output_var_list, commit 65354e7, model Buildings.ThermalZones.EnergyPlus.Validation.Actuator.LightsControl.

Any idea what causes this?

@kbenne
Copy link
Contributor Author

kbenne commented Mar 1, 2021

I'm not sure I'm parsing the question correctly. I think maybe you are asking about differences related to how "Electric Power Level" is referenced. EnergyPlus recently changed how it references to electric power. It was "Electricity Rate" and now it is "Electric Power Level" (or maybe I have that backwards). These control type strings are hard coded into spawn, because EnergyPlus does not have a schema that we can pull from. One problem is that they can get out of date and it is easy to overlook the change, which might be happening here. I'll take a look, and maybe also devise a test using simulation and parsing the generated EMS data dictionary to confirm the values are correct.

@mwetter
Copy link
Member

mwetter commented Mar 1, 2021

It looks like the hard-coding is indeed the cause of the problem. This name changed between E+ 9.4 and 9.5, and the string received from spawn --actuators seems to be for E+ 9.4.

@mwetter
Copy link
Member

mwetter commented Mar 1, 2021

@kbenne : With the update of the idf files from 9.4 to 9.5, some results changed quite a bit. For example, Buildings.ThermalZones.EnergyPlus.Examples.SmallOffice.ASHRAE2006Spring has a change in heating energy consumption (res.EHea) from 8.38E5 J to 8.94E5 J, or 7%. I assume this is an intentional change due to the different E+ version. Please let me know otherwise.

@mwetter
Copy link
Member

mwetter commented Mar 1, 2021

Todo:

  • Remove "Note that some actuator names changed between EnergyPlus 9.4 and 9.5..." in Buildings/ThermalZones/EnergyPlus/UsersGuide.mo (commit fe1a501)

@kbenne
Copy link
Contributor Author

kbenne commented Mar 1, 2021

Todo:

  • Remove "Note that some actuator names changed between EnergyPlus 9.4 and 9.5..." in Buildings/ThermalZones/EnergyPlus/UsersGuide.mo (commit fe1a501)

I will have an update to address this and add a test to catch future cases of this soon.

@kbenne
Copy link
Contributor Author

kbenne commented Mar 1, 2021

@kbenne : With the update of the idf files from 9.4 to 9.5, some results changed quite a bit. For example, Buildings.ThermalZones.EnergyPlus.Examples.SmallOffice.ASHRAE2006Spring has a change in heating energy consumption (res.EHea) from 8.38E5 J to 8.94E5 J, or 7%. I assume this is an intentional change due to the different E+ version. Please let me know otherwise.

Quantitative changes in results are common, they are tracked on a PR basis and normally have to be justified. The CI runs results regression continuously. I might be able to get a comparison of this model between vanilla EnergyPlus 9.4 and 9.5. 7% does seem a bit high. Especially considering that this would be exclusively of any diffs caused by HVAC changes.

mwetter added a commit that referenced this issue Mar 2, 2021
* Added test case for #2314

* Updated install script for #2223

* Changed code for new json structure of output variables

* Copied file from E+ v9.5.0-IOFreeze

Copied file and added Output:EnergyManagementSystem section

* Updated controlType to 'Electricity Rate'

* Updated documentation for actuators

* Added new binaries. These are for E+ 9.5.0

* Copied file from E+ v9.5.0-IOFreeze

* Removed outputs to avoid E+ warning

* Added text because table is for EnergyPlus 9.4 and not 9.5

* Exclude Spawn E+ model for csv generation

This is because they used E+ 9.5 which has not yet been released
@mwetter
Copy link
Member

mwetter commented Mar 30, 2021

@kbenne : Are the actuator names reported by E+ with

spawn --actuators

current to the respective E+ version? My documentation still has the section #2223 (comment) which I can remove if the names are consistent with the shipped E+ version.

@mwetter mwetter added this to the Release 8.0 milestone Mar 30, 2021
@mwetter
Copy link
Member

mwetter commented Apr 21, 2021

@kbenne : Can #2223 (comment) be closed?

kbenne added a commit to NREL/Spawn that referenced this issue Apr 21, 2021
Update spawn's list of supported actuators according to the 9.5.0
release version of EnergyPlus.

Also add test to catch future changes, by parsing the EnergyPlus .edd
file.

ref lbl-srg/modelica-buildings#2223
@kbenne
Copy link
Contributor Author

kbenne commented Apr 21, 2021

@kbenne : Can #2223 (comment) be closed?

I addressed this in NREL/Spawn@7cc34b1

@mwetter
Copy link
Member

mwetter commented May 4, 2021

I will close this as the variables are updated with 3ca165b

@mwetter mwetter closed this as completed May 4, 2021
@mwetter
Copy link
Member

mwetter commented May 4, 2021

This is now corrected on the master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spawn Development for Spawn of EnergyPlus
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants