Skip to content

Conversation

@andrew-platt
Copy link
Collaborator

@andrew-platt andrew-platt commented Nov 10, 2025

Ready for merging

Feature or improvement description
The WaveTank glue-code is an experimental code for coupling hardware-in-the-loop MHK models in a wavetank to software simulating the MHK turbine loads that cannot be physically modeled in the wave tank. The OpenFAST modules SeaState, AeroDyn, MoorDyn, and InflowWind are statically linked into a single dynamic library (cmake target wavetanktesting_c_binding) with a c-binding based interface. This library can be called from LabView or another code.

Related issue, if one exists
#2720
#2735

Impacted areas of the software
Updates to following modules and interfaces:

  • AeroDyn_Inflow_C_Binding library
    • Improved internal memory handling during Init
  • HydroDyn
    • fix broken error handling in HydroDyn_CalcOutput routine
  • MoorDyn_C_Binding library
  • SeaState_C_Binding library
    • use TMax instead of number of timesteps
    • revised argument order in Init
    • WaveTimeShift for advancing wavefield in time (cannot delay)
    • direct string passing of some path/filenames instead of pointers
  • pyOpenFAST
    • Updates to match SeaState changes
    • new tdmslib.py for reading tdms files from LabView
  • NWTC_Library
    • ability to set CU to a different value for writing to file instead of output to screen (used with LabView)

Incomplete items and limitations

  • LabView example is not functional
  • No Visual Studio build process exists yet

Additional supporting information
This code is still a work in progress and should not be considered usable for generic cases.

Test results, if applicable
New test cases:

  • glue-codes/openfast/MHK_RM1_Floating_Tank-scaled - 1/49th scale version of the MHK_RM1_Floating case. This is a reference case.
  • glue-codes/other/py_wavetank_test1 - 1/49th scale version of the MHK_RM1_Floating case using Python to call the wavetank library. Prescribed motion from a wave tank simulation of the RM1 is used as the motion input. This case can be used as a template

rafmudaf added 30 commits May 20, 2025 14:00
Without this approach, errors occur when making the _C_Binding.f90 for static and shared in parallel.
@andrew-platt andrew-platt marked this pull request as ready for review December 22, 2025 16:14
Initial commit, it doesn't work yet.  Restructuring required.
There is a huge initial transient that needs addressing at some point
copy of files from MHK_RM1_Floating_Tank-scaled case -- GH actions doesn't have this case copied in the integrations test
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new wavetank library for Hardware-in-the-Loop (HIL) simulations integrating AeroDyn (AD), MoorDyn (MD), and SeaState (SS) modules. The changes enable wave tank testing capabilities with phase-shifted wave fields for hybrid testing scenarios.

Key changes:

  • Added WaveTimeShift parameter to SeaState for phase-shifting wave fields in tank testing
  • Converted CU (console unit) from parameter to variable to support output redirection to files (LabView integration)
  • Refactored C-binding interfaces for SeaState, MoorDyn, and AeroDyn to support static linking for wavetank library
  • Added Python interface and test infrastructure for wavetank functionality

Reviewed changes

Copilot reviewed 58 out of 60 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
requirements.txt Added nptdms package for TDMS file reading
modules/seastate/src/*.f90 Added WaveTimeShift parameter and updated C-binding interface
modules/moordyn/src/*.f90 Improved error handling and C-binding updates
modules/nwtc-library/src/Sys*.f90 Changed CU from parameter to public variable with SetConsoleUnit
modules/aerodyn/src/*.f90 Updated C-binding interface and VTK timing logic
glue-codes/python/pyOpenFAST/*.py Added wavetank testing interface and TDMS library support
glue-codes/labview/src/*.f90 New wavetank structural model and interface code
Comments suppressed due to low confidence (3)

modules/seastate/src/SeaState_Types.f90:1

  • The default value initialization uses integer 0 instead of double precision 0.0_DbKi. This should be 0.0_DbKi to match the type declaration.
    modules/seastate/src/SeaSt_WaveField_Types.f90:1
  • The default value initialization uses integer 0 instead of double precision 0.0_R8Ki. This should be 0.0_R8Ki to match the type declaration.
    reg_tests/executeWavetankPyRegressionCase.py:1
  • The help text mentions 'InflowWind driver executable' but the metavar is 'WaveTank-Python', which is confusing and inconsistent with the actual purpose.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@deslaughter deslaughter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good, impressive work!

@andrew-platt andrew-platt merged commit 7740c88 into OpenFAST:dev Dec 31, 2025
24 checks passed
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.

3 participants