How to model dynamic shading control and daylight dimming with EnergyPlus?
This guide will demonstrate how to use a controller function to control the shading state, cooling setpoint temperature, and electric lighting power intensity during simulation.
The example is a medium office building with a four tinted states electrochromic glazing system. At the beginning of each timestep, EnergyPlus will call the controller function that operates the facade shading state based on exterior solar irradiance, cooling setpoint temperature based on time of day (pre-cooling), and electric lighting power intensity based on occupancy and workplane illuminance (daylight dimming). The workplane illuminance is calculated using the three-phase method in Radiance.
Workflow
-
1.1 Initialize an EnergyPlus model
1.2 Create glazing systems (Complex Fenestration States)
-
2.1 Initialize EnergyPlus Simulation Setup
2.2 Define control algorithms using a controller function
2.3 Set callback
2.4 Run simulation
graph LR
subgraph IGSDB
A[Step 1.2 <br/> glazing/shading products];
end
subgraph frads
C[Step 1.1 idf/epjs] --> |Initialize an EnergyPlus model| E;
subgraph Step 2 EnergyPlus Simulation Setup
subgraph Radiance
R[Workplane Illuminance];
end
subgraph EnergyPlus
E[EnergyPlusModel]<--> K[Step 2.2 & 2.3 <br/> controller function];
E <--> R;
K <--> R;
end
end
subgraph WincalcEngine
A --> D[Step 1.3 <br/> create a glazing system <br/> per CFS state];
D --> |Add glazing systems| E;
end
L[Step 1.4 lighting systems] --> |Add lighting| E;
end
0. Import required Python libraries
1. Setup an EnergyPlus Model
1.1 Initialize an EnergyPlus model
You will need a working EnergyPlus model in idf or epjson format to initialize an EnergyPlus model. Or you can load an EnergyPlus reference model from pyenergyplus.dataset
. See How to run a simple EnergyPlus simulation? for more information on how to setup an EnergyPlus model.
- EnergyPlus medium size office reference model from
pyenergyplus.dataset
.
1.2 Create glazing systems (Complex Fenestration States)
Create four glazing systems for the four electrochromic tinted states
Each glazing system consists of:
- One layer of electrochromic glass
- One gap (10% air and 90% argon) at 0.0127 m thickness
- One layer of clear glass
Call create_glazing_system
to create a glazing system. See How to create a glazing system? for more details on how to create a glazing system.
gs_ec01 = fr.create_glazing_system(
name="ec01",
layers=[
"igsdb_product_7405.json", # electrochromic glass Tvis: 0.01
"igsdb_product_364.json", # clear glass
],
gaps=[
fr.Gap(
[fr.Gas("air", 0.1), fr.Gas("argon", 0.9)], 0.0127
)
],
)
Create glazing systems for the other tinted electrochromic states
gs_ec06 = fr.create_glazing_system(
name="ec06",
layers=[
"igsdb_product_7407.json",
"igsdb_product_364.json",
],
gaps=[
fr.Gap(
[fr.Gas("air", 0.1), fr.Gas("argon", 0.9)], 0.0127
)
],
)
gs_ec18 = fr.create_glazing_system(
name="ec18",
layers=[
"igsdb_product_7404.json",
"igsdb_product_364.json",
],
gaps=[
fr.Gap(
[fr.Gas("air", 0.1), fr.Gas("argon", 0.9)], 0.0127
)
],
)
gs_ec60 = fr.create_glazing_system(
name="ec60",
layers=[
"igsdb_product_7406.json",
"igsdb_product_364.json",
],
gaps=[
fr.Gap(
[fr.Gas("air", 0.1), fr.Gas("argon", 0.9)], 0.0127
)
],
)
1.3 Add glazing systems to EnergyPlus model
Call EnergyPlusModel.add_glazing_system()
to add glazing systems to the EnergyPlus model.
Add other glazing systems to the EnergyPlus model
1.4 Add lighting systems to EnergyPlus model
Call EnergyPlusModel.add_lighting
to add lighting systems to the EnergyPlus model.
- 1200W is the maximum lighting power density for the zone. This will be dimmed based on the daylight illuminance.
2. Setup EnergyPlus Simulation
2.1 Initialize EnergyPlus Simulation Setup
Initialize EnergyPlus simulation setup by calling EnergyPlusSetup
and passing in an EnergyPlus model and an optional weather file. Enable Radiance for daylighting simulation by setting enable_radiance
to True
. See How to enable Radiance in EnergyPlus simulation? for more information.
epsetup = fr.EnergyPlusSetup(
epmodel, weather_files["usa_ca_san_francisco"], enable_radiance=True
) # (1)
- San Francisco, CA weather file from
pyenergyplus.dataset
.
2.2 Define control algorithms using a controller function
The controller function defines the control algorithm and control the facade shading state, cooling setpoint temperature, and electric lighting power intensity in the EnergyPlus model during simulation.
Controller function
The example shows how to implement control algorithms for zone "Perimeter_bot_ZN_1", which has a window named "Perimeter_bot_ZN_1_Wall_South_Window" and lighting named "Perimeter_bot_ZN_1".
- Facade CFS state based on exterior solar irradiance
- Cooling setpoint temperature based on time of day (pre-cooling)
- Electric lighting power intensity based on occupancy and workplane illuminance (daylight dimming)
The controller function takes in a state
argument. See How to set up a callback function in EnergyPlus? for more details on how to define a controller function.
2.3 Set callback
Register the controller functions to be called back by EnergyPlus during runtime by calling set_callback
and passing in a callback point and function. See How to set up a callback function in EnergyPlus? for more details.