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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
f80d45c
nwtc-library: adding FlowField module
deslaughter Dec 22, 2022
64509d8
inflowwind: adding IfW_FlowField module
deslaughter Dec 22, 2022
67d83e9
inflowwind: add FlowField init to InflowWind_Init
deslaughter Dec 22, 2022
8d3bf70
nwtc-library: add acceleration calc for FlowField
deslaughter Dec 28, 2022
d58ffc3
inflowwind: add acceleration calc to IfW_FlowField
deslaughter Dec 28, 2022
fee05ac
nwtc-library: FlowField smooth Grid and ExtGrid
deslaughter Dec 28, 2022
385dd41
inflowwind: added ExtGrid & ExtPoint to FlowField
deslaughter Dec 28, 2022
ed24fc1
flowfield: set end derivatives of cubic spline = 0
deslaughter Jan 25, 2023
3519095
Moved FlowField module to InflowWind
deslaughter Feb 17, 2023
e0e5926
Added VelInterpOrder to IfW input file
deslaughter Feb 17, 2023
26e690c
Reorg FlowField module, finish VelInterpCubic flag
deslaughter Feb 20, 2023
1baa7f5
Updating to ifw-mod branch of r-test
deslaughter Feb 20, 2023
af3fcb2
FlowField integration and testing with driver
deslaughter Feb 21, 2023
75583f1
Flow field supports Bladed wind files
deslaughter Feb 22, 2023
b370ab7
IfW: add flags for handling wind grid exceedence points (only for OLAF)
andrew-platt Aug 25, 2021
23f8a1c
IfW: rearrange FFWind_Interp routine
andrew-platt Sep 2, 2021
d4de507
IfW: logic for extrapolation of points outside grid
andrew-platt Sep 29, 2021
3a63e7c
IfW grid exceed: algorithm for extrapolating from tower below grid
andrew-platt Oct 1, 2021
1698843
IfW grid exceed: add some rudimentary documentation
andrew-platt Oct 4, 2021
7f7596d
IfW grid exceed: fix logic error for points outside box
andrew-platt Oct 5, 2021
37cef06
IfW grid exceed: add rough test case placeholder
andrew-platt Oct 5, 2021
6966ab9
IfW grid exceed: add warning on first occurance
andrew-platt Oct 5, 2021
17530fd
Ifw grid exceed: fix logic error at grid boundary
andrew-platt Oct 11, 2021
5f7e540
docs: mispell on figure option `width`
andrew-platt Mar 20, 2023
e3df8c0
Changed InflowWind to use new FlowField type
deslaughter Mar 27, 2023
1642941
Merge remote-tracking branch 'upstream/dev' into ifw-mod
deslaughter Mar 27, 2023
97bf508
Fixed code to writes files from inflowwind_driver
deslaughter Mar 28, 2023
4240273
Fixed bug Grid3DField_GetBoundsT for periodic wind
deslaughter Mar 28, 2023
cb31cde
Updated FASTWrapper for FlowField structure
deslaughter Mar 28, 2023
2621d31
Check IfW acceleration data in test
deslaughter Mar 28, 2023
cf5c406
Update regression test pointer
deslaughter Mar 28, 2023
0b7f41e
Merge remote-tracking branch 'andy/f/IfW_BoxExceed' into ifw-mod
deslaughter Mar 28, 2023
ce12a86
Integrated IfW BoxExceed
deslaughter Apr 5, 2023
db5ae99
Merge remote-tracking branch 'upstream/dev' into ifw-mod
deslaughter Apr 5, 2023
c82222d
Regenerated IfW types and updated r-test
deslaughter Apr 5, 2023
5075f9a
Removed new InflowwindRegressionCase.py code
deslaughter Apr 5, 2023
7ac862b
Moved IfW_FlowField into MiscVars
deslaughter Apr 5, 2023
d48ce42
Removed inflowwind_driver change
deslaughter Apr 5, 2023
10b5f51
Added InflowWind acceleration outputs
deslaughter Apr 5, 2023
aca292e
Missing check for OutputAccel in IfW
deslaughter Apr 5, 2023
fbf4487
InflowWind: minor cleanup
deslaughter Apr 6, 2023
bdf7f18
InflowWind cleanup and better tower grid interp
deslaughter Apr 6, 2023
a8a4de6
Updated api_change.rst for InflowWind changes
deslaughter Apr 6, 2023
465d5a9
IfW: fix comment on Point_WindNumber
deslaughter Apr 7, 2023
3059a24
Fix Grid3DField_GetCell returning NaN when Y=0
deslaughter Apr 7, 2023
e323e90
Merge remote-tracking branch 'refs/remotes/origin/ifw-mod' into ifw-mod
deslaughter Apr 7, 2023
05e999e
IfW: Moved Y bounds checking to reduce calls
deslaughter Apr 7, 2023
c0fd518
Updated InflowWind docs for acceleration
deslaughter Apr 7, 2023
d3dfeee
IfW: final iteration of tower interpolation
deslaughter Apr 7, 2023
4860bc4
IfW put FlowField back in ParameterType, cleanup
deslaughter Apr 7, 2023
9531399
IfW: added BoxExceed to driver input, moved accel
deslaughter Apr 7, 2023
4421449
Updated Visual Studio Files
deslaughter Apr 7, 2023
4725546
Fix Visual Studio project files
deslaughter Apr 7, 2023
9313055
IfW: initialized ErrStat/ErrMsg in IfW_Points_Init
deslaughter Apr 7, 2023
179dea0
Merge remote-tracking branch 'upstream/dev' into ifw-mod
deslaughter Apr 17, 2023
168e294
Resolved inflowwind/CMakeLists.txt issue
deslaughter Apr 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cmake/OpenfastCmakeUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@
function(generate_f90_types regfile outfile)
get_filename_component(input ${regfile} ABSOLUTE)
get_filename_component(outdir ${outfile} DIRECTORY)

add_custom_command(
OUTPUT ${outfile}
DEPENDS openfast_registry ${input}
COMMAND ${CMAKE_BINARY_DIR}/modules/openfast-registry/openfast_registry ${input} "-O" "${outdir}" ${OPENFAST_REGISTRY_INCLUDES} ${ARGN}
COMMAND ${CMAKE_BINARY_DIR}/modules/openfast-registry/openfast_registry ${input} "-O" ${outdir} ${OPENFAST_REGISTRY_INCLUDES} ${ARGN}
)
set_source_files_properties(${output} PROPERTIES GENERATED TRUE)
endfunction(generate_f90_types)

#
Expand Down
Binary file modified docs/OtherSupporting/OutListParameters.xlsx
Binary file not shown.
29 changes: 15 additions & 14 deletions docs/source/user/api_change.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,25 @@ Modified in OpenFAST `dev`
Module Line Flag Name Example Value
============================================= ==== ==================== ========================================================================================================================================================================================================
ServoDyn-StructCtrl 6 StC_DOF_MODE 2 StC_DOF_MODE - DOF mode (switch) {0: No StC or TLCD DOF; 1: StC_X_DOF, StC_Y_DOF, and/or StC_Z_DOF (three independent StC DOFs); 2: StC_XY_DOF (Omni-Directional StC); 3: TLCD; 4: Prescribed force/moment time series; 5: Force determined by external DLL}
InflowWind 50 ================== LIDAR Parameters ===========================================================================
InflowWind 51 SensorType 0 SensorType - Switch for lidar configuration (0 = None, 1 = Single Point Beam(s), 2 = Continuous, 3 = Pulsed)
InflowWind 52 NumPulseGate 0 NumPulseGate - Number of lidar measurement gates (used when SensorType = 3)
InflowWind 53 PulseSpacing 30 PulseSpacing - Distance between range gates (m) (used when SensorType = 3)
InflowWind 54 NumBeam 0 NumBeam - Number of lidar measurement beams (0-5)(used when SensorType = 1)
InflowWind 55 FocalDistanceX -200 FocalDistanceX - Focal distance co-ordinates of the lidar beam in the x direction (relative to hub height) (only first coordinate used for SensorType 2 and 3) (m)
InflowWind 56 FocalDistanceY 0 FocalDistanceY - Focal distance co-ordinates of the lidar beam in the y direction (relative to hub height) (only first coordinate used for SensorType 2 and 3) (m)
InflowWind 57 FocalDistanceZ 0 FocalDistanceZ - Focal distance co-ordinates of the lidar beam in the z direction (relative to hub height) (only first coordinate used for SensorType 2 and 3) (m)
InflowWind 58 RotorApexOffsetPos 0.0 0.0 0.0 RotorApexOffsetPos - Offset of the lidar from hub height (m)
InflowWind 59 URefLid 17 URefLid - Reference average wind speed for the lidar[m/s]
InflowWind 50 MeasurementInterval 0.25 MeasurementInterval - Time between each measurement [s]
InflowWind 61 LidRadialVel False LidRadialVel - TRUE => return radial component, FALSE => return 'x' direction estimate
InflowWind 62 ConsiderHubMotion 1 ConsiderHubMotion - Flag whether to consider the hub motion's impact on Lidar measurements
InflowWind 8 VelInterpCubic true VelInterpCubic - Use cubic interpolation for velocity in time (false=linear, true=cubic) [Used with WindType=2,3,4,5,7]
InflowWind 51 ================== LIDAR Parameters ===========================================================================
InflowWind 52 SensorType 0 SensorType - Switch for lidar configuration (0 = None, 1 = Single Point Beam(s), 2 = Continuous, 3 = Pulsed)
InflowWind 53 NumPulseGate 0 NumPulseGate - Number of lidar measurement gates (used when SensorType = 3)
InflowWind 54 PulseSpacing 30 PulseSpacing - Distance between range gates (m) (used when SensorType = 3)
InflowWind 55 NumBeam 0 NumBeam - Number of lidar measurement beams (0-5)(used when SensorType = 1)
InflowWind 56 FocalDistanceX -200 FocalDistanceX - Focal distance co-ordinates of the lidar beam in the x direction (relative to hub height) (only first coordinate used for SensorType 2 and 3) (m)
InflowWind 57 FocalDistanceY 0 FocalDistanceY - Focal distance co-ordinates of the lidar beam in the y direction (relative to hub height) (only first coordinate used for SensorType 2 and 3) (m)
InflowWind 58 FocalDistanceZ 0 FocalDistanceZ - Focal distance co-ordinates of the lidar beam in the z direction (relative to hub height) (only first coordinate used for SensorType 2 and 3) (m)
InflowWind 59 RotorApexOffsetPos 0.0 0.0 0.0 RotorApexOffsetPos - Offset of the lidar from hub height (m)
InflowWind 60 URefLid 17 URefLid - Reference average wind speed for the lidar[m/s]
InflowWind 61 MeasurementInterval 0.25 MeasurementInterval - Time between each measurement [s]
InflowWind 62 LidRadialVel False LidRadialVel - TRUE => return radial component, FALSE => return 'x' direction estimate
InflowWind 63 ConsiderHubMotion 1 ConsiderHubMotion - Flag whether to consider the hub motion's impact on Lidar measurements
============================================= ==== ==================== ========================================================================================================================================================================================================



OpenFAST v3.4.1 to OpenFAST v3.4.1
OpenFAST v3.4.0 to OpenFAST v3.4.1
----------------------------------

Restored the AeroDyn channel names with `Aero` in the name. These had be
Expand Down
133 changes: 115 additions & 18 deletions docs/source/user/inflowwind/driver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@ Command-line syntax for InflowWind driver:
options: /ifw -- treat <filename> as name of InflowWind input file (no driver input file)

The following options will override values in the driver input file:
/DT[#] -- timestep
/TStart[#] -- start time
/TSteps[#] -- number of timesteps
/xrange[#:#] -- range of x (#'s are reals)
/yrange[#:#] -- range of y
/zrange[#:#] -- range in z (ground = 0.0)
/Dx[#] -- spacing in x
/Dy[#] -- spacing in y
/Dz[#] -- spacing in z
/points[FILE] -- calculates at x,y,z coordinates specified in a white space delimited FILE
/v -- verbose output
/vv -- very verbose output
/hawc -- convert wind file specified in InflowWind to HAWC format
/bladed -- convert wind file specified in InflowWind to Bladed format
/uniform -- convert wind file specified in InflowWind to Uniform-wind format
/vtk -- convert wind file specified in InflowWind to VTK format
/help -- print this help menu and exit
/DT[#] -- timestep
/TStart[#] -- start time
/TSteps[#] -- number of timesteps
/xrange[#:#] -- range of x (#'s are reals)
/yrange[#:#] -- range of y
/zrange[#:#] -- range in z (ground = 0.0)
/Dx[#] -- spacing in x
/Dy[#] -- spacing in y
/Dz[#] -- spacing in z
/points[FILE] -- calculates at x,y,z coordinates specified in a white space delimited FILE
/v -- verbose output
/vv -- very verbose output
/hawc -- convert wind file specified in InflowWind to HAWC format
/bladed -- convert wind file specified in InflowWind to Bladed format
/vtk -- convert wind file specified in InflowWind to VTK format
/accel -- output acceleration when processing a points file
/BoxExceedAllow -- set flag to extrapolate values of points outside FF wind box
/help -- print this help menu and exit

::

Expand Down Expand Up @@ -137,4 +138,100 @@ When converting from a full-field wind format to a uniform wind file, the follow
- The power law exponent is either

1. The power-law exponent specified in InflowWind (if a power law wind profile is used to add to the turbulence with native-Bladed or HAWC2 files), or
2. Calculated by using the mean wind speeds at two points: the reference (hub) height and the uppermost height on the grid.
2. Calculated by using the mean wind speeds at two points: the reference (hub) height and the uppermost height on the grid.

accel flag
-------------------

The ability to calculate the acceleration of the flow field was added to InflowWind
to support the analysis of MHK, underwater, turbines. The acceleration is needed
to calculate the mass effects of the fluid interacting with the rotor. Calculation of the
acceleration is supported for Uniform/Steady Wind and grid based wind profiles (Turbsim,
HAWC, and Bladed files). Enabling this flag causes the driver to output the flow field
acceleration for points defined in the Points file in addition to the velocities at those
same points.


BoxExceedAllow flag
-------------------

A feature was added to InflowWind to all for some requested points to lie
outside the full field wind grid. This allows for a continuous exptrapolation of
values beyond the grid that approaches an average level.

Purpose
~~~~~~~

When InflowWind is coupled to OpenFAST, wind points corresponding to the free
vortex wake module (OLAF) in AeroDyn 15 and LidarSim module may be outside the
full-field wind data. No other wind data points may be outside the grid
(AeroDyn15 blades must be within the wind box). The wake from OLAF may over
time stray outside the full-field wind box, in which case it should be
sufficiently far from the turbine that any inacuracies in the reported wind
value should have little to no effect on the turbine. The method employed here
should allow the wake to continue evolving without flow reversals or other
oddities due to a discontinuity at the wind grid boundary. However, to limit
the impact of the approximation used, the wake should not be allowed to exit the
box until far from the turbine.

The other use case is when the LidarSim requests data far from the turbine that
may lie outside the wind box, such as a yawed, or floating turbine where the
sensing beam periodically exits the wind box.

Method
~~~~~~

During initialization, a flag and corresponding index are passed to tell IfW to
allow points in the requested position array to lie outside the full-field wind
and tower grids starting at this index. The values for these points are then
extrapolated using the data from the full-field wind as follows:

1. The average wind value at each Z height at each timestep is calculated and
stored during initialization (averaged across the Y dimension).
2. Wind above the full field wind grid is linearly interpolated between the
value at the top of the grid the average of the top of the grid. This
linear interpolation zone extends from the top of grid to the top of the
grid + one half grid height (``FFZHWid``). Values beyond that are held
constant.
3. Values beyond the +/-Y grid edges are linearly interpolated between the
value at the edge of the grid and the average for that Z elevation in the
grid. The interpolation zone is between the edge of the grid and one half
grid width further along Y at ``+/-2*FFYHWid``.
4. When no tower data is present, the values below the grid are linearly
interpolated between the bottom of the grid and 0 at the ground.
5. When tower data is present, points below the grid are interpolated between
the tower and grid and the ground (0 value at ``+/-2*FFYHWid``). Linear
interpolation is then used beyond the edge of the grid.


Testing with driver
~~~~~~~~~~~~~~~~~~~

To test this feature, the driver accepts the flag ``BoxExceedAllow`` and will
signal to InflowWind that all windgrid points may be beyond the edge of the
grid. To use this, setup a driver input file with an output wind grid that is
larger than the full-field grid from the wind file referenced in the
corresponding InflowWind input file. Then the following command can be used
(Linux syntax, Windows is slightly different):

.. code-block:: bash

> inflowwind_driver -BoxExceedAllow MyDriverFile.inp

For a single YZ plane from the resulting wind grid output file at time T, the
results for extrapolated data points can be plotted and should show
characteristics similar to the following plots.


.. figure:: figs/FFWindExtrap--NoTower.png
:width: 90%

Extrapolation of wind values beyond the full field wind grid when no tower data is present. The semi-transparent red planes indicate the edges of the full-field wind grid, and the red points are the locations of wind grid data in this example case. All other points shown on the surface are interpolated/extrapolated.


.. figure:: figs/FFWindExtrap--Tower.png
:width: 90%

Extrapolation of wind values beyond the full field wind grid when tower data is present. The semi-transparent red planes indicate the edges of th e full-field wind grid, blue semi-transparent plane indicates the tower grid, and the red points indcate the data points from the wind grid and tower. All other points shown on the surface are interpolated/extrapolated.


Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ InflowWind driver input file.
DEFAULT DT -- timestep size for driver to take (s, or DEFAULT for what the file contains)
t Summary -- Summarize the data extents in the windfile (flag)
t SummaryFile -- Write summary to file (.dvr.sum) (flag)
f BoxExceedAllow -- Allow point sampling outside grid
---- Points file input (output given as POINTSFILENAME.Velocity.dat) --------
f PointsFile -- read in a list of output points from a file (flag)
"Test005.txt" PointsFileName -- name of points file (-) (comma separated x,y,z coordinates, # symbol for comments)
f CalcAccel -- calculate and output acceleration at points in addition to velocity
---- Output grid (Points below ground will simply be ignored) ---------------
t WindGrid -- report wind data at set of X,Y,Z coordinat (flag)
6,0,15 GridCtrCoord -- coordinate of center of grid (m)
Expand Down
16 changes: 15 additions & 1 deletion docs/source/user/inflowwind/examples/inflowwind_example.dat
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ False Echo - Echo input data to <RootName>.ech (flag)
0 PropagationDir - Direction of wind propagation (meteorological rotation from aligned with X (positive rotates towards -Y) -- degrees) (not used for native Bladed format WindType=7)
0 VFlowAng - Upflow angle (degrees) (not used for native Bladed format WindType=7)
1 NWindVel - Number of points to output the wind velocity (0 to 9)
False VelInterpCubic - Use cubic interpolation for velocity in time (false=linear, true=cubic) [Used with WindType=2,3,4,5,7]
0 WindVxiList - List of coordinates in the inertial X direction (m)
0 WindVyiList - List of coordinates in the inertial Y direction (m)
90 WindVziList - List of coordinates in the inertial Z direction (m)
Expand Down Expand Up @@ -46,7 +47,20 @@ False TowerFile - Have tower file (.twr) (flag) ignored when WindTy
2 WindProfile - Wind profile type (0=constant;1=logarithmic,2=power law)
0.2 PLExp_HAWC - Power law exponent (-) (used for PL wind profile type only)
0.03 Z0 - Surface roughness length (m) (used for LG wind profile type only)
0 XOffset - Initial offset in +x direction (shift of wind box)
0 XOffset - Initial offset in +x direction (shift of wind box)
================== LIDAR Parameters ===========================================================================
0 SensorType - Switch for lidar configuration (0 = None, 1 = Single Point Beam(s), 2 = Continuous, 3 = Pulsed)
0 NumPulseGate - Number of lidar measurement gates (used when SensorType = 3)
30 PulseSpacing - Distance between range gates (m) (used when SensorType = 3)
0 NumBeam - Number of lidar measurement beams (0-5)(used when SensorType = 1)
-200 FocalDistanceX - Focal distance co-ordinates of the lidar beam in the x direction (relative to hub height) (only first coordinate used for SensorType 2 and 3) (m)
0 FocalDistanceY - Focal distance co-ordinates of the lidar beam in the y direction (relative to hub height) (only first coordinate used for SensorType 2 and 3) (m)
0 FocalDistanceZ - Focal distance co-ordinates of the lidar beam in the z direction (relative to hub height) (only first coordinate used for SensorType 2 and 3) (m)
0.0 0.0 0.0 RotorApexOffsetPos - Offset of the lidar from hub height (m)
17 URefLid - Reference average wind speed for the lidar[m/s]
0.25 MeasurementInterval - Time between each measurement [s]
False LidRadialVel - TRUE => return radial component, FALSE => return 'x' direction estimate
1 ConsiderHubMotion - Flag whether to consider the hub motion's impact on Lidar measurements
====================== OUTPUT ==================================================
False SumPrint - Print summary data to <RootName>.IfW.sum (flag)
OutList - The next line(s) contains a list of output parameters. See OutListParameters.xlsx for a listing of available output channels, (-)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading