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

InflowWind Update / restructure #1516

Merged
merged 56 commits into from
Apr 18, 2023
Merged

Conversation

deslaughter
Copy link
Contributor

@deslaughter deslaughter commented Apr 6, 2023

This pull request is ready to be merged.

Feature or improvement description

This pull request contains the following changes to InflowWind:

  • Create FlowFieldType which contains and represents all wind types.
  • Create FlowFieldType supporting functions to:
    • Initialize the structure
    • Read wind files
    • Convert between Grid3D and Uniform flow fields
    • Write converted flow field types
  • Add ability to calculate flow field acceleration for Uniform and Grid3D flow fields (needed for MHK)
  • Create a subroutine to calculate flow field velocities and accelerations only using the FlowFieldType
  • Reworked Grid3D data layout and interpolation routines to improve locality and performance
  • Add flag in the InflowWind input file (VelCubicInterp) to optionally calculate accelerations and use cubic spline interpolation for velocities.
  • Add new OutList variables for acceleration components and magnitudes (e.g. Wind#AccX),. These values will be zero if accelerations are not requested and the unit field will be set to INVALID.
  • Updated InflowWind_CalcOutput to use new methods and structures
  • Updated FAST.Farm to use FlowFieldType
  • Added ability for OLAF and LidarSim to exceed the wind box with out crashing by adding extrapolation to an average flow velocity/acceleration
  • Add functionality to InflowWind_Driver to output accelerations and exceed the wind box

Related issue, if one exists

Impacted areas of the software

  • InflowWind
  • FAST.Farm (renamed a variable)

Additional supporting information

Test results, if applicable

All unit and regression tests are currently passing. This pull request adds three new regression tests for InflowWind:

  • Calculation of flow field accelerations (added to ifw_turbsimff in the Points.Velocity.dat file)
  • Exceeding the wind box without tower grids (ifw_BoxExceed test)
  • Exceeding the wind box with tower grids (ifw_BoxExceedTwr test)

deslaughter and others added 30 commits February 17, 2023 22:44
The FlowField module provides a generic way to represent
Uniform, Full-Field, User, and External wind data. This module
is part of the effort to provide Inflow data to AeroDyn and HydroDyn
via pointers instead of calling InflowWind.
This module allows InflowWind to read wind data files into the new
FlowField module data structure in NWTC_Library. In the future, the
routines within this module will replace the other InflowWind modules.
Minimal code changes to InflowWind_Init so it can initialize the
FlowField data structure in parallel its normal init. This supports
comparing output using the driver.
This commit adds routines to calculate flow field derivatives for
UniformField and GridField. It also adds a method to calculate
smooth velocity and acceleration (in time) for the UniformField.
This is a significant improvement over the constant acceleration
previously implemented.
This commit adds a flow field type specific initialization section.
Currently only used for calculating acceleration when requested.
This commit adds a smooth interpolation function for the
FlowField GridField type which gives velocity and acceleration
based on cubic hermite spline interpolation. An external grid
field type was added to satisfy the 4Dext type from InflowWind.
Changes to InflowWind to support addition of FlowField types
Needed to simplify the routine a bit for adding the GridExceedence options
Only applies to OLAF free wake points.
This gives a reasonably continuous function (not smooth) from the tower out beyond the +/-Y edge of the grid.  There is some physics that we can't account for simply because the information doesn't exist, but this should at least allow wake evolution.  If weirdness occurs, extend grid to ground.

One missing piece at the moment is the summation of NGe should be ==1 for the region between 2*FFYHWid < abs(y) < FFYHWid, but it is not.  Since the plots show continuity in value (not in derivatives), it is assumed there is some book-keeping incorrect with the NGe(5) and NGe(10) terms which get multiplied by zero.  So something isn't exactly right in the derivation, but the result is still reasonable (though potentially incorrect).
The tolerance check for the bottom edge of the grid should be scaled to match the other tolerance specs
Also removed all redundant modules.
- lines swapped in Uniform_to_Grid3D
- array dims swapped in Uniform_to_Grid3D
- check for Z==0 in Uniform_to_Grid3D
- array dims swapped in Grid3D_to_Uniform
- fix real types in Grid3D_WriteBladed
- fix swapped lines in Grid3D_WriteVTK which caused a nested directory
  to be created for each file (bug in existing code)
@andrew-platt andrew-platt modified the milestones: v4.0.0, v3.5.0 Apr 10, 2023
@andrew-platt andrew-platt changed the title InflowWind Update InflowWind Update / restructure Apr 10, 2023
@andrew-platt andrew-platt merged commit 84158f3 into OpenFAST:dev Apr 18, 2023
andrew-platt added a commit that referenced this pull request Apr 18, 2023
@andrew-platt
Copy link
Collaborator

WindBox_extrap
Extrapolation of wind beyond the boundaries of the wind box. See https://openfast.readthedocs.io/en/dev/source/user/inflowwind/driver.html#boxexceedallow-flag for details on the implementation.

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.

2 participants