OpenFASTWorkshop NAWEAWindTech2023 Practical Branlard

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 58

Practical usage of OpenFAST

Emmanuel Branlard (NREL)


Jason Jonkman (NREL)
NAWEA 2023
About
We provide a shared folder with some Simulations, Demos, Executables, Slides:

[tinyurl will be placed here]

Target audience:
[L1]: beginner
[L2]: standard user
[L3]: advanced user

Hopefully this presentation will make some of you level-up!

NREL | 2
Outline
1. Choose your own adventure:
• [L2]: Challenges for standard users
• [L1]: Become a standard user

2. When you are on your own (how to find help)

3. Tools:
• pyDatView
• python-toolbox (input/output, case generations)
• WEIS (DLC generation)

4. More difficult runs: OLAF, Linearization and Campbell diagrams

5. Your questions
NREL | 3
Tools overview
• OpenFAST realm:
• Glue codes executables (use multiple modules): openFAST, FAST.farm, TurbSim
• Driver executables (use a single module): aerodyn_driver, hydrodyn_driver
• Libraries: Simulink, C++ library, DISCON (controller), more and more C-libraries wrapped with python
They take input files and return outputs (files).

• ROSCO: opensource controller that can be used with OpenFAST


https://github.com/NREL/ROSCO

• Python-toolbox: tools for preprocessing and postprocessing OpenFAST files (granular)


https://github.com/OpenFAST/python-toolbox

• Matlab-toolbox: tools for preprocessing and postprocessing OpenFAST files


https://github.com/OpenFAST/matlab-toolbox

• WEIS: tools for preprocessing and postprocessing OpenFAST files (workhorse, e.g. DLC)
https://github.com/WISDEM/WEIS

• ParaView: for 3D visualization of VTK/VTP files written by OpenFAST


https://www.paraview.org/

• pyDatView: for 1D visualization of input and output files, some postprocessing


https://github.com/ebranlard/pyDatView
NREL | 4
1. Chose your own adventure:
[L2] Challenges to become a
superuser
Challenges for standard users
If you have already used OpenFAST, we don’t want you to be bored during the
tutorial... Coming up is a list of challenges that can help you “level up” in your
OpenFAST experience.

If you want, send some of your approach/solutions to emmanuel.branlard@nrel.gov,


we can then share them to the community.

If you are stuck, we can discuss after the seminar.

NREL | 6
Challenges – OpenFAST Debugging
Your friend Luigi wants to go green and change his flag with a wind turbine. To avoid hitting his head
with the rotor, he had attached the rotor at a 30 deg yaw angle around the pole (slightly away from his
2D world). He his concerned about the yaw torsion of his flagpole. He has heard of OpenFAST, and he
knows tower torsion is not available in ElastoDyn, but he believes he can tune the yaw degree of
freedom to approximate the tower torsion of his pole.

He wonders:
1) What is the natural frequency and damping of the yaw degree of freedom of his structure only,
at standstill, without any wind, aerodynamics and rotation
2) What are these values when the turbine is spinning at a constant speed (9 rpm), with a wind of
8m/s, including aerodynamic forces (but he doesn’t want dynamic stall).
3) Can he adapt his model to get a structural frequency to 2.5 Hz instead?

He therefore setup an OpenFAST model, with a 30 deg yaw offset to the wind.

But nothing works!

So he calls you, Mario. Can you help him?

See 13_DebuggingChallenge (Make a backup of the folder):


• First, try to make the .fst files “runnable”.
• Then, look at the outputs of the non-spinning case and investigate.
• Redo the step for the spinning case.
• Write a script to look at the modal parameters in both cases
NREL | 7
Challenges – OpenFAST Debugging – Expected results

Spinning with aero


Nat. freq. 3.0105[Hz]
Damping ratio 7.8559[%]

Not spinning no aero


Nat. freq. 3.0109 [Hz]
Damping ratio 2.0073 [%]

NREL | 8
Challenges –Text Editor
NOTE: I can help for Vim

• TE1: Setup syntax highlighting so that FAST input files look nicer
when you open them. Example specs:
• Extensions: .dat, .fst, .dvr, .inp
• Comments characters: !, #, ===
• Strings: “” or ‘’
• Numbers
• Keywords: True, False, default (case insensitive)

• TE2: Can you edit multiple lines at once?

• TE3: Can you open the file where the cursor is located?
And then go back.

• TE4: Can you open a terminal in the same folder as the file you are
editing?

• TE5: When you are typing a filepath, can you autocomplete it with
existing files on your system?
NREL | 9
Challenges – Operating system and command prompt

• OS1: Can you open a terminal in a given folder from your file explorer?
Application: run openfast/turbsim from a given folder

• OS2: Can you compare two files? two folders?


Application: compare two input files (e.g. different version of conditions)

• OS3: Can you copy/paste a filename from the file explorer to your
terminal?
Application: run openfast/turbsim on a given filename

• OS4: Can you add a directory to your system/user path so that binaries
within this folder are accessible in your terminal?
Application: put your openfast executables in one directory, access them everywhere

• OS5: Can you add an alias to your command prompt to shorten


commands you often use?
Application: alias `python path/to/pydatview` as pydat, or alias `git status` as `lg`
NREL | 10
Challenges – OpenFAST Features
• OF1: How to 3D-visualize the results of an OpenFAST simulation?
Hint: use WrVTK

• OF2: How to export velocity and vorticity fields with OLAF?


Hint: use the grid outputs of OLAF

• OF3: How to export the axial induction for all the nodes of blade 1?
Hint: look for BldNd_BladesOut in the documentation.
NOTE: you can use pyDatView (FAST Radial average), and/or the python-toolbox examples
input_output/examples/Example_RadialPostPro.py to look at the average results.

• OF4: How to export and visualize the mode shapes of a substructure


in SubDyn?
Hint: select JSON export in SubDyn input file
and use the webapp viz3danim

• OF5: How to run an OpenFAST linearization? Generate a Campbell


diagram?
Hint: use the option Linearize, and some python-toolbox tools

• OF6: Can you prescribe a load time series at the tower top?
Hint: Use a nacelle structural controller, see “NumNStC”

NREL | 11
Challenges – Tools

• TO1: Can you install the python-toolbox?


Have a look at the different examples, try to run them and see if any can be relevant to your
work:
input_output/README.md
input_output/examples/*.py
airfoils/examples/*.py
case_generation/examples/*.py

• TO2: Can you install pyDatView? (try v0.4 or the latest dev version)
• Open several OpenFAST input and output files at once.
• Perform some FFT analyses, Compare signals, change the units.
• Try the menu “Data/Fast Radial average” on a simulation outputs that has multiple
radial outputs (like AB1N001alpha)

NREL | 12
Challenges – Developers [L3]

• Can you compile the aerodyn_driver, with OpenMP, debug and double precision?
Hint: cmake options: -DOPENMP=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=Debug

• Can you run ctests for the aerodyn_driver only?


Hint: cmake options: -DBUILD_TESTING=ON , ctest options: -R ad_BAR*

• Can you fork OpenFAST, create an issue, submit a pull request?

NREL | 13
1. Chose your own adventure:

[L1] Become a standard user


Inputs and outputs
INPUTS: OUTPUTS:
• one main file (extension .fst) which • one data file (.out or .outb) with time series
references other files of selected output channels
• optional files: summary (.sum), echo (.ech),
Main.fst linearization (.lin), visualization (vtk)
ElastoDyn.dat Main.out
ED_Tower.dat Time
(s)
Rotor
Speed
… Channel[n]
(unit)
(rpm)
ED_Blade.dat 0 5.0
OpenFAST
AeroDyn.dat executable 0.1 4.9

… …
AD_Blade.dat
tMax 5.5
Polar.dat

…. Main*.sum Main*.ech Main*.lin vtk*/ …


NREL | 15
Inputs and outputs (in practice)
Typical folder:

INPUTS
OUTPUT
EXE

NREL | 16
Inputs and outputs – Some notes [L1-L2]
• Filenames can be absolute (“C:/path/AeroDyn.dat”) or relative (“../AeroDyn.dat”, “./sub/AeroDyn.dat”)

• Relative paths are relative to the “parent file” that specify them, for instance:
the “main AeroDyn file” is relative to the “Main file (.fst)”
the “AeroDyn blade file” is relative to the “main AeroDyn file”

• Both “/” and “\” should work, but it’s recommended to use “/”

• Avoid filepaths with spaces.. but if you do, remember to surround them by quotes: “my folder/my file.dat”

• Output files are overwritten when OpenFAST is rerun!

NREL | 17
Getting OpenFAST
• Installation instructions:
https://openfast.readthedocs.io/en/main/source/install/index.html

• Windows:
https://github.com/OpenFAST/openfast/releases
(NOTE: the executable are also available from the tinyurl)

• Mac/Linux:
# Create a new conda environment
conda create -n openfast_env
# Install OpenFAST through the Conda Forge channel
conda install -c conda-forge openfast
# Test OpenFAST
openfast -v

• Compile from source [L3] (possible on all platform)


https://openfast.readthedocs.io/en/dev/source/install/index.html#compile-from-source
NREL | 18
Running OpenFAST
• Open a terminal/command line
Windows: From the File explorer: File -> Open Windows PowerShell
Also, see Challenges OS1 and TE4

• Navigate to the folder where the OpenFAST executable and main input file are:

cd path/to/folder

• Call the OpenFAST executable with the main input file as argument:

./openfast_x64.exe Main.fst

• Pay attention to the terminal outputs


Warnings/errors would show up here

NREL | 19
Running OpenFAST – Some notes [L1-L2]
• The path to the executable can be absolute or relative to the current folder you are in:

• The path of the main input file can be absolute or relative to the current folder you are in:

• You can add the directory containing the OpenFAST executable to the system path or create an “alias” in your
terminal to avoid having to type the path to the executable all the time
(see Challenges OS4 and OS5)

• We recommend running OpenFAST from the directory where the main FST file is located.
• Avoid spaces in your filenames and directories
• Using the extension of the executable is optional on windows.
• The direction of the slashes depends on the OS and terminal (use “\” on windows, use “/” otherwise)
NREL | 20
Input file syntax
• There are many inputs, which can be overwhelming

• It takes time and practice to grasp them all

• The syntax is (almost) always the same:


VALUE KEY COMMENT {accepted values} [condition] (unit or type)

• Reading the comment is often enough

• More details on each input can be found on readthedocs: https://openfast.readthedocs.io/en/


(use the search feature)

• All inputs need to be provided and the order matters.

• A bit of syntax highlighting makes it more “friendly” (See challenge TE1) NREL | 21
Output file and output channels [L1-L2]
• Each module define the output channels
at the end of their input file, after the key “ OutList”

• Output for selected sections is possible via


“Gages” (see e.g. BlOutNd, TwOutNd, TwrGagNd, BldGagNd )

• We have recently added “Nodal outputs”


for ElastoDyn, AeroDyn and BeamDyn,
which provides outputs for all blade sections.
(See Challenge OF3 and Case2)

• You can find the list of output channels available for each module in the OpenFAST repository:
docs/OtherSupporting/OutListParameters.xlsx

NREL | 22
Errors [L1-L2]
• User errors are common….

• OpenFAST should provide some kind of indication (The terminal output is Function1:Function2:Function[n]:Error Message )
Read the error messages carefully

• Some hints for common troubleshooting can be found here:


https://ebranlard-openfast.readthedocs.io/en/doc/source/working.html#running-and-troubleshooting-a-simulation

• Some general rules:


• “Simplify your model to the bare minimum”
(for instance: no aerodynamic, stiff structure, steady inflow, no controller)
• Make sure your inputs files match the OpenFAST version you are using
• Make sure your model is physical
NREL | 23
[L1] Quick start/tutorial for new users
Tutorial inputs files
• We’ll use cases defined in the folder Simulations from the shared folder

• We’ll use the NREL 5-MW (sometimes, a simplified version of it), which is a fictitious but representative multi-MW
wind turbine. (https://www.nrel.gov/docs/fy09osti/38060.pdf)
Rated power 5 MW
Rated rotor speed 12.1 rpm
Hub Height 90 m
Rotor diameter 126 m

NREL | 25
Case 1 – Onshore turbine, structure only
• The turbine is only loaded by gravity, the tower is initially
displaced by 3m

• How to run and plot results (Note: Matlab script provided as well):

• Important inputs for this case:


• Main.fst: TMax, DT, CompElast, Gravity
• ElastoDyn.dat: *DOF*, TTDspFA

• Try changing these inputs and rerun

• Other files (ElastoDyn_Blade.dat, ElastoDyn_Tower.dat ) define


the structural properties. They can be plotted with pyDatView or
the python-toolbox (Challenge TO1 and TO2) NREL | 26
Case 2 – Steady Wind of 8m/s
• Aerodynamics loads are now added using the AeroDyn and
InflowWind modules

• Nodal outputs (AxInd) added to AeroDyn outputs

• Important inputs for this case:


• Main.fst: CompInflow, CompAero, AirDens
• ElastoDyn.dat: RotSpeed, BlPitch*
• InflowWind.dat: WindType, HWindSpeed, RefHt, PLExp
• AeroDyn.dat: WakeMod, AFAeroMod, TwrPotent
• AeroDyn_Blade.dat (blade aerodynamic properties)
• AeroDyn_Polar.dat (polar data, here only one polar)

• Run OpenFAST on the Main.fst and the plot script

• Try changing the wind speed, rotor speed, blade pitch

NREL | 27
Case 3 – Steady Wind of 8m/s with simple controller
• We add a simple controller (generator torque) using the ServoDyn module.
(we do not use a DLL to avoid platform compatibility issues)

• We refer to input files in the directory ../_5MW_Baseline to avoid repeating


common input files

• We output 3D surfaces for visualization (see challenge OF1)

• The turbine is started with a tower top displacement (to better see the tower
motion)

• Important inputs for this case:


• Main.fst: CompServo , WrVTK, VTK_type, VTK_fps
• ServoDyn.dat: VSContrl, VS_Rgn2K, VS_*

• Run OpenFAST on the Main.fst and the plot script

• Try changing the rotor speed, or the VS_* parameters

• Clean your vtk folder if you change fps, tmax, or dt

NREL | 28
Case 5 – Turbulent Wind ~8m/s with simple controller
• In AeroDyn, we add unsteady airfoil aerodynamics (AFAeroMod=2), tower
influence (TwrPotent=1), and aerodynamic forces on the tower
(TwrAero=True).

• We create a turbulent wind field in the TurbSim/AeroDyn format (.bts) using


the program TurbSim (part of OpenFAST)

./TurbSim.exe ./TurbSimBox_8mps_5MW.inp

• TurbSim executable can be downloaded from:


https://github.com/OpenFAST/openfast/releases (latest)
https://www.nrel.gov/wind/nwtc/turbsim.html (legacy, v2.0)

• It is important that the “box” dimensions are large enough to include the
rotor, and, because we use TwrAero, the tower as well ( WrADTWR)

NREL | 29
Case 5 – Turbulent Wind ~8m/s with simple controller
• Important inputs for this case:
• AeroDyn.dat: TwrAero, TwrPotent, AFAeroMod
• InflowWind.dat: WindType, FileName_BTS
• TurbSimBox*.inp: WrADFF, WrADTWR, NumGrid*,
AnalysisTime
RefHt, Uref, PLExp
TurbModel, IEC*

• Run OpenFAST on the Main.fst and the plot script

• Try running a longer simulation, changing the mean wind speed of the box,
changing the shear (PLExp). Try opening the box in pyDatView.

NREL | 30
40

Case 6 – Monopile with regular waves

Z
30
• We use the “offshore“ version of the NREL 5-MW mounted on a monopile (OC3
Monopile developed within IEA Wind Task 23 OC3 project)
20
• The sea state consists of regular waves with 2m height and 8s period

• We output the Craig-Bampton modes (see challenge OF4)


10
• Important inputs for this case:
• Main.fst: DT, CompHydro, CompSub, WtrDens, WtrDpth
• ElastoDyn.dat: Ptfm*DOF, TowerBsHt, PtfmRefzt, PtfmYIner
• HydroDyn.dat: WaveMod, WaveHs, WaveTp 0
• SubDyn.dat: Jdampings, Nmodes

• Run OpenFAST on the Main.fst. Run the plot script. Open the JSON files in: -10
https://ebranlard.github.io/viz3Danim/

-20

2
0 2
-2 -20

OC3-Monopile Meshes –
HydroDyn (Blue, Green,
Red) & SubDyn (Gray)
Y X
NREL | 31
3. When you are on your own and
need help
Where to find help
• As much as possible, readthedocs:
https://openfast.readthedocs.io/en/
• Installing/compiling OpenFAST
• User Documentation
• Modules input files
• Modules theory (AeroAcoustics, OLAF, ExtPtfm,
SubDyn, Structural Control, FAST.Farm)
• Modules theory not in html (ElastoDyn,
~AeroDyn, HydroDyn, TurbSim)
• NOTE: a quick start, with practical usecases, is missing.
Hopefully one day! A preliminary version:
https://ebranlard-openfast.readthedocs.io/en/doc/sou
rce/working.html

• NREL forum: https://forums.nrel.gov/

• Github issues and discussions:


https://github.com/OpenFAST/openfast/issues
https://github.com/OpenFAST/openfast/discussions

NREL | 33
Input files change all the time….
• If you change version of OpenFAST the input files will likely change a bit.
We are aware that this is painful… it’ll take time for us to improve on that.

• [L1] Input file changes from one version to the next are documented here:

https://openfast.readthedocs.io/en/main/source/user/api_change.html

• [L1] You can find up-to-date example input files of the current stable
version of OpenFAST here:
https://github.com/OpenFAST/r-test/tree/main/glue-codes/openfast
• Navigate to
5MW_Baseline

• or another folder that is similar to what you are trying to simulate :


5MW_OC4Jckt_DLL_WTurb_WavesIrr_Mgrowth
(OC4 Jacket, DLL controller, Turbulent wind, irregular waves, marine
growth)

• Click on a given file to see its format, copy paste content to a new
file on your computer, compare with your input file (we’ll cover
comparison later)

• [L2] If you are using a previous version, clone the repository and checkout
the corresponding version tag (and follow similar steps than above)
git clone https://github.com/OpenFAST/r-test/ NREL | 34
cd r-test
3. Tools to work with OpenFAST
pyDatView
Tool for 1D visualization of input and output files and some typical postprocessing:
https://github.com/ebranlard/pyDatView

• Windows installation:
• Download “setup.exe” files for stable, or latest dev:
https://github.com/ebranlard/pyDatView/releases
Install it. Then you’ll find pyDatView in the windows menu
You can pin it to the task bar and add file association.
• Or, clone the repo and install the dependencies

• Mac (you might need to stay in the conda base environment) :


conda install -c conda-forge wxpython
git clone https://github.com/ebranlard/pyDatView -b dev
cd pyDatView
python -m pip install --user -r requirements.txt
pythonw pyDatView.py example_files/FASTIn_arf_coords.txt

• Linux:
sudo apt-get install libgtk-3-dev # might need to be changed.
# Search for “How to install wxpython on [your OS]”
git clone https://github.com/ebranlard/pyDatView -b dev
cd pyDatView
python -m pip install --user -r requirements.txt
python pyDatView.py example_files/FASTIn_arf_coords.txt

• You can create an alias for quick access (Challenge OS5)


NREL | 36
pyDatView
Useful features (see Demos/pyDatview from shared folder):
• Open most input and output files
• Quickly plots multiple channels
• Plot spectra (FFT)
• Compare multiple files
• Extract FAST(.Farm) radial data
• Change units
• Perform simple operations on channels
• Measure (e.g. periods)
• Filter, Resample, Bin, Mask data
• Curve Fitting
• Export data
• Export script

You can also use it directly from python

NREL | 37
python-toolbox

Tools to read/write, preprocess and postproces OpenFAST files (granular)


https://github.com/OpenFAST/python-toolbox

• As much as possible independent of OpenFAST version

• Currently the package is called pyFAST. We might rename it in the future because pyFAST is already
taken on pypi.

• Installation:
git clone http://github.com/OpenFAST/python-toolbox
cd python-toolbox
python -m pip install -e .

• Most of what pyDatView does can be scripted using the python-toolbox (or welib)

NREL | 38
python-toolbox – simple examples
(see Demos/python-toolbox from shared folder)

• Read an AeroDyn file, modify it and write it back (Example1.py):


from pyFAST.input_output import FASTInputFile
filename = 'AeroDyn.dat'
f = FASTInputFile(filename)
f['TwrAero'] = True
f['AirDens'] = 1.225
f.write('AeroDyn_Changed.dat’)

• Read an OpenFAST output file (binary or ascii), plot some signals (Example2.py):
import matplotlib.pyplot as plt
from pyFAST.input_output import FASTOutputFile
df = FASTOutputFile('FASTOutBin.outb').toDataFrame()
print(df.keys())
plt.plot(df['Time_[s]'], df['RotSpeed_[rpm]'])

NREL | 39
python-toolbox – simple examples
(see Demos/python-toolbox from shared folder)

• Plot the AeroDyn blade properties (Example3.py):


import matplotlib.pyplot as plt
from pyFAST.input_output import FASTInputFile
df = FASTInputFile('data/AeroDyn_Blade.dat').toDataFrame()
plt.plot(df['BlSpn_[m]'], df['BlChord_[m]'])

• Read a TurbSim box, modify it, write it back (Example4.py):


(Also: fit profiles, plot time series, cross correlation, export to Mann format)
from pyFAST.input_output import TurbSimFile
ts = TurbSimFile('data/TurbSimBox.bts')
print(ts)
ts['u'][0,:,:,:] += 1 # Add 1 m/s in the streamwise direction
ts.write('data/TurbSimBox_Changed.bts')

NREL | 40
python-toolbox – simple examples
(see Demos/python-toolbox from shared folder)

• Read a CSV file with (alpha, Cl, etc) and write it to AeroDyn format (Example5.py):
from pyFAST.airfoils.Polar import Polar
polar = Polar('data/DU21_A17.csv', fformat='delimited')
ADpol = polar.toAeroDyn('data/AeroDyn_Polar_DU21_A17.dat’)

• Read an output file and average the radial/nodal data (Example6.py):


import matplotlib.pyplot as plt
import pyFAST.input_output as io
import pyFAST.input_output.postpro as postpro
# Step 1: Read an openfast output file
df = io.fast_output_file.FASTOutputFile('data/Main.out').toDataFrame()
# Step2 : Average data (over 1 period) and extract the radial stations
dfRad_ED, dfRad_AD, dfRad_BD = postpro.spanwisePostPro(
FST_In='data/Main.fst', avgMethod='periods', avgParam=1, df=df)
# Plot
plt.plot(dfRad_AD['r/R_[-]'], dfRad_AD['B1AxInd_[-]'])

NREL | 41
python-toolbox – simple examples
Create input files for parametric simulations (Example7.py):

import pyFAST.case_generation.case_gen as case_gen


import pyFAST.case_generation.runner as runner
import pyFAST.input_output.postpro as postpro
ref_dir = 'templateDir/' # Folder where the fast input files are located (will be copied)
main_file = 'Main.fst' # Main file in ref_dir, used as a template
work_dir = 'parametric/' # Output folder (will be created)
# Define the parametric study (list of dictionaries)
PARAMS=[]
for i, (wsp, rpm) in enumerate(zip([4,5,..], [2,7,..])):
p = {'TMax': 10}
p['EDFile|RotSpeed'] = rpm
p['InflowFile|HWindSpeed'] = wsp
p['__name__'] = 'case_'+str(i+1) # basename for all files
PARAMS.append(p)
# Generate all files in a working directory
fastFiles = case_gen.templateReplace(PARAMS, ref_dir, outputDir=work_dir, main_file=main_file)
# Run the simulations
runner.run_fastfiles(fastFiles, fastExe='./openfast_x64.exe’, nCores=2)
# Simple postprocessing (mean value of all channels over the last period for each simulation)
outFiles = [os.path.splitext(f)[0]+'.out' for f in fastFiles]
avg_results = postpro.averagePostPro(outFiles, avgMethod='periods’, avgParam=1)
plt.plot(avg_results['WS_[m/s]'], avg_results['RtAeroCp_[-]'])
NREL | 42
python-toolbox
Find more examples on the repository (look for “examples” folder in each subdirectory).
https://github.com/OpenFAST/python-toolbox/

NREL | 43
WEIS - ROSCO
WEIS: Documentation and examples: https://github.com/WISDEM/WEIS

• WEIS wraps both OpenFAST and python tools together

• Everything is compiled during installation.

• WEIS is useful to run optimization studies, parametric studies, full DLC load cases, with batch
postprocessing, including rainflow counting.

• You will likely still need the python-toolbox for “granularity” (simple tasks)

ROSCO (controller): Documentation and examples: https://github.com/NREL/ROSCO

• Compile a controller (using cmake)

• Tune a controller for a given turbine

• See different examples in the repository

NREL | 44
4. More difficult runs:
OLAF, Linearization
OLAF – Guidelines
We always have to setup and adapt the OLAF parameters. The guidelines of the documentation are a good start:
https://openfast.readthedocs.io/en/dev/source/user/aerodyn-olaf/RunningOLAF.html#guidelines

Two main concerns:


• “Meshing” (wake length and time step)
• “Regularization” (vortex code / avoiding singularity)

You need to setup the “meshing” for different:


• rotational speed
• mean wind speed
• (average axial induction)
• (rotor size)
Because
• we want a sufficiently long wake
• the wake is expressed in terms of “number of panels”
• we don’t want the simulation time to be too large
Note: simulations will be faster if compiled
You need to tune the regularization parameters because: with OpenMP
• It is not an exact science, and it depends on the rotor scale
Visual inspection of the wake and velocity field helps.
NREL | 46
OLAF – Case 9
(See Simulations/9_RigidSteadyWind_OLAF in shared folder)

• We compare BEM and OLAF. OLAF parameters are not tuned in this example!

• To setup the OLAF parameters we provide a script: Params.py

• Important inputs for this case (in OLAF.dat):


• nNWPanels, nNWPanelsFree
• WakeRegFactor, WingRegFactor

• The OLAF simulation generates VTK files in the folder vtk_fvw (see OLAF inputs WrVTK and
GridOuts)

• The postprocessing script (PlotSimulationResults.*) compares BEM/OLAF and shows the velocity field
at the end of the simulation

NREL | 47
OLAF – Case 9
Before parameter setup: (wake way too short, spiky velocity field)

After parameter setup:

Note: we still need to run longer, convergence has not been reached.
The guidelines estimate the transient time to be 186s
NREL | 48
Linearization – Some preliminary notes
• Warning: The process can be tedious and time consuming ([L3], but we’ll try step by step…)

• Simplified theory: A
Given a nonlinear state equation:
We can linearize it about an operating point using a Taylor expansion:
An eigenvalue analysis of A gives: frequencies, dampings, modes of the system

• Implementation:
• OpenFAST performs similar operations than this simplified theory behind the scene, with added complexity due to the modular
framework, and the account of algebraic constraints, see Jonkman et al. 2016, 2018.
• The “same code” is run within OpenFAST during time-domain simulations and during linearization
• OpenFAST mostly use finite differences to compute Jacobian
• A subset of the modelling options is available when doing linearization
(for instance in AeroDyn we need FrozenWake=True, WakeMod=1, AFAeroMod=1, in ServoDyn we need the simple VS controller)

NREL | 49
Linearization – Some preliminary notes
• Rotating system:
• When the system is rotating, the operating point is a periodic steady state.
• We need to linearize multiple times across one revolution.
• Due to the presence of states in the rotating frame, a multi-blade coordinate transform needs to be applied to the “A” matrices
before averaging them over one revolution.

• In practice:
• Linearization is activated using the Linearize input file switch “Linfile (.lin)”

• It’s the user responsibility to ensure the operating point is an equilibrium point.
• A trimming algorithm is available to help this process.

• Let’s see with examples…

NREL | 50
Linearization – Case 10 – Blade Only in Vacuum
(See Simulations/10_Linearization_BladeOnly_Vacuum in shared folder)

• Only one blade, only the Blade DOFs are on

• Vacuum conditions: gravity is zero, no aero/inflow

• Linearization is requested at t=0.

• A “lin-file” (extension.lin) is generated.

• Important inputs for this case:


• Main.fst: Linearize, NLinTimes, LinTimes, Gravity
• ElastoDyn.dat: *DOF*, NumBlades

• The postprocessing script (postpro_SimpleEigenAnalysis.*) performs a simple eigenvalue analysis on the A matrix:
Nat. freq. [Hz] Damping ratio [%] Mode Identified
0.6717 0.4738 1 st Flap
1.0791 0.4712 1 st Edge
1.9809 0.4894 2 nd Flap

NREL | 51
Linearization – Case 11 – Rotating
(See Simulations/11_Linearization_Rotating in shared folder)

• Three blades, Blade DOFs on and generator DOF on (others are off)
• Wind Speed=8m/s, Target rotational speed of 9 rpm.

• Linearization is obtained using a “Trim” algorithm (CalcSteady), which ensures that the rotational speed
is as specified. The trim algorithm continuously adapts the generator torque or pitch angle (depending on
TrimCase), and waits for a (periodic) equilibrium to be reached.

• 36 “lin-files” are generated over one rotor revolution (based on input NLinTimes)

• Important inputs for this case:


• Main.fst: Linearize, CalcSteady, TrimGain, TrimCase, NLinTimes
• AeroDyn.dat: FrozenWake=True, WakeMod=1, AFAeroMod=1
(needed for linearization)
• ElastoDyn.dat: RotSpeed

• The postprocessing script (postpro_OneOP.*) performs a multi-blade coordinate (MBC) transformation on


all the A matrices (found in each lin-file) before averaging them
#, NatFreq_[Hz], DampRatio_[-], Mode_Identified[-]
1, 0.588, 0.632 , ED 1st flapwise cos
2, 0.722, 0.526 , ED 1st flapwise coll.
3, 0.841, 0.441 , ED 1st edgewise sin
4, 0.937, 0.016 , ED 1st edgewise cos
5, 1.237, 0.012 , ED 2nd flapwise sin
6, 1.837, 0.155 , ED 2nd flapwise sin
7, 1.987, 0.142 , ED 2nd flapwise coll.
8, 2.133, 0.133 , ED 1st flapwise cos
9, 2.256, 0.022 , ED Variable speed generator DOF
NREL | 52
Linearization – Case 11 – Rotating
(See Simulations/11_Linearization_Rotating in shared folder)

• You can also try the script (postpro_MultiLin_Campbell.py) which is intended for several
Operating points (OP)

#, NatFreq_[Hz], DampRatio_[-], M
1, 0.588, 0.632 , E
2, 0.722, 0.526 , E
3, 0.841, 0.441 , E
4, 0.937, 0.016 , E
5, 1.237, 0.012 , E
6, 1.837, 0.155 , E
7, 1.987, 0.142 , E
8, 2.133, 0.133 , E
9, 2.256, 0.022 , E
NREL | 53
Linearization – Case 12 – Campbell diagram
(See Simulations/12_Campbell in shared folder)

• All degrees of freedom are ON, except generator (to avoid switching between TrimGain=2 and TrimGain=3)
• The operating conditions are specified in a CSV file (rotor speed, wind speed, pitch)
• The script runCampbel_NoServo.*:
• Generates input files for each operating conditions
• Runs OpenFAST (the trim algorithm is used to find a periodic steady state)
• Postprocess the linfiles, generates a set of Campbell files “Campbell_*.*”, and plots them

NREL | 54
Linearization – Case 11 – Campbell diagram
• In this case, the identification works fine
• Usually, the user needs to adjust the Mode ID file: “Campbell_ModesID.csv” file
• You can try plotting the Campbell diagram using a different ID file:

python .\plotCampbellData.py .\Campbell_NoServo\


Campbell_ModesID_WrongID.csv WS

• You can also rerun the script runCampbell*.py setting: writeFSTfiles = False,
runFast=False, and changing the variable modeID_file

NREL | 55
Linearization – Some more notes
• Mode Identification is usually difficult and time consuming

• When the Generator DOF is ON (Using the simplified controller), depending on the wind speed, the user needs to switch between:
• TrimGain=2 in Region2 (Generator Torque control)
• TrimCase=3 in Region 3 (Pitch control)
• At the boundary between the two, things can be tricky. A good hack is, in Region 3, to set the rated speed to a small value so
that Qgen=Qrated, for instance VS_RtGnSp = 0.01

• The python function writeLinearizationFiles (pyFAST), should take care of all of that (remember to set trimGainPitch,
trimGainGenTorque, and possibly maxTrq). The Operating point file needs to contain the Generator Torque so that the function can
decide when to switch from region 2 and 3.

• It can happen that the trim algorithm does not find a periodic steady state (even after a long time like 5400s). The latest OpenFAST will
output one lin time at the end of the simulation.

• 3D visualization of mode shapes is possible, but even more tedious. You can read about it here:
https://ebranlard-openfast.readthedocs.io/en/doc/source/working.html

• We will work in the coming two years at improving the process.


NREL | 56
Good luck in your OpenFAST
journey
5. Your questions

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy