-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Shutdown: Add framework for more shutdown modes * shutdown: add a working shutdown model, needs more polish * shutdown: add torque control to shutdown and other small changes * shutdown: Run rosco controller registry to add shutdown variables * Shutdown: Fix registry to solve build issue * Shutdown: Add separate shutdown variable for pitch * Shutdown: Modify DISCON.IN files for test cases * Shutdown: Fix utilities.py to remove unknown character * Shutdown: Fix issue where SD_MaxPit was named SD_MaxPitch in some places and reduce default SD_MaxTorqueRate * Shutdown: Fix DISCON.IN files in example_inputs * Shutdown: Set defaults values SD_MaxPitchRate and SD_MaxTorqeRate based on turbine properties * Shutdown: Fix DISCON.IN files in Test_Cases * Shutdown: Convert some filtered signals to local variables * Shutdown: Add comments and minor code edit * Shutdown: Use wrapping for filtering nacelle vane signal * Shutdown: Remove optional shutdown inputs from minimal_discon.in * Shutdown: Set defaults for various shutdown parameters * Shutdown: Cleanup * Shutdown: Specify defaults for shutdown parameters in toolbox * Shutdown: Add example 30_shutdown.py to regression test list * Shutdown: Correced the unit of SD_MaxYawError from rad to deg * Shutdown: Run update_rosco_discons.py to update the DISCON.IN files in Examples/Test_Cases * Add mpi_tools to rosco * Shutdown: Add SD_TimeActivate to enable delaying activate of shutdown * Shutdown: Add docstring to example 30_shutdown and remove time mode of shutdown * Shutdown: Add example 30 documentation to docs * Shutdown: Fix unit of SD_TimeActivate in toolbox * Shutdown: Fix some bugs in shutdown logic * Shutdown: Add images in docs for example 30_shutdown * Shutdown: Run update_rosco_discons.py * Shutdown: quick edit in example 30_shutdown * Fix duplicated main call * Change some minor formatting --------- Co-authored-by: dzalkind <[email protected]>
- Loading branch information
1 parent
da03e56
commit 938e4f1
Showing
29 changed files
with
801 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,3 @@ def main(): | |
if __name__ == "__main__": | ||
main() | ||
|
||
if __name__=='__main__': | ||
main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
""" | ||
30_shutdown | ||
---------------- | ||
This example demonstrates turbine shutdown using collective blade pitch threshold mode. | ||
ROSCO allows for four shutdown trigger options: | ||
- collective blade pitch exceeds a threshold | ||
- yaw error exceeds a threshold | ||
- generator speed exceeds a threshold | ||
- Shutdown at a predefined time | ||
Pitch Threshold Demo | ||
```````````````````` | ||
The following plot demonstrates turbine shutdown when blade pitch exceeds a threshold of 30 degrees. | ||
This shutdown mode can provide protection against high wind speeds. | ||
.. image:: ../images/30_shutdown_pitch_demo.png | ||
Yaw Error Threshold Demo | ||
```````````````````````` | ||
The following plot demonstrates turbine shutdown when turbine yaw error pitch exceeds a threshold of 25 degrees. | ||
This demonstration uses the extreme coherent gust with direction change wind inflow used in DLC 1.4. | ||
.. image:: ../images/30_shutdown_yaw_demo.png | ||
Generator Speed Threshold Demo | ||
`````````````````````````````` | ||
The following plot demonstrates turbine shutdown when generator speed exceeds a threshold of 8.5 rpm. | ||
This also compares the use of :code:`SD_TimeActive` to enable shutdown at 0 seconds and 10 seconds. | ||
.. image:: ../images/30_shutdown_gen_demo.png | ||
Time Demo | ||
````````` | ||
The following plot demonstrates turbine shutdown at 20 second time. | ||
.. image:: ../images/30_shutdown_time_demo.png | ||
""" | ||
|
||
import os | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
from rosco.toolbox.ofTools.case_gen.run_FAST import run_FAST_ROSCO | ||
from rosco.toolbox.ofTools.case_gen import CaseLibrary as cl | ||
from rosco.toolbox.ofTools.fast_io import output_processing | ||
|
||
rpm2RadSec = 2.0 * (np.pi) / 60.0 | ||
deg2rad = np.pi/180.0 | ||
|
||
# directories | ||
this_dir = os.path.dirname(os.path.abspath(__file__)) | ||
example_out_dir = os.path.join(this_dir, "examples_out") | ||
os.makedirs(example_out_dir, exist_ok=True) | ||
|
||
|
||
def main(): | ||
# Input yaml and output directory | ||
parameter_filename = os.path.join(this_dir, "Tune_Cases/IEA15MW.yaml") | ||
|
||
# Set DISCON input dynamically through yaml/dict | ||
controller_params = {} | ||
controller_params["DISCON"] = {} | ||
controller_params["DISCON"]["Echo"] = 1 | ||
controller_params["LoggingLevel"] = 3 | ||
controller_params["SD_Mode"] = 1 | ||
controller_params["DISCON"]["SD_EnablePitch"] = 1 | ||
controller_params["DISCON"]["SD_MaxPit"] = 30*deg2rad | ||
controller_params["DISCON"]["SD_MaxPitchRate"] = 0.0348 | ||
controller_params["DISCON"]["SD_MaxTorqueRate"] = 4500000 | ||
|
||
# simulation set up | ||
r = run_FAST_ROSCO() | ||
r.tuning_yaml = parameter_filename | ||
r.case_inputs = {} | ||
|
||
# Disable floating DOFs for clarity | ||
r.case_inputs[("ElastoDyn", "PtfmSgDOF")] = {"vals": ["False"], "group": 0} | ||
r.case_inputs[("ElastoDyn", "PtfmSwDOF")] = {"vals": ["False"], "group": 0} | ||
r.case_inputs[("ElastoDyn", "PtfmHvDOF")] = {"vals": ["False"], "group": 0} | ||
r.case_inputs[("ElastoDyn", "PtfmRDOF")] = {"vals": ["False"], "group": 0} | ||
r.case_inputs[("ElastoDyn", "PtfmPDOF")] = {"vals": ["False"], "group": 0} | ||
r.case_inputs[("ElastoDyn", "PtfmYDOF")] = {"vals": ["False"], "group": 0} | ||
|
||
|
||
t_max = 80 | ||
|
||
run_dir = os.path.join(example_out_dir, "30_shutdown_demo/1_pitch") | ||
|
||
# Wind case | ||
r.wind_case_fcn = cl.ramp | ||
r.wind_case_opts = { | ||
"U_start": 25, | ||
"U_end": 50, | ||
"t_start": 0, | ||
"t_end": t_max, | ||
} | ||
r.case_inputs[("ElastoDyn", "BlPitch1")] = {"vals": [20.0], "group": 0} | ||
r.case_inputs[("ElastoDyn", "BlPitch2")] = {"vals": [20.0], "group": 0} | ||
r.case_inputs[("ElastoDyn", "BlPitch3")] = {"vals": [20.0], "group": 0} | ||
r.case_inputs[("ElastoDyn", "RotSpeed")] = {"vals": [10.0], "group": 0} | ||
|
||
# Run simulation | ||
os.makedirs(run_dir, exist_ok=True) | ||
r.controller_params = controller_params | ||
r.save_dir = run_dir | ||
r.run_FAST() | ||
|
||
# Plot output | ||
outfile = [os.path.join(run_dir, "IEA15MW", "ramp", "base", "IEA15MW_0.outb")] | ||
cases = {} | ||
cases["Baseline"] = ["Wind1VelX", "BldPitch1", "GenTq", "RotSpeed", "GenPwr"] | ||
fast_out = output_processing.output_processing() | ||
fastout = fast_out.load_fast_out(outfile) | ||
fast_out.plot_fast_out(cases=cases, showplot=False) | ||
|
||
plt.savefig(os.path.join(example_out_dir, "30_shutdown.png")) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.