Skip to content

RAFT v1.3.0#62

Merged
lucas-carmo merged 125 commits intomasterfrom
dev
Sep 11, 2024
Merged

RAFT v1.3.0#62
lucas-carmo merged 125 commits intomasterfrom
dev

Conversation

@lucas-carmo
Copy link
Contributor

@lucas-carmo lucas-carmo commented Sep 3, 2024

Purpose

Pull request to merge dev into master to make a new RAFT release. It includes new features and bug fixes that will be better documented in the release notice.

In summary, the main additions and modifications are:

  1. Change in overhang convention. Before, overhang was positive for upwind turbines. The sign convention is now along +x (opposite of before), thus following OpenFAST convention. For now, the code issues a warning when the overhang is positive to make sure that the user meant to analyze a downwind turbine. This warning will probably be removed after a few releases.
  2. New set of automated tests in the tests directory, including both unit and regression tests. Developers should run those tests using pytest locally before submitting a PR. The tests are also run after each push and PR using GitHub Actions. Please consider adding new tests when you implement new features to make sure that the automated tests are comprehensive 😀
  3. Ability to use preexisting WAMIT files (added mass from .1 file and wave excitation from .3 file) for hydrodynamic loads.
  4. MacCamy-Fuchs and Kim-and-Yue corrections to approximate wave scattering effects in the first- and second-order wave loads computed with the strip-theory approach. The Kim-and-Yue correction is particularly useful to get more accurate QTFs with the strip-theory approach in some cases of interest.
  5. Overhaul of the rotor class. Most of the changes are internal to the code and shouldn't affect the user, except for items 1 and 2 listed above.
  6. Bug fix in helper function getRMS(). The RMS value was missing a factor of sqrt(0.5). This bug fix affects the calculation of the linearized drag force/damping, as well as the standard-deviation, maximum, and minimum values that were printed to the console. This wasn't a problem in the past because the calculation of the wave amplitudes also missed that factor of 0.5, so they cancelled out. But I forgot to add this factor in getRMS() when we fixed the calculation of the wave amplitudes about a year ago.
  7. Several other bug fixes that will be listed in the documentation

Other minor modifications:

  • Besides the already available option of specifying the hub height (using input key hHub), now the user can also specify the coordinates of the RNA reference position (with respect to the FOWT reference frame) via the input key rRNA. For multirotor designs, the user has to provide rRNA for each RNA/rotor
  • The user can output the QTFs computed with RAFT (using the slender-body approach with or without the Kim-and-Yue correction) in WAMIT .12d format. Documented in Improvement to hydrodynamic capabilities - Mostly MacCamy-Fuchs and second-order loads #48 and exemplified by examples/OC4semi-RAFT_QTF.yaml
  • Removed input key qtfPath. Now, the path to precomputed QTFs is specified by hydroPath
  • New flag MCF within each member of a platform to specify whether MacCamy-Fuchs and Kim-and-Yue corrections should be used. Documented in Improvement to hydrodynamic capabilities - Mostly MacCamy-Fuchs and second-order loads #48 and exemplified by examples/OC4semi-RAFT_QTF.yaml
  • Now the output channels also include the minimum value of the quantities of interest

Type of change

What types of change is it?

  • Bugfix (non-breaking change which fixes an issue)
  • 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

Tested using pytest.

Checklist

Put an x in the boxes that apply.

  • 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

lucas-carmo and others added 30 commits March 20, 2023 10:06
- 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.
- Fix F_lines0 size
- Compute natural periods with RAFT
- Handle multi-rotor outputs
- Updated rotor.calcHydroConstants method to copy each blade member over each heading before moving on to the next blade member
- Added ballast fill levels to the outer columns of the RM1 Model
- Updated FOCTT example to make sure rA is always below rB
- Small zero addition to raft_member to avoid python warnings
mattEhall and others added 23 commits July 17, 2024 13:23
- Rotor methods and variables changed to handle rotor orientation
  and yaw in a more integrated way. Several new Rotor attributes
  store this information.
- Yaw modes work the same as before
- Rotor.setYaw has all the logic for rotor nacelle yaw.
- overhang has a sign change - now it's positive with +x. WILL NEED TO CHANGE INPUTS.
- Various methods changed through the code to use new Rotor attributes.
- DOES NOT WORK! Currently getting NaNs out of CCBlade.
- Fixed a couple bugs and missing pieces, so now the updated
  rotor orientation handline seems to work.
- Added a temporary check for positive overhang entries, in which
  case we make them negative (assuming people want to model upwind
  rotors). Will remove this once the change in YAML inputs is formalized.
- Still needs testing for different yaw angles and modes!
The drag force transverse to a circular element should be parallel to the relative transverse fluid velocity, but this was not the case with the previous code. This commit fixes that.

This modification does not affect rectangular cylinders. For rectangular cylinders, we still treat the flow along each direction independently.
The 2D arrays storing the PSD of mooring line tension had size [2*nLines, nfreqs ] in the model class, but the reverse [nfreqs, 2*nLines] in the fowt class. Now they both have size [2*nLines, nfreqs ]
- Tests for model.solveStatics, model.calcEigen, and model.analyzeCases. Test cases are the OC3-Hywind spar, the UMaine VolturnUS-S semisubmersible, and two VolturnUS-S with shared moorings

- Added a test case for calcCurrentLoads in fowt.test

- Updated true valus for hydroLinearization and hydroExcitation because increased frequency resolution of the input files
I had forgotten to update omdao_raft.py to follow the changes in raft_fowt.py introduced by commit 02d5330 (results['Tmoor_PSD'].shape= [2*nLines, nfreqs])
- Made many console print outputs optional and controlled by display flag.
- New method FOWT.getStiffness gets stiffness on individual FOWT.
- Changed many of the case_metrics results to now output in np.array
  rather than list form for easier processing.
- Added Member property Member.V to store submerged volume.
test_calcCurrentLoads() wasn't comparing the results against true values, so it was useless. It's working now
The input key 'hHub' corresponds to the hub height but it was being assigned to the z coordinate of the RNA reference point. The difference is overhang*sin(tilt)
- The call to CCBlade receives the total shaft tilt, which is due to the initial shaft tilt + platform tilt. We changed the name of the input variable because it was misleading
- Fixed some temporary code that was included by mistake in a previous commit
There were several modifications in dev and rerotor branches that changed the true values (most of them only slightly)
Previous true values were obtained using MoorPy's dev branch. Because we plan to merge this into the master branch soon, replaced those values to use MoorPy's master branch. Will change it back to using MoorPy's dev branch after.

Also removed checks on natural modes from solveStatics for now, but will also put it back later
Because some people are using RAFT to analyze downwind turbines, we do NOT change the sign of overhang anymore.

To analyze upwind turbines, the overhang needs to be negative (same convention as OpenFAST). If the overhang is positive, RAFT issues a warning to let the user know that we changed overhang convention from previous versions, but treats the turbine as downwind.

We will probably remove this warning after a few releases.
- Removed input key `qtfPath`. Now, the path to a precomputed qtf is obtained from `hydroPath` just like other hydrodynamic coefficients
- Changed the example using WAMIT_QTFs to use WAMIT_Coefs
- Besides the already available option of specifying the hub height (using input key `hHub`), now the user can also specify the coordinates of the RNA reference position (with respect to the FOWT reference frame) via the input key `rRNA`. For multirotor designs, the user needs to provide `rRNA` for each RNA/rotor

- moved the flagSaveValues to be an input of test_calcAero
Code clean up. I tried to keep some chunks of commented code that seemed to be work in progress. Removed only commented code that didn't seem to be used anymore. I didn't clean parts of the code that I don't know well. If we need, we can retrieve the removed comments using git.
- Added a new list of pitch angles to the VolturnUS design to match the actual turbine control behavior (which has been in the VolturnUS-farm file for a while)
- Wrote a new function to ensure that if you "dump" a RAFT design dictionary to yaml, and then want to read it in again, you won't get any errors
The code for the second-order loads was lacking a lot of comments and had some stuff that was meant to be temporary for debugging.
lucas-carmo and others added 5 commits September 10, 2024 11:03
The calculation of the RMS value was missing a factor of 0.5 (within the sqrt). This bug fix impacts the calculation of the linearized drag force/damping, so the affected tests were updated accordingly. It also impacts the standard-deviation, maximum, and minimum values that were printed to the console.

This wasn't a problem in the original code because the calculation of the wave amplitudes also missed that factor of 0.5, so they cancelled out. But I forgot to add this factor in getRMS() when we fixed the calculation of the wave amplitude.
- Updating the README to include intructions to test the installation afterwards
- General organization and ensuring that the README instructions allow for proper installation (in 1 of 2 ways)
- Some quick fixes in raft_rotor and raft_fowt to allow for array plotting
- - Given a RAFT array, each FOWT would have it's own x/y position, which wasn't captured
- Changed yaml extension names to yaml
- Included a specific version of numpy (1.26.4), which is just the last version before it switched to 2.0. There were some errors with numpy v2.0 that we found. Doing this for only the environment-source.yaml since the environment.yaml didn't need it
- Checks did not pass in GitHub with .yaml, so switching back, and also updating the README to reflect these changes
@lucas-carmo lucas-carmo merged commit f3f9db1 into master Sep 11, 2024
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.

6 participants