![]() |
OpenFAST
Wind turbine multiphysics simulator
|
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) |
AeroDyn is a time-domain aerodynamics module for horizontal-axis wind turbines.
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.
[in] | time | Current simulation time in seconds |
[in] | u | Inputs at Time |
[in] | p | Parameters |
[in] | x | Continuous states at Time |
[in] | xd | Discrete states at Time |
[in] | z | Constraint states at Time (possibly a guess) |
[in] | otherstate | Other states at Time |
[in,out] | m | Misc/optimization variables |
[in,out] | z_residual | Residual of the constraint state equations using the input values described above |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
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.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at Time t |
[in] | p | Parameters |
[in] | x | Continuous states at t |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t |
[in] | otherstate | Other states at t |
[in,out] | y | Outputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated) |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
[in] | needwriteoutput | Flag to determine if WriteOutput values need to be calculated in this call |
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.
[in,out] | u | System inputs |
[in,out] | p | Parameters |
[in,out] | x | Continuous states |
[in,out] | xd | Discrete states |
[in,out] | z | Constraint states |
[in,out] | otherstate | Other states |
[in,out] | y | System outputs |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
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.
[in] | t | Time in seconds at operating point |
[in] | u | Inputs at operating point (may change to inout if a mesh copy is required) |
[in] | p | Parameters |
[in] | x | Continuous states at operating point |
[in] | xd | Discrete states at operating point |
[in] | z | Constraint states at operating point |
[in] | otherstate | Other states at operating point |
[in] | y | Output at operating point |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
[in,out] | u_op | values of linearized inputs |
[in,out] | y_op | values of linearized outputs |
[in,out] | x_op | values of linearized continuous states |
[in,out] | dx_op | values of first time derivatives of linearized continuous states |
[in,out] | xd_op | values of linearized discrete states |
[in,out] | z_op | values of linearized constraint states |
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.
[in] | initinp | Input data for initialization routine |
[out] | u | An initial guess for the input; input mesh must be defined |
[out] | p | Parameters |
[out] | x | Initial continuous states |
[out] | xd | Initial discrete states |
[out] | z | Initial guess of the constraint states |
[out] | otherstate | Initial other states |
[out] | y | Initial system outputs (outputs are not calculated; only the output mesh is initialized) |
[out] | m | Initial misc/optimization variables |
[in,out] | interval | Coupling 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] | initout | Output for initialization routine |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
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.
[in] | t | Time in seconds at operating point |
[in] | u | Inputs at operating point (may change to inout if a mesh copy is required) |
[in] | p | Parameters |
[in] | x | Continuous states at operating point |
[in] | xd | Discrete states at operating point |
[in] | z | Constraint states at operating point |
[in] | otherstate | Other states at operating point |
[in,out] | y | Output (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] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
[in,out] | dydz | Partial derivatives of output functions (Y) with respect to the constraint states (z) [intent in to avoid deallocation] |
[in,out] | dxdz | Partial derivatives of continuous state functions (X) with respect to the constraint states (z) [intent in to avoid deallocation] |
[in,out] | dxddz | Partial derivatives of discrete state functions (Xd) with respect to the constraint states (z) [intent in to avoid deallocation] |
[in,out] | dzdz | Partial derivatives of constraint state functions (Z) with respect to the constraint states (z) [intent in to avoid deallocation] |
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.
[in] | t | Time in seconds at operating point |
[in] | u | Inputs at operating point (may change to inout if a mesh copy is required) |
[in] | p | Parameters |
[in] | x | Continuous states at operating point |
[in] | xd | Discrete states at operating point |
[in] | z | Constraint states at operating point |
[in] | otherstate | Other states at operating point |
[in] | y | Output (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] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
[in,out] | dydx | Partial derivatives of output functions (Y) with respect to the continuous states (x) [intent in to avoid deallocation] |
[in,out] | dxdx | Partial derivatives of continuous state functions (X) with respect to the continuous states (x) [intent in to avoid deallocation] |
[in,out] | dxddx | Partial derivatives of discrete state functions (Xd) with respect to the continuous states (x) [intent in to avoid deallocation] |
[in,out] | dzdx | Partial derivatives of constraint state functions (Z) with respect to the continuous states (x) [intent in to avoid deallocation] |
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.
[in] | t | Time in seconds at operating point |
[in] | u | Inputs at operating point (may change to inout if a mesh copy is required) |
[in] | p | Parameters |
[in] | x | Continuous states at operating point |
[in] | xd | Discrete states at operating point |
[in] | z | Constraint states at operating point |
[in] | otherstate | Other states at operating point |
[in] | y | Output (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] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
[in,out] | dydxd | Partial derivatives of output functions (Y) with respect to the discrete states (xd) [intent in to avoid deallocation] |
[in,out] | dxdxd | Partial derivatives of continuous state functions (X) with respect to the discrete states (xd) [intent in to avoid deallocation] |
[in,out] | dxddxd | Partial derivatives of discrete state functions (Xd) with respect to the discrete states (xd) [intent in to avoid deallocation] |
[in,out] | dzdxd | Partial derivatives of constraint state functions (Z) with respect to the discrete states (xd) [intent in to avoid deallocation] |
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.
[in] | t | Time in seconds at operating point |
[in,out] | u | Inputs at operating point (may change to inout if a mesh copy is required) |
[in] | p | Parameters |
[in] | x | Continuous states at operating point |
[in] | xd | Discrete states at operating point |
[in] | z | Constraint states at operating point |
[in] | otherstate | Other states at operating point |
[in,out] | y | Output (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] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
[in,out] | dydu | Partial derivatives of output functions (Y) with respect to the inputs (u) [intent in to avoid deallocation] |
[in,out] | dxdu | Partial derivatives of continuous state functions (X) with respect to the inputs (u) [intent in to avoid deallocation] |
[in,out] | dxddu | Partial derivatives of discrete state functions (Xd) with respect to the inputs (u) [intent in to avoid deallocation] |
[in,out] | dzdu | Partial derivatives of constraint state functions (Z) with respect to the inputs (u) [intent in to avoid deallocation] |
|
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.
[in] | t | Time in seconds at operating point |
[in,out] | u | Inputs at operating point (may change to inout if a mesh copy is required) |
[in] | p | Parameters |
[in] | x | Continuous states at operating point |
[in] | xd | Discrete states at operating point |
[in] | z | Constraint states at operating point |
[in] | otherstate | Other states at operating point |
[in,out] | y | Output (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] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
[in,out] | dydu | Partial derivatives of output functions (Y) with respect to the inputs (u) [intent in to avoid deallocation] |
[in,out] | dxdu | Partial derivatives of continuous state functions (X) with respect to the inputs (u) [intent in to avoid deallocation] |
[in,out] | dxddu | Partial derivatives of discrete state functions (Xd) with respect to the inputs (u) [intent in to avoid deallocation] |
[in,out] | dzdu | Partial derivatives of constraint state functions (Z) with respect to the inputs (u) [intent in to avoid deallocation] |
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.
[in] | p | Parameters |
[in,out] | x | Initial continuous states |
[in,out] | xd | Initial discrete states |
[in,out] | z | Initial guess of the constraint states |
[in,out] | otherstate | Initial other states |
[in,out] | m | Initial misc/optimization variables |
[in] | interval | Coupling 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] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
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
[in] | t | Current simulation time in seconds |
[in] | n | Current simulation time step n = 0,1,... |
[in,out] | u | Inputs at utimes (out only for mesh record-keeping in ExtrapInterp routine) |
[in] | utimes | Times associated with u(:), in seconds |
[in] | p | Parameters |
[in,out] | x | Input: Continuous states at t; Output: Continuous states at t + Interval |
[in,out] | xd | Input: Discrete states at t; Output: Discrete states at t + Interval |
[in,out] | z | Input: Constraint states at t; Output: Constraint states at t+dt |
[in,out] | otherstate | Input: Other states at t; Output: Other states at t+dt |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This subroutine calculates the tower loads for the AeroDyn TowerLoad output mesh.
[in] | u | Inputs at Time t |
[in] | p | Parameters |
[in,out] | m | Misc/optimization variables |
[in,out] | y | Outputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated) |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
[in] | p | AD parameters |
[in,out] | m | Misc/optimization variables |
|
private |
This routine checks for invalid inputs to the tower influence models.
[in] | u | Inputs at Time t |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
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!
[in] | p | parameters |
[in] | y_p | AD outputs at \( u + \Delta_p u \) or \( z + \Delta_p z \) (p=plus) |
[in] | y_m | AD outputs at \( u - \Delta_m u \) or \( z - \Delta_m z \) (m=minus) |
[in] | delta_p | difference in inputs or states \( delta_p = \Delta_p u \) or \( delta_p = \Delta_p z \) |
[in] | delta_m | difference in inputs or states \( delta_m = \Delta_m u \) or \( delta_m = \Delta_m z \) |
[in,out] | dy | column 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}\) |
|
private |
[in] | p | AD parameters |
[in] | u | AD Inputs at Time |
[in,out] | m | Misc/optimization variables |
|
private |
[in] | p | AD parameters |
[in] | u | AD Inputs at Time |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
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.
[in] | u | Inputs at Time t |
[in] | p | Parameters |
[in] | bladenodeposition | local blade node position |
[out] | theta_tower_trans | transpose of local tower orientation expressed as a DCM |
[out] | w_tower | local relative wind speed normal to the tower |
[out] | xbar | local x^ component of r_TowerBlade normalized by tower radius |
[out] | ybar | local y^ component of r_TowerBlade normalized by tower radius |
[out] | zbar | local z^ component of r_TowerBlade normalized by tower radius |
[out] | twrcd | local tower drag coefficient |
[out] | twrclrnc | tower clearance for potential output |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine initializes the Airfoil Noise module from within AeroDyn.
[in] | drvinitinp | AeroDyn-level initialization inputs |
[in] | ad_inputfiledata | All the data in the AeroDyn input file |
[in] | u_ad | AD inputs - used for input mesh node positions |
[out] | u | An initial guess for the input; input mesh must be defined |
[in,out] | p | Parameters ! intent out b/c we set the AA parameters here |
[out] | x | Initial continuous states |
[out] | xd | Initial discrete states |
[out] | z | Initial guess of the constraint states |
[out] | otherstate | Initial other states |
[out] | y | Initial system outputs (outputs are not calculated; only the output mesh is initialized) |
[out] | m | Initial misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
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.
[in,out] | inputfiledata | All the data in the AeroDyn input file (intent(out) only because of the call to MOVE_ALLOC) |
[out] | p_afi | parameters returned from the AFI (airfoil info) module |
[in] | unec | I/O unit for echo file. If > 0, file is open for writing. |
[in] | numbl | number of blades (for performing check on valid airfoil data read in) |
[out] | errstat | Error status |
[out] | errmsg | Error message |
|
private |
This routine initializes the BEMT module from within AeroDyn.
[in] | inputfiledata | All the data in the AeroDyn input file |
[in] | u_ad | AD inputs - used for input mesh node positions |
[out] | u | An initial guess for the input; input mesh must be defined |
[in,out] | p | Parameters ! intent out b/c we set the BEMT parameters here |
[out] | x | Initial continuous states |
[out] | xd | Initial discrete states |
[out] | z | Initial guess of the constraint states |
[out] | otherstate | Initial other states |
[out] | y | Initial system outputs (outputs are not calculated; only the output mesh is initialized) |
[out] | m | Initial misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine initializes the FVW module from within AeroDyn.
[in] | inputfiledata | All the data in the AeroDyn input file |
[in,out] | u_ad | AD inputs - used for input mesh node positions (intent out for meshcopy) |
[out] | u | An initial guess for the input; input mesh must be defined |
[in,out] | p | Parameters ! intent out b/c we set the FVW parameters here |
[out] | x | Initial continuous states |
[out] | xd | Initial discrete states |
[out] | z | Initial guess of the constraint states |
[out] | otherstate | Initial other states |
[out] | y | Initial system outputs (outputs are not calculated; only the output mesh is initialized) |
[out] | m | Initial misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
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 !
[in] | inputfiledata | input file data (for default blade perturbation) |
[in,out] | p | parameters |
[in] | u | inputs |
[in] | y | outputs |
[in] | m | miscellaneous variable |
[in,out] | initout | Initialization output data (for Jacobian row/column names) |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
[in,out] | p | parameters |
[in] | y | outputs |
[in,out] | initout | Initialization output data (for Jacobian row/column names) |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine initializes (allocates) the misc variables for use during the simulation.
[in,out] | m | misc/optimization data (not defined in submodules) |
[in] | p | Parameters |
[in,out] | u | input for HubMotion mesh (create sibling mesh here) |
[in] | y | output (create mapping between output and otherstate mesh here) |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine initializes (allocates) the misc variables for use during the simulation.
[in] | m | misc/optimization data (not defined in submodules) |
[in] | p | Parameters |
[in,out] | otherstate | Discrete states |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine initializes AeroDyn meshes and input array variables for use during the simulation.
[out] | u | Input data |
[in] | p | Parameters |
[in] | inputfiledata | Data stored in the module's input file |
[in] | initinp | Input data for AD initialization routine |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine initializes AeroDyn meshes and output array variables for use during the simulation.
[out] | y | Module outputs |
[in,out] | u | Module inputs – intent(out) because of mesh sibling copy |
[in] | p | Parameters |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
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!
[in] | p | parameters |
[in] | n | number of array element to use |
[in] | perturb_sign | +1 or -1 (value to multiply perturbation by; positive or negative difference) |
[in,out] | u | perturbed ED inputs |
[out] | du | amount that specific input was perturbed |
|
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).
[in] | p | AD parameters |
[in] | u | AD Inputs at Time |
[in,out] | m | Misc/optimization variables |
[in] | indx | index into mBEMT_u(indx) array; 1=t and 2=t+dt (but not checked here) |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This subroutine sets mAA_u.
[in] | p | AD parameters |
[in] | u | AD Inputs at Time |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This subroutine sets mBEMT_u(indx).
[in] | p | AD parameters |
[in] | u | AD Inputs at Time |
[in,out] | m | Misc/optimization variables |
[in] | indx | index into mBEMT_u array; must be 1 or 2 (but not checked here) |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This subroutine sets mFVW_u(indx).
[in] | p | AD parameters |
[in] | u | AD Inputs at Time |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This subroutine converts outputs from BEMT (stored in mBEMT_y) into values on the AeroDyn BladeLoad output mesh.
[in] | p | AD parameters |
[in,out] | y | AD outputs |
[in,out] | m | Misc/optimization variables |
|
private |
This subroutine converts outputs from FVW (stored in mFVW_y) into values on the AeroDyn BladeLoad output mesh.
[in] | u | Inputs at Time t |
[in] | p | AD parameters |
[in] | xd | Discrete states |
[in,out] | y | AD outputs |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine sets AeroDyn parameters for use during the simulation; these variables are not changed after AD_Init.
[in] | initinp | Input data for initialization routine, out is needed because of copy below |
[in,out] | inputfiledata | Data stored in the module's input file – intent(out) only for move_alloc statements |
[in,out] | p | Parameters |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine calculates mDisturbedInflow, the influence of tower shadow and/or potential flow on the inflow velocities.
[in] | u | Inputs at Time t |
[in] | p | Parameters |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
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()
[in] | u | Inputs at Time t |
[in] | p | Parameters |
[in] | bladenodeposition | local blade node position |
[out] | r_towerblade | distance vector from tower to blade |
[out] | theta_tower_trans | transpose of local tower orientation expressed as a DCM |
[out] | w_tower | local relative wind speed normal to the tower |
[out] | xbar | local x^ component of r_TowerBlade normalized by tower radius |
[out] | ybar | local y^ component of r_TowerBlade normalized by tower radius |
[out] | zbar | local z^ component of r_TowerBlade normalized by tower radius |
[out] | twrcd | local tower drag coefficient |
[out] | twrdiam | local tower diameter |
[out] | found | whether a mapping was found with this option |
|
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.
[in] | u | Inputs at Time t |
[in] | p | Parameters |
[in] | bladenodeposition | local blade node position |
[out] | r_towerblade | distance vector from tower to blade |
[out] | theta_tower_trans | transpose of local tower orientation expressed as a DCM |
[out] | w_tower | local relative wind speed normal to the tower |
[out] | xbar | local x^ component of r_TowerBlade normalized by tower radius |
[out] | ybar | local y^ component of r_TowerBlade normalized by tower radius |
[out] | zbar | local z^ component of r_TowerBlade normalized by tower radius |
[out] | twrcd | local tower drag coefficient |
[out] | twrdiam | local tower diameter |
|
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
[in] | u | Inputs at Time t |
[in] | p | Parameters |
[in,out] | m | Misc/optimization variables |
[in] | positions | Positions where tower influence is to be computed |
[in,out] | inflow | Undisturbed inflow (in) -> disturbed inflow (out) |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
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.
[in] | initinp | Input data for initialization routine |
[in] | inputfiledata | All the data in the AeroDyn input file |
[in] | numbl | Number of blades |
[out] | errstat | Error status |
[out] | errmsg | Error message |