OpenFAST
Wind turbine multiphysics simulator
Functions/Subroutines
aerodyn Module Reference

AeroDyn is a time-domain aerodynamics module for horizontal-axis wind turbines. More...

Functions/Subroutines

subroutine ad_setinitout (p, InputFileData, InitOut, errStat, errMsg)
 This subroutine sets the initialization output data structure, which contains data to be returned to the calling program (e.g., FAST or AeroDyn_Driver)
 
subroutine, public ad_init (InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut, ErrStat, ErrMsg)
 This routine is called at the start of the simulation to perform initialization steps. More...
 
subroutine, public ad_reinit (p, x, xd, z, OtherState, m, Interval, ErrStat, ErrMsg)
 This subroutine reinitializes BEMT and UA, assuming that we will start the simulation over again, with only the inputs being different. More...
 
subroutine init_miscvars (m, p, u, y, errStat, errMsg)
 This routine initializes (allocates) the misc variables for use during the simulation. More...
 
subroutine init_otherstates (m, p, OtherState, errStat, errMsg)
 This routine initializes (allocates) the misc variables for use during the simulation. More...
 
subroutine init_y (y, u, p, errStat, errMsg)
 This routine initializes AeroDyn meshes and output array variables for use during the simulation. More...
 
subroutine init_u (u, p, InputFileData, InitInp, errStat, errMsg)
 This routine initializes AeroDyn meshes and input array variables for use during the simulation. More...
 
subroutine setparameters (InitInp, InputFileData, p, ErrStat, ErrMsg)
 This routine sets AeroDyn parameters for use during the simulation; these variables are not changed after AD_Init. More...
 
subroutine, public ad_end (u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg)
 This routine is called at the end of the simulation. More...
 
subroutine, public ad_updatestates (t, n, u, utimes, p, x, xd, z, OtherState, m, errStat, errMsg)
 Loose coupling routine for solving for constraint states, integrating continuous states, and updating discrete and other states. More...
 
subroutine, public ad_calcoutput (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, NeedWriteOutput)
 Routine for computing outputs, used in both loose and tight coupling. More...
 
subroutine, public ad_calcconstrstateresidual (Time, u, p, x, xd, z, OtherState, m, z_residual, ErrStat, ErrMsg)
 Tight coupling routine for solving for the residual of the constraint state equations. More...
 
subroutine setinputs (p, u, m, indx, errStat, errMsg)
 This subroutine converts the AeroDyn inputs into values that can be used for its submodules. More...
 
subroutine setinputsforbemt (p, u, m, indx, errStat, errMsg)
 This subroutine sets mBEMT_u(indx). More...
 
subroutine diskavgvalues (p, u, m, x_hat_disk, y_hat_disk, z_hat_disk, Azimuth)
 
subroutine geomwithoutsweeppitchtwist (p, u, m, thetaBladeNds, ErrStat, ErrMsg)
 
subroutine setinputsforfvw (p, u, m, errStat, errMsg)
 This subroutine sets mFVW_u(indx). More...
 
subroutine setinputsforaa (p, u, m, errStat, errMsg)
 This subroutine sets mAA_u. More...
 
subroutine setoutputsfrombemt (p, m, y)
 This subroutine converts outputs from BEMT (stored in mBEMT_y) into values on the AeroDyn BladeLoad output mesh. More...
 
subroutine setoutputsfromfvw (u, p, OtherState, xd, m, y, ErrStat, ErrMsg)
 This subroutine converts outputs from FVW (stored in mFVW_y) into values on the AeroDyn BladeLoad output mesh. More...
 
subroutine validateinputdata (InitInp, InputFileData, NumBl, ErrStat, ErrMsg)
 This routine validates the inputs from the AeroDyn input files. More...
 
subroutine init_afiparams (InputFileData, p_AFI, UnEc, NumBl, ErrStat, ErrMsg)
 This subroutine sets up the data structures and initializes AirfoilInfo to get the necessary AFI parameters. More...
 
subroutine init_aamodule (DrvInitInp, AD_InputFileData, u_AD, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg)
 This routine initializes the Airfoil Noise module from within AeroDyn. More...
 
subroutine init_bemtmodule (InputFileData, u_AD, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg)
 This routine initializes the BEMT module from within AeroDyn. More...
 
subroutine init_fvwmodule (InputFileData, u_AD, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg)
 This routine initializes the FVW module from within AeroDyn. More...
 
subroutine adtwr_calcoutput (p, u, m, y, ErrStat, ErrMsg)
 This subroutine calculates the tower loads for the AeroDyn TowerLoad output mesh. More...
 
subroutine checktwrinfl (u, ErrStat, ErrMsg)
 This routine checks for invalid inputs to the tower influence models. More...
 
subroutine twrinfl (p, u, m, ErrStat, ErrMsg)
 This routine calculates mDisturbedInflow, the influence of tower shadow and/or potential flow on the inflow velocities. More...
 
subroutine twrinflarray (p, u, m, Positions, Inflow, ErrStat, ErrMsg)
 Calculate the tower influence on a array of points Positions (3xn) The subroutine has side effecs and modifies the inflow Relies heavily (i.e. More...
 
subroutine getlocaltowerprops (p, u, BladeNodePosition, theta_tower_trans, W_tower, xbar, ybar, zbar, TwrCd, TwrClrnc, ErrStat, ErrMsg)
 This routine returns the tower constants necessary to compute the tower influence. More...
 
subroutine twrinfl_nearestline2element (p, u, BladeNodePosition, r_TowerBlade, theta_tower_trans, W_tower, xbar, ybar, zbar, TwrCd, TwrDiam, found)
 Option 1: Find the nearest-neighbor line2 element of the tower mesh for which the blade line2-element node projects orthogonally onto the tower line2-element domain (following an approach similar to the line2_to_line2 mapping search for motion and scalar quantities). More...
 
subroutine twrinfl_nearestpoint (p, u, BladeNodePosition, r_TowerBlade, theta_tower_trans, W_tower, xbar, ybar, zbar, TwrCd, TwrDiam)
 Option 2: used when the blade node does not orthogonally intersect a tower element. More...
 
subroutine, public ad_jacobianpinput (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdu, dXdu, dXddu, dZdu)
 Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the inputs (u). More...
 
subroutine ad_jacobianpinput_orig (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdu, dXdu, dXddu, dZdu)
 Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the inputs (u). More...
 
subroutine, public ad_jacobianpcontstate (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdx, dXdx, dXddx, dZdx)
 Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the continuous states (x). More...
 
subroutine, public ad_jacobianpdiscstate (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdxd, dXdxd, dXddxd, dZdxd)
 Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the discrete states (xd). More...
 
subroutine, public ad_jacobianpconstrstate (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdz, dXdz, dXddz, dZdz)
 Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the constraint states (z). More...
 
subroutine, public ad_getop (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, u_op, y_op, x_op, dx_op, xd_op, z_op)
 Routine to pack the data structures representing the operating points into arrays for linearization. More...
 
subroutine init_jacobian_y (p, y, InitOut, ErrStat, ErrMsg)
 
subroutine init_jacobian (InputFileData, p, u, y, m, InitOut, ErrStat, ErrMsg)
 This routine initializes the array that maps rows/columns of the Jacobian to specific mesh fields. More...
 
subroutine perturb_u (p, n, perturb_sign, u, du)
 This routine perturbs the nth element of the u array (and mesh/field it corresponds to) Do not change this without making sure subroutine aerodyn::init_jacobian is consistant with this routine! More...
 
subroutine compute_dy (p, y_p, y_m, delta_p, delta_m, dY)
 This routine uses values of two output types to compute an array of differences. More...
 
logical function checkbemtinputperturbations (p, m)
 

Detailed Description

AeroDyn is a time-domain aerodynamics module for horizontal-axis wind turbines.

Function/Subroutine Documentation

◆ ad_calcconstrstateresidual()

subroutine, public aerodyn::ad_calcconstrstateresidual ( real(dbki), intent(in)  Time,
type(ad_inputtype), intent(in)  u,
type(ad_parametertype), intent(in)  p,
type(ad_continuousstatetype), intent(in)  x,
type(ad_discretestatetype), intent(in)  xd,
type(ad_constraintstatetype), intent(in)  z,
type(ad_otherstatetype), intent(in)  OtherState,
type(ad_miscvartype), intent(inout)  m,
type(ad_constraintstatetype), intent(inout)  z_residual,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Tight coupling routine for solving for the residual of the constraint state equations.

Parameters
[in]timeCurrent simulation time in seconds
[in]uInputs at Time
[in]pParameters
[in]xContinuous states at Time
[in]xdDiscrete states at Time
[in]zConstraint states at Time (possibly a guess)
[in]otherstateOther states at Time
[in,out]mMisc/optimization variables
[in,out]z_residualResidual of the constraint state equations using the input values described above
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ ad_calcoutput()

subroutine, public aerodyn::ad_calcoutput ( real(dbki), intent(in)  t,
type(ad_inputtype), intent(in)  u,
type(ad_parametertype), intent(in)  p,
type(ad_continuousstatetype), intent(in)  x,
type(ad_discretestatetype), intent(in)  xd,
type(ad_constraintstatetype), intent(in)  z,
type(ad_otherstatetype), intent(in)  OtherState,
type(ad_outputtype), intent(inout)  y,
type(ad_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
logical, intent(in), optional  NeedWriteOutput 
)

Routine for computing outputs, used in both loose and tight coupling.

This subroutine is used to compute the output channels (motions and loads) and place them in the WriteOutput() array. The descriptions of the output channels are not given here. Please see the included OutListParameters.xlsx sheet for for a complete description of each output parameter.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at Time t
[in]pParameters
[in]xContinuous states at t
[in]xdDiscrete states at t
[in]zConstraint states at t
[in]otherstateOther states at t
[in,out]yOutputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated)
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in]needwriteoutputFlag to determine if WriteOutput values need to be calculated in this call

◆ ad_end()

subroutine, public aerodyn::ad_end ( type(ad_inputtype), intent(inout)  u,
type(ad_parametertype), intent(inout)  p,
type(ad_continuousstatetype), intent(inout)  x,
type(ad_discretestatetype), intent(inout)  xd,
type(ad_constraintstatetype), intent(inout)  z,
type(ad_otherstatetype), intent(inout)  OtherState,
type(ad_outputtype), intent(inout)  y,
type(ad_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine is called at the end of the simulation.

Parameters
[in,out]uSystem inputs
[in,out]pParameters
[in,out]xContinuous states
[in,out]xdDiscrete states
[in,out]zConstraint states
[in,out]otherstateOther states
[in,out]ySystem outputs
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ ad_getop()

subroutine, public aerodyn::ad_getop ( real(dbki), intent(in)  t,
type(ad_inputtype), intent(in)  u,
type(ad_parametertype), intent(in)  p,
type(ad_continuousstatetype), intent(in)  x,
type(ad_discretestatetype), intent(in)  xd,
type(ad_constraintstatetype), intent(in)  z,
type(ad_otherstatetype), intent(in)  OtherState,
type(ad_outputtype), intent(in)  y,
type(ad_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
real(reki), dimension(:), intent(inout), optional, allocatable  u_op,
real(reki), dimension(:), intent(inout), optional, allocatable  y_op,
real(reki), dimension(:), intent(inout), optional, allocatable  x_op,
real(reki), dimension(:), intent(inout), optional, allocatable  dx_op,
real(reki), dimension(:), intent(inout), optional, allocatable  xd_op,
real(reki), dimension(:), intent(inout), optional, allocatable  z_op 
)

Routine to pack the data structures representing the operating points into arrays for linearization.

Parameters
[in]tTime in seconds at operating point
[in]uInputs at operating point (may change to inout if a mesh copy is required)
[in]pParameters
[in]xContinuous states at operating point
[in]xdDiscrete states at operating point
[in]zConstraint states at operating point
[in]otherstateOther states at operating point
[in]yOutput at operating point
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in,out]u_opvalues of linearized inputs
[in,out]y_opvalues of linearized outputs
[in,out]x_opvalues of linearized continuous states
[in,out]dx_opvalues of first time derivatives of linearized continuous states
[in,out]xd_opvalues of linearized discrete states
[in,out]z_opvalues of linearized constraint states

◆ ad_init()

subroutine, public aerodyn::ad_init ( type(ad_initinputtype), intent(in)  InitInp,
type(ad_inputtype), intent(out)  u,
type(ad_parametertype), intent(out)  p,
type(ad_continuousstatetype), intent(out)  x,
type(ad_discretestatetype), intent(out)  xd,
type(ad_constraintstatetype), intent(out)  z,
type(ad_otherstatetype), intent(out)  OtherState,
type(ad_outputtype), intent(out)  y,
type(ad_miscvartype), intent(out)  m,
real(dbki), intent(inout)  Interval,
type(ad_initoutputtype), intent(out)  InitOut,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine is called at the start of the simulation to perform initialization steps.

The parameters are set here and not changed during the simulation. The initial states and initial guess for the input are defined.

Parameters
[in]initinpInput data for initialization routine
[out]uAn initial guess for the input; input mesh must be defined
[out]pParameters
[out]xInitial continuous states
[out]xdInitial discrete states
[out]zInitial guess of the constraint states
[out]otherstateInitial other states
[out]yInitial system outputs (outputs are not calculated; only the output mesh is initialized)
[out]mInitial misc/optimization variables
[in,out]intervalCoupling interval in seconds: the rate that (1) AD_UpdateStates() is called in loose coupling & (2) AD_UpdateDiscState() is called in tight coupling. Input is the suggested time from the glue code; Output is the actual coupling interval that will be used by the glue code.
[out]initoutOutput for initialization routine
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ ad_jacobianpconstrstate()

subroutine, public aerodyn::ad_jacobianpconstrstate ( real(dbki), intent(in)  t,
type(ad_inputtype), intent(in)  u,
type(ad_parametertype), intent(in)  p,
type(ad_continuousstatetype), intent(in)  x,
type(ad_discretestatetype), intent(in)  xd,
type(ad_constraintstatetype), intent(in)  z,
type(ad_otherstatetype), intent(in)  OtherState,
type(ad_outputtype), intent(inout)  y,
type(ad_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dYdz,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXdz,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXddz,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dZdz 
)

Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the constraint states (z).

The partial derivatives dY/dz, dX/dz, dXd/dz, and dZ/dz are returned.

Parameters
[in]tTime in seconds at operating point
[in]uInputs at operating point (may change to inout if a mesh copy is required)
[in]pParameters
[in]xContinuous states at operating point
[in]xdDiscrete states at operating point
[in]zConstraint states at operating point
[in]otherstateOther states at operating point
[in,out]yOutput (change to inout if a mesh copy is required); Output fields are not used by this routine, but type is available here so that mesh parameter information (i.e., connectivity) does not have to be recalculated for dYdz.
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in,out]dydzPartial derivatives of output functions (Y) with respect to the constraint states (z) [intent in to avoid deallocation]
[in,out]dxdzPartial derivatives of continuous state functions (X) with respect to the constraint states (z) [intent in to avoid deallocation]
[in,out]dxddzPartial derivatives of discrete state functions (Xd) with respect to the constraint states (z) [intent in to avoid deallocation]
[in,out]dzdzPartial derivatives of constraint state functions (Z) with respect to the constraint states (z) [intent in to avoid deallocation]

◆ ad_jacobianpcontstate()

subroutine, public aerodyn::ad_jacobianpcontstate ( real(dbki), intent(in)  t,
type(ad_inputtype), intent(in)  u,
type(ad_parametertype), intent(in)  p,
type(ad_continuousstatetype), intent(in)  x,
type(ad_discretestatetype), intent(in)  xd,
type(ad_constraintstatetype), intent(in)  z,
type(ad_otherstatetype), intent(in)  OtherState,
type(ad_outputtype), intent(in)  y,
type(ad_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dYdx,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXdx,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXddx,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dZdx 
)

Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the continuous states (x).

The partial derivatives dY/dx, dX/dx, dXd/dx, and dZ/dx are returned.

Parameters
[in]tTime in seconds at operating point
[in]uInputs at operating point (may change to inout if a mesh copy is required)
[in]pParameters
[in]xContinuous states at operating point
[in]xdDiscrete states at operating point
[in]zConstraint states at operating point
[in]otherstateOther states at operating point
[in]yOutput (change to inout if a mesh copy is required); Output fields are not used by this routine, but type is available here so that mesh parameter information (i.e., connectivity) does not have to be recalculated for dYdx.
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in,out]dydxPartial derivatives of output functions (Y) with respect to the continuous states (x) [intent in to avoid deallocation]
[in,out]dxdxPartial derivatives of continuous state functions (X) with respect to the continuous states (x) [intent in to avoid deallocation]
[in,out]dxddxPartial derivatives of discrete state functions (Xd) with respect to the continuous states (x) [intent in to avoid deallocation]
[in,out]dzdxPartial derivatives of constraint state functions (Z) with respect to the continuous states (x) [intent in to avoid deallocation]

◆ ad_jacobianpdiscstate()

subroutine, public aerodyn::ad_jacobianpdiscstate ( real(dbki), intent(in)  t,
type(ad_inputtype), intent(in)  u,
type(ad_parametertype), intent(in)  p,
type(ad_continuousstatetype), intent(in)  x,
type(ad_discretestatetype), intent(in)  xd,
type(ad_constraintstatetype), intent(in)  z,
type(ad_otherstatetype), intent(in)  OtherState,
type(ad_outputtype), intent(in)  y,
type(ad_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dYdxd,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXdxd,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXddxd,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dZdxd 
)

Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the discrete states (xd).

The partial derivatives dY/dxd, dX/dxd, dXd/dxd, and dZ/dxd are returned.

Parameters
[in]tTime in seconds at operating point
[in]uInputs at operating point (may change to inout if a mesh copy is required)
[in]pParameters
[in]xContinuous states at operating point
[in]xdDiscrete states at operating point
[in]zConstraint states at operating point
[in]otherstateOther states at operating point
[in]yOutput (change to inout if a mesh copy is required); Output fields are not used by this routine, but type is available here so that mesh parameter information (i.e., connectivity) does not have to be recalculated for dYdxd.
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in,out]dydxdPartial derivatives of output functions (Y) with respect to the discrete states (xd) [intent in to avoid deallocation]
[in,out]dxdxdPartial derivatives of continuous state functions (X) with respect to the discrete states (xd) [intent in to avoid deallocation]
[in,out]dxddxdPartial derivatives of discrete state functions (Xd) with respect to the discrete states (xd) [intent in to avoid deallocation]
[in,out]dzdxdPartial derivatives of constraint state functions (Z) with respect to the discrete states (xd) [intent in to avoid deallocation]

◆ ad_jacobianpinput()

subroutine, public aerodyn::ad_jacobianpinput ( real(dbki), intent(in)  t,
type(ad_inputtype), intent(inout)  u,
type(ad_parametertype), intent(in)  p,
type(ad_continuousstatetype), intent(in)  x,
type(ad_discretestatetype), intent(in)  xd,
type(ad_constraintstatetype), intent(in)  z,
type(ad_otherstatetype), intent(in)  OtherState,
type(ad_outputtype), intent(inout)  y,
type(ad_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dYdu,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXdu,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXddu,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dZdu 
)

Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the inputs (u).

The partial derivatives dY/du, dX/du, dXd/du, and dZ/du are returned.

Parameters
[in]tTime in seconds at operating point
[in,out]uInputs at operating point (may change to inout if a mesh copy is required)
[in]pParameters
[in]xContinuous states at operating point
[in]xdDiscrete states at operating point
[in]zConstraint states at operating point
[in]otherstateOther states at operating point
[in,out]yOutput (change to inout if a mesh copy is required); Output fields are not used by this routine, but type is available here so that mesh parameter information (i.e., connectivity) does not have to be recalculated for dYdu.
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in,out]dyduPartial derivatives of output functions (Y) with respect to the inputs (u) [intent in to avoid deallocation]
[in,out]dxduPartial derivatives of continuous state functions (X) with respect to the inputs (u) [intent in to avoid deallocation]
[in,out]dxdduPartial derivatives of discrete state functions (Xd) with respect to the inputs (u) [intent in to avoid deallocation]
[in,out]dzduPartial derivatives of constraint state functions (Z) with respect to the inputs (u) [intent in to avoid deallocation]

◆ ad_jacobianpinput_orig()

subroutine aerodyn::ad_jacobianpinput_orig ( real(dbki), intent(in)  t,
type(ad_inputtype), intent(inout)  u,
type(ad_parametertype), intent(in)  p,
type(ad_continuousstatetype), intent(in)  x,
type(ad_discretestatetype), intent(in)  xd,
type(ad_constraintstatetype), intent(in)  z,
type(ad_otherstatetype), intent(in)  OtherState,
type(ad_outputtype), intent(inout)  y,
type(ad_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dYdu,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXdu,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXddu,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dZdu 
)
private

Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the inputs (u).

The partial derivatives dY/du, dX/du, dXd/du, and dZ/du are returned.

Parameters
[in]tTime in seconds at operating point
[in,out]uInputs at operating point (may change to inout if a mesh copy is required)
[in]pParameters
[in]xContinuous states at operating point
[in]xdDiscrete states at operating point
[in]zConstraint states at operating point
[in]otherstateOther states at operating point
[in,out]yOutput (change to inout if a mesh copy is required); Output fields are not used by this routine, but type is available here so that mesh parameter information (i.e., connectivity) does not have to be recalculated for dYdu.
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in,out]dyduPartial derivatives of output functions (Y) with respect to the inputs (u) [intent in to avoid deallocation]
[in,out]dxduPartial derivatives of continuous state functions (X) with respect to the inputs (u) [intent in to avoid deallocation]
[in,out]dxdduPartial derivatives of discrete state functions (Xd) with respect to the inputs (u) [intent in to avoid deallocation]
[in,out]dzduPartial derivatives of constraint state functions (Z) with respect to the inputs (u) [intent in to avoid deallocation]

◆ ad_reinit()

subroutine, public aerodyn::ad_reinit ( type(ad_parametertype), intent(in)  p,
type(ad_continuousstatetype), intent(inout)  x,
type(ad_discretestatetype), intent(inout)  xd,
type(ad_constraintstatetype), intent(inout)  z,
type(ad_otherstatetype), intent(inout)  OtherState,
type(ad_miscvartype), intent(inout)  m,
real(dbki), intent(in)  Interval,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This subroutine reinitializes BEMT and UA, assuming that we will start the simulation over again, with only the inputs being different.

This allows us to bypass reading input files and allocating arrays because p is already set.

Parameters
[in]pParameters
[in,out]xInitial continuous states
[in,out]xdInitial discrete states
[in,out]zInitial guess of the constraint states
[in,out]otherstateInitial other states
[in,out]mInitial misc/optimization variables
[in]intervalCoupling interval in seconds: the rate that (1) AD_UpdateStates() is called in loose coupling & (2) AD_UpdateDiscState() is called in tight coupling. Input is the suggested time from the glue code; Output is the actual coupling interval that will be used by the glue code.
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ ad_updatestates()

subroutine, public aerodyn::ad_updatestates ( real(dbki), intent(in)  t,
integer(intki), intent(in)  n,
type(ad_inputtype), dimension(:), intent(inout)  u,
real(dbki), dimension(:), intent(in)  utimes,
type(ad_parametertype), intent(in)  p,
type(ad_continuousstatetype), intent(inout)  x,
type(ad_discretestatetype), intent(inout)  xd,
type(ad_constraintstatetype), intent(inout)  z,
type(ad_otherstatetype), intent(inout)  OtherState,
type(ad_miscvartype), intent(inout)  m,
integer(intki), intent(out)  errStat,
character(*), intent(out)  errMsg 
)

Loose coupling routine for solving for constraint states, integrating continuous states, and updating discrete and other states.

Continuous, constraint, discrete, and other states are updated for t + Interval

Parameters
[in]tCurrent simulation time in seconds
[in]nCurrent simulation time step n = 0,1,...
[in,out]uInputs at utimes (out only for mesh record-keeping in ExtrapInterp routine)
[in]utimesTimes associated with u(:), in seconds
[in]pParameters
[in,out]xInput: Continuous states at t; Output: Continuous states at t + Interval
[in,out]xdInput: Discrete states at t; Output: Discrete states at t + Interval
[in,out]zInput: Constraint states at t; Output: Constraint states at t+dt
[in,out]otherstateInput: Other states at t; Output: Other states at t+dt
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ adtwr_calcoutput()

subroutine aerodyn::adtwr_calcoutput ( type(ad_parametertype), intent(in)  p,
type(ad_inputtype), intent(in)  u,
type(ad_miscvartype), intent(inout)  m,
type(ad_outputtype), intent(inout)  y,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This subroutine calculates the tower loads for the AeroDyn TowerLoad output mesh.

Parameters
[in]uInputs at Time t
[in]pParameters
[in,out]mMisc/optimization variables
[in,out]yOutputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated)
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ checkbemtinputperturbations()

logical function aerodyn::checkbemtinputperturbations ( type(ad_parametertype), intent(in)  p,
type(ad_miscvartype), intent(inout)  m 
)
private
Parameters
[in]pAD parameters
[in,out]mMisc/optimization variables
Returns
if .true., the perturbation is valid; if false, invalid (and thus don't use it)

◆ checktwrinfl()

subroutine aerodyn::checktwrinfl ( type(ad_inputtype), intent(in)  u,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine checks for invalid inputs to the tower influence models.

Parameters
[in]uInputs at Time t
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ compute_dy()

subroutine aerodyn::compute_dy ( type(ad_parametertype), intent(in)  p,
type(ad_outputtype), intent(in)  y_p,
type(ad_outputtype), intent(in)  y_m,
real(r8ki), intent(in)  delta_p,
real(r8ki), intent(in)  delta_m,
real(r8ki), dimension(:), intent(inout)  dY 
)
private

This routine uses values of two output types to compute an array of differences.

Do not change this packing without making sure subroutine aerodyn::init_jacobian is consistant with this routine!

Parameters
[in]pparameters
[in]y_pAD outputs at \( u + \Delta_p u \) or \( z + \Delta_p z \) (p=plus)
[in]y_mAD outputs at \( u - \Delta_m u \) or \( z - \Delta_m z \) (m=minus)
[in]delta_pdifference in inputs or states \( delta_p = \Delta_p u \) or \( delta_p = \Delta_p z \)
[in]delta_mdifference in inputs or states \( delta_m = \Delta_m u \) or \( delta_m = \Delta_m z \)
[in,out]dycolumn of dYdu or dYdz: \( \frac{\partial Y}{\partial u_i} = \frac{y_p - y_m}{2 \, \Delta u}\) or \( \frac{\partial Y}{\partial z_i} = \frac{y_p - y_m}{2 \, \Delta z}\)

◆ diskavgvalues()

subroutine aerodyn::diskavgvalues ( type(ad_parametertype), intent(in)  p,
type(ad_inputtype), intent(in)  u,
type(ad_miscvartype), intent(inout)  m,
real(reki), dimension(3), intent(out)  x_hat_disk,
real(reki), dimension(3), intent(out)  y_hat_disk,
real(reki), dimension(3), intent(out)  z_hat_disk,
real(r8ki), dimension(p%numblades), intent(out)  Azimuth 
)
private
Parameters
[in]pAD parameters
[in]uAD Inputs at Time
[in,out]mMisc/optimization variables

◆ geomwithoutsweeppitchtwist()

subroutine aerodyn::geomwithoutsweeppitchtwist ( type(ad_parametertype), intent(in)  p,
type(ad_inputtype), intent(in)  u,
type(ad_miscvartype), intent(inout)  m,
real(r8ki), dimension(p%numblnds,p%numblades), intent(out)  thetaBladeNds,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private
Parameters
[in]pAD parameters
[in]uAD Inputs at Time
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ getlocaltowerprops()

subroutine aerodyn::getlocaltowerprops ( type(ad_parametertype), intent(in)  p,
type(ad_inputtype), intent(in)  u,
real(reki), dimension(3), intent(in)  BladeNodePosition,
real(reki), dimension(3,3), intent(out)  theta_tower_trans,
real(reki), intent(out)  W_tower,
real(reki), intent(out)  xbar,
real(reki), intent(out)  ybar,
real(reki), intent(out)  zbar,
real(reki), intent(out)  TwrCd,
real(reki), intent(out)  TwrClrnc,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine returns the tower constants necessary to compute the tower influence.

if uTowerMotion does not have any nodes there will be serious problems. I assume that has been checked earlier.

Parameters
[in]uInputs at Time t
[in]pParameters
[in]bladenodepositionlocal blade node position
[out]theta_tower_transtranspose of local tower orientation expressed as a DCM
[out]w_towerlocal relative wind speed normal to the tower
[out]xbarlocal x^ component of r_TowerBlade normalized by tower radius
[out]ybarlocal y^ component of r_TowerBlade normalized by tower radius
[out]zbarlocal z^ component of r_TowerBlade normalized by tower radius
[out]twrcdlocal tower drag coefficient
[out]twrclrnctower clearance for potential output
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ init_aamodule()

subroutine aerodyn::init_aamodule ( type(ad_initinputtype), intent(in)  DrvInitInp,
type(ad_inputfile), intent(in)  AD_InputFileData,
type(ad_inputtype), intent(in)  u_AD,
type(aa_inputtype), intent(out)  u,
type(ad_parametertype), intent(inout)  p,
type(aa_continuousstatetype), intent(out)  x,
type(aa_discretestatetype), intent(out)  xd,
type(aa_constraintstatetype), intent(out)  z,
type(aa_otherstatetype), intent(out)  OtherState,
type(aa_outputtype), intent(out)  y,
type(aa_miscvartype), intent(out)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine initializes the Airfoil Noise module from within AeroDyn.

Parameters
[in]drvinitinpAeroDyn-level initialization inputs
[in]ad_inputfiledataAll the data in the AeroDyn input file
[in]u_adAD inputs - used for input mesh node positions
[out]uAn initial guess for the input; input mesh must be defined
[in,out]pParameters ! intent out b/c we set the AA parameters here
[out]xInitial continuous states
[out]xdInitial discrete states
[out]zInitial guess of the constraint states
[out]otherstateInitial other states
[out]yInitial system outputs (outputs are not calculated; only the output mesh is initialized)
[out]mInitial misc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ init_afiparams()

subroutine aerodyn::init_afiparams ( type(ad_inputfile), intent(inout)  InputFileData,
type(afi_parametertype), dimension(:), intent(out), allocatable  p_AFI,
integer(intki), intent(in)  UnEc,
integer(intki), intent(in)  NumBl,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This subroutine sets up the data structures and initializes AirfoilInfo to get the necessary AFI parameters.

It then verifies that the UA parameters are included in the AFI tables if UA is being used.

Parameters
[in,out]inputfiledataAll the data in the AeroDyn input file (intent(out) only because of the call to MOVE_ALLOC)
[out]p_afiparameters returned from the AFI (airfoil info) module
[in]unecI/O unit for echo file. If > 0, file is open for writing.
[in]numblnumber of blades (for performing check on valid airfoil data read in)
[out]errstatError status
[out]errmsgError message

◆ init_bemtmodule()

subroutine aerodyn::init_bemtmodule ( type(ad_inputfile), intent(in)  InputFileData,
type(ad_inputtype), intent(in)  u_AD,
type(bemt_inputtype), intent(out)  u,
type(ad_parametertype), intent(inout)  p,
type(bemt_continuousstatetype), intent(out)  x,
type(bemt_discretestatetype), intent(out)  xd,
type(bemt_constraintstatetype), intent(out)  z,
type(bemt_otherstatetype), intent(out)  OtherState,
type(bemt_outputtype), intent(out)  y,
type(bemt_miscvartype), intent(out)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine initializes the BEMT module from within AeroDyn.

Parameters
[in]inputfiledataAll the data in the AeroDyn input file
[in]u_adAD inputs - used for input mesh node positions
[out]uAn initial guess for the input; input mesh must be defined
[in,out]pParameters ! intent out b/c we set the BEMT parameters here
[out]xInitial continuous states
[out]xdInitial discrete states
[out]zInitial guess of the constraint states
[out]otherstateInitial other states
[out]yInitial system outputs (outputs are not calculated; only the output mesh is initialized)
[out]mInitial misc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ init_fvwmodule()

subroutine aerodyn::init_fvwmodule ( type(ad_inputfile), intent(in)  InputFileData,
type(ad_inputtype), intent(inout)  u_AD,
type(fvw_inputtype), intent(out)  u,
type(ad_parametertype), intent(inout)  p,
type(fvw_continuousstatetype), intent(out)  x,
type(fvw_discretestatetype), intent(out)  xd,
type(fvw_constraintstatetype), intent(out)  z,
type(fvw_otherstatetype), intent(out)  OtherState,
type(fvw_outputtype), intent(out)  y,
type(fvw_miscvartype), intent(out)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine initializes the FVW module from within AeroDyn.

Parameters
[in]inputfiledataAll the data in the AeroDyn input file
[in,out]u_adAD inputs - used for input mesh node positions (intent out for meshcopy)
[out]uAn initial guess for the input; input mesh must be defined
[in,out]pParameters ! intent out b/c we set the FVW parameters here
[out]xInitial continuous states
[out]xdInitial discrete states
[out]zInitial guess of the constraint states
[out]otherstateInitial other states
[out]yInitial system outputs (outputs are not calculated; only the output mesh is initialized)
[out]mInitial misc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ init_jacobian()

subroutine aerodyn::init_jacobian ( type(ad_inputfile), intent(in)  InputFileData,
type(ad_parametertype), intent(inout)  p,
type(ad_inputtype), intent(in)  u,
type(ad_outputtype), intent(in)  y,
type(ad_miscvartype), intent(in)  m,
type(ad_initoutputtype), intent(inout)  InitOut,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine initializes the array that maps rows/columns of the Jacobian to specific mesh fields.

Do not change the order of this packing without changing corresponding parts of AD linearization !

Parameters
[in]inputfiledatainput file data (for default blade perturbation)
[in,out]pparameters
[in]uinputs
[in]youtputs
[in]mmiscellaneous variable
[in,out]initoutInitialization output data (for Jacobian row/column names)
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ init_jacobian_y()

subroutine aerodyn::init_jacobian_y ( type(ad_parametertype), intent(inout)  p,
type(ad_outputtype), intent(in)  y,
type(ad_initoutputtype), intent(inout)  InitOut,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private
Parameters
[in,out]pparameters
[in]youtputs
[in,out]initoutInitialization output data (for Jacobian row/column names)
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ init_miscvars()

subroutine aerodyn::init_miscvars ( type(ad_miscvartype), intent(inout)  m,
type(ad_parametertype), intent(in)  p,
type(ad_inputtype), intent(inout)  u,
type(ad_outputtype), intent(in)  y,
integer(intki), intent(out)  errStat,
character(*), intent(out)  errMsg 
)
private

This routine initializes (allocates) the misc variables for use during the simulation.

Parameters
[in,out]mmisc/optimization data (not defined in submodules)
[in]pParameters
[in,out]uinput for HubMotion mesh (create sibling mesh here)
[in]youtput (create mapping between output and otherstate mesh here)
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ init_otherstates()

subroutine aerodyn::init_otherstates ( type(ad_miscvartype), intent(in)  m,
type(ad_parametertype), intent(in)  p,
type(ad_otherstatetype), intent(inout)  OtherState,
integer(intki), intent(out)  errStat,
character(*), intent(out)  errMsg 
)
private

This routine initializes (allocates) the misc variables for use during the simulation.

Parameters
[in]mmisc/optimization data (not defined in submodules)
[in]pParameters
[in,out]otherstateDiscrete states
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ init_u()

subroutine aerodyn::init_u ( type(ad_inputtype), intent(out)  u,
type(ad_parametertype), intent(in)  p,
type(ad_inputfile), intent(in)  InputFileData,
type(ad_initinputtype), intent(in)  InitInp,
integer(intki), intent(out)  errStat,
character(*), intent(out)  errMsg 
)
private

This routine initializes AeroDyn meshes and input array variables for use during the simulation.

Parameters
[out]uInput data
[in]pParameters
[in]inputfiledataData stored in the module's input file
[in]initinpInput data for AD initialization routine
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ init_y()

subroutine aerodyn::init_y ( type(ad_outputtype), intent(out)  y,
type(ad_inputtype), intent(inout)  u,
type(ad_parametertype), intent(in)  p,
integer(intki), intent(out)  errStat,
character(*), intent(out)  errMsg 
)
private

This routine initializes AeroDyn meshes and output array variables for use during the simulation.

Parameters
[out]yModule outputs
[in,out]uModule inputs – intent(out) because of mesh sibling copy
[in]pParameters
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ perturb_u()

subroutine aerodyn::perturb_u ( type(ad_parametertype), intent(in)  p,
integer( intki ), intent(in)  n,
integer( intki ), intent(in)  perturb_sign,
type(ad_inputtype), intent(inout)  u,
real( r8ki ), intent(out)  du 
)
private

This routine perturbs the nth element of the u array (and mesh/field it corresponds to) Do not change this without making sure subroutine aerodyn::init_jacobian is consistant with this routine!

Parameters
[in]pparameters
[in]nnumber of array element to use
[in]perturb_sign+1 or -1 (value to multiply perturbation by; positive or negative difference)
[in,out]uperturbed ED inputs
[out]duamount that specific input was perturbed

◆ setinputs()

subroutine aerodyn::setinputs ( type(ad_parametertype), intent(in)  p,
type(ad_inputtype), intent(in)  u,
type(ad_miscvartype), intent(inout)  m,
integer, intent(in)  indx,
integer(intki), intent(out)  errStat,
character(*), intent(out)  errMsg 
)
private

This subroutine converts the AeroDyn inputs into values that can be used for its submodules.

It calculates the disturbed inflow on the blade if tower shadow or tower influence are enabled, then uses these values to set mBEMT_u(indx).

Parameters
[in]pAD parameters
[in]uAD Inputs at Time
[in,out]mMisc/optimization variables
[in]indxindex into mBEMT_u(indx) array; 1=t and 2=t+dt (but not checked here)
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ setinputsforaa()

subroutine aerodyn::setinputsforaa ( type(ad_parametertype), intent(in)  p,
type(ad_inputtype), intent(in)  u,
type(ad_miscvartype), intent(inout)  m,
integer(intki), intent(out)  errStat,
character(*), intent(out)  errMsg 
)
private

This subroutine sets mAA_u.

Parameters
[in]pAD parameters
[in]uAD Inputs at Time
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ setinputsforbemt()

subroutine aerodyn::setinputsforbemt ( type(ad_parametertype), intent(in)  p,
type(ad_inputtype), intent(in)  u,
type(ad_miscvartype), intent(inout)  m,
integer, intent(in)  indx,
integer(intki), intent(out)  errStat,
character(*), intent(out)  errMsg 
)
private

This subroutine sets mBEMT_u(indx).

Parameters
[in]pAD parameters
[in]uAD Inputs at Time
[in,out]mMisc/optimization variables
[in]indxindex into mBEMT_u array; must be 1 or 2 (but not checked here)
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ setinputsforfvw()

subroutine aerodyn::setinputsforfvw ( type(ad_parametertype), intent(in)  p,
type(ad_inputtype), dimension(:), intent(in)  u,
type(ad_miscvartype), intent(inout)  m,
integer(intki), intent(out)  errStat,
character(*), intent(out)  errMsg 
)
private

This subroutine sets mFVW_u(indx).

Parameters
[in]pAD parameters
[in]uAD Inputs at Time
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ setoutputsfrombemt()

subroutine aerodyn::setoutputsfrombemt ( type(ad_parametertype), intent(in)  p,
type(ad_miscvartype), intent(inout)  m,
type(ad_outputtype), intent(inout)  y 
)
private

This subroutine converts outputs from BEMT (stored in mBEMT_y) into values on the AeroDyn BladeLoad output mesh.

Parameters
[in]pAD parameters
[in,out]yAD outputs
[in,out]mMisc/optimization variables

◆ setoutputsfromfvw()

subroutine aerodyn::setoutputsfromfvw ( type(ad_inputtype), intent(in)  u,
type(ad_parametertype), intent(in)  p,
type(ad_otherstatetype), intent(in)  OtherState,
type(ad_discretestatetype), intent(in)  xd,
type(ad_miscvartype), intent(inout)  m,
type(ad_outputtype), intent(inout)  y,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This subroutine converts outputs from FVW (stored in mFVW_y) into values on the AeroDyn BladeLoad output mesh.

Parameters
[in]uInputs at Time t
[in]pAD parameters
[in]xdDiscrete states
[in,out]yAD outputs
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ setparameters()

subroutine aerodyn::setparameters ( type(ad_initinputtype), intent(in)  InitInp,
type(ad_inputfile), intent(inout)  InputFileData,
type(ad_parametertype), intent(inout)  p,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine sets AeroDyn parameters for use during the simulation; these variables are not changed after AD_Init.

Parameters
[in]initinpInput data for initialization routine, out is needed because of copy below
[in,out]inputfiledataData stored in the module's input file – intent(out) only for move_alloc statements
[in,out]pParameters
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ twrinfl()

subroutine aerodyn::twrinfl ( type(ad_parametertype), intent(in)  p,
type(ad_inputtype), intent(in)  u,
type(ad_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine calculates mDisturbedInflow, the influence of tower shadow and/or potential flow on the inflow velocities.

Parameters
[in]uInputs at Time t
[in]pParameters
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ twrinfl_nearestline2element()

subroutine aerodyn::twrinfl_nearestline2element ( type(ad_parametertype), intent(in)  p,
type(ad_inputtype), intent(in)  u,
real(reki), dimension(3), intent(in)  BladeNodePosition,
real(reki), dimension(3), intent(out)  r_TowerBlade,
real(reki), dimension(3,3), intent(out)  theta_tower_trans,
real(reki), intent(out)  W_tower,
real(reki), intent(out)  xbar,
real(reki), intent(out)  ybar,
real(reki), intent(out)  zbar,
real(reki), intent(out)  TwrCd,
real(reki), intent(out)  TwrDiam,
logical, intent(out)  found 
)
private

Option 1: Find the nearest-neighbor line2 element of the tower mesh for which the blade line2-element node projects orthogonally onto the tower line2-element domain (following an approach similar to the line2_to_line2 mapping search for motion and scalar quantities).

That is, for each node of the blade mesh, an orthogonal projection is made onto all possible Line2 elements of the tower mesh and the line2 element of the tower mesh that is the minimum distance away is found. Adapted from modmesh_mapping::createmapping_projecttoline2()

Parameters
[in]uInputs at Time t
[in]pParameters
[in]bladenodepositionlocal blade node position
[out]r_towerbladedistance vector from tower to blade
[out]theta_tower_transtranspose of local tower orientation expressed as a DCM
[out]w_towerlocal relative wind speed normal to the tower
[out]xbarlocal x^ component of r_TowerBlade normalized by tower radius
[out]ybarlocal y^ component of r_TowerBlade normalized by tower radius
[out]zbarlocal z^ component of r_TowerBlade normalized by tower radius
[out]twrcdlocal tower drag coefficient
[out]twrdiamlocal tower diameter
[out]foundwhether a mapping was found with this option

◆ twrinfl_nearestpoint()

subroutine aerodyn::twrinfl_nearestpoint ( type(ad_parametertype), intent(in)  p,
type(ad_inputtype), intent(in)  u,
real(reki), dimension(3), intent(in)  BladeNodePosition,
real(reki), dimension(3), intent(out)  r_TowerBlade,
real(reki), dimension(3,3), intent(out)  theta_tower_trans,
real(reki), intent(out)  W_tower,
real(reki), intent(out)  xbar,
real(reki), intent(out)  ybar,
real(reki), intent(out)  zbar,
real(reki), intent(out)  TwrCd,
real(reki), intent(out)  TwrDiam 
)
private

Option 2: used when the blade node does not orthogonally intersect a tower element.

Find the nearest-neighbor node in the tower Line2-element domain (following an approach similar to the point_to_point mapping search for motion and scalar quantities). That is, for each node of the blade mesh, the node of the tower mesh that is the minimum distance away is found.

Parameters
[in]uInputs at Time t
[in]pParameters
[in]bladenodepositionlocal blade node position
[out]r_towerbladedistance vector from tower to blade
[out]theta_tower_transtranspose of local tower orientation expressed as a DCM
[out]w_towerlocal relative wind speed normal to the tower
[out]xbarlocal x^ component of r_TowerBlade normalized by tower radius
[out]ybarlocal y^ component of r_TowerBlade normalized by tower radius
[out]zbarlocal z^ component of r_TowerBlade normalized by tower radius
[out]twrcdlocal tower drag coefficient
[out]twrdiamlocal tower diameter

◆ twrinflarray()

subroutine aerodyn::twrinflarray ( type(ad_parametertype), intent(in)  p,
type(ad_inputtype), intent(in)  u,
type(ad_miscvartype), intent(inout)  m,
real(reki), dimension(:,:), intent(in)  Positions,
real(reki), dimension(:,:), intent(inout)  Inflow,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

Calculate the tower influence on a array of points Positions (3xn) The subroutine has side effecs and modifies the inflow Relies heavily (i.e.

unfortunate copy pasting), on TwrInfl

Parameters
[in]uInputs at Time t
[in]pParameters
[in,out]mMisc/optimization variables
[in]positionsPositions where tower influence is to be computed
[in,out]inflowUndisturbed inflow (in) -> disturbed inflow (out)
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ validateinputdata()

subroutine aerodyn::validateinputdata ( type(ad_initinputtype), intent(in)  InitInp,
type(ad_inputfile), intent(in)  InputFileData,
integer(intki), intent(in)  NumBl,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine validates the inputs from the AeroDyn input files.

Parameters
[in]initinpInput data for initialization routine
[in]inputfiledataAll the data in the AeroDyn input file
[in]numblNumber of blades
[out]errstatError status
[out]errmsgError message