Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Taoning Wang committed Oct 30, 2023
1 parent ec51e43 commit a6c654d
Show file tree
Hide file tree
Showing 13 changed files with 171 additions and 103 deletions.
24 changes: 12 additions & 12 deletions docs/how-to/guide5.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# How to model dynamic shading control and daylight dimming with EnergyPlus?


The example demonstrates how to use a controller function to control the shading state, cooling setpoint temperature, and electric lighting power intensity during simulation. 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 through Radiance.
The example demonstrates how to use a controller function to control the shading state, cooling setpoint temperature, and electric lighting power intensity during simulation. 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 through Radiance.

**Workflow**

Expand All @@ -27,7 +27,7 @@ graph LR
R[Workplane Illuminance]
end
subgraph <b>EnergyPlus</b>
E[EnergyPlusModel]<--> K[Step 2.2 & 2.3 controller function<br/> <br/> * switch shading state <br/> * daylight dimming <br/>* pre-cooling <br/>]
E[EnergyPlusModel]<--> K[Step 2.2 & 2.3 controller function<br/> <br/> * switch shading state <br/> * daylight dimming <br/>* pre-cooling <br/>]
E <--> R
K <--> R;
end
Expand Down Expand Up @@ -68,7 +68,7 @@ Initialize an EnergyPlus model by calling `load_energyplus_model` and passing in
epmodel = fr.load_energyplus_model(ref_models["medium_office"])
```

or
or

```python
epmodel = fr.load_energyplus_model("medium_office.idf")
Expand All @@ -78,7 +78,7 @@ epmodel = fr.load_energyplus_model("medium_office.idf")

!!! example "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
Expand Down Expand Up @@ -135,7 +135,7 @@ gs_ec01 = fr.create_glazing_system(
gs_ec60 = fr.create_glazing_system(
name="ec60",
layers=[
Patha("products/igsdb_product_7406.json"),
Path("products/igsdb_product_7406.json"),
Path("products/CLEAR_3.DAT"),
],
gaps=[
Expand Down Expand Up @@ -187,22 +187,22 @@ eps = fr.EnergyPlusSetup(

### 2.2 Define control algorithms using a controller function

The controller function will control the facade shading state, cooling setpoint temperature, and electric lighting power intensity in the EnergyPlus model during simulation.
The controller function will control the facade shading state, cooling setpoint temperature, and electric lighting power intensity in the EnergyPlus model during simulation.

!!! example "Controller function"
The example shows how to implement control algorithms for zone "Perimeter_bot_ZN_1", which has window "Perimeter_bot_ZN_1_Wall_South_Window" and lighting "Perimeter_bot_ZN_1_Lights".
The example shows how to implement control algorithms for zone "Perimeter_bot_ZN_1", which has window "Perimeter_bot_ZN_1_Wall_South_Window" and lighting "Perimeter_bot_ZN_1_Lights".

* **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)

!!! notes "Actuate"
* **Gerneric actuator**
* **Generic actuator**

Use `EnergyPlusSetup.actuate` to set or update the operating value of an actuator in the EnergyPlus model. `EnergyPlusSetup.actuate` takes in a component type, name, key, and value. The component type is the actuator category, e.g. "Weather Data". The name is the name of the actuator, e.g. "Outdoor Dew Point". The key is the instance of the variable to retrieve, e.g. "Environment". The value is the value to set the actuator to.

* **Special actuator**

* **Facade CFS state**

`EnergyPlusSetup.actuate_cfs_state` takes in a window name and a CFS state (the name of the glazing system).
Expand Down Expand Up @@ -254,7 +254,7 @@ def controller(state):
cfs_state=cfs_state,
)

# control cooling setpoint temperature based on the time of day
# control cooling setpoint temperature based on the time of day
# pre-cooling
# get the current time
datetime = ep.get_datetime()
Expand Down Expand Up @@ -328,4 +328,4 @@ To simulate, use `run` with optional parameters:

```python
eps.run()
```
```
Empty file removed docs/ref/epjson2rad.md
Empty file.
4 changes: 4 additions & 0 deletions docs/ref/eplus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
::: frads.EnergyPlusSetup
::: frads.EnergyPlusModel
::: frads.epmodel_to_radmodel
::: frads.load_energyplus_model
5 changes: 0 additions & 5 deletions docs/ref/epmodel.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/ref/epsetup.md

This file was deleted.

3 changes: 3 additions & 0 deletions docs/ref/window.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

::: frads.GlazingSystem
::: frads.create_glazing_system
::: frads.Gap
::: frads.Gas

11 changes: 7 additions & 4 deletions frads/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@

from .eplus import load_energyplus_model, EnergyPlusSetup, ep_datetime_parser

from .eplus_model import EnergyPlusModel

from .matrix import (
load_matrix,
load_binary_matrix,
Expand Down Expand Up @@ -101,12 +103,11 @@
__all__ = [
"AIR",
"ARGON",
"create_glazing_system",
"Gap",
"Gas",
"load_energyplus_model",
"EnergyPlusModel",
"EnergyPlusSetup",
"FivePhaseMethod",
"Gap",
"Gas",
"GlazingSystem",
"KRYPTON",
"Matrix",
Expand All @@ -123,12 +124,14 @@
"WeaMetaData",
"WorkflowConfig",
"XENON",
"create_glazing_system",
"ep_datetime_parser",
"epmodel_to_radmodel",
"gen_grid",
"gen_perez_sky",
"genskymtx",
"load_binary_matrix",
"load_energyplus_model",
"load_matrix",
"matrix_multiply_rgb",
"parse_epw",
Expand Down
10 changes: 8 additions & 2 deletions frads/ep2rad.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,14 +593,20 @@ def create_settings(ep_model: EnergyPlusModel, epw_file: Optional[str]) -> dict:
def epmodel_to_radmodel(
ep_model: EnergyPlusModel, epw_file: Optional[str] = None, add_views: bool = True
) -> dict:
"""Convert EnergyPlus model to Radiance model.
"""Convert EnergyPlus model to Radiance models where each zone is a separate model.
Args:
ep_model: EnergyPlus model.
epw_file: EnergyPlus weather file path. Defaults to None.
add_views: Add views to the model. Such views will be positioned
at the center of the zone facing windows weighted by window
area. Defaults to True.
Returns:
dict: Radiance model.
dict: Radiance models.
Examples:
>>> radmodels = epmodel_to_radmodel(ep_model, epw_file)
"""
model_parser = EnergyPlusToRadianceModelConverter(ep_model)
zone_models = model_parser.parse()
Expand Down
Loading

0 comments on commit a6c654d

Please sign in to comment.