Skip to content

McBorisson/openFAST_ToolBox

 
 

Repository files navigation

openfast_toolbox

Build status Python: 3.6+

Python package to work with NREL-supported OpenFAST tool. This repository intends to provide simple scripts to help OpenFAST users setup models, run simulations and postprocess the results.

Installation and testing

git clone https://github.com/OpenFAST/openfast_toolbox
cd openfast_toolbox
python -m pip install -e .
pytest

Subpackages

The repository contains a set of small packages:

  • input_output: read/write OpenFAST/FAST.Farm/OLAF input and output files (see README)
  • postpro: postprocess OpenFAST outputs (extract radial data, compute fatigue loads) (see examples)
  • linearization: tools to deal with OpenFAST linearization, e.g. generate a Campbell diagram (see examples)
  • aeroacoustics: tools for aeroacoustics (generate BL files and plot outputs)
  • case_generation: tools to generate and run a set of input of OpenFAST input files (see examples)

QuickStart and main usage

Read and write files

Find examples scripts in this folder and the different fileformats here.

Read an AeroDyn file (or any OpenFAST input file), modifies some values and write the modified file:

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

Read an OpenFAST binary output file and convert it to a pandas DataFrame

from openfast_toolbox.io import FASTOutputFile
df = FASTOutputFile('5MW.outb').toDataFrame()
time  = df['Time_[s]']
Omega = df['RotSpeed_[rpm]']

Read a TurbSim binary file, modify it and write it back

from openfast_toolbox.io import TurbSimFile
ts = TurbSimFile('Turb.bts')
print(ts.keys())
print(ts['u'].shape)  
ts['u'][0,:,:,:] += 1 # Adding 1 m/s in the streamwise
tw.write('NewTurbulenceBox.bts')

Polar/airfoil manipulation

Find examples scripts in this folder.

Read a CSV file with alpha, Cl, Cd, Cm, and write it to AeroDyn format (also computes unsteady coefficients)

from openfast_toolbox.airfoils.Polar import Polar
polar = Polar('openfast_toolbox/airfoils/data/DU21_A17.csv', ff