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

Fix potential error when requesting wind below the ground (also fix build issue with SD syntax) #1534

Merged
merged 3 commits into from
Apr 18, 2023

Conversation

bjonkman
Copy link
Contributor

Feature or improvement description
This fixes a couple of issues:

  • the SubDyn.f90 code did not build on my Windows Intel 2019 compiler due to the way the string constant was specified on a continuation line.
  • InflowWind could potentially add shear below the ground or return NaN if trying to compute the power law below the ground. This change sets the mean velocity to 0 below ground.

Related issue, if one exists
None reported on OpenFAST code.

Impacted areas of the software
Any place that requests inflow below the ground; likely not a common occurrence.

Also note the question in IfW_FlowField.f90's GetMeanVelocity function: I am not sure why it is not adding the mean horizontal or vertical shear there.

Test results, if applicable
This should not change any existing r-test cases since they likely don't request wind speeds below z=0.

@bjonkman
Copy link
Contributor Author

bjonkman commented Apr 18, 2023

Seems like there is an intermittent failure with the r-tests again; this time with the rtest-interfaces check. I reran the failing case on 7a35023 and it passed the second time (with no code changes)

@deslaughter
Copy link
Collaborator

@bjonkman, thanks for taking a look at this. You're right that GetMeanVelocity isn't doing everything it needs to do. At one point I was pretty sure that VLinShr and HLinShr weren't used by Grid3D as they're set to 0 in all except one place. The Grid3D_AddMeanVelocity subroutine isn't used and should be removed. The GetMeanVelocity function should be removed and replaced with CalculateMeanVelocity.

@bjonkman
Copy link
Contributor Author

@deslaughter, I think the horizontal and vertical shear that are added in those routines is mostly for the native Bladed format 3D grid files; that's something Envision added, but I don't think OpenFAST has any tests for, yet.

@deslaughter
Copy link
Collaborator

@bjonkman, that does explain why it wasn't caught in testing. If you could send a small native Bladed wind file, I'd be happy to add it to the regression tests.

@andrew-platt
Copy link
Collaborator

Will the checks for above ground cause issues with MHK turbines? Or are those currents based on the ground located at the seafloor?

call LegacyWarning('Member table contains 6 columns instead of 7, using default member directional cosines ID (-1) for all members.\
The directional cosines will be computed based on the member nodes for all members.')
call LegacyWarning('Member table contains 6 columns instead of 7, using default member directional cosines ID (-1) for all members. &
&The directional cosines will be computed based on the member nodes for all members.')
Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't know you could continue a string to the next line this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

I learned something new today :)

@andrew-platt andrew-platt merged commit 1d17dcd into OpenFAST:dev Apr 18, 2023
@bjonkman
Copy link
Contributor Author

Will the checks for above ground cause issues with MHK turbines? Or are those currents based on the ground located at the seafloor?

Basically, this just says if we are asking for mean velocities below the ground or MSL, they should return 0. The power law case returns NaN if z is negative and the power-law coefficient is less than 1 (typical use case), so that wouldn't make sense if z < 0. The log profile also doesn't make sense mathematically if Z <=0.

I'm not sure how they've set up modeling for MHK turbines, but I don't think this should hurt.

@andrew-platt
Copy link
Collaborator

Good point. That would result in nonsensical results.

@hkross
Copy link
Contributor

hkross commented Apr 18, 2023

We leave InflowWind alone for MHK and adjust the query points from the glue code before the are passed to InflowWind to put the origin at the seabed (as if it was the ground). So I don't think this will cause an issue.

@bjonkman bjonkman deleted the b/IfW_below_ground branch April 18, 2023 20:11
@andrew-platt andrew-platt mentioned this pull request May 12, 2023
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants