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

IfW: add VTK output of slice in XY to driver #1643

Conversation

andrew-platt
Copy link
Collaborator

@andrew-platt andrew-platt commented Jun 21, 2023

This PR is ready to merge.

Feature or improvement description
This allows visualizing a slice through hub-height (or other height) when comparing with a simulation. The user can specify the height at which to export the slice. At the moment it is a very slow process due to the looping and because it exports over the entire time range (this could be improved later).

Screenshot 2023-06-21 at 2 26 44 PM
This figure shows the XY plane at the hub height for a Mann wind field (HAWC format). The vertical plane is exported from the driver using the WrVTK option. Both are taken at 23.625 seconds.

Related issue, if one exists
none

Impacted areas of the software
InflowWind driver only

Additional supporting information
During testing of the wake added turbulence feature, I ran into issues in verifying that the background turbulence was being added correctly. To check this, I needed some way to visualize the XY plane through the hub from the Mann box turbulence.

Test results, if applicable
No test cases are affected. I did not add a test case for this since it is a very slow code to execute.

This allows visualizing a slice through hub-height (or other height) when compairing with a simulation.
@andrew-platt andrew-platt added this to the v4.0.0 milestone Jun 21, 2023
@andrew-platt andrew-platt self-assigned this Jun 21, 2023
Copy link
Collaborator

@deslaughter deslaughter left a comment

Choose a reason for hiding this comment

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

That's a cool feature. Saw a couple of things that should probably be fixed.

modules/inflowwind/src/InflowWind_IO.f90 Outdated Show resolved Hide resolved
character(*), intent(in) :: FileRootName !< RootName for output files
real(ReKi), intent(in) :: XYslice_height
integer(IntKi), intent(in) :: unit !< Error status of the operation
integer(IntKi), intent(out) :: ErrStat !< Error status of the operation
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are ErrStat and ErrMsg initialized in this function? Maybe I missed it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They aren't explicitly initialized, but get set either by OpenFOutFile or by the check on the slice height. For completeness I can add them.

I also just noticed that there is no upper bounds check on the height, which could lead to an invalid index on iz. I'll fix that also.

@ebranlard
Copy link
Contributor

ebranlard commented Jun 21, 2023

If it's not too much work, maybe XZ and YZ could be added too (like fast farm).

On a side note, plotting slices of TurbSim and Mann boxes can easily be done using the python-toolbox:
https://github.com/OpenFAST/python-toolbox/blob/787092df79a558b849c45aa9c53adfb737beb386/pyFAST/input_output/examples/Example_TurbSimBox.py#L51

@andrew-platt
Copy link
Collaborator Author

Adding the XY and YZ slices should be pretty straightforward. I'll give that a shot. Also, it might make sense to allow exporting multiple slices instead of just one.

For generating InflowWind_Driver_Types.f90
@andrew-platt andrew-platt deleted the branch OpenFAST:dev-unstable-pointers May 10, 2024 15:33
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.

3 participants