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

Revision history [back]

Overriding fan mass air flow in EMS

Related to a previous question - Double skin facade providing outside air to AHUs - I'm actively trying to implement an EMS solution.

I've setup a simple case with two labs (the rectangles if you will) and a "cavity" (the long thing):

image description

The cavity is modeled with a separate AirLoopHVAC (which ultimately I'll set the fan curve coefficient to all zero in order to not double count fan power), 100% outside air (it's not right now...), and an adiabatic cooler which operation is limited to weather-permitting conditions matching the proposed sequence of operation from the MEP for summer pre-cooling.

Cavity AHU

Each lab AHU is modeled explicitly as an AirLoopHVAC with an outdoor air system. Both are identical and as follows:

RTU labs

The following pseudo-code algorithm is envisioned to be implemented using the EnergyManagementSystem:

  • Sum the requested mass air flow rates for outside air of all AHU drawing from the cavity
  • Pass the requested mass air flow rates to the cavity’s AirLoopHVAC
  • Get the condition of the cavity’s zone node and feed this condition to outside air node of each lab AHU

I've then moved to EnergyPlus .idf and implemented the code in EMS, but I'm getting some strange results:

  • I see the Cavity Fan using energy
  • I see the Mass Flow Rate at the fan supply outlet node (which is also the loop's supply outlet) being changed
  • BUT, All of the other nodes in the Cavity AHU loop has zero Mass Flow Rate

Additionally I'm trying to set both the Drybulb and Wetlbulb of the Lab's AHU outside air node to match the cavity zone, but the zone doesn't have wetbulb available, so I'm calculating wetbulb from db, humidity ratio and pressure, using the built-in Psychrometric function in EMS and getting absurd results.

What's wrong with this EMS code? How can I fix it?


Source:

I've uploaded my EnergyPlus model (and the initial OpenStudio model if you want to take an easier look at loops) here, but here is also my EMS code if that's easier for you:

!-   ===========  ALL OBJECTS IN CLASS: OUTDOORAIR:NODELIST ===========

OutdoorAir:NodeList,
    Cavity East AHU Outside Air Node;  !- Node or NodeList Name 1

OutdoorAir:NodeList,
    RTU Lab1 Outside Air Node;  !- Node or NodeList Name 1

OutdoorAir:NodeList,
    RTU Lab2 Outside Air Node;  !- Node or NodeList Name 1


!-   ===========  ALL OBJECTS IN CLASS: ENERGYMANAGEMENTSYSTEM:SENSOR ===========

EnergyManagementSystem:Sensor,
    S_Cavity_Tdb,            !- Name
    Cavity East Zn,          !- Output:Variable or Output:Meter Index Key Name
    Zone Air Temperature;    !- Output:Variable or Output:Meter Name

EnergyManagementSystem:Sensor,
    RTU1MassFlowRate,        !- Name
    RTU Lab1,                !- Output:Variable or Output:Meter Index Key Name
    Air System Outdoor Air Mass Flow Rate;  !- Output:Variable or Output:Meter Name

EnergyManagementSystem:Sensor,
    RTU2MassFlowRate,        !- Name
    RTU Lab2,                !- Output:Variable or Output:Meter Index Key Name
    Air System Outdoor Air Mass Flow Rate;  !- Output:Variable or Output:Meter Name

EnergyManagementSystem:Sensor,
    S_Cavity_W,              !- Name
    Cavity East Zn,          !- Output:Variable or Output:Meter Index Key Name
    Zone Air Humidity Ratio; !- Output:Variable or Output:Meter Name

EnergyManagementSystem:Sensor,
    Pb,                      !- Name
    *,                       !- Output:Variable or Output:Meter Index Key Name
    Site Outdoor Air Barometric Pressure;  !- Output:Variable or Output:Meter Name


!-   ===========  ALL OBJECTS IN CLASS: ENERGYMANAGEMENTSYSTEM:ACTUATOR ===========

EnergyManagementSystem:Actuator,
    A_RTU1_OA_Tdb,           !- Name
    RTU Lab1 Outside Air Node,  !- Actuated Component Unique Name
    Outdoor Air System Node, !- Actuated Component Type
    Drybulb Temperature;     !- Actuated Component Control Type

EnergyManagementSystem:Actuator,
    A_RTU1_OA_Twb,           !- Name
    RTU Lab1 Outside Air Node,  !- Actuated Component Unique Name
    Outdoor Air System Node, !- Actuated Component Type
    Wetbulb Temperature;     !- Actuated Component Control Type

EnergyManagementSystem:Actuator,
    A_RTU2_OA_Tdb,           !- Name
    RTU Lab2 Outside Air Node,  !- Actuated Component Unique Name
    Outdoor Air System Node, !- Actuated Component Type
    Drybulb Temperature;     !- Actuated Component Control Type

EnergyManagementSystem:Actuator,
    A_RTU2_OA_Twb,           !- Name
    RTU Lab2 Outside Air Node,  !- Actuated Component Unique Name
    Outdoor Air System Node, !- Actuated Component Type
    Wetbulb Temperature;     !- Actuated Component Control Type

EnergyManagementSystem:Actuator,
    A_CavityFanMassFlowRate, !- Name
    Cavity East AHU VSD Supply Fan,  !- Actuated Component Unique Name
    Fan,                     !- Actuated Component Type
    Fan Air Mass Flow Rate;  !- Actuated Component Control Type


!-   ===========  ALL OBJECTS IN CLASS: ENERGYMANAGEMENTSYSTEM:PROGRAMCALLINGMANAGER ===========

EnergyManagementSystem:ProgramCallingManager,
    CalcOAMassFlowRate_emulator,  !- Name
    InsideHVACSystemIterationLoop,  !- EnergyPlus Model Calling Point
    CalcOAMassFlowRate;      !- Program Name 1

EnergyManagementSystem:ProgramCallingManager,
    SetOANodeConditions_emulator,  !- Name
    BeginTimestepBeforePredictor,  !- EnergyPlus Model Calling Point
    SetOANodeConditions;     !- Program Name 1


!-   ===========  ALL OBJECTS IN CLASS: ENERGYMANAGEMENTSYSTEM:PROGRAM ===========

EnergyManagementSystem:Program,
    CalcOAMassFlowRate,      !- Name
    SET TotalRTUMassFlowRate = RTU1MassFlowRate,  !- Program Line 1
    SET TotalRTUMassFlowRate = TotalRTUMassFlowRate  + RTU2MassFlowRate,  !- Program Line 2
    SET A_CavityFanMassFlowRate = TotalRTUMassFlowRate;  !- A4

EnergyManagementSystem:Program,
    SetOANodeConditions,     !- Name
    SET Cavity_Twb = @TwbFnTdbWPb S_Cavity_Tdb S_Cavity_W Pb,  !- Program Line 1
    SET A_RTU1_OA_Tdb = S_Cavity_Tdb,  !- Program Line 2
    SET A_RTU1_OA_Twb = Cavity_Twb,  !- A4
    SET A_RTU2_OA_Tdb = S_Cavity_Tdb,  !- A5
    SET A_RTU2_OA_Twb = Cavity_Twb;  !- A6


!-   ===========  ALL OBJECTS IN CLASS: ENERGYMANAGEMENTSYSTEM:GLOBALVARIABLE ===========

EnergyManagementSystem:GlobalVariable,
    TotalRTUMassFlowRate,    !- Erl Variable 1 Name
    Cavity_Twb;              !- Erl Variable 2 Name

Overriding fan mass air flow in EMS

Related to a previous question - Double skin facade providing outside air to AHUs - I'm actively trying to implement an EMS solution.

I've setup a simple case with two labs (the rectangles if you will) and a "cavity" (the long thing):

image description

The cavity is modeled with a separate AirLoopHVAC (which ultimately I'll set the fan curve coefficient to all zero in order to not double count fan power), 100% outside air (it's not right now...), and an adiabatic cooler which operation is limited to weather-permitting conditions matching the proposed sequence of operation from the MEP for summer pre-cooling.

Cavity AHU

Each lab AHU is modeled explicitly as an AirLoopHVAC with an outdoor air system. Both are identical and as follows:

RTU labs

The following pseudo-code algorithm is envisioned to be implemented using the EnergyManagementSystem:

  • Sum the requested mass air flow rates for outside air of all AHU drawing from the cavity
  • Pass the requested mass air flow rates to the cavity’s AirLoopHVAC
  • Get the condition of the cavity’s zone node and feed this condition to outside air node of each lab AHU

I've then moved to EnergyPlus .idf and implemented the code in EMS, but I'm getting some strange results:

  • I see the Cavity Fan using energy
  • I see the Mass Flow Rate at the fan supply outlet node (which is also the loop's supply outlet) being changed
  • BUT, All of the other nodes in the Cavity AHU loop has zero Mass Flow Rate

Additionally I'm trying to set both the Drybulb and Wetlbulb of the Lab's AHU outside air node to match the cavity zone, but the zone doesn't have wetbulb available, so I'm calculating wetbulb from db, humidity ratio and pressure, using the built-in Psychrometric function in EMS and getting absurd results.

What's wrong with this EMS code? How can I fix it?


Source:

I've uploaded my EnergyPlus model (and the initial OpenStudio model if you want to take an easier look at loops) here, but here is also my EMS code if that's easier for you:

!-   ===========  ALL OBJECTS IN CLASS: OUTDOORAIR:NODELIST ===========

OutdoorAir:NodeList,
    Cavity East AHU Outside Air Node;  !- Node or NodeList Name 1

OutdoorAir:NodeList,
    RTU Lab1 Outside Air Node;  !- Node or NodeList Name 1

OutdoorAir:NodeList,
    RTU Lab2 Outside Air Node;  !- Node or NodeList Name 1


!-   ===========  ALL OBJECTS IN CLASS: ENERGYMANAGEMENTSYSTEM:SENSOR ===========

EnergyManagementSystem:Sensor,
    S_Cavity_Tdb,            !- Name
    Cavity East Zn,          !- Output:Variable or Output:Meter Index Key Name
    Zone Air Temperature;    !- Output:Variable or Output:Meter Name

EnergyManagementSystem:Sensor,
    RTU1MassFlowRate,        !- Name
    RTU Lab1,                !- Output:Variable or Output:Meter Index Key Name
    Air System Outdoor Air Mass Flow Rate;  !- Output:Variable or Output:Meter Name

EnergyManagementSystem:Sensor,
    RTU2MassFlowRate,        !- Name
    RTU Lab2,                !- Output:Variable or Output:Meter Index Key Name
    Air System Outdoor Air Mass Flow Rate;  !- Output:Variable or Output:Meter Name

EnergyManagementSystem:Sensor,
    S_Cavity_W,              !- Name
    Cavity East Zn,          !- Output:Variable or Output:Meter Index Key Name
    Zone Air Humidity Ratio; !- Output:Variable or Output:Meter Name

EnergyManagementSystem:Sensor,
    Pb,                      !- Name
    *,                       !- Output:Variable or Output:Meter Index Key Name
    Site Outdoor Air Barometric Pressure;  !- Output:Variable or Output:Meter Name


!-   ===========  ALL OBJECTS IN CLASS: ENERGYMANAGEMENTSYSTEM:ACTUATOR ===========

EnergyManagementSystem:Actuator,
    A_RTU1_OA_Tdb,           !- Name
    RTU Lab1 Outside Air Node,  !- Actuated Component Unique Name
    Outdoor Air System Node, !- Actuated Component Type
    Drybulb Temperature;     !- Actuated Component Control Type

EnergyManagementSystem:Actuator,
    A_RTU1_OA_Twb,           !- Name
    RTU Lab1 Outside Air Node,  !- Actuated Component Unique Name
    Outdoor Air System Node, !- Actuated Component Type
    Wetbulb Temperature;     !- Actuated Component Control Type

EnergyManagementSystem:Actuator,
    A_RTU2_OA_Tdb,           !- Name
    RTU Lab2 Outside Air Node,  !- Actuated Component Unique Name
    Outdoor Air System Node, !- Actuated Component Type
    Drybulb Temperature;     !- Actuated Component Control Type

EnergyManagementSystem:Actuator,
    A_RTU2_OA_Twb,           !- Name
    RTU Lab2 Outside Air Node,  !- Actuated Component Unique Name
    Outdoor Air System Node, !- Actuated Component Type
    Wetbulb Temperature;     !- Actuated Component Control Type

EnergyManagementSystem:Actuator,
    A_CavityFanMassFlowRate, !- Name
    Cavity East AHU VSD Supply Fan,  !- Actuated Component Unique Name
    Fan,                     !- Actuated Component Type
    Fan Air Mass Flow Rate;  !- Actuated Component Control Type


!-   ===========  ALL OBJECTS IN CLASS: ENERGYMANAGEMENTSYSTEM:PROGRAMCALLINGMANAGER ===========

EnergyManagementSystem:ProgramCallingManager,
    CalcOAMassFlowRate_emulator,  !- Name
    InsideHVACSystemIterationLoop,  !- EnergyPlus Model Calling Point
    CalcOAMassFlowRate;      !- Program Name 1

EnergyManagementSystem:ProgramCallingManager,
    SetOANodeConditions_emulator,  !- Name
    BeginTimestepBeforePredictor,  !- EnergyPlus Model Calling Point
    SetOANodeConditions;     !- Program Name 1


!-   ===========  ALL OBJECTS IN CLASS: ENERGYMANAGEMENTSYSTEM:PROGRAM ===========

EnergyManagementSystem:Program,
    CalcOAMassFlowRate,      !- Name
    SET TotalRTUMassFlowRate = RTU1MassFlowRate,  !- Program Line 1
    SET TotalRTUMassFlowRate = TotalRTUMassFlowRate  + RTU2MassFlowRate,  !- Program Line 2
    SET A_CavityFanMassFlowRate = TotalRTUMassFlowRate;  !- A4

EnergyManagementSystem:Program,
    SetOANodeConditions,     !- Name
    SET Cavity_Twb = @TwbFnTdbWPb S_Cavity_Tdb S_Cavity_W Pb,  !- Program Line 1
    SET A_RTU1_OA_Tdb = S_Cavity_Tdb,  !- Program Line 2
    SET A_RTU1_OA_Twb = Cavity_Twb,  !- A4
    SET A_RTU2_OA_Tdb = S_Cavity_Tdb,  !- A5
    SET A_RTU2_OA_Twb = Cavity_Twb;  !- A6


!-   ===========  ALL OBJECTS IN CLASS: ENERGYMANAGEMENTSYSTEM:GLOBALVARIABLE ===========

EnergyManagementSystem:GlobalVariable,
    TotalRTUMassFlowRate,    !- Erl Variable 1 Name
    Cavity_Twb;              !- Erl Variable 2 Name