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

Second-order wave loads in RAFT #37

Merged
merged 16 commits into from
Dec 2, 2023
Merged

Second-order wave loads in RAFT #37

merged 16 commits into from
Dec 2, 2023

Conversation

lucas-carmo
Copy link
Contributor

Purpose

This PR implements second-order wave loads in RAFT. For now, we only capture the magnitude of these loads, hence without the phases. This should be acceptable for single units but could be problematic for arrays. We plan to address this limitation in the future.

Two approaches are now available:

  • Using precomputed Quadratic Transfer Functions (QTFs) from a frequency-domain radiation/diffraction software such as WAMIT or NEMOH. The input file is assumed to be in the WAMIT format (.10, .11, and .12 files), which is the same adopted by OpenFAST.
  • Using a second-order slender-body approximation based on a modified version of Rainey's equation. In loose terms, this extends Morison's equation to include higher-order inertial terms. While not as precise as using QTFs, this approach should be sufficient in many cases and doesn't require preprocessing.

image

To use precomputed QTFs, the user needs to provide the following inputs:

  • potSecOrder = 2: A switch to specify whether and how the second-order loads should be computed.
  • qtfPath = 'string/with/path': Path to the precomputed QTF file.

image

To compute the second-order loads internally with the slender-body approach:

  • potSecOrder = 1
  • min_freq2nd: minimum frequency, in Hz, to compute the QTFs matrices.
  • max_freq2nd: maximum frequency, in Hz, to compute the QTF matrices.
  • df_freq2nd: frequency step, in Hz, of the QTF matrices. These parameters are only for the QTF matrices, as the second-order wave loads are interpolated to the frequencies specified in settings.
  • outFolderQTF = 'string/with/path': Path to the folder to output the QTF computed with RAFT. If no path is specified, the QTF is only used internally. Currently, the file is always named "qtf-slender_body-total.12d".

image

Note that potSecOrder does not conflict with potModMaster. We should be able to use any combination of them. For instance, we can use Morison's equation for the first-order wave loads and QTFs from WAMIT for the second-order wave loads.

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

I included two test cases in the examples folder. They correspond to the OC3-Hywind spar using (i) precomputed QTFs and (ii) the slender-body approximation. I have done some comparisons with OpenFAST simulations, and the results match well within the inherent limitations.

Checklist

  • I have run existing tests which pass locally with my changes.
  • I have added new tests or examples that prove my fix is effective or that my feature works.
  • I have added necessary documentation

This branch did not pass the automated tests, but it seems to be unrelated to this PR.

- Included mean drift. Current implementation is not rigorously correct when more than one wave direction are acting at the same time, but should be good enough for now.
- The QTF files pre-computed with a BEM code are in a different resolution then the incoming waves in RAFT. To solve that, we were computing the second-order force spectrum considering the QTF resolution and then interpolating the result. Turns out that we obtain different results if we interpolate the QTF first. Left both implementations in the code, but still thinking whether it is worth adding a flag for that on the input file.
- Typo fix
- Added helper functions to compute quantities needed for the slender-body approximation for second-order wave loads
- Added the capability of computing QTFs using the slender-body approximation
- Included flags in the input file for the second-order loads
- Updated solveDynamics for the case where the second-order loads are computed with the slender-body approximation. In that case, we need to first solve for the first-order motions to compute the second-order forces and moments.
- Added force due to the rotation term from slender-body approach
- Added force due to body motions inside the wave field
- Bug fix: The force component due to the relative wave elevation was being computed for one member only;
- Bug fix: There was a cos instead of a sin in the computation of gradient matrix of fluid velocity induced by waves. This influenced the axial-divergence acceleration and the component due to body displacements;
- Bug fix: The 2D qtf interpolation in calcHydroForce_2ndOrd was interpolating only the real part of the matrix
- Commented a part of raft_member.py that breaks the computation of second-order loads. Still need to figure out why
Also changed test cases for the OC3 Hywind
Made it run for a single turbine case, but need to test it with an array.

Besides, had to change some stuff in the code from ctopt and comment other stuff that I don't know how to fix right now.
- Damping levels were heavily underpredicted when motions induced by second-order loads are large. It much improved after including these motions in the drag linearization procedure.
- There was a bug in the calculation of the second-order force amplitude from the spectrum, namely a factor of 2 that was outside a sqrt but should be inside it.
@lucas-carmo lucas-carmo changed the base branch from master to dev November 30, 2023 18:02
@mattEhall
Copy link
Contributor

This looks awesome, and I think good to merge in. One last little thing: could you confirm that for the preexisting designs/examples, with no 2nd order, results from this branch match those from the dev branch?

@mattEhall mattEhall merged commit d77fafd into dev Dec 2, 2023
0 of 12 checks passed
@lucas-carmo
Copy link
Contributor Author

Yes, they do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants