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

SeaState: fix grid size in wave surface visualization #1992

Merged

Conversation

andrew-platt
Copy link
Collaborator

This PR is ready to merge.

Feature or improvement description
When the SeaState module was introduced, the grid used for wave surface visualization was based on interpolated data from the SeaState wave grid stored in the WaveField data. The wave surface size was hard-coded to be 4x the blade length of the turbine being modeled. This resulted in clamping any parts of the wave surface outside the WaveField data. As result, the visualization looks a bit strange.

Before
Screenshot 2024-01-17 at 5 52 33 PM
Figure 1: before modification, wave surfaces beyond the WaveField data would be set to the value of the nearest edge of the WaveField data. The WaveField edges are shown as pink vertical boundaries. In the original formulation, 25x25 data points were interpolated from the WaveField data and stored. For this visualization, the 5MW_OC4Semi_WSt_WavesWN regression test was modified with WaveHs=55, WaveTp=4, WaveDir=30, WaveDirMod=1, WaveDirSpread=1, WaveNDir=75, WaveDirRange=60, and second order turned off.

After
Screenshot 2024-01-17 at 5 55 24 PM
Figure 2: after modification, the wave surfaces for visualization are bounded by the WaveField data set and use the native WaveField grid resolution specified in the SeaState input file (6 nodes in each half-width direction). The same WaveField is used here as in the original case above.

Related issue, if one exists
None.

Impacted areas of the software
Visualization of wave surface.

Additional supporting information
Before the addition of the SeaState module, the grid had been set to 25x25 points. The sea surface at each point was calculated from the FFT of the wave spectral data. After the addition of the SeaState module, each point requested was interpolated from the WaveField data. It would be nice to someday restore the ability to calculate an arbitrary number of points for the sea surface from the FFT of the wave spectral data for that location, but I don't have time right now to modify this.

Test results, if applicable
None.

@andrew-platt andrew-platt added this to the v4.0.0 milestone Jan 18, 2024
@andrew-platt andrew-platt added the Module: SeaState SeaState module for wave data generation label Jan 18, 2024
@andrew-platt andrew-platt self-assigned this Jan 18, 2024
@andrew-platt
Copy link
Collaborator Author

@luwang00 and @RBergua, could you take a look at this?

@luwang00
Copy link
Contributor

@andrew-platt
Thanks for fixing this! I agree that constraining the wavefield visualization to the SeaState wave grid is a good solution. This also helps the user in checking whether or not the structure stays within the SeaState wave grid throughout the simulation.

@RBergua
Copy link
Contributor

RBergua commented Jan 18, 2024

It looks good to me @andrew-platt. Thanks for the effort!

@andrew-platt andrew-platt merged commit 2d19d1c into OpenFAST:dev-unstable-pointers Jan 18, 2024
21 checks passed
@andrew-platt andrew-platt deleted the b/SeaStat_Vis branch January 19, 2024 21:59

if (allocated(Init%OutData_SeaSt%WaveElevVisGrid)) then
p_FAST%VTK_surface%NWaveElevPts(1) = size(Init%OutData_SeaSt%WaveElevVisX)
p_FAST%VTK_surface%NWaveElevPts(2) = size(Init%OutData_SeaSt%WaveElevVisX)
Copy link
Contributor

@bjonkman bjonkman Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrew-platt : Should line 821 use Init%OutData_SeaSt%WaveElevVisY instead of WaveElevVisX? Or are they the same size?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are right. They aren't necessarily the same size.

@@ -89,8 +91,11 @@ typedef ^ InitOutputType CHARACTER(ChanLen) Wri
typedef ^ ^ CHARACTER(ChanLen) WriteOutputUnt {:} - - "The is the list of all HD-related output channel unit strings (includes all sub-module channels)" -
typedef ^ ^ ProgDesc Ver - - - "Version of SeaState"
typedef ^ ^ LOGICAL InvalidWithSSExctn - - - "Whether SeaState configuration is invalid with HydroDyn's state-space excitation (ExctnMod=2)" (-)
typedef ^ ^ SiKi WaveElevSeries {:}{:} - - "Wave elevation time-series at each of the points given by WaveElevXY. First dimension is the timestep. Second dimension is XY point number corresponding to second dimension of WaveElevXY." (m)
typedef ^ ^ SiKi WaveElevVisX {:} - - "X locations of grid output" "m,-"
typedef ^ ^ SiKi WaveElevVisY {:} - - "X locations of grid output" "m,-"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WaveElevVisY should say Y locations of grid output, not X (was done correctly in FAST_Registry.txt).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

call move_alloc( InitInData_SeaSt%WaveElevXY, p_FAST%VTK_Surface%WaveElevXY )
call move_alloc( InitOutData_SeaSt%WaveElevSeries, p_FAST%VTK_Surface%WaveElev )
if ( allocated(InitOutData_SeaSt%WaveElevVisGrid) ) then
print*,'Storing Wave surface visualization'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a leftover debugging statement?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how that got left in there.

I'll make a PR to fix the issues you pointed out. Thanks @bjonkman!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in PR #2071

andrew-platt added a commit to andrew-platt/openfast that referenced this pull request Mar 5, 2024
A few minor issues were noted with PR OpenFAST#1992 after it was merged.

Co-authored-by: bjonkman <[email protected]>
andrew-platt added a commit that referenced this pull request Mar 5, 2024
@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: SeaState SeaState module for wave data generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants