First time here? Check out the Help page!
1 | initial version |
In an EMS Program, you should only use two equal signs "==" within a logic statement (IF, ELSE, etc.). When defining a SET statement, you only need one equal sign "=". So all of your EMS Program lines setting the absorptance values should use one equal sign near the right end of the lines.
...
if Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> < 28,
set Surface_Property_Solar_Absorptance_<LoopSurfaceVariableName> = 0.9,
set Surface_Property_Thermal_Absorptance_<LoopSurfaceVariableName> = 0.9,
set Surface_Property_Visible_Absorptance_<LoopSurfaceVariableName> = 0.9,
...
You can read more in the EMS Application Guide about statement keywords and see some examples in various expressions.
2 | No.2 Revision |
In an EMS Program, you should only use two equal signs "==" within a logic statement (IF, ELSE, etc.). When defining a SET statement, you only need one equal sign "=". So all of your EMS Program lines setting the absorptance values should use one equal sign near the right end of the lines.
...
if Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> < 28,
set Surface_Property_Solar_Absorptance_<LoopSurfaceVariableName> = 0.9,
set Surface_Property_Thermal_Absorptance_<LoopSurfaceVariableName> = 0.9,
set Surface_Property_Visible_Absorptance_<LoopSurfaceVariableName> = 0.9,
...
You can read more in the EMS Application Guide about statement keywords and see some examples in various expressions.
UPDATE
The original post above settles some syntax issues in the EMS program, but your EMS Actuator also has issues. You are trying to read EMS sensors for every exterior surface, then use that sensor data to change the absorption of the outermost material layer of that surface. You are correctly looping over surfaces to create the EMS actuator, but the actuator information you have entered is for material layers. These are different types of objects in the model, which is why you're still getting severe errors after the syntax fixes above.
If you want to potentially change the absorption of the outermost material layer of any exterior surface, then you will need to change your EMS script approach. Instead of directly setting absorptance in your EMS program, you should be setting the Surface Construction State. This is an EMS Actuator that works with an EMS Construction Index Variable object that is connected to a specific construction assembly defined in the model. With this new approach, you will have to:
if/elsif/else
temperature checks and loop for all exterior surfacesExample:
<ForAllExternalSurfaces>
EnergyManagementSystem:Sensor,
Surface_Outside_Face_Temperature_<LoopSurfaceVariableName>,
<LoopSurfaceIDFName>,
Surface Outside Face Temperature;
<LoopNextSurface>
<ForAllExternalSurfaces>
EnergyManagementSystem:Actuator,
Surface_Cons_State_<LoopSurfaceVariableName>,
<LoopSurfaceIDFName>,
Surface,
Construction State;
<LoopNextSurface>
EnergyManagementSystem:ConstructionIndexVariable,
EMS_Cons_High_Abs, !- Name
High Absorptance Construction; !- Construction Object Name (needs to match name of construction assembly you defined in the model)
EnergyManagementSystem:ConstructionIndexVariable,
EMS_Cons_Mid_Abs, !- Name
Mid Absorptance Construction; !- Construction Object Name (needs to match name of construction assembly you defined in the model)
EnergyManagementSystem:ConstructionIndexVariable,
EMS_Cons_Low_Abs, !- Name
Low Absorptance Construction; !- Construction Object Name (needs to match name of construction assembly you defined in the model)
EnergyManagementSystem:ProgramCallingManager,
Thermo,
BeginTimestepBeforePredictor,
Thermo;
EnergyManagementSystem:Program,
Thermo,
<ForAllExternalSurfaces>
if Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> < 28,
set Surface_Cons_State_<LoopSurfaceVariableName> = EMS_Cons_High_Abs,
elseif Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> > 28,
set Surface_Cons_State_<LoopSurfaceVariableName> = EMS_Cons_Low_Abs,
elseif Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> == 28,
set Surface_Cons_State_<LoopSurfaceVariableName> = EMS_Cons_Mid_Abs,
endif,
<LoopNextSurface>
;
You can read more information about this process in an Unmet Hours post as well as review an example for thermochromic windows from EnergyPlus EMS Application guide.
3 | No.3 Revision |
In an EMS Program, you should only use two equal signs "==" within a logic statement (IF, ELSE, etc.). When defining a SET statement, you only need one equal sign "=". So all of your EMS Program lines setting the absorptance values should use one equal sign near the right end of the lines.
...
if Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> < 28,
set Surface_Property_Solar_Absorptance_<LoopSurfaceVariableName> = 0.9,
set Surface_Property_Thermal_Absorptance_<LoopSurfaceVariableName> = 0.9,
set Surface_Property_Visible_Absorptance_<LoopSurfaceVariableName> = 0.9,
...
You can read more in the EMS Application Guide about statement keywords and see some examples in various expressions.
UPDATE
The original post above settles some syntax issues in the EMS program, but your EMS Actuator also has issues. You are trying to read EMS sensors for every exterior surface, then use that sensor data to change the absorption of the outermost material layer of that surface. You are correctly looping over surfaces to create the EMS actuator, but the actuator information you have entered is for material layers. These are different types of objects in the model, which is why you're still getting severe errors after the syntax fixes above.
If you want to potentially change the absorption of the outermost material layer of any exterior surface, then you will need to change your EMS script approach. Instead of directly setting absorptance in your EMS program, you should be setting the Surface Construction State. This is an EMS Actuator that works with an EMS Construction Index Variable object that is connected to a specific construction assembly defined in the model. With this new approach, you will have to:
Construction
objects you created in the previous step to see if the names are identical to what you entered in DB or if DB has changed them in some way when creating the IDF.if/elsif/else
temperature checks and loop for all exterior surfacesExample:
<ForAllExternalSurfaces>
EnergyManagementSystem:Sensor,
Surface_Outside_Face_Temperature_<LoopSurfaceVariableName>,
<LoopSurfaceIDFName>,
Surface Outside Face Temperature;
<LoopNextSurface>
<ForAllExternalSurfaces>
EnergyManagementSystem:Actuator,
Surface_Cons_State_<LoopSurfaceVariableName>,
<LoopSurfaceIDFName>,
Surface,
Construction State;
<LoopNextSurface>
EnergyManagementSystem:ConstructionIndexVariable,
EMS_Cons_High_Abs, !- Name
High Absorptance Construction; !- Construction Object Name (needs to match name of construction assembly you defined in the model)
Construction object in exported IDF)
EnergyManagementSystem:ConstructionIndexVariable,
EMS_Cons_Mid_Abs, !- Name
Mid Absorptance Construction; !- Construction Object Name (needs to match name of construction assembly you defined in the model)
Construction object in exported IDF)
EnergyManagementSystem:ConstructionIndexVariable,
EMS_Cons_Low_Abs, !- Name
Low Absorptance Construction; !- Construction Object Name (needs to match name of construction assembly you defined in the model)
Construction object in exported IDF)
EnergyManagementSystem:ProgramCallingManager,
Thermo,
BeginTimestepBeforePredictor,
Thermo;
EnergyManagementSystem:Program,
Thermo,
<ForAllExternalSurfaces>
if Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> < 28,
set Surface_Cons_State_<LoopSurfaceVariableName> = EMS_Cons_High_Abs,
elseif Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> > 28,
set Surface_Cons_State_<LoopSurfaceVariableName> = EMS_Cons_Low_Abs,
elseif Surface_Outside_Face_Temperature_<LoopSurfaceVariableName> == 28,
set Surface_Cons_State_<LoopSurfaceVariableName> = EMS_Cons_Mid_Abs,
endif,
<LoopNextSurface>
;
You can read more information about this process in an Unmet Hours post as well as review an example for thermochromic windows from EnergyPlus EMS Application guide.