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

EMS built-in variable Year is not constant

asked 2019-09-21 03:10:49 -0500

daniellosg's avatar

updated 2019-09-28 09:18:32 -0500

Hi everyone,

I'm working on a script and I found that the built-in variable Year is not working properly. The variables YearDiff, YearBaseline, AvgElecVPSC, AvgElecVPSCBase, VPSCIncRate and HVACEnergyCost are declared global variables, and HVACConsump is the sensor of the output meter Facility Total HVAC Electric Demand Power. The values of YearBaseline, AvgElecVPSCBase, VPSCIncRate are defined in the SetInputData program.

EnergyManagementSystem:Program,
    SetInputData,
set AvgElecVPSCBase = 0.1226, !(Euros/kWh)
set VPSCIncRate = 1.91, !%
set YearBaseline = 2015; 

EnergyManagementSystem:Sensor,
           HVACConsump,
          Whole Building ,
           Facility Total HVAC Electric Demand Power;

EnergyManagementSystem:ProgramCallingManager,
               ApplyATCCI,
            InsideHVACSystemIterationLoop,
                ApplyATCCI;

EnergyManagementSystem:Program,
                ApplyATCCI,
            set YearDiff = Year - YearBaseline,

            set AvgElecVPSC = AvgElecVPSCBase*((1+(VPSCIncRate/100))^YearDiff),

            set HVACEnergyCost = (HVACConsump/1000) * AvgElecVPSC;

In this case, the EPW year is 2025 and YearBaseline is 2015, so that YearDiff should be 2025-2015=10 always. However, when I run the simulation, the results show the following values: when there is a peak in HVAC consumption, for some reason, there is a peak in the built-in variable Year and in the global variable YearBaseline, and therefore the substraction is wrong. Please see screenshot below.

image description

Does anyone know why is this happening?

You can download the IDF from the following link:

https://drive.google.com/file/d/10hFQ...

And the EPW file from the following link:

https://drive.google.com/open?id=1eMe...

Thank you so much in advance.

edit retag flag offensive close merge delete

Comments

Can you provide a link to the IDF? You can use Google Drive or Dropbox.

shorowit's avatar shorowit  ( 2019-09-21 11:00:51 -0500 )edit

Hi shorowit,

You can download it from the following link:

https://drive.google.com/file/d/10hFQ...

Thanks in advance.

daniellosg's avatar daniellosg  ( 2019-09-21 12:05:49 -0500 )edit

This is probably unrelated since the Year variable is supposed to come from the EPW, but in any case: based upon the png, E+ is doing 2002. You should consider modifying your RunPeriod so E+ is doing 2025.

Jason DeGraw's avatar Jason DeGraw  ( 2019-09-21 14:29:41 -0500 )edit

Hi Jason, Please, could you clarify how to achieve that? I set the year to 2025 by modifying the header of an EPW file from EnergyPlus with the software Elements. Thanks in advance.

daniellosg's avatar daniellosg  ( 2019-09-24 15:24:31 -0500 )edit

In the RunPeriod object, set the start year as 2025 and make sure the start day of the week is blank. E+ will figure that out for you. Unfortunately, there's no EMS variable connected to the internal variable that tracks the calendar year of the simulation. If that's something you need please put in a feature request on the E+ GitHub repo.

Jason DeGraw's avatar Jason DeGraw  ( 2019-09-25 11:20:55 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-09-27 12:26:25 -0500

Since you didn't include the weather file, I made my own based on the objects in the IDF you shared. I wasn't able to exactly replicate your results, but I do get the same sort of unexpected variability. It's just later in the year.

My first suggestion was going to be to double check that the EPW year is always 2025, and I would still do that if I were you, but I've checked my version and it's 2025 all the way down. So this feels like a bug. I'd put in an issue on the E+ repo if you have not already and make sure to point out that two variables are changing unexpectedly. This probably needs someone with EMS expertise to look at it.

edit flag offensive delete link more

Comments

Thank you so much, Jason.

Just in case you have a chance to look at it, you can download the EPW file from the following link: https://drive.google.com/open?id=1eMe...

It's the weather file for Seville downloaded from the EnergfyPlus website. The only change that I made was the year at the header, with the Elements software.

I'll put in an issue about this.

Thanks again.

daniellosg's avatar daniellosg  ( 2019-09-28 09:17:04 -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

1 follower

Stats

Asked: 2019-09-21 03:10:49 -0500

Seen: 417 times

Last updated: Sep 28 '19