Skip to content

Commit 7740c88

Browse files
authored
Merge pull request #3065 from andrew-platt/wavetank3
New wavetank library for HIL simulations for MHK floating turbines with AeroDyn, MoorDyn, SeaState, and InflowWind.
2 parents 7f5b3a1 + 01ad8b5 commit 7740c88

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+5140
-804
lines changed

.github/workflows/automated-dev-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ jobs:
368368
path: |
369369
${{github.workspace}}/build/reg_tests/glue-codes/openfast-cpp
370370
${{github.workspace}}/build/reg_tests/glue-codes/python
371+
${{github.workspace}}/build/reg_tests/glue-codes/other
371372
${{github.workspace}}/build/reg_tests/modules/aerodyn
372373
${{github.workspace}}/build/reg_tests/modules/moordyn
373374
${{github.workspace}}/build/reg_tests/modules/inflowwind

docs/source/user/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ This section contains documentation for the OpenFAST module-coupling environment
3232
TurbSim <turbsim/index.rst>
3333
FAST.Farm <fast.farm/index.rst>
3434
C++ API <cppapi/index.rst>
35+
WaveTank <other/index.rst>
3536

3637

3738
Additional module documentation

docs/source/user/other/index.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.. _WaveTank:
2+
3+
WaveTank
4+
========
5+
6+
The WaveTank glue-code is an experimental code for coupling hardware-in-the-loop
7+
MHK models in a wavetank to software simulating the MHK turbine loads that
8+
cannot be physically modeled in the wave tank. The *OpenFAST* modules
9+
*SeaState*, *AeroDyn*, *MoorDyn*, and *InflowWind* are statically linked into a
10+
single dynamic library (``cmake`` target ``wavetanktesting_c_binding``) with a
11+
c-binding based interface. This library can be called from *LabView* or another
12+
code.
13+
14+
Inputs to the library include the time and motions, including the velocities and
15+
accelerations, located at a single reference poitn at each time step. The
16+
resulting forces and moments are returned to the calling code.
17+
18+
Restrictions
19+
~~~~~~~~~~~~
20+
The current setup WaveTank library has several restrictions:
21+
22+
- rigid structure including platform, tower, and nacelle
23+
- no yaw DOF
24+
- rigid rotor
25+
- constant rotor RPM for entire simulation
26+
- no option for controller interfacing at present
27+
- visualization limitted to *AeroDyn* and *SeaState*
28+
- Current implementation only supports floating MHK turbines (``MHK = 2``). Other modes are present but not fully implemented.
29+
30+
31+
32+
33+
Input File
34+
~~~~~~~~~~
35+
36+
37+
.. toctree::
38+
:maxdepth: 2
39+
40+
wavetank_input.rst
Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
.. _WaveTank-Input:
2+
3+
Input File
4+
----------
5+
6+
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.
7+
8+
- The file is read by the WaveTank library during initialization.
9+
10+
Conventions and Units
11+
---------------------
12+
13+
- SI units are used throughout: m, s, kg, N, Pa.
14+
- Angles are in degrees unless otherwise specified.
15+
- Rotational speed is in rpm where noted.
16+
- Positions and heights are referenced to Mean Sea Level (MSL) unless otherwise noted.
17+
- Input files for modules may be relative or absolute paths.
18+
19+
File and Simulation Control
20+
---------------------------
21+
22+
OutRootName (string)
23+
Root name used when writing summary or other files.
24+
Example: ``FRM1Q_Floating_tank_test``.
25+
26+
DT (s)
27+
Nominal timestep for WaveTank internal scheduling. Currently unused/reserved.
28+
29+
TMax (s)
30+
Maximum simulation time for WaveTank internal scheduling. Currently unused/reserved.
31+
32+
MHK (switch)
33+
MHK turbine type switch:
34+
35+
- 0: Not an MHK turbine
36+
- 1: Fixed MHK turbine
37+
- 2: Floating MHK turbine
38+
39+
Only the floating option (2) is supported at present.
40+
41+
InterpOrd (-)
42+
Interpolation order for internal data interpolation. Currently unused/reserved.
43+
44+
DebugLevel (switch)
45+
Controls logging and visualization detail:
46+
47+
- 0: none
48+
- 1: I/O summary
49+
- 2: + positions/orientations passed
50+
- 3: + input file
51+
- 4: + all meshes
52+
53+
.. note::
54+
Parameters marked “unused” are reserved for future development and are currently ignored by the code path.
55+
56+
Froude Scaling (disabled)
57+
-------------------------
58+
59+
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.
60+
61+
ScaleFact (-)
62+
Froude scaling factor λ = (full-size dimension) / (model-size dimension). Expected > 1 for scale-model testing.
63+
64+
DensFact (-)
65+
Density ratio ρ_full / ρ_model, used with Froude scaling of forces/moments.
66+
67+
Environment
68+
-----------
69+
70+
Gravity (m/s^2)
71+
Gravitational acceleration.
72+
73+
WtrDens (kg/m^3)
74+
Water (working fluid) density.
75+
76+
WtrVisc (m^2/s)
77+
Kinematic viscosity of the working fluid.
78+
79+
SpdSound (m/s)
80+
Speed of sound in the working fluid.
81+
82+
Patm (Pa)
83+
Atmospheric pressure. Used for cavitation checks.
84+
85+
Pvap (Pa)
86+
Vapor pressure of the working fluid. Used for cavitation checks.
87+
88+
WtrDpth (m)
89+
Water depth.
90+
91+
MSL2SWL (m)
92+
Offset between still-water level (SWL) and mean sea level (MSL); positive upward.
93+
94+
Sea State
95+
---------
96+
97+
SS_InputFile (string)
98+
Path to SeaState input file defining wave conditions. Ensure path is valid relative to the run directory or use an absolute path.
99+
100+
WaveTimeShift (s)
101+
Time shift applied to the SeaState wave time series to adjust phase and match tank conditions.
102+
103+
MoorDyn
104+
-------
105+
106+
MD_InputFile (string)
107+
Path to MoorDyn input file defining mooring system properties and connections.
108+
109+
AeroDyn and InflowWind
110+
----------------------
111+
112+
AD_InputFile (string)
113+
Path to AeroDyn input file defining aerodynamic model configuration (used for hydro/aero coupling as applicable in MHK context).
114+
115+
IfW_InputFile (string)
116+
Path to InflowWind input file defining inflow conditions for the rotor (e.g., currents or wind, depending on model setup).
117+
118+
Turbine Geometry and Reference Frames
119+
-------------------------------------
120+
121+
NumBl (-)
122+
Number of blades on the rotor.
123+
124+
HubRad (m)
125+
Distance from the rotor apex to the blade root.
126+
127+
PreCone (deg)
128+
Blade cone angle.
129+
130+
OverHang (m)
131+
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.
132+
133+
ShftTilt (deg)
134+
Rotor shaft tilt angle.
135+
136+
Twr2Shft (m)
137+
Vertical distance from tower-top to the rotor shaft center (nacelle center). Negative values are below tower-top.
138+
139+
TowerHt (m)
140+
Height of the tower relative to MSL. Tower is vertically aligned with ``TowerBsPt`` (sloped towers not supported).
141+
142+
TowerBsPt (m, m, m)
143+
Tower base location relative to the platform reference position in x and y, and relative to MSL in z:
144+
145+
- x: along surge axis
146+
- y: along sway axis
147+
- z: height relative to MSL
148+
149+
PtfmRefPos (m, m, m)
150+
Platform reference point position relative to MSL. All platform motions and loads connect at this point.
151+
152+
PtfmRefOrient (deg, deg, deg)
153+
Platform reference orientation given as Euler angles [roll, pitch, yaw].
154+
155+
Turbine Initial Conditions
156+
--------------------------
157+
158+
RotSpeed (rpm)
159+
Initial rotational speed of the rotor (in rotor coordinates).
160+
161+
NacYaw (deg)
162+
Initial or fixed nacelle yaw angle.
163+
164+
BldPitch (deg)
165+
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.
166+
167+
Azimuth (deg)
168+
Initial rotor azimuth angle.
169+
170+
Wave Buoy
171+
---------
172+
173+
WaveBuoyLoc (m, m)
174+
Location of the wave elevation measurement buoy in the tank coordinate frame. SeaState data is returned at each timestep at this location.
175+
176+
Output
177+
------
178+
179+
SendScreenToFile (flag)
180+
If true, send screen output to a file named ``<OutRootName>.screen.log``.
181+
182+
OutFile (switch)
183+
Controls tabular output of channels:
184+
185+
- 0: no output file of channels
186+
- 1: output file in text format (written at default DT)
187+
188+
OutFmt (string)
189+
Format specifier for text tabular output channels (excluding the time channel). Uses a Fortran-like format string.
190+
Example: ``ES20.6E2``.
191+
192+
VTK Visualization Output
193+
------------------------
194+
195+
WrVTK_Dir (string)
196+
Output directory for VTK visualization files.
197+
198+
WrVTK (switch)
199+
VTK visualization data output:
200+
201+
- 0: none
202+
- 1: initialization data only
203+
- 2: animation
204+
- 3: mode shapes
205+
206+
WrVTK_type (switch)
207+
Type of VTK visualization data:
208+
209+
- 1: surfaces
210+
- 2: basic meshes (lines/points)
211+
- 3: all meshes (debug)
212+
213+
.. note::
214+
Only lines/points may be supported in some builds. If surfaces are not
215+
supported, use ``WrVTK_type = 2`` to visualize line/point data.
216+
217+
WrVTK_DT (s)
218+
Timestep for writing VTK files.
219+
220+
VTKNacDim (m, m, m, m, m, m)
221+
Nacelle dimensions for VTK surface rendering in the format ``[x0, y0, z0, Lx, Ly, Lz]``:
222+
223+
- ``x0, y0, z0``: nacelle origin offsets
224+
- ``Lx, Ly, Lz``: nacelle extents along x, y, z
225+
226+
Implementation Notes and Best Practices
227+
---------------------------------------
228+
229+
- Only floating MHK (``MHK = 2``) is currently supported; other MHK modes will
230+
not perform as expected.
231+
- Ensure external file paths (*SeaState*, *MoorDyn*, *AeroDyn*, *InflowWind*)
232+
are valid relative to the working directory or specify absolute paths.
233+
- Coordinate conventions:
234+
235+
- Positions and heights are referenced to MSL unless otherwise noted.
236+
- The platform reference point (``PtfmRefPos``) is the coupling point for
237+
motions and loads.
238+
- The tower base is defined relative to ``PtfmRefPos`` in x and y, and to MSL
239+
in z.
240+
241+
- Choose ``OutFmt`` to balance precision and file size. The example ``ES20.6E2``
242+
is suitable for scientific notation with fixed width.

glue-codes/labview/CMakeLists.txt

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,29 @@
1414
# limitations under the License.
1515
#
1616

17-
add_library(wavetanktestinglib SHARED
17+
if (GENERATE_TYPES)
18+
generate_f90_types(src/WaveTank_Registry.txt ${CMAKE_CURRENT_LIST_DIR}/src/WaveTank_Types.f90 -noextrap)
19+
endif()
20+
21+
add_library(wavetanktesting_c_binding SHARED
22+
src/WaveTank_Types.f90
23+
src/WaveTank_IO.f90
24+
src/WaveTank_Struct.f90
1825
src/WaveTank.f90
1926
)
20-
target_link_libraries(wavetanktestinglib aerodyn_inflow_c_binding moordyn_c_binding seastate_c_binding nwtclibs versioninfolib)
27+
target_link_libraries(
28+
wavetanktesting_c_binding
29+
aerodyn_inflow_c_bind_static
30+
moordyn_c_bind_static
31+
seastate_c_bind_static
32+
nwtclibs
33+
versioninfolib
34+
)
2135
if(APPLE OR UNIX)
22-
target_compile_definitions(wavetanktestinglib PRIVATE IMPLICIT_DLLEXPORT)
36+
target_compile_definitions(wavetanktesting_c_binding PRIVATE IMPLICIT_DLLEXPORT)
2337
endif()
2438

25-
install(TARGETS wavetanktestinglib
39+
install(TARGETS wavetanktesting_c_binding
2640
EXPORT "${CMAKE_PROJECT_NAME}Libraries"
2741
RUNTIME DESTINATION bin
2842
LIBRARY DESTINATION lib
13.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)