Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New AeroDynInflow module with c-bindings interface #1110

Merged
merged 84 commits into from
Oct 25, 2022

Conversation

andrew-platt
Copy link
Collaborator

@andrew-platt andrew-platt commented May 2, 2022

This PR ready for merging

Feature or improvement description
This PR introduces a new library version of the AeroDyn and InflowWind modules together (called AeroDyn_Inflow) with a c-bindings interface for calling from other codes. Included with this PR:

  • AeroDyn_Inflow_C_Binding.f90 -- Fortran library interface with c-bindings. This wraps both AeroDyn15 and InflowWind modules together (simplifies passing of aerodynamics data).
  • aerodyn_inflow_library.py -- Python library corresponding to Fortran code
  • example code for running the 5MW_OC4Semi_WSt_WavesWN test case using the timeseries input for the ad_py_5MW_OC4Semi_WSt_WavesWN driver version (Python results closely agree with the Fortran driver results, which agree with the force/moment results for the corresponding full OpenFAST regression test). This driver code is not a true driver code; it contains hard coded input files and is not configurable from the command line or an input file (funding limitations during development).
  • Regression test integrated into CTest environment
  • Library incorporated into the build systems (VS project, and CMake)
  • Library supports correction steps (handled internally in the library)
  • Updated AeroDyn driver code architecture with AeroDyn_Inflow.f90 that wraps both AeroDyn15 and InflowWind together for the AeroDyn15 driver, and for this library interface.
  • AD_WrVTK added to AeroDyn_IO
  • AD_NumWindPoints added to AeroDyn.f90

This module interface is compatible with the OWENS vertical axis wind turbine code from Sandia National Labs.

Missing things:

  • Documentation of this feature is missing due to funding and time limitations.
  • Passing of linearization matrices is not supported (also funding limited)

Related issue, if one exists
This is the 4th PR providing a c-bindings interface for a module and follows the same architectural design used in those:

Impacted areas of the software
This does not affect any existing functionality of OpenFAST.

Additional supporting information
This project was funded through SBIR funding from ARPA-E in collaboration with XFlow Energy (https://www.xflowenergy.com/).

Test results, if applicable
Comparison between Python or Julia driver simulations to a fully coupled OpenFAST simulation show good agreement. For the OpenFAST simulation, the tower shadow and tower potential have been turned off (the driver has no knowledge of the tower). Loads along the blade span agree well after an initial difference during startup.

Lift force at 3 blade nodes:
Screen Shot 2022-05-02 at 5 42 18 AM

Axial induction at 3 blade nodes:
Screen Shot 2022-05-02 at 5 44 02 AM

Tangential induction at 3 blade nodes:
Screen Shot 2022-05-02 at 5 45 40 AM

To Do

ebranlard and others added 30 commits October 22, 2021 19:57
This is a very rough start -- it is a placeholder for something that compiles and doesn't segfault.  It is merely a starting point.
If the last line does not have a carriage return, the file may be passed with no NULL at the end of the last line.  If this happens and the last line starts with "END", the routine for finding the outlist may overstep the end of hte FileInfoType and read garbage (or segfault) -- at the very least give nasty errors from whatever code called it to parse the FileInfoType into the file structure.  This fixes this issue.
Compare BldPtMotionMesh with AD_Blade vtk outputs to see that things now align
Kind of rough python code that looks pretty ugly
@ebranlard ebranlard marked this pull request as ready for review October 20, 2022 22:59
@ebranlard ebranlard changed the title c-bindings interface for AeroDyn + InflowWind New AeroDynInflow module with c-bindings interface Oct 20, 2022
@andrew-platt andrew-platt changed the base branch from dev to main October 24, 2022 21:53
@andrew-platt andrew-platt changed the base branch from main to dev October 24, 2022 21:53
@ebranlard ebranlard merged commit 1ca6165 into OpenFAST:dev Oct 25, 2022
andrew-platt added a commit to OpenFAST/r-test that referenced this pull request Oct 25, 2022
This is a test case for testing the ADI interface through python (AeroDyn + InflowWind). This goes along with OpenFAST/openfast#1110

The mesh motion from the 5MW_OC4Semi_WSt_WavesWN case with a rigid turbine is used as inputs to the python driver code, and passed through to the ADI library (the results are very slightly different due to the rigid turbine).
@andrew-platt andrew-platt deleted the f/adi_c_binding branch October 25, 2022 17:07
@rafmudaf rafmudaf mentioned this pull request Oct 27, 2022
10 tasks
@andrew-platt andrew-platt mentioned this pull request Dec 19, 2022
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants