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

Sum up Variables Over SystemTimeStep (EMS_E+)

asked 2018-11-24 09:16:20 -0500

taher.ahel's avatar

updated 2018-11-24 16:13:47 -0500

We know that each ZoneTimeStep maybe consists of some SystemTimeStep. I want to sum a special variable over all SystemTimeSteps at a ZoneTimeStep and then report it as schedule. The @TrendSum function just provide sum of variables for several ZoneTimeSteps not for SystemTimeStep.

Sincerely Daniel.A

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2018-12-04 14:57:06 -0500

First, define a custom output variable at the system timestep which is summed (not averaged). Let's say the value you are reporting is "MyEMSOutput".

EnergyManagementSystem:OutputVariable ,
MyEMSOutputVariable[units], !- Name
MyEMSOutput , !- EMS Variable Name
Summed , !- Type of Data in Variable
SystemTimeStep; !- Update Frequency

Then, report it at the zone timestep frequency. EnergyPlus will accumulate (sum) the variable at the end of every system timestep and then report it at the end of every zone timestep.

Output:Variable,
*, !- Key Value
MyEMSOutputVariable, !- Variable Name
Timestep; !- Reporting Frequency
edit flag offensive delete link more

Comments

thank you for answer...I did it and it works when I just intend to have an Output:Variable. Suppose the situation I intend to set a schedule as sum of SystemTimeStep variable over ZoneTimeStep And we have had the amount of FogAvailibility (You can see in the report part) so I write this code:

taher.ahel's avatar taher.ahel  ( 2018-12-09 00:49:09 -0500 )edit

Schedule:Constant,

Fog_On_OFF,              !- Name
Any,                     !- Schedule Type Limits Name
0;                       !- Hourly Value

EnergyManagementSystem:ProgramCallingManager,

Fog,                                    !- Name
EndOfZoneTimestepBeforeZoneReporting,   !- EnergyPlus Model Calling Point
Fog_Test;                               !- Program Name 1

EnergyManagementSystem:Program,

Fog_Test,                       !- Name
Set Fog_On_OFF=FogAvailibility; !- Program Line 1
taher.ahel's avatar taher.ahel  ( 2018-12-10 07:48:08 -0500 )edit

EnergyManagementSystem:OutputVariable,

FogAvailibility,         !- Name
Fog_Availibility,        !- EMS Variable Name
Summed,                  !- Type of Data in Variable
SystemTimestep;          !- Update Frequency

Output:Variable,

*,                      !- Key Value
FogAvailibility,        !- Variable Name
Detailed;               !- Reporting Frequency

Output:Variable,

*,                       !- Key Value
Fog_On_OFF,              !- Variable Name
Detailed;                !- Reporting Frequency
taher.ahel's avatar taher.ahel  ( 2018-12-10 07:50:21 -0500 )edit

But What has been reported is:

Date/Time FogAvailibility Fog_On_OFF,

18:02:00, 1,

18:05:00, 0,

18:07:00, 1,

18:10:00, 0, 0,

18:11:00, 1,

18:13:00, 0,

18:16:00, 1,

18:20:00, 1, 1,

taher.ahel's avatar taher.ahel  ( 2018-12-10 07:51:46 -0500 )edit

The problem here is that the EMS calling point is EndOfZoneTimestepBeforeZoneReporting which happens only once per zone timestep. But the variable FogAvailibility has been set to update every system timestep. Either change the calling point to InsideHVACSystemIterationLoop or change the variable to update at the zone timestep.

MJWitte's avatar MJWitte  ( 2018-12-11 15:04:57 -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: 2018-11-24 09:16:20 -0500

Seen: 181 times

Last updated: Dec 04 '18