Skip to content

IHCantabria/FASTurbine_wrapper

Repository files navigation

FASTurbine_wrapper

FASTurbine_wrapper is a Fortran/C interface layer around OpenFAST modules to expose wind turbine aerodynamic, structural, and control interactions to external simulators.

The library wraps module initialization and time-step calls for:

  • AeroDyn
  • InflowWind
  • ServoDyn
  • ElastoDyn

The project builds a shared library and provides C-compatible headers and a C++ test driver.

Repository layout

  • src/: Fortran sources and C headers for the wrapper API
  • test/: C++ integration test and reference input files
  • compile.sh, compile_cluster.sh, compile.bat: build scripts
  • run_test.sh, run_test.bat: test launch scripts
  • resources/: script to help with OpenFAST Windows installation

Requirements

Common

  • OpenFAST built and installed (headers/modules + libraries available)

Linux

  • GNU Fortran (gfortran)
  • GNU C++ (g++)
  • Shell environment with module support if using cluster scripts

Windows

  • Intel oneAPI (ifx, MKL)
  • Visual Studio C++ toolchain (cl, link)

Installation manual

Linux local build

  1. Edit compile.sh and set include/lib paths to your OpenFAST install if needed.
  2. Run:
bash compile.sh
  1. Artifacts are placed in:
  • install/lib/libfasturbwrapper.so
  • install/include/*.h
  • install/include/*.mod

Linux cluster build

  1. Ensure required modules are available on your cluster.
  2. Run:
bash compile_cluster.sh
  1. Verify artifacts in install/.

Windows build

  1. Edit compile.bat and set OPENFAST_INSTALL to your local OpenFAST install directory.
  2. Run in a regular command prompt:
compile.bat
  1. Artifacts are placed in:
  • install\lib\fasturbwrapper.dll
  • install\lib\fasturbwrapper.lib
  • install\include\*.h
  • install\include\*.mod

User manual

API entry points

The wrapper exports the following C ABI routines (see src/FASTurbW_Library.h):

  • FSTW_Init(...): initialize all wrapped modules and I/O structures
  • FSTW_CalcWind(...): compute wind-field related quantities
  • FSTW_CalcForces(...): compute aero/structural loads for the current step
  • FSTW_CalcController(...): run control-related updates
  • FSTW_WriteOutput(...): write module outputs
  • FSTW_End(...): finalize and release resources

Typical simulation flow

  1. Fill file paths and initial parameters in FSTW_InitInputType_t.
  2. Call FSTW_Init.
  3. For each simulation time step:
    • update FSTW_InputType_t values
    • call FSTW_CalcWind
    • call FSTW_CalcForces
    • call FSTW_CalcController
    • call FSTW_WriteOutput
    • read outputs from FSTW_OutputType_t
  4. Call FSTW_End.

Running the provided test

Linux:

bash run_test.sh

Windows:

run_test.bat

The test compiles and runs test/test.cpp using files under test/inputs/ and writes outputs under test/outputs/.

License

This project is licensed under the GNU General Public License, version 3 or later.

  • SPDX identifier used in source files: GPL-3.0-or-later
  • Full license text: see LICENSE

About

Wrapper to couple AeroDyn, ServoDyn and InfloWind with a C++ code for floating platforms dynamic simulation.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors