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

Revision history [back]

Design Builder Control for natural ventilation - EMS code problem

Hi everybody,

I modified an EMS control script in DesignBuilder to control the opening of external windows to provide free cooling on spaces which are too hot. I only want the occupants to open the windows when zone is occupied. The first part of the code works fine. But I want to do another thing: To prevent overheat, when people arrive in the morning (7 am), during the summer, they always open the window until 9am, to cool the space in prevention (use of thermal inertia of the space). So, I tried to add some boolean expression to do this, but it don't works. I don't know if I can nest boolean expression, or if there is an easier way to do what I want.

<ForAllExternalWindows>
EnergyManagementSystem:Sensor,
   Zone_People_Occupant_Count_<LoopWindowVariableName>,
   <LoopWindowZoneIDFName>,
   Zone People Occupant Count;
<LoopNextWindow>

<ForAllExternalWindows>
EnergyManagementSystem:Actuator,
      Venting_Opening_Factor_<LoopWindowVariableName>,
      <LoopWindowIDFName>,
      AirFlow Network Window/Door Opening,
      Venting Opening Factor;
<LoopNextWindow>

EnergyManagementSystem:ProgramCallingManager,
   Natural ventilation,
   BeginTimestepBeforePredictor,
   NatVent;

EnergyManagementSystem:Program,
   NatVent,
    <ForAllExternalWindows>
    IF Zone_People_Occupant_Count_<LoopWindowVariableName> == 0,        
        SET Venting_Opening_Factor_<LoopWindowVariableName> = 0,
    ELSEIF (Zone_People_Occupant_Count_<LoopWindowVariableName> > 0),
    <IF LoopWindowAttribute Month >=5 Then>
    <IF LoopWindowAttribute Month <=9 Then>
    <IF LoopWindowAttribute Hour >=7 Then>
    <IF LoopWindowAttribute Hour <=9 Then>
        SET Venting_Opening_Factor_<LoopWindowVariableName> = 1,
    <endif>
    <endif>
    <endif>
    <endif>
    ELSE,
        SET Venting_Opening_Factor_<LoopWindowVariableName> = null,
    ENDIF,
<LoopNextWindow>
;

Blockquote

Thanks a lot!

Design Builder Control for natural ventilation - EMS code problem

Hi everybody,

I modified an EMS control script in DesignBuilder to control the opening of external windows to provide free cooling on spaces which are too hot. I only want the occupants to open the windows when zone is occupied. The first part of the code works fine. But I want to do another thing: To prevent overheat, when people arrive in the morning (7 am), during the summer, they always open the window until 9am, to cool the space in prevention (use of thermal inertia of the space). So, I tried to add some boolean expression to do this, but it don't works. I don't know if I can nest boolean expression, or if there is an easier way to do what I want.

<ForAllExternalWindows>
EnergyManagementSystem:Sensor,
   Zone_People_Occupant_Count_<LoopWindowVariableName>,
   <LoopWindowZoneIDFName>,
   Zone People Occupant Count;
<LoopNextWindow>

<ForAllExternalWindows>
EnergyManagementSystem:Actuator,
      Venting_Opening_Factor_<LoopWindowVariableName>,
      <LoopWindowIDFName>,
      AirFlow Network Window/Door Opening,
      Venting Opening Factor;
<LoopNextWindow>

EnergyManagementSystem:ProgramCallingManager,
   Natural ventilation,
   BeginTimestepBeforePredictor,
   NatVent;

EnergyManagementSystem:Program,
   NatVent,
    <ForAllExternalWindows>
    IF Zone_People_Occupant_Count_<LoopWindowVariableName> == 0,        
        SET Venting_Opening_Factor_<LoopWindowVariableName> = 0,
    ELSEIF (Zone_People_Occupant_Count_<LoopWindowVariableName> > 0),
    <IF LoopWindowAttribute Month >=5 Then>
    <IF LoopWindowAttribute Month <=9 Then>
    <IF LoopWindowAttribute Hour >=7 Then>
    <IF LoopWindowAttribute Hour <=9 Then>
        SET Venting_Opening_Factor_<LoopWindowVariableName> = 1,
    <endif>
    <endif>
    <endif>
    <endif>
    ELSE,
        SET Venting_Opening_Factor_<LoopWindowVariableName> = null,
    ENDIF,
<LoopNextWindow>
;

Blockquote

Thanks a lot!