Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
cbab85d
Reapply "Connect WaveTankInit to SS and MD Init"
rafmudaf May 13, 2025
c0b90b7
Reapply "Connect WaveTankInit to ADI Init"
rafmudaf May 13, 2025
17bc7c5
Reapply "Fix C-based ErrMsg handling"
rafmudaf May 13, 2025
b2353da
Reapply "Add type specifier to floating point constants"
rafmudaf May 13, 2025
19244a3
Reapply "Add WaveTankEnd routine"
rafmudaf May 13, 2025
e8917ff
Reapply "Call ADI Preinit and SetRotor"
rafmudaf May 13, 2025
992933f
Revert "Partiall revert "Add MHK flag to ADI C interface""
rafmudaf May 13, 2025
927666b
Reapply "Add F to C string converter to fix ADI Init"
rafmudaf May 13, 2025
39f7f76
Revert "Partially revert "Update and clean up code comments""
rafmudaf May 13, 2025
eedaad6
Revert "Partially revert "Move initial conditions to ADI C Preinit""
rafmudaf May 13, 2025
7fc7079
Revert "Partially revert "Set SS WaveField data pointer onto MD""
rafmudaf May 13, 2025
3d71fef
Revert "Partially revert "Add subroutines for debugging LabVIEW conne…
rafmudaf May 13, 2025
bfd1c03
Reapply "Fix placement of implicit none"
rafmudaf May 13, 2025
0339d1a
Reapply "Add basic header file"
rafmudaf May 13, 2025
09d101f
Reapply "Export output sizes and allocate memory in driver"
rafmudaf May 13, 2025
1fdb83e
Reapply "Extend CalcOutput routine"
rafmudaf May 13, 2025
f08deeb
Reapply "Use floating MHK reg test files for dev testing"
rafmudaf May 13, 2025
122df96
Revert "Partially revert "Fix Python lib APIs""
rafmudaf May 13, 2025
a127057
Reapply "Connect ADI SetRotorMotion, UpdateStates, CalcOutput"
rafmudaf May 13, 2025
11f789c
Reapply "Add check for initialized WaveField pointer"
rafmudaf May 13, 2025
7230693
Reapply "Add WaveTank module config file"
rafmudaf May 13, 2025
e3b2d2c
Revert "Partially Revert "Extend C ErrMes length to 8196""
rafmudaf May 13, 2025
dd9a407
Reapply "Remove implicit none’s to fix linting"
rafmudaf May 13, 2025
baf64f5
Reapply "Remove data that aren’t used"
rafmudaf May 13, 2025
2e8492d
Reapply "Streamline parts of the WaveTank module API"
rafmudaf May 13, 2025
129148f
Reapply "Get ADI rotor loads"
rafmudaf May 13, 2025
25da50d
Reapply "Bug fix when passing structure positions"
rafmudaf May 13, 2025
57ee29c
Reapply "Update WaveTank model closer to RM1"
rafmudaf May 13, 2025
006e8dd
Compute component positions from floater reference
rafmudaf May 21, 2025
900f9f8
Use qualisys floater motions for WaveTankMod test
rafmudaf May 21, 2025
3714ac1
Improve the model geometry inputs
rafmudaf May 21, 2025
0ee4426
Use a module-global time step
rafmudaf May 22, 2025
8637ac8
Remove dummy libraries
rafmudaf May 23, 2025
5b999c7
Remove stub subroutines used in testing
rafmudaf May 23, 2025
8998d37
Bug fix: reduce array dimensions and fix overflow
rafmudaf May 23, 2025
6262c42
Initial pos, vel, accel with input data
rafmudaf May 23, 2025
6f2a735
Merge branch 'dev' into dev-cbind-wavetank2
rafmudaf Jul 8, 2025
3b1fad4
Merge branch 'dev' into dev-cbind-wavetank2
rafmudaf Jul 11, 2025
63c8413
Debugging changes to WaveTank.f90
deslaughter Jun 18, 2025
2a557d8
WaveTank_Init working with LabView
deslaughter Jun 24, 2025
0de8fe8
Add wave tank labview file
deslaughter Jun 25, 2025
e2ca151
wavetank: add license and brief description
andrew-platt Jun 25, 2025
10b451f
labview: remove stale fortran file (dates to 2012 FAST7 days)
andrew-platt Jun 25, 2025
94ec846
WaveTank: update vi to relative paths
andrew-platt Jun 25, 2025
f9cd4e0
Fix WaveTank Python driver case files
rafmudaf Jul 14, 2025
7c36fc1
Update Python wave tank driver file string passing
rafmudaf Jul 14, 2025
f3c0202
Remove End call from Init
rafmudaf Jul 14, 2025
d96453f
Fix copyright copy/paste error
rafmudaf Jul 14, 2025
d5bdeda
Merge pull request #30 from rafmudaf/deslaughter/dev-cbind-wavetank2
rafmudaf Jul 14, 2025
6361417
Add SetConsoleUnit subroutine to SysSubs modules so the user can chan…
deslaughter Jul 22, 2025
907d195
SrvD: dropped NewLines from call WrScr
andrew-platt Sep 4, 2025
f37955e
nwtclib: make CU public
andrew-platt Sep 4, 2025
3a674ff
Merge remote-tracking branch 'OpenFAST/dev' into wavetank3
andrew-platt Sep 4, 2025
7b014eb
ADI-cbind: remove comment about Re-Init
andrew-platt Sep 4, 2025
16e41c6
nwtclib/version unit tests: fix CU usage from commit 6361417b3
andrew-platt Sep 5, 2025
76d4450
Merge remote-tracking branch 'OpenFAST/dev' into wavetank3
andrew-platt Sep 9, 2025
a50d0c3
ADI cbind: typo in registry
andrew-platt Sep 6, 2025
465dc3a
wavetank: split out IO and types files
andrew-platt Sep 6, 2025
9c25b6b
Wavetank: switch to FileInfo parsing for file read
andrew-platt Sep 9, 2025
db45f45
wavetank: improve error handling in python driver
andrew-platt Sep 9, 2025
229f25b
wavetank: error handling in python example code
andrew-platt Sep 9, 2025
f8eb51e
wavetank: rearrange a bunch of code and delete some things
andrew-platt Sep 9, 2025
3175977
Merge remote-tracking branch 'OpenFAST/dev' into wavetank3
andrew-platt Oct 14, 2025
055be89
wavetank: update interfaces after merging dev changes
andrew-platt Oct 15, 2025
55ada5b
ss c-bind: pass inputfilename outrootname as fixed length char array …
andrew-platt Oct 15, 2025
c2c4edb
wavetank: major revisions
andrew-platt Oct 15, 2025
ebd50b3
wavetank: add option to send all screen to file
andrew-platt Oct 15, 2025
d6b6979
wavetank: add 'static' linking of libs
andrew-platt Oct 15, 2025
9fb9f81
wavetank: add NacYaw to input file
andrew-platt Oct 15, 2025
82fb812
adi c-bind: output filenames in ShowPassed data
andrew-platt Oct 15, 2025
0dd71f9
ss c-bind: revise vtk directory handling (was broken)
andrew-platt Oct 15, 2025
d68fa7c
wavetank: module input files read from input file instead of passed
andrew-platt Oct 16, 2025
c454340
wavetank: remove input files from interface WaveTank.vi
andrew-platt Oct 17, 2025
d2d5e8b
wavetank: return VTKdir from init
andrew-platt Oct 17, 2025
4f318d9
wavetank: update WaveTank.vi example
andrew-platt Oct 17, 2025
d85b5d1
wavetank: revert to standard tdms library (offshore group)
andrew-platt Oct 20, 2025
64c4ede
wavetank: CalcStep routine, dbgouts file
andrew-platt Oct 20, 2025
7d86049
MD: segfault if MD_End called twice from c-bind
andrew-platt Oct 20, 2025
b0ffb4d
wavetank: add output file from c-bind with all output channels
andrew-platt Oct 21, 2025
af3e21b
wavetank: add placeholder for scaling at interface
andrew-platt Oct 21, 2025
608ae34
wavetank: add rough start of struct model
andrew-platt Oct 21, 2025
7ff22cf
wavetank: vtk output partially assembled.
andrew-platt Oct 21, 2025
aea2856
wavetank: fixes to compile in double prec
andrew-platt Oct 22, 2025
73eb4f9
SeaState: add ability to time shift the wavefield
andrew-platt Oct 29, 2025
e75ac45
wavetank: add buoy for wave elev, input for WaveTimeShift, ADI_Cbind …
andrew-platt Oct 30, 2025
1359e3b
wavetank: add meshes, update SS for WaveTimeShift
andrew-platt Oct 30, 2025
8783e49
wavetank: add more meshes, add Froude scaling routines (not working)
andrew-platt Oct 30, 2025
6a39af1
wavetank: remove TipRad -- unused
andrew-platt Oct 30, 2025
7d5ba52
wavetank: add blade root motion meshes, cleanup
andrew-platt Nov 4, 2025
3bd6dba
wavetank: all calls and mappings complete. forces returned
andrew-platt Nov 6, 2025
e9fade8
wavetank: missing MD forces/moments
andrew-platt Nov 6, 2025
6daccea
wavetank: don't transpose DCM to ADI
andrew-platt Nov 6, 2025
1832fc9
wavetank: remove scaling option (not complete)
andrew-platt Nov 10, 2025
c96e3c5
Merge remote-tracking branch 'OpenFAST/dev' into wavetank3
andrew-platt Nov 10, 2025
0f4a7ee
wavetank: fix type issue so double prec compiles
andrew-platt Nov 21, 2025
7664528
SeaSt c-bind: replace numTimeSteps with time_max
andrew-platt Dec 21, 2025
30eb71d
Merge remote-tracking branch 'OpenFAST/dev' into wavetank3
andrew-platt Dec 21, 2025
b706b8e
ED: comment in registry was never updated
andrew-platt Dec 21, 2025
7935e21
SeaSt_WaveField: remove unused params from registry
andrew-platt Dec 21, 2025
92c80cc
SeaSt c-bind: fix WaveTimeShift after `dev` merge
andrew-platt Dec 21, 2025
d0fb325
cmake: objects for AD, MD, SS c-bind shared/static lib builds
andrew-platt Dec 21, 2025
224e772
seast c-bind: fix issue in reg test
andrew-platt Dec 22, 2025
ed1eb8d
HD: improve error handling in CalcOutput
andrew-platt Dec 22, 2025
9ca10b3
Add regression test case for MHK RM1 scaled tank size
andrew-platt Dec 22, 2025
245e0c5
move wavetank example python to regression
andrew-platt Dec 23, 2025
0bf37cf
functional wavetank test case
andrew-platt Dec 24, 2025
9b6f6dd
wavetank: fix debug level issue
andrew-platt Dec 24, 2025
3a79346
wavetank: updates for GH actions
andrew-platt Dec 24, 2025
f305048
wavetank regression: rearrange for GH action
andrew-platt Dec 24, 2025
44171ae
wavetank regression: rearrange again for GH actions
andrew-platt Dec 24, 2025
071fb06
typo found by ai review
andrew-platt Dec 31, 2025
12be0fb
Merge remote-tracking branch 'OpenFAST/dev' into wavetank3
andrew-platt Dec 31, 2025
01ad8b5
wavetank: add brief documentation
andrew-platt Dec 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/automated-dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ jobs:
path: |
${{github.workspace}}/build/reg_tests/glue-codes/openfast-cpp
${{github.workspace}}/build/reg_tests/glue-codes/python
${{github.workspace}}/build/reg_tests/glue-codes/other
${{github.workspace}}/build/reg_tests/modules/aerodyn
${{github.workspace}}/build/reg_tests/modules/moordyn
${{github.workspace}}/build/reg_tests/modules/inflowwind
Expand Down
1 change: 1 addition & 0 deletions docs/source/user/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ This section contains documentation for the OpenFAST module-coupling environment
TurbSim <turbsim/index.rst>
FAST.Farm <fast.farm/index.rst>
C++ API <cppapi/index.rst>
WaveTank <other/index.rst>


Additional module documentation
Expand Down
40 changes: 40 additions & 0 deletions docs/source/user/other/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.. _WaveTank:

WaveTank
========

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.

Inputs to the library include the time and motions, including the velocities and
accelerations, located at a single reference poitn at each time step. The
resulting forces and moments are returned to the calling code.

Restrictions
~~~~~~~~~~~~
The current setup WaveTank library has several restrictions:

- rigid structure including platform, tower, and nacelle
- no yaw DOF
- rigid rotor
- constant rotor RPM for entire simulation
- no option for controller interfacing at present
- visualization limitted to *AeroDyn* and *SeaState*
- Current implementation only supports floating MHK turbines (``MHK = 2``). Other modes are present but not fully implemented.




Input File
~~~~~~~~~~


.. toctree::
:maxdepth: 2

wavetank_input.rst
242 changes: 242 additions & 0 deletions docs/source/user/other/wavetank_input.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
.. _WaveTank-Input:

Input File
----------

This document describes the WaveTank configuration input file (``wavetankconfig_input.txt``) used to set up and run the WaveTank model for marine hydrokinetic (MHK) turbine testing.

- The file is read by the WaveTank library during initialization.

Conventions and Units
---------------------

- SI units are used throughout: m, s, kg, N, Pa.
- Angles are in degrees unless otherwise specified.
- Rotational speed is in rpm where noted.
- Positions and heights are referenced to Mean Sea Level (MSL) unless otherwise noted.
- Input files for modules may be relative or absolute paths.

File and Simulation Control
---------------------------

OutRootName (string)
Root name used when writing summary or other files.
Example: ``FRM1Q_Floating_tank_test``.

DT (s)
Nominal timestep for WaveTank internal scheduling. Currently unused/reserved.

TMax (s)
Maximum simulation time for WaveTank internal scheduling. Currently unused/reserved.

MHK (switch)
MHK turbine type switch:

- 0: Not an MHK turbine
- 1: Fixed MHK turbine
- 2: Floating MHK turbine

Only the floating option (2) is supported at present.

InterpOrd (-)
Interpolation order for internal data interpolation. Currently unused/reserved.

DebugLevel (switch)
Controls logging and visualization detail:

- 0: none
- 1: I/O summary
- 2: + positions/orientations passed
- 3: + input file
- 4: + all meshes

.. note::
Parameters marked “unused” are reserved for future development and are currently ignored by the code path.

Froude Scaling (disabled)
-------------------------

The following parameters may appear but are typically commented out. Froude scaling is not complete in the current code. Do not use unless explicitly enabled.

ScaleFact (-)
Froude scaling factor λ = (full-size dimension) / (model-size dimension). Expected > 1 for scale-model testing.

DensFact (-)
Density ratio ρ_full / ρ_model, used with Froude scaling of forces/moments.

Environment
-----------

Gravity (m/s^2)
Gravitational acceleration.

WtrDens (kg/m^3)
Water (working fluid) density.

WtrVisc (m^2/s)
Kinematic viscosity of the working fluid.

SpdSound (m/s)
Speed of sound in the working fluid.

Patm (Pa)
Atmospheric pressure. Used for cavitation checks.

Pvap (Pa)
Vapor pressure of the working fluid. Used for cavitation checks.

WtrDpth (m)
Water depth.

MSL2SWL (m)
Offset between still-water level (SWL) and mean sea level (MSL); positive upward.

Sea State
---------

SS_InputFile (string)
Path to SeaState input file defining wave conditions. Ensure path is valid relative to the run directory or use an absolute path.

WaveTimeShift (s)
Time shift applied to the SeaState wave time series to adjust phase and match tank conditions.

MoorDyn
-------

MD_InputFile (string)
Path to MoorDyn input file defining mooring system properties and connections.

AeroDyn and InflowWind
----------------------

AD_InputFile (string)
Path to AeroDyn input file defining aerodynamic model configuration (used for hydro/aero coupling as applicable in MHK context).

IfW_InputFile (string)
Path to InflowWind input file defining inflow conditions for the rotor (e.g., currents or wind, depending on model setup).

Turbine Geometry and Reference Frames
-------------------------------------

NumBl (-)
Number of blades on the rotor.

HubRad (m)
Distance from the rotor apex to the blade root.

PreCone (deg)
Blade cone angle.

OverHang (m)
Distance from the yaw axis (tower centerline) to the rotor apex. Negative values indicate rotor apex aft of the yaw axis under the model’s convention.

ShftTilt (deg)
Rotor shaft tilt angle.

Twr2Shft (m)
Vertical distance from tower-top to the rotor shaft center (nacelle center). Negative values are below tower-top.

TowerHt (m)
Height of the tower relative to MSL. Tower is vertically aligned with ``TowerBsPt`` (sloped towers not supported).

TowerBsPt (m, m, m)
Tower base location relative to the platform reference position in x and y, and relative to MSL in z:

- x: along surge axis
- y: along sway axis
- z: height relative to MSL

PtfmRefPos (m, m, m)
Platform reference point position relative to MSL. All platform motions and loads connect at this point.

PtfmRefOrient (deg, deg, deg)
Platform reference orientation given as Euler angles [roll, pitch, yaw].

Turbine Initial Conditions
--------------------------

RotSpeed (rpm)
Initial rotational speed of the rotor (in rotor coordinates).

NacYaw (deg)
Initial or fixed nacelle yaw angle.

BldPitch (deg)
Initial blade 1 pitch angle. If a multi-blade model is used, blade pitch control typically applies per blade in other modules; here this initializes blade 1.

Azimuth (deg)
Initial rotor azimuth angle.

Wave Buoy
---------

WaveBuoyLoc (m, m)
Location of the wave elevation measurement buoy in the tank coordinate frame. SeaState data is returned at each timestep at this location.

Output
------

SendScreenToFile (flag)
If true, send screen output to a file named ``<OutRootName>.screen.log``.

OutFile (switch)
Controls tabular output of channels:

- 0: no output file of channels
- 1: output file in text format (written at default DT)

OutFmt (string)
Format specifier for text tabular output channels (excluding the time channel). Uses a Fortran-like format string.
Example: ``ES20.6E2``.

VTK Visualization Output
------------------------

WrVTK_Dir (string)
Output directory for VTK visualization files.

WrVTK (switch)
VTK visualization data output:

- 0: none
- 1: initialization data only
- 2: animation
- 3: mode shapes

WrVTK_type (switch)
Type of VTK visualization data:

- 1: surfaces
- 2: basic meshes (lines/points)
- 3: all meshes (debug)

.. note::
Only lines/points may be supported in some builds. If surfaces are not
supported, use ``WrVTK_type = 2`` to visualize line/point data.

WrVTK_DT (s)
Timestep for writing VTK files.

VTKNacDim (m, m, m, m, m, m)
Nacelle dimensions for VTK surface rendering in the format ``[x0, y0, z0, Lx, Ly, Lz]``:

- ``x0, y0, z0``: nacelle origin offsets
- ``Lx, Ly, Lz``: nacelle extents along x, y, z

Implementation Notes and Best Practices
---------------------------------------

- Only floating MHK (``MHK = 2``) is currently supported; other MHK modes will
not perform as expected.
- Ensure external file paths (*SeaState*, *MoorDyn*, *AeroDyn*, *InflowWind*)
are valid relative to the working directory or specify absolute paths.
- Coordinate conventions:

- Positions and heights are referenced to MSL unless otherwise noted.
- The platform reference point (``PtfmRefPos``) is the coupling point for
motions and loads.
- The tower base is defined relative to ``PtfmRefPos`` in x and y, and to MSL
in z.

- Choose ``OutFmt`` to balance precision and file size. The example ``ES20.6E2``
is suitable for scientific notation with fixed width.
22 changes: 18 additions & 4 deletions glue-codes/labview/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,29 @@
# limitations under the License.
#

add_library(wavetanktestinglib SHARED
if (GENERATE_TYPES)
generate_f90_types(src/WaveTank_Registry.txt ${CMAKE_CURRENT_LIST_DIR}/src/WaveTank_Types.f90 -noextrap)
endif()

add_library(wavetanktesting_c_binding SHARED
src/WaveTank_Types.f90
src/WaveTank_IO.f90
src/WaveTank_Struct.f90
src/WaveTank.f90
)
target_link_libraries(wavetanktestinglib aerodyn_inflow_c_binding moordyn_c_binding seastate_c_binding nwtclibs versioninfolib)
target_link_libraries(
wavetanktesting_c_binding
aerodyn_inflow_c_bind_static
moordyn_c_bind_static
seastate_c_bind_static
nwtclibs
versioninfolib
)
if(APPLE OR UNIX)
target_compile_definitions(wavetanktestinglib PRIVATE IMPLICIT_DLLEXPORT)
target_compile_definitions(wavetanktesting_c_binding PRIVATE IMPLICIT_DLLEXPORT)
endif()

install(TARGETS wavetanktestinglib
install(TARGETS wavetanktesting_c_binding
EXPORT "${CMAKE_PROJECT_NAME}Libraries"
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
Expand Down
Binary file added glue-codes/labview/examples/WaveTank.vi
Binary file not shown.
Loading