Skip to content

Commit b504699

Browse files
MShabaraakeeste
andauthored
QTF Standing (Newman) Approximation (WEC-Sim#1461)
* Adds Newman Approx for the QTFs * Bug Fix * Bug Fix * Adds user guide doc for the QTFs * asserts that the QTFs are not enabled with the meanDrift * Update docs/user/advanced_features.rst Co-authored-by: Adam Keester <72414466+akeeste@users.noreply.github.com> * Update docs/user/advanced_features.rst Co-authored-by: Adam Keester <72414466+akeeste@users.noreply.github.com> * Update docs/user/advanced_features.rst Co-authored-by: Adam Keester <72414466+akeeste@users.noreply.github.com> * Update docs/user/advanced_features.rst Co-authored-by: Adam Keester <72414466+akeeste@users.noreply.github.com> * Update docs/user/advanced_features.rst Co-authored-by: Adam Keester <72414466+akeeste@users.noreply.github.com> * Adds QTFs option 2 for the run from simulink feature * fixes a bug with the QTF doc * Pulled updated WECSim_Lib_Body_Elements.slx from dev branch to resolve conflicts * Modifies the user doc * Modifies lines in the Standing approx * Modifies the user doc --------- Co-authored-by: Adam Keester <72414466+akeeste@users.noreply.github.com>
1 parent 1368234 commit b504699

3 files changed

Lines changed: 163 additions & 74 deletions

File tree

docs/user/advanced_features.rst

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,67 @@ Applications <https://github.com/WEC-Sim/WEC-Sim_Applications>`_ repository
734734

735735
Morison Elements cannot be used with :code:`elevationImport`.
736736

737+
.. _user-advanced-features-second-order-excitation-forces:
738+
739+
Second-Order Excitation Forces and Quadratic Transfer Functions (QTFs)
740+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
741+
742+
For large offshore structures, second-order wave excitation forces can significantly influence system behavior—particularly in surge, pitch, and other low-frequency motions. These forces arise from interactions between pairs of wave frequencies, :math:`\omega_i` and :math:`\omega_j`, within the wave spectrum.
743+
744+
There are two types of second-order forces:
745+
746+
- **Sum-frequency forces** (:math:`\omega_i + \omega_j`): High-frequency components that can excite fast body motions.
747+
- **Difference-frequency forces** (:math:`\omega_i - \omega_j`): Low-frequency components that can induce slow-drift responses, commonly in surge or pitch.
748+
749+
WEC-Sim supports **Quadratic Transfer Functions (QTFs)** to model second-order excitation forces. These can be imported from hydrodynamic solvers such as **WAMIT** and **NEMOH**. BEMIO functions will automatically read, process, and write QTF coefficients from WAMIT and NEMOH to the ``*.h5`` file.
750+
751+
File Naming and Conventions
752+
"""""""""""""""""""""""""""""""""
753+
754+
The QTF file naming depends on the hydrodynamics solver:
755+
756+
**WAMIT**
757+
758+
- QTF files should be located in the same folder as the `.out` file.
759+
- File naming format:
760+
761+
::
762+
763+
qtfResults_<body#>.11s
764+
qtfResults_<body#>.11d
765+
766+
Example: ``qtfWAMIT_1.11s``
767+
768+
- Note: WAMIT uses **1-based indexing** for body numbers.
769+
770+
**NEMOH**
771+
772+
- QTF files should follow this naming format:
773+
774+
::
775+
776+
OUT_QTFP_N_<body#>.dat (for sum-frequency QTFs)
777+
OUT_QTFM_N_<body#>.dat (for difference-frequency QTFs)
778+
779+
- NEMOH uses **0-based indexing** for body numbers.
780+
781+
Activating QTFs in WEC-Sim
782+
""""""""""""""""""""""""""""""""
783+
784+
To enable second-order excitation forces in WEC-Sim, use the following flag in your `body(i)` definition:
785+
786+
- ``body(i).QTFs = 1`` — Enables **full QTF-based** second-order excitation.
787+
- ``body(i).QTFs = 2`` — Enables **Standing approximation** for **difference-frequency** forces.
788+
- In this case, sum-frequency components are still computed using full QTFs.
789+
790+
.. note::
791+
792+
Do **not** use ``body[i].QTFs`` and ``body[i].meanDrift`` together.
793+
This will result in **double-counting** of mean drift forces — once from the QTFs and once from the linear mean drift formulation.
794+
If both ``body[i].QTFs`` and ``body[i].meanDrift`` are enabled, a warning will be issued and the standalone mean drift flag will be disabled. Only the QTFs will be used to compute the mean drift forces.
795+
796+
The **Standing approximation** is a modified form of **Newman's approximation**. While mathematically equivalent, Standing's formulation is expressed differently and is designed to support multidirectional wave environments. Unlike Newman's original version, it does not require high-frequency filtering after application.
797+
737798
.. _user-advanced-features-non-hydro-body:
738799

739800
Non-Hydrodynamic Bodies

source/functions/BEMIO/QTFs/triToFullMatrix.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
F_ij(dof_data(i, end-1), dof_data(i, end)) = elements(i);
4343
F_ij(dof_data(i, end), dof_data(i, end-1)) = conj(F_ij(dof_data(i, end-1), dof_data(i, end)));
4444
else
45-
elements = dof_data(:, col) - 1i .* dof_data(:, col + 1);
45+
elements = dof_data(:, col) + 1i .* dof_data(:, col + 1);
4646
F_ij(dof_data(i, end-1), dof_data(i, end)) = elements(i);
4747
F_ij(dof_data(i, end), dof_data(i, end-1)) = F_ij(dof_data(i, end-1), dof_data(i, end));
4848
end

0 commit comments

Comments
 (0)