Skip to content

Commit 1abae7d

Browse files
paulf81Copilotgenevievestarke
authored
Open cycle gas turbine model and thermal power plant base class (#189)
* Add combustion turbine model * add to hybrid plant * add to utilities * add first test * add new example * add test dicts * address comment * standardize to min_stable_load_fraction * address comment * clean up state_num error checks * clean up step function * add else case * linting * fix long line * fix long line * fix comment * adjust timing * Add tests for Ct * add combustion turbine docs * Add 07 example * remove combustion turbine model * add thermal component base * add tests * update h_dict * linting * add ocgt * route ocgt * rename example * linting * update example 7 * update utilities * bugfix * add shell post-process test * update docs * Add 07 doc * Update hercules/hybrid_plant.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * harmonize comments * clarify comment * Fix comment * add warm start state and hard code start state time definitions * refactor from heat_rate to efficiency * add tests * update test defaults * linting * start shutdown behavior within on state * Fix test * docstring fix * add limit to run up ramp * remove redundant line * Update tests/thermal_component_base_test.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * clearer controller name * Update tests/thermal_component_base_test.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update examples/07_ocgt/hercules_input.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Refactor states to an enum * Remove .value * Change initial condition behavior * rename fuel values * Refactor to rate * specify effiency in HHV and provide defaults * rename example 7 * linting * remove get initial conditions * add get initial conditions to base class * remove state names property * Make component_name and types to be class attributes * rename calc functions * Update with minor notes on specific turbine * Fix ruff formatting --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Genevieve Starke <genevieve.starke@nrel.gov>
1 parent 5179e77 commit 1abae7d

15 files changed

Lines changed: 2129 additions & 3 deletions
Lines changed: 71 additions & 0 deletions
Loading

docs/_toc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ parts:
2626
- file: solar_pv
2727
- file: battery
2828
- file: electrolyzer
29+
- file: thermal_component_base
30+
- file: open_cycle_gas_turbine
2931
- caption: Inputs
3032
chapters:
3133
- file: hercules_input
@@ -43,3 +45,4 @@ parts:
4345
- file: examples/04_wind_and_storage
4446
- file: examples/05_wind_and_storage_with_lmp
4547
- file: examples/06_wind_and_hydrogen
48+
- file: examples/07_open_cycle_gas_turbine
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Example 07: Open Cycle Gas Turbine (OCGT)
2+
3+
## Description
4+
5+
This example demonstrates a standalone open-cycle gas turbine (OCGT) simulation. The example showcases the turbine's state machine behavior including startup sequences, power ramping, minimum stable load constraints, and shutdown sequences.
6+
7+
For details on OCGT parameters and configuration, see {doc}`../open_cycle_gas_turbine`. For details on the underlying state machine and ramp behavior, see {doc}`../thermal_component_base`.
8+
9+
## Scenario
10+
11+
The simulation runs for 6 hours with 1-minute time steps. A controller commands the turbine through several operating phases. The table below shows both **control commands** (setpoint changes) and **state transitions** (responses to commands based on constraints).
12+
13+
### Timeline
14+
15+
| Time (min) | Event Type | Setpoint | State | Description |
16+
|------------|------------|----------|-------|-------------|
17+
| 0 | Initial | 0 | OFF (0) | Turbine starts off, `time_in_state` begins counting |
18+
| 40 | Command | → 100 MW | OFF (0) | Setpoint changes to full power, but `min_down_time` (60 min) not yet satisfied—turbine remains off |
19+
| 60 | State | 100 MW | → HOT STARTING (1) | `min_down_time` satisfied, turbine begins hot starting sequence |
20+
| ~64 | State | 100 MW | HOT STARTING (1) | `hot_readying_time` (~4.2 min) complete, run-up ramp begins |
21+
| ~68 | State | 100 MW | → ON (4) | Power reaches P_min (20 MW) after `hot_startup_time` (~8.2 min), turbine now operational |
22+
| ~76 | Ramp | 100 MW | ON (4) | Power reaches 100 MW (ramped at 10 MW/min from P_min) |
23+
| 120 | Command | → 50 MW | ON (4) | Setpoint reduced to 50% capacity |
24+
| ~125 | Ramp | 50 MW | ON (4) | Power reaches 50 MW (ramped down at 10 MW/min) |
25+
| 180 | Command | → 10 MW | ON (4) | Setpoint reduced to 10% (below P_min), power clamped to P_min |
26+
| ~183 | Ramp | 10 MW | ON (4) | Power reaches P_min (20 MW), cannot go lower |
27+
| 210 | Command | → 100 MW | ON (4) | Setpoint increased to full power |
28+
| ~218 | Ramp | 100 MW | ON (4) | Power reaches 100 MW |
29+
| 240 | Command + State | → 0 | → STOPPING (5) | Shutdown command; `min_up_time` satisfied (~172 min on), begins stopping sequence |
30+
| ~250 | State | 0 | → OFF (0) | Power reaches 0 (ramped down at 10 MW/min), turbine off |
31+
| 360 | End | 0 | OFF (0) | Simulation ends |
32+
33+
### Key Behaviors Demonstrated
34+
35+
- **Minimum down time**: The turbine cannot start until `min_down_time` (60 min) is satisfied, even though the command is issued at 40 min
36+
- **Hot startup sequence**: After `min_down_time`, the turbine enters HOT STARTING, waits through `hot_readying_time`, then ramps to P_min using `run_up_rate`
37+
- **Ramp rate constraints**: All power changes in ON state are limited by `ramp_rate` (10 MW/min)
38+
- **Minimum stable load**: When commanded to 10 MW (below P_min = 20 MW), power is clamped to P_min
39+
- **Minimum up time**: Shutdown is allowed immediately at 240 min because `min_up_time` (60 min) was satisfied long ago
40+
- **Stopping sequence**: The turbine ramps down to zero at `ramp_rate` before transitioning to OFF
41+
42+
## Setup
43+
44+
No manual setup is required. The example uses only the OCGT component which requires no external data files.
45+
46+
## Running
47+
48+
To run the example, execute the following command in the terminal:
49+
50+
```bash
51+
python hercules_runscript.py
52+
```
53+
54+
## Outputs
55+
56+
To plot the outputs, run:
57+
58+
```bash
59+
python plot_outputs.py
60+
```
61+
62+
The plot shows:
63+
- Power output over time (demonstrating ramp constraints and minimum stable load)
64+
- Operating state transitions
65+
- Fuel consumption tracking
66+
- Heat rate variation with load

docs/open_cycle_gas_turbine.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# Open Cycle Gas Turbine
2+
3+
The `OpenCycleGasTurbine` class models an open-cycle gas turbine (OCGT), also known as a peaker plant or simple-cycle gas turbine. Since this class is focused on peaker plant behavior, this class was developed based on aeroderivative engines. It is a subclass of {doc}`ThermalComponentBase <thermal_component_base>` and inherits all state machine behavior, ramp constraints, and operational logic from the base class.
4+
5+
For details on the state machine, startup/shutdown behavior, and base parameters, see {doc}`thermal_component_base`.
6+
7+
## OCGT-Specific Parameters
8+
9+
The OCGT class provides default values for natural gas properties from [6]:
10+
11+
| Parameter | Units | Default | Description |
12+
|-----------|-------|---------|-------------|
13+
| `hhv` | J/m³ | 39050000 | Higher heating value of natural gas (39.05 MJ/m³) [6] |
14+
| `fuel_density` | kg/m³ | 0.768 | Fuel density for mass calculations [6] |
15+
16+
The `efficiency_table` parameter is **optional**. If not provided, default values based on approximate readings from the SC1A curve in Exhibit ES-4 of [5] are used. All efficiency values are **HHV (Higher Heating Value) net plant efficiencies**. See {doc}`thermal_component_base` for details on the efficiency table format.
17+
18+
## Default Parameter Values
19+
20+
The `OpenCycleGasTurbine` class provides default values for base class parameters based on References [1-5]. Only `rated_capacity` and `initial_conditions` are required in the YAML configuration.
21+
22+
| Parameter | Default Value | Source |
23+
|-----------|---------------|--------|
24+
| `min_stable_load_fraction` | 0.40 (40%) | [4] |
25+
| `ramp_rate_fraction` | 0.10 (10%/min) | [1] |
26+
| `run_up_rate_fraction` | Same as `ramp_rate_fraction` ||
27+
| `hot_startup_time` | 420 s (7 minutes) | [1], [5] |
28+
| `warm_startup_time` | 480 s (8 minutes) | [1], [5] |
29+
| `cold_startup_time` | 480 s (8 minutes) | [1], [5] |
30+
| `min_up_time` | 1800 s (30 minutes) | [4] |
31+
| `min_down_time` | 3600 s (1 hour) | [4] |
32+
| `hhv` | 39050000 J/m³ (39.05 MJ/m³) | [6] |
33+
| `fuel_density` | 0.768 kg/m³ | [6] |
34+
| `efficiency_table` | SC1A HHV net efficiency (see below) | Exhibit ES-4 of [5] |
35+
36+
### Default Efficiency Table
37+
38+
The default HHV net plant efficiency table is based on approximate readings from the SC1A (simple cycle) curve in Exhibit ES-4 of [5]:
39+
40+
| Power Fraction | HHV Net Efficiency |
41+
|---------------|-------------------|
42+
| 1.00 | 0.39 (39%) |
43+
| 0.75 | 0.37 (37%) |
44+
| 0.50 | 0.325 (32.5%) |
45+
| 0.25 | 0.245 (24.5%) |
46+
47+
## OCGT Outputs
48+
49+
The OCGT model provides the following outputs (inherited from base class):
50+
51+
| Output | Units | Description |
52+
|--------|-------|-------------|
53+
| `power` | kW | Actual power output |
54+
| `state` | integer | Operating state number (0-5), corresponding to the `STATES` enum |
55+
| `efficiency` | fraction (0-1) | Current HHV net plant efficiency |
56+
| `fuel_volume_rate` | m³/s | Fuel volume flow rate |
57+
| `fuel_mass_rate` | kg/s | Fuel mass flow rate (computed using `fuel_density` [6]) |
58+
59+
### Efficiency and Fuel Rate
60+
61+
HHV net plant efficiency varies with load based on the `efficiency_table`. The fuel volume rate is calculated as:
62+
63+
$$
64+
\text{fuel\_volume\_rate} = \frac{\text{power}}{\text{efficiency} \times \text{hhv}}
65+
$$
66+
67+
Where:
68+
- `power` is in W (converted from kW internally)
69+
- `efficiency` is the HHV net efficiency interpolated from the efficiency table
70+
- `hhv` is the higher heating value in J/m³ (default 39.05 MJ/m³ for natural gas [6])
71+
- Result is fuel volume rate in m³/s
72+
73+
The fuel mass rate is then computed from the volume rate using the fuel density [6]:
74+
75+
$$
76+
\text{fuel\_mass\_rate} = \text{fuel\_volume\_rate} \times \text{fuel\_density}
77+
$$
78+
79+
Where:
80+
- `fuel_volume_rate` is in m³/s
81+
- `fuel_density` is in kg/m³ (default 0.768 kg/m³ for natural gas [6])
82+
- Result is fuel mass rate in kg/s
83+
84+
## YAML Configuration
85+
86+
### Minimal Configuration
87+
88+
Required parameters only (uses defaults for `hhv`, `efficiency_table`, and other parameters):
89+
90+
```yaml
91+
open_cycle_gas_turbine:
92+
component_type: OpenCycleGasTurbine
93+
rated_capacity: 100000 # kW (100 MW)
94+
initial_conditions:
95+
power: 0 # 0 kW means OFF; power > 0 means ON
96+
```
97+
98+
### Full Configuration
99+
100+
All parameters explicitly specified:
101+
102+
```yaml
103+
open_cycle_gas_turbine:
104+
component_type: OpenCycleGasTurbine
105+
rated_capacity: 100000 # kW (100 MW)
106+
min_stable_load_fraction: 0.4 # 40% minimum operating point
107+
ramp_rate_fraction: 0.1 # 10%/min ramp rate
108+
run_up_rate_fraction: 0.05 # 5%/min run up rate
109+
hot_startup_time: 420.0 # 7 minutes
110+
warm_startup_time: 480.0 # 8 minutes
111+
cold_startup_time: 480.0 # 8 minutes
112+
min_up_time: 1800 # 30 minutes
113+
min_down_time: 3600 # 1 hour
114+
hhv: 39050000 # J/m³ for natural gas (39.05 MJ/m³) [6]
115+
fuel_density: 0.768 # kg/m³ for natural gas [6]
116+
efficiency_table:
117+
power_fraction:
118+
- 1.0
119+
- 0.75
120+
- 0.50
121+
- 0.25
122+
efficiency: # HHV net plant efficiency from SC1A in Exhibit ES-4 of [5]
123+
- 0.39
124+
- 0.37
125+
- 0.325
126+
- 0.245
127+
log_channels:
128+
- power
129+
- fuel_volume_rate
130+
- fuel_mass_rate
131+
- state
132+
- efficiency
133+
- power_setpoint
134+
initial_conditions:
135+
power: 0 # 0 kW means OFF; power > 0 means ON
136+
```
137+
138+
## Logging Configuration
139+
140+
The `log_channels` parameter controls which outputs are written to the HDF5 output file.
141+
142+
**Available Channels:**
143+
- `power`: Actual power output in kW (always logged)
144+
- `state`: Operating state number (0-5), corresponding to the `STATES` enum
145+
- `fuel_volume_rate`: Fuel volume flow rate in m³/s
146+
- `fuel_mass_rate`: Fuel mass flow rate in kg/s (computed using `fuel_density` [6])
147+
- `efficiency`: Current HHV net plant efficiency (0-1)
148+
- `power_setpoint`: Requested power setpoint in kW
149+
150+
## References
151+
152+
1. Agora Energiewende (2017): "Flexibility in thermal power plants - With a focus on existing coal-fired power plants."
153+
154+
2. "Impact of Detailed Parameter Modeling of Open-Cycle Gas Turbines on Production Cost Simulation", NREL/CP-6A40-87554, National Renewable Energy Laboratory, 2024.
155+
156+
3. Deane, J.P., G. Drayton, and B.P. Ó Gallachóir. "The Impact of Sub-Hourly Modelling in Power Systems with Significant Levels of Renewable Generation." Applied Energy 113 (January 2014): 152–58. https://doi.org/10.1016/j.apenergy.2013.07.027.
157+
158+
4. IRENA (2019), Innovation landscape brief: Flexibility in conventional power plants, International Renewable Energy Agency, Abu Dhabi.
159+
160+
5. M. Oakes, M. Turner, "Cost and Performance Baseline for Fossil Energy Plants, Volume 5: Natural Gas Electricity Generating Units for Flexible Operation," National Energy Technology Laboratory, Pittsburgh, May 5, 2023.
161+
162+
6. I. Staffell, "The Energy and Fuel Data Sheet," University of Birmingham, March 2011. https://claverton-energy.com/cms4/wp-content/uploads/2012/08/the_energy_and_fuel_data_sheet.pdf

0 commit comments

Comments
 (0)