2

Sum up Variables Over SystemTimeStep (EMS_E+)

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

taher.ahel's avatar
436
taher.ahel
asked 2018-11-24 09:16:20 -0500, updated 2018-11-24 16:13:47 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

3

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
MJWitte's avatar
9.7k
MJWitte
answered 2018-12-04 14:57:06 -0500
edit flag offensive 0 remove flag delete link

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
add a comment see more comments