Coder Social home page Coder Social logo

precice / openfast-adapter Goto Github PK

View Code? Open in Web Editor NEW
1.0 6.0 0.0 4.3 MB

Couples the wind energy engineering tool OpenFAST to CFD solvers via the coupling library preCICE

License: GNU Lesser General Public License v2.1

C++ 60.84% Shell 1.87% Roff 17.40% Python 2.48% F* 16.05% CMake 1.36%
cfd coupling multiphysics openfast windenergy

openfast-adapter's Introduction

preCICE-Openfast Adapter

โš ๏ธ The state of the adapter is experimental.

OpenFAST is a multi-physics engineering tool for the aero-servo-elastic simulation of wind turbines. It includes modules for the modeling of aerodynamic, structural, and electrical behaviour of on- and offshore wind turbines.

This project aims to couple OpenFAST with CFD simulation tools with the coupling library preCICE. Therefore, a preCICE-OpenFAST Adapter is being developed. The Adapter calls OpenFAST via the C++ API to drive the turbine simulation. Additionally, it calls the preCICE library to communicate and coordinate with CFD solvers like OpenFOAM.

As a first test case, the Adapter should be able to perform the coupled simulation of a single NREL5MW onshore turbine. OpenFAST calculates the forces and internal state of the turbine, while OpenFOAM is used as CFD solver to compute the inflow (see image).

img Source: OpenFAST documentation, visited on 07.11.2023

Dependencies

Note

If you are using a different version of OpenFAST and want to run the provided cases, make sure to check if the OpenFAST input files are suitable for your version

Run a simulation

  • Install the adapter
  • Select a simulation case
  • Compile the necessary scripts
  • Run the coupled simulation

Instructions on how to compile the files and run the simulation are given in each case.

Installation

Clone the repository and switch to the source directory:

git clone https://github.com/precice/openfast-adapter.git
cd openfast-adapter/src

We use cmake for the compilation by invoking a make script:

bash Allmake

The adapter is built locally in the bin folder. To make it accessible on the whole system, you need to export the installation path after compilation.

Open the .bashrc file

cd ~
nano .bashrc

and add the following line:

export PATH={path_to_repository}/openfast-adapter/bin:$PATH

Now run

source .basrhc

and restart your terminal.

You're good to go! If you want to re-compile the adapter, make sure to clean the old installation first by running src/Allclean.

Known installation issues

The installation may fail to detect OpenFAST.H, causing the installation process to end with the error message

fatal error: OpenFAST.H: No such file or directory
    1 | #include <OpenFAST.H>

One solution is to change the include command in line 1 of openfast-adapter.cpp and provide the direct path to the OpenFAST.H file of your OpenFAST installation:

#include "/yourPath/openfast/install/include/OpenFAST.H"

While in no way perfect, this solution adresses the issue and allows to proceed with the installation.

References

A more detailed description of the concept behind the adapter can be found in this report. Please consider citing the report if you are using the adapter.

License and attribution

Parts of the code in src/openfast-adapter were reused from a OpenFAST C++ API example, which is licensed under the Apache 2 license.

Development contribution

The initial version of this adapter was developed by Leonard Willeke during his research stay at Delft University of Technology in the group for Wind Energy in collaboration with Evert Wiegant.

openfast-adapter's People

Contributors

leonardwilleke avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

openfast-adapter's Issues

Adapter does not use the same compiler as OpenFAST

I installed OpenFAST from Spack*, which gave me the following in its CMakeConfig:

# Compilers use by OpenFAST build
set(OpenFAST_CXX_COMPILER "/home/gc/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/openmpi-5.0.3-ecb7njyuqk5aaoxtz3rbkmobkisc5hhp/bin/mpic++")
set(OpenFAST_C_COMPILER "/home/gc/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/openmpi-5.0.3-ecb7njyuqk5aaoxtz3rbkmobkisc5hhp/bin/mpicc")
set(OpenFAST_Fortran_COMPILER "/home/gc/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-11.4.0/openmpi-5.0.3-ecb7njyuqk5aaoxtz3rbkmobkisc5hhp/bin/mpif90")

However, building the adapter with the default CMake options leads to errors finding mpi.h in various dependency source files, since it uses the plain g++ instead of mpic++.

We need a way to get the right compiler that the OpenFAST header expects.

*with some issues and workarounds, I will elaborate on that later.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.