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

Revision history [back]

click to hide/show revision 1
initial version

Hi Waseem,

I replied to your question on E+ yahoo group. Just in case you haven't seen it, I am adding my answer here as well.

I was recently involved in a study between De Montfort University, Salford University and ENSIMS which faced the same issue; how to calculate number of overheating hours (in addition to other overheating criteria outputs such as CEN15251) during occupied period from. I needed a code which can be applied to a large number of simulations and I decided to try to do it in EMS. You can see the piece of code which worked for me.

Regards,

Ivan Korolija

IESD, De Montfort University, Leicester, UK

! EMS code to calculate overheating hours
! EP Macro command to set threshold temperature (you can place it at the top of the imf file)
##set1 OHTempBed 25

! Get the operative temperature from the E+ output variables (This can be dry-bulb temperature too))    
  EnergyManagementSystem:Sensor,
    BedOpTemp,      !- Name
    Bedroom,                !- Output:Variable or Output:Meter Index Key Name
    Zone Operative Temperature;  !- Output:Variable or Output:Meter Name

! Get the occupancy schedule value to use as a reference when the room is occupied
  EnergyManagementSystem:Sensor,
    BedOcc, !- Name
    Occupancy_Bedroom Sch,           !- Output:Variable or Output:Meter Index Key Name
    Schedule Value;  !- Output:Variable or Output:Meter Name

! EMS programm
  EnergyManagementSystem:ProgramCallingManager,
    Overheating,  !- Name
    EndOfZoneTimestepBeforeZoneReporting,  !- EnergyPlus Model Calling Point
    OverheatingProg;     !- Program Name 1

! If zone is occupied and temperature is above threshold, count for overheating hours
  EnergyManagementSystem:Program,
    OverheatingProg,     !- Name
    IF BedOcc > 0 && BedOpTemp > OHTempBed[],
    SET BedOH = ZoneTimeStep, ! ZoneTimeStep is built in variable which is fraction of hour specified elswhere in the model (default value is 4 which is equal to 0.25 overheating hours)
    ELSE,
    SET BedOH = 0,
    ENDIF;

  EnergyManagementSystem:GlobalVariable,
    BedOH;

  EnergyManagementSystem:OutputVariable,
    Bedroom Zones Overheating While Occupied,  !- Name
    BedOH,         !- EMS Variable Name
    Summed,                  !- Type of Data in Variable
    ZoneTimestep;            !- Update Frequency

  Output:Variable,*,Bedroom Zones Overheating While Occupied,Annual;

Hi Waseem,

I replied to your question on E+ yahoo group. Just in case you haven't seen it, I am adding my answer here as well.

I was recently involved in a study between De Montfort University, Salford University and ENSIMS which faced the same issue; how to calculate number of overheating hours (in addition to other overheating criteria outputs such as CEN15251) during occupied period from. I needed a code which can be applied to a large number of simulations and I decided to try to do it in EMS. You can see the piece of code which worked for me.

Regards,

Ivan Korolija

IESD, De Montfort University, Leicester, UK

! EMS code to calculate overheating hours
! EP Macro command to set threshold temperature (you can place it at the top of the imf file)
##set1 OHTempBed 25

! Get the operative temperature from the E+ output variables (This can be dry-bulb temperature too))    
  EnergyManagementSystem:Sensor,
    BedOpTemp,      !- Name
    Bedroom,                !- Output:Variable or Output:Meter Index Key Name
    Zone Operative Temperature;  !- Output:Variable or Output:Meter Name

! Get the occupancy schedule value to use as a reference when the room is occupied
  EnergyManagementSystem:Sensor,
    BedOcc, !- Name
    Occupancy_Bedroom Sch,           !- Output:Variable or Output:Meter Index Key Name
    Schedule Value;  !- Output:Variable or Output:Meter Name

! EMS programm
  EnergyManagementSystem:ProgramCallingManager,
    Overheating,  !- Name
    EndOfZoneTimestepBeforeZoneReporting,  !- EnergyPlus Model Calling Point
    OverheatingProg;     !- Program Name 1

! If zone is occupied and temperature is above threshold, count for overheating hours
  EnergyManagementSystem:Program,
    OverheatingProg,     !- Name
    IF BedOcc > 0 && BedOpTemp > OHTempBed[],
    SET BedOH = ZoneTimeStep, ! ZoneTimeStep is built in variable which is fraction of hour specified elswhere in the model (default value is 4 which is equal to 0.25 overheating hours)
    ELSE,
    SET BedOH = 0,
    ENDIF;

  EnergyManagementSystem:GlobalVariable,
    BedOH;

  EnergyManagementSystem:OutputVariable,
    Bedroom Zones Overheating While Occupied,  !- Name
    BedOH,         !- EMS Variable Name
    Summed,                  !- Type of Data in Variable
    ZoneTimestep;            !- Update Frequency

  Output:Variable,*,Bedroom Zones Overheating While Occupied,Annual;
  • Since I wasn't able to post the following code in the comment due to length limit, I edited this answer.

It should be possible to calculate PPD over 10% by using EMS. The code (which has to be validated :) )for PPD should be:

##set1 PPDBedThershold 10

  EnergyManagementSystem:Sensor,
    ActualBedPPD,      !- Name
    Bedroom,                !- Output:Variable or Output:Meter Index Key Name
    Zone Thermal Comfort Fanger Model PPD;  !- Output:Variable or Output:Meter Name

! If you already defined occupancy sensor for the overheating hours, you should delete this one
  EnergyManagementSystem:Sensor,
    BedOcc, !- Name
    Occupancy_Bedroom Sch,           !- Output:Variable or Output:Meter Index Key Name
    Schedule Value;  !- Output:Variable or Output:Meter Name

  EnergyManagementSystem:ProgramCallingManager,
    PPD,  !- Name
    EndOfZoneTimestepBeforeZoneReporting,  !- EnergyPlus Model Calling Point
    PPDProg;     !- Program Name 1

  EnergyManagementSystem:Program,
    PPDProg,     !- Name
    IF BedOcc > 0 && ActualBedPPD > PPDBedThershold[],
    SET BedPPD = ZoneTimeStep, 
    ELSE,
    SET BedPPD = 0,
    ENDIF;

  EnergyManagementSystem:GlobalVariable,
    BedPPD;

  EnergyManagementSystem:OutputVariable,
    Bedroom Zones PPD Over 10 While Occupied,  !- Name
    BedPPD,         !- EMS Variable Name
    Summed,                  !- Type of Data in Variable
    ZoneTimestep;            !- Update Frequency

  Output:Variable,*,Bedroom Zones PPD Over 10 While Occupied,Annual;