OpenFAST
Wind turbine multiphysics simulator
Functions/Subroutines | Variables
ifw_hawcwind Module Reference

This module uses full-field binary wind files to determine the wind inflow. More...

Functions/Subroutines

subroutine, public ifw_hawcwind_init (InitInp, p, MiscVars, Interval, InitOut, ErrStat, ErrMsg)
 This routine is used to initialize the parameters for using HAWC wind format files. More...
 
subroutine validateinput (InitInp, ErrStat, ErrMsg)
 This routine is used to make sure the initInp data is valid. More...
 
subroutine readturbulencedata (p, InitInp, ErrStat, ErrMsg)
 This routine is used read the full-field turbulence data stored in HAWC format. More...
 
subroutine scaleturbulence (p, InitInp, Interval, InitOut, MiscVars, ErrStat, ErrMsg)
 This routine is used read scale the full-field turbulence data stored in HAWC format. More...
 
subroutine addmeanvelocity (p, InitInp, ErrStat, ErrMsg)
 This routine is used to add a mean wind profile to the HAWC format turbulence data. More...
 
subroutine, public ifw_hawcwind_calcoutput (Time, PositionXYZ, p, Velocity, DiskVel, MiscVars, ErrStat, ErrMsg)
 This routine acts as a wrapper for the GetWindSpeed routine. More...
 
real(reki) function, dimension(3) ff_interp (Time, Position, p, MiscVars, ErrStat, ErrMsg)
 This function is used to interpolate into the full-field wind array. More...
 
subroutine, public ifw_hawcwind_end (p, MiscVars, ErrStat, ErrMsg)
 This subroutine cleans up any data that is still allocated. More...
 

Variables

type(progdesc), parameter ifw_hawcwind_ver = ProgDesc( 'IfW_HAWCWind', '', '' )
 
integer(intki), parameter nc = 3
 number of wind components
 
integer(intki), parameter windprofiletype_none = -1
 don't add wind profile; already included in input data
 
integer(intki), parameter windprofiletype_constant = 0
 constant wind
 
integer(intki), parameter windprofiletype_log = 1
 logarithmic
 
integer(intki), parameter windprofiletype_pl = 2
 power law
 
integer(intki), parameter scalemethod_none = 0
 no scaling
 
integer(intki), parameter scalemethod_direct = 1
 direct scaling factors
 
integer(intki), parameter scalemethod_stddev = 2
 requested standard deviation
 

Detailed Description

This module uses full-field binary wind files to determine the wind inflow.

This module assumes that the origin, (0,0,0), is located at the tower centerline at ground level, and that all units are specified in the metric system (using meters and seconds). Data is assumed periodic in the X direction (and thus not shifted like FFWind files are).

Function/Subroutine Documentation

◆ addmeanvelocity()

subroutine ifw_hawcwind::addmeanvelocity ( type(ifw_hawcwind_parametertype), intent(inout)  p,
type(ifw_hawcwind_initinputtype), intent(in)  InitInp,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine is used to add a mean wind profile to the HAWC format turbulence data.

Parameters
[in,out]pParameters
[in]initinpInitialization input data passed to the module
[out]errstatdetermines if an error has been encountered
[out]errmsgMessage about errors

◆ ff_interp()

real(reki) function, dimension(3) ifw_hawcwind::ff_interp ( real(dbki), intent(in)  Time,
real(reki), dimension(3), intent(in)  Position,
type(ifw_hawcwind_parametertype), intent(in)  p,
type(ifw_hawcwind_miscvartype), intent(inout)  MiscVars,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This function is used to interpolate into the full-field wind array.

It receives X, Y, Z and TIME from the calling routine. It then computes a time shift due to a nonzero X based upon the average windspeed. The modified time is used to decide which pair of time slices to interpolate within and between. After finding the two time slices, it decides which four grid points bound the (Y,Z) pair. It does a 3-d linear interpolation. This routine assumes that X is downwind, Y is to the left when looking downwind and Z is up. It also assumes that no extrapolation will be needed.

Parameters
[in]timeTime at which to find wind speed
[in]positiontakes the place of XGrnd, YGrnd, ZGrnd
[in]pParameters
[in,out]miscvarsMisc variables for optimization (not copied in glue code)
Returns
The U, V, W velocities
Parameters
[out]errstaterror status
[out]errmsgerror message

◆ ifw_hawcwind_calcoutput()

subroutine, public ifw_hawcwind::ifw_hawcwind_calcoutput ( real(dbki), intent(in)  Time,
real(reki), dimension(:,:), intent(in)  PositionXYZ,
type(ifw_hawcwind_parametertype), intent(in)  p,
real(reki), dimension(:,:), intent(inout)  Velocity,
real(reki), dimension(3), intent(out)  DiskVel,
type(ifw_hawcwind_miscvartype), intent(inout)  MiscVars,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine acts as a wrapper for the GetWindSpeed routine.

It steps through the array of input positions and calls the GetWindSpeed routine to calculate the velocities at each point.

There are inefficiencies in how this set of routines is coded, but that is a problem for another day. For now, it merely needs to be functional. It can be fixed up and made all pretty later.

16-Apr-2013 - A. Platt, NREL. Converted to modular framework. Modified for NWTC_Library 2.0

Parameters
[in]timetime from the start of the simulation
[in]positionxyzArray of XYZ coordinates, 3xN
[in]pParameters
[in,out]velocityVelocity output at Time (Set to INOUT so that array does not get deallocated)
[out]diskvelHACK for AD14: disk velocity output at Time
[in,out]miscvarsMisc variables for optimization (not copied in glue code)
[out]errstaterror status
[out]errmsgThe error message

◆ ifw_hawcwind_end()

subroutine, public ifw_hawcwind::ifw_hawcwind_end ( type(ifw_hawcwind_parametertype), intent(inout)  p,
type(ifw_hawcwind_miscvartype), intent(out)  MiscVars,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This subroutine cleans up any data that is still allocated.

The (possibly) open files are closed in InflowWindMod.

Parameters
[in,out]pParameters
[out]miscvarsMisc variables for optimization (not copied in glue code)
[out]errstatdetermines if an error has been encountered
[out]errmsgMessage about errors

◆ ifw_hawcwind_init()

subroutine, public ifw_hawcwind::ifw_hawcwind_init ( type(ifw_hawcwind_initinputtype), intent(in)  InitInp,
type(ifw_hawcwind_parametertype), intent(out)  p,
type(ifw_hawcwind_miscvartype), intent(out)  MiscVars,
real(dbki), intent(in)  Interval,
type(ifw_hawcwind_initoutputtype), intent(out)  InitOut,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine is used to initialize the parameters for using HAWC wind format files.

Parameters
[in]initinpInitialization data passed to the module
[out]pParameters
[out]miscvarsMisc variables for optimization (not copied in glue code)
[out]initoutInitialization output
[in]intervalTime Interval to use (passed through here)
[out]errstatdetermines if an error has been encountered
[out]errmsgMessage about errors

◆ readturbulencedata()

subroutine ifw_hawcwind::readturbulencedata ( type(ifw_hawcwind_parametertype), intent(inout)  p,
type(ifw_hawcwind_initinputtype), intent(in)  InitInp,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine is used read the full-field turbulence data stored in HAWC format.

Parameters
[in,out]pParameters
[in]initinpInitialization input data passed to the module
[out]errstatdetermines if an error has been encountered
[out]errmsgMessage about errors

◆ scaleturbulence()

subroutine ifw_hawcwind::scaleturbulence ( type(ifw_hawcwind_parametertype), intent(inout)  p,
type(ifw_hawcwind_initinputtype), intent(in)  InitInp,
real(dbki), intent(in)  Interval,
type(ifw_hawcwind_initoutputtype), intent(inout)  InitOut,
type(ifw_hawcwind_miscvartype), intent(inout)  MiscVars,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine is used read scale the full-field turbulence data stored in HAWC format.

Parameters
[in,out]pParameters
[in]initinpInitialization input data passed to the module
[in,out]initoutInitialization output data passed from the module
[in]intervalTime Interval to use (passed through here)
[in,out]miscvarsMisc variables for optimization (not copied in glue code)
[out]errstatdetermines if an error has been encountered
[out]errmsgMessage about errors

◆ validateinput()

subroutine ifw_hawcwind::validateinput ( type(ifw_hawcwind_initinputtype), intent(in)  InitInp,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine is used to make sure the initInp data is valid.

Parameters
[in]initinpInitialization input data passed to the module
[out]errstatdetermines if an error has been encountered
[out]errmsgMessage about errors