###################################################################################################################################
# Registry for AeroDyn 15 Driver in the FAST Modularization Framework
# This Registry file is used to create AeroDyn_Driver_Types.
# It also contains copy, destroy, pack, and unpack routines associated with each defined data types.
# See the NWTC Programmer's Handbook for further information on the format/contents of this file.
#
# Entries are of the form
# <keyword>    <ModuleName/ModName>    <TypeName>    <FieldType>    <FieldName>    <Dims>    <IO>    <DNAME>    <DESCRIP>    <UNITS>
#
# Use ^ as a shortcut for the value in the same column from the previous line.
###################################################################################################################################
# ...... Include files (definitions from NWTC Library) ............................................................................
include    Registry_NWTC_Library.txt
usefrom    AeroDyn_Registry.txt
usefrom    AeroDyn_Inflow_Registry.txt
#
# ..... Table of combined cases to run .......................................................................................................
typedef   AeroDyn_Driver/AD_Dvr Dvr_Case          ReKi                   HWindSpeed       -      -     -   "Hub wind speed" "m/s"
typedef   ^                         ^             ReKi                   PLExp            -      -     -   "Power law wind-shear exponent" "-"
typedef   ^                         ^             ReKi                   rotSpeed         -      -     -   "Rotor speed" "rad/s"
typedef   ^                         ^             ReKi                   bldPitch         -      -     -   "Pitch angle" "rad"
typedef   ^                         ^             ReKi                   nacYaw           -      -     -   "Yaw angle" "rad"
typedef   ^                         ^             DbKi                   tMax             -      -     -   "Max time" "s"
typedef   ^                         ^             DbKi                   dT               -      -     -   "time increment" "s"
typedef   ^                         ^             IntKi                  numSteps         -      -     -   "number of steps in this case" "-"
typedef   ^                         ^             IntKi                  DOF              -      -     -   "Degree of freedom for sinusoidal motion" "-"
typedef   ^                         ^             ReKi                   amplitude        -      -     -   "Amplitude for sinusoidal motion (when DOF>0)" "-"
typedef   ^                         ^             ReKi                   frequency        -      -     -   "Frequency for sinusoidal motion (when DOF>0)" "-"

# ...... Data for VTK surface visualization ............................................................................
# typedef   AeroDyn_Driver/AD_Dvr   DvrVTK_BLSurfaceType SiKi    AirfoilCoords    {:}{:}{:}    -    -    "x,y coordinates for airfoil around each blade node on a blade (relative to reference)"    -
typedef    ^    DvrVTK_SurfaceType    IntKi    NumSectors        -    -    -    "number of sectors in which to split circles (higher number gives smoother surface)"    -
typedef    ^    DvrVTK_SurfaceType    SiKi    NacelleBox    {3}{8}    -    -    "X-Y-Z locations of 8 points that define the nacelle box, relative to the nacelle position"    m
typedef    ^    DvrVTK_SurfaceType    SiKi    BaseBox       {3}{8}    -    -    "X-Y-Z locations of 8 points that define the base box"    m
# typedef    ^    DvrVTK_SurfaceType    SiKi    TowerRad         {:}    -    -    "radius of each ED tower node"    m
# typedef    ^    DvrVTK_SurfaceType    DvrVTK_BLSurfaceType    BladeShape    {:}    -    -    "AirfoilCoords for each blade"    m

# ..... Data for driver output file .......................................................................................................
typedef   AeroDyn_Driver/AD_Dvr  Dvr_Outputs      ProgDesc               AD_ver           -      -     -   "AeroDyn version information" -
typedef   ^                         ^             IntKi                  unOutFile        :      -     -   "unit number for writing output file for each rotor" "-"
typedef   ^                         ^             IntKi                  ActualChanLen    -      -     -   "Actual length of channels written to text file (less than or equal to ChanLen)" "-"
typedef   ^                         ^             IntKi                  nDvrOutputs      -      -     -   "Number of outputs for the driver (without AD and IW)" "-"
typedef   ^                         ^             character(20)          Fmt_t            -      -     -   "Format specifier for time channel" "-"
typedef   ^                         ^             character(25)          Fmt_a            -      -     -   "Format specifier for each column (including delimiter)" "-"
typedef   ^                         ^             character(1)           delim            -      -     -   "column delimiter" "-"
typedef   ^                         ^             character(20)          outFmt           -      -     -   "Format specifier" "-"
typedef   ^                         ^             IntKi                  fileFmt          -      -     -   "Output format 1=Text, 2=Binary, 3=Both" "-"
typedef   ^                         ^             IntKi                  WrVTK            -      -     -   "0= no vtk, 1=init only, 2=animation" "-"
typedef   ^                         ^             IntKi                  WrVTK_Type       -      -     -   "Flag for VTK output type (1=surface, 2=line, 3=both)"    -
typedef   ^                         ^             character(1024)        Root             -      -     -   "Output file rootname" "-"
typedef   ^                         ^             character(1024)        VTK_OutFileRoot  -      -     -   "Output file rootname for vtk (includes directory)" "-"
typedef   ^                         ^             character(ChanLen)     WriteOutputHdr  {:}     -     -   "Channel headers" "-"
typedef   ^                         ^             character(ChanLen)     WriteOutputUnt  {:}     -     -   "Channel units" "-"
typedef   ^                         ^             ReKi                   storage         :::     -     -   "nTurbines x nChannel x nTime"
typedef   ^                         ^             ReKi                   outLine          :      -     -   "Output line to be written to disk"
typedef   ^                         ^             DvrVTK_SurfaceType     VTK_surface      :      -     -   "Data for VTK surface visualization"
typedef   ^                         ^             IntKi                  VTK_tWidth       -      -     -   "Width of number of files for leading zeros in file name format"    -
typedef   ^                         ^             IntKi                  n_VTKTime        -      -     -   "Number of time steps between writing VTK files" -
typedef   ^                         ^             DbKi                   VTK_DT           -      -     -   "Write VTK time step" -
typedef   ^                         ^             SiKi                   VTKHubRad        -      -     -   "Hub radius for visualization"    m
typedef   ^                         ^             ReKi                   VTKNacDim        6      -     -   "Nacelle dimensions for visualization"    m
typedef   ^                         ^             SiKi                   VTKRefPoint      3      -     -   "RefPoint for VTK outputs"
typedef   ^                         ^             DbKi                   DT_Outs          -      -     -   "Output time resolution" s
typedef   ^                         ^             IntKi                  n_DT_Out         -      -     -   "Number of time steps between writing a line in the time-marching output files" -

# ..... Blade data for driver.................................................................................................
typedef   ^                        BladeData     ReKi                    pitch            -      -     -   "rad" -
typedef   ^                         ^            ReKi                    pitchSpeed       -      -     -   "rad/s" -
typedef   ^                         ^            ReKi                    pitchAcc         -      -     -   "rad/s/s" -
typedef   ^                         ^            ReKi                    origin_h         3      -     -   "" -
typedef   ^                         ^            ReKi                    orientation_h    3      -     -   "" -
typedef   ^                         ^            ReKi                    hubRad_bl        -      -     -   "" -
typedef   ^                         ^            DbKi                    Rh2bl0        {3}{3}    -     -   "Rotation matrix blade 2 hub" -
typedef   ^                         ^            IntKi                   motionType       -      -     -   "" -
typedef   ^                         ^            IntKi                   iMotion          -      -     -   "Stored index to optimize time interpolation" -
typedef   ^                         ^            ReKi                    motion           ::     -     -   "" "-"
typedef   ^                         ^            character(1024)         motionFileName   -      -     -   "" -
                                                                        
# ... Hub data for driver....................................................................................................
typedef   ^                         HubData      ReKi                    origin_n         3      -     -   "" -
typedef   ^                         ^            ReKi                    orientation_n    3      -     -   "" -
typedef   ^                         ^            IntKi                   motionType       -      -     -   "" -
typedef   ^                         ^            IntKi                   iMotion          -      -     -   "Stored index to optimize time interpolation" -
typedef   ^                         ^            ReKi                    azimuth          -      -     -   "rotor position" "rad"
typedef   ^                         ^            ReKi                    rotSpeed         -      -     -   "rotor speed" "rad/s" 
typedef   ^                         ^            ReKi                    rotAcc           -      -     -   "rotor acceleration" "rad/s/s"
typedef   ^                         ^            character(1024)         motionFileName   -      -     -   "" -
typedef   ^                         ^            ReKi                    motion           ::     -     -   "" "-"

# ... Nacelle data for driver................................................................................................
typedef   ^                         NacData      ReKi                    origin_t         3      -     -   "" -
typedef   ^                         ^            IntKi                   motionType       -      -     -   "" -
typedef   ^                         ^            IntKi                   iMotion          -      -     -   "Stored index to optimize time interpolation" -
typedef   ^                         ^            ReKi                    yaw              -      -     -   "rad" "rad"
typedef   ^                         ^            ReKi                    yawSpeed         -      -     -   "yawspeed " "rad/s"
typedef   ^                         ^            ReKi                    yawAcc           -      -     -   "yawAcceleration" "rad/s^2"
typedef   ^                         ^            character(1024)         motionFileName   -      -     -   "" -
typedef   ^                         ^            ReKi                    motion           ::     -     -   "" "-"

# ... Tower data for driver .................................................................................................
typedef   ^                         TwrData      ReKi                    origin_t         3      -     -   "" -

# ..... Wind Turbine data for driver ........................................................................................
typedef   ^                        WTData        ReKi                    originInit       3      -     -   "" -
typedef   ^                         ^            ReKi                    orientationInit  3      -     -   "" -
typedef   ^                         ^            MeshMapType             map2twrPt        -      -     -   "Mesh mapping from base to tower"
typedef   ^                         ^            MeshMapType             map2nacPt        -      -     -   "Mesh mapping from base to nacelle"
typedef   ^                         ^            MeshMapType             map2hubPt        -      -     -   "Mesh mapping from Nacelle to hub"
typedef   ^                         ^            MeshMapType             map2BldPt        :      -     -   "Mesh mapping from hub to bld root motion"
typedef   ^                         ^            BladeData               bld              :      -     -   "" -
typedef   ^                         ^            HubData                 hub              -      -     -   "" -
typedef   ^                         ^            NacData                 nac              -      -     -   "" -
typedef   ^                         ^            TwrData                 twr              -      -     -   "" -
typedef   ^                         ^            IntKi                   numBlades        -      -     -   "" -
typedef   ^                         ^            logical                 basicHAWTFormat  -      -     -   "If true simply input HubRad/Pitch/Overhang/Cone, otherwise all turbine inputs" -
typedef   ^                         ^            logical                 hasTower         -      -     -   "" -
typedef   ^                         ^            IntKi                   projMod          -      -     -   "If true simply input HubRad/Pitch/Overhang/Cone, otherwise all turbine inputs" -
typedef   ^                         ^            IntKi                   BEM_Mod          -      -     -   "Switch for different BEM implementations" -
typedef   ^                         ^            logical                 HAWTprojection   -      -     -   "" -
typedef   ^                         ^            IntKi                   motionType       -      -     -   "" -
typedef   ^                         ^            ReKi                    motion           ::     -     -   "" "-"
typedef   ^                         ^            IntKi                   iMotion          -      -     -   "Stored index to optimize time interpolation" -
typedef   ^                         ^            IntKi                   degreeOfFreedom  -      -     -   "" -
typedef   ^                         ^            ReKi                    amplitude        -      -     -   "" -
typedef   ^                         ^            ReKi                    frequency        -      -     -   "" -
typedef   ^                         ^            character(1024)         motionFileName   -      -     -   "" -
typedef   ^                         ^            ReKi                    WriteOutput      :      -     -   "WriteOutputs of the driver only"
typedef   ^                         ^            ReKi                    userSwapArray    :      -     -   "Array to store user data for user-defined functions" "-"


# ..... Data for driver simulation .......................................................................................................
typedef   ^                        Dvr_SimData   character(1024)         AD_InputFile     -      -     -   "Name of AeroDyn input file" -
typedef   ^                         ^            IntKi                   MHK              -      -     -   "MHK turbine type (switch) {0: not an MHK turbine, 1: fixed MHK turbine, 2: floating MHK turbine}" "-"
typedef   ^                         ^            IntKi                   AnalysisType     -      -     -   "0=Steady Wind, 1=InflowWind" "-"
typedef   ^                         ^            ReKi                    FldDens          -      -     -   "Density of working fluid" "kg/m^3"
typedef   ^                         ^            ReKi                    KinVisc          -      -     -   "Kinematic viscosity of working fluid" "m^2/s"
typedef   ^                         ^            ReKi                    SpdSound         -      -     -   "Speed of sound in working fluid" "m/s"
typedef   ^                         ^            ReKi                    Patm             -      -     -   "Atmospheric pressure" "Pa"
typedef   ^                         ^            ReKi                    Pvap             -      -     -   "Vapour pressure of working fluid" "Pa"
typedef   ^                         ^            ReKi                    WtrDpth          -      -     -   "Water depth" "m"
typedef   ^                         ^            ReKi                    MSL2SWL          -      -     -   "Offset between still-water level and mean sea level" "m"
typedef   ^                         ^            IntKi                   numTurbines      -   -9999    -   "number of turbine rotors" "-"
typedef   ^                         ^            WTData                  WT               :      -     -   "Wind turbine data for driver" "-"
typedef   ^                         ^            DbKi                    dT               -      -     -   "time increment" "s"
typedef   ^                         ^            DbKi                    tMax             -      -     -   "time increment" "s"
typedef   ^                         ^            IntKi                   numSteps         -      -     -   "number of steps in this case" "-"
typedef   ^                         ^            IntKi                   numCases         -      -     -   "number of steps in this case" "-"
typedef   ^                         ^            Dvr_Case               Cases           {:}     -     -   "table of cases to run when AnalysisType=2" "-"
typedef   ^                         ^            IntKi                   iCase            -      -     -   "Current Case being run" -
typedef   ^                         ^            ReKi                    timeSeries       ::     -     -   "Times series inputs when AnalysisType=1, 6 columns, Time, WndSpeed, ShearExp, RotSpd, Pitch, Yaw" "-"
typedef   ^                         ^            IntKi                   iTimeSeries      -      -     -   "Stored index to optimize time interpolation" -
typedef   ^                         ^            character(1024)         root             -      -     -   "Output file rootname" "-"
typedef   ^                         ^            Dvr_Outputs             out              -      -     -   "data for driver output file" "-"
typedef   ^                         ^            ADI_IW_InputData        IW_InitInp       -      -     -   "" -

# ..... Data to wrap the driver ..........................................................................................................
typedef   ^                        AllData       Dvr_SimData             dvr              -      -     -   "Driver data" -
typedef   ^                           ^          ADI_Data                ADI              -      -     -   "AeroDyn InflowWind Data" -
typedef   ^                           ^          FED_Data                FED              -      -     -   "Elastic wind turbine data (Fake ElastoDyn)" "-"
typedef   ^                           ^          IntKi                   errStat          -      -     -   "" -
typedef   ^                           ^          character(ErrMsgLen)    errMsg           -      -     -   "" -
typedef   ^                           ^          logical                 initialized      -      -     -   "" -


