Improvement to hydrodynamic capabilities - Mostly MacCamy-Fuchs and second-order loads
Purpose
This PR implements the following improvements to the hydrodynamic capabilities of RAFT (a more detailed description is given below):
-
The first-order strip-theory solution can now apply the MacCamy-Fuchs correction (MCF) similarly to OpenFAST .
-
The computation of the QTFs using the slender-body approximation can now use a "sort of MCF". This is based on the analytical solution for the second-order diffraction problem of a bottom-mounted, surface piercing, vertical, circular cylinder . In the code, I am calling this "Kim And Yue correction" (KAY). With this, we now have a more reasonable mean and slow drift of the platform than purely using the slender-body approach implemented in #37
-
Because some users might be interested in using RAFT to generate QTF matrices to use in other tools, I added an example called 'example-RAFT_QTF.py' that computes the QTFs of the OC4-DeepCwind platform. This is also useful for cases where you want to compute the QTFs only once and make RAFT use these QTFs for all cases that will be analyzed.
-
Other changes
-
Added a "constant" wave spectrum that behaves similar to 'unit', but with a user-specified magnitude. Note that this is the magnitude of the SPECTRUM across all frequencies, not the wave height or amplitude. I confess this bothers me a little, because the input file says "wave height". I thought of considering the input as the "significant wave height" of the spectrum, but this would mean that the magnitude of the spectrum for a given frequency would change depending on the frequency range specified by the user.
-
Changed the way that the second-order motions are included in the linearization loop of the quadratic drag when potSecOrder=1. Now, we perform the linearization twice. First, we perform the linearization loop WITHOUT the second-order loads/motions. After the loop converges, we compute the QTFs, the second-order loads, and then we recompute the motions. Since the motions induced by second-order wave loads may be very relevant, we redo the linearization loop including the second-order motions. This is only done for the first wave of the case, like before. Note that this is only the case when we compute the QTFs in RAFT (potSecOrder=1). For potSecOrder=0 (no second-order loads) or potSecOrder=2 (read precomputed QTFs from a .12d file), the linearization loop is computed only once.
-
Within model.analyzeCases(), we now call model.solveStatics() twice if the analysis includes second-order wave loads: once before and once after model.solveDynamics(). In principle, this would only be needed for cases where the QTFs are computed in RAFT within model.solveDynamics() (potSecOrder=1), but we currently need to do that even when using external QTFs (potSecOrder=2) because the wave computations are performed within model.solveDynamics(). We could reorganize that in the future.
-
To avoid code repetition, I included a calcImat() function in raft_member.py. It computes Imat with or without the MCF correction depending on the inputs and flags of the member.
-
Other things that I wanted to implement but wasn't able yet
- Newman's approximation
- Account for the phases in second-order loads for arrays
- For now, cases with more than one wave direction are treated by summing each of them independently. This is ok for first-order wave loads because linearity allows for a simple superposition of different waves. However, for the second-order wave loads the correct would be to consider the combinations of wave headings.
More detailed description of points 1 and 2
- The MacCamy-Fuchs correction (MCF) corrects the inertia coefficient of the Morison equation for short waves based on the analytical solution of the first-order wave diffraction problem of a bottom-mounted, surface piercing, vertical, circular cylinder (https://erdc-library.erdc.dren.mil/jspui/bitstream/11681/3444/1/BEB-TM-69.pdf). The user can specify the adoption of the MCF correction with a boolean flag "MCF" within each member. However, the flag will be ignored (with a warning) if the user specifies the MCF for a noncircular element. This in the ONLY restriction that we impose on the element, even though the approximation would be clearly wrong for a non-surface-piercing cylinder, very tapered elements, or a cylinder with a large inclination with respect to the vertical. We leave this to the user's discretion.
This does not change the added mass matrix of the floater, only the inertial excitation in Morison's equation.
Below, a comparison of the first-order surge force RAO of the VolturnUS obtained with WAMIT, an OpenFAST model with strip-theory only, and RAFT. As expected, MCF reduces the surge force as the wave length becomes comparable to the diameter of the cylinder. Though the results are not the same as OpenFAST (which follows a different approach because it is in time domain), the MCF in RAFT seems to be good enough to avoid unrealistically large forces in short waves.
- Similar to the MacCamy-Fuchs correction (MCF), the Kim and Yue correction (KAY) is based on the analytical solution of the SECOND-order wave diffraction problem of a bottom-mounted, surface piercing, vertical, circular cylinder. While KAY is much more needed than MCF due to the larger sensibility of the second-order loads to diffraction effects, it is not as effective as MCF. The reason is that first-order body motions, which impact the second-order loads, are not taken into account in this correction. For instance, the first-order wave radiation would affect the relative wave elevation. Also, the approximation does not take into account the hydrodynamic interaction between the different cylinders that comprise the structure. Note that first-order body motions are included in the slender-body approximation—which neglects wave radiation/diffraction—employed by RAFT.
Even with this limitation, this correction for diffraction effects is already a good improvement. This correction is activated using the same flag as MCF, i.e. it is activated if: - the user requests the computation of the QTFs in RAFT (potSecOrder: 1) - the user specifies the MCF correction (MCF: 1)
Different from MCF, KAY does not work by scaling the inertia coefficient. It works by summing the real part of the force computed with the analytical solution (which is related to wave scattering) with the force computed with the slender-body approximation adopted in RAFT. This ensures that we do not double count force terms.
Below, an example of the surge force QTF of the OC4-DeepCwind platform computed using RAFT with and without the KAY correction (only the main and the first diagonal of the QTF matrix is shown).
We probably still need to fix some bugs, but I wanted to open this PR to make this capability available to other users. Also, it is already very long 😅
Type of change
What types of change is it? Select the appropriate type(s) that describe this PR
- [ ] Bugfix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds 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
Added 'example-RAFT_QTF' that computes the QTFs in RAFT using the slender-body approximation with the Kim and Yue correction.
Tests are passing locally, but GitHub actions is not working well for windows-latest. Only tests that use pyHAMS are breaking, and it seems that pyHAMS is not being installed correctly on windows-latest. Tests pass normally on ubuntu-latest and macos-latest.
Checklist
Put an x in the boxes that apply.
- [X] I have run existing tests which pass locally with my changes
- [X] I have added new tests or examples that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation