Skip to content

SeaState: combine SeaSt_Interp into SeaSt_WaveField, and bug fix#2026

Merged
andrew-platt merged 8 commits intoOpenFAST:dev-unstable-pointersfrom
andrew-platt:f/SeaSt_combine_Interp+WaveField
Feb 8, 2024
Merged

SeaState: combine SeaSt_Interp into SeaSt_WaveField, and bug fix#2026
andrew-platt merged 8 commits intoOpenFAST:dev-unstable-pointersfrom
andrew-platt:f/SeaSt_combine_Interp+WaveField

Conversation

@andrew-platt
Copy link
Collaborator

This is ready for merging

@luwang00, please review.
@RBergua, please check that this now works for your model.

Feature or improvement description
There was a bug in the how the indices for time in the wave field data was calculated when deltaT was zero. This resulted in nonsensical bounds for time, which caused a segmentation fault during interpolation.

Included in this PR:

  1. SeaState_Interp has been combined into the SeaSt_WaveField module. While attempting to find the root issue, it became obvious that there was no reason to keep these separated. This includes revisions to how the misc vars and parameters are stored for WaveField.
  2. Parts of HydroDyn were directly accessing the SeaState_Interp routines. New interfaces were provided within SeaSt_WaveField so that the WaveField discretization information could be used in HydroDyn to find the indices and weighting during interpolation (HydroDyn shares the same grid discetization for the WAMIT forces).
  3. Waves.f90 was revised with some updated error handling so that it is more readable. I couldn't figure out what was going on before cleaning and formatting a bit.
  4. All direct calls to interp functions from SeaState.f90 were converted to WaveField function calls instead.
  5. A check on deltaT was added to the interpolation functions.

Related issue, if one exists
@RBergua ran into a segmentation fault with the HydroDyn driver when running linearization from the driver only. The model is proprietary so it cannot be shared.

Impacted areas of the software
HydroDyn and SeaState

Additional supporting information

Test results, if applicable
A new HD driver test should be added to exercise the driver linearization function.

There is no reason to ever acces the interp routines directly outside of the WaveField module, so combining the two.
Also use this routine internally, and condense a bunch of redundant code sections as a result
Attempting to troubleshoot the issue led to cleaning up when I couldn't really follow what was going on due to too much error hanlding in the way.
@andrew-platt andrew-platt added Module: HydroDyn Module: SeaState SeaState module for wave data generation labels Feb 8, 2024
@andrew-platt andrew-platt added this to the v4.0.0 milestone Feb 8, 2024
@andrew-platt andrew-platt self-assigned this Feb 8, 2024
@RBergua
Copy link
Contributor

RBergua commented Feb 8, 2024

@andrew-platt I confirm that this PR runs with my OpenFAST model (Morison-only approach) and returns the expected results:
image

Add interface WAMIT_ForceWaves_Interp (WAMIT_Interp) for
   * WAMIT_ForceWaves_Interp_3D_vec6 -- 3D interpolation
   * WAMIT_ForceWaves_Interp_4D_vec6 -- 4D interpolation

Also added WaveField_Interp_4D_Vec6 routine to SeaSt_WaveField for completeness (not currently used).

Also an update to the RunRegistry.bat file for something missed before.
This was excess code that simply isn't needed.
@luwang00
Copy link
Contributor

luwang00 commented Feb 8, 2024

Thanks @andrew-platt for the bug fix and the code cleanup. Looks great to me.

@andrew-platt andrew-platt merged commit 5d6fd4f into OpenFAST:dev-unstable-pointers Feb 8, 2024
@andrew-platt andrew-platt deleted the f/SeaSt_combine_Interp+WaveField branch February 12, 2024 16:17
@andrew-platt andrew-platt mentioned this pull request Dec 24, 2024
38 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module: HydroDyn Module: SeaState SeaState module for wave data generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments