For some reason I can’t attach files to my posts. here’s the fortran code:
[code]program Aeroding
use AeroDyn
use sharedtypes
implicit none
INTEGER :: ErrStat, i, j
REAL(ReKi) :: time, Rotatebottom(3,3), test(3), time2
INTEGER :: Numbl, hubradius, nelem
LOGICAL :: OutputPlottingInfo
type(AeroConfig) :: ADInterfaceComponents
type(AD_InitOptions) :: ADOptions
type(AllAeroMarkers) :: ADAeroMarkers
type(AllAeroLoads) :: ADAeroLoads
type(AllAeroLoads) :: ADAeroLoads2
type(AeroLoadsOptions) :: ALOptions
CALL NWTC_Init(‘Aerotest’, ‘0.01’)
Numbl = 2
Hubradius=1
Nelem= 3
OutputPlottingInfo = .true.
ADOptions%ADInputFile = ‘aerodyn2.ipt’
ADOptions%OutRootName = ‘./out’
ADOptions%WrSumFile = .TRUE.
ADInterfaceComponents%Hub%Position( = 0.0
ADInterfaceComponents%Hub%Position(3) = 55
ADInterfaceComponents%Hub%Orientation(1,1) = 0.0
ADInterfaceComponents%Hub%Orientation(1,1) = 1.0
ADInterfaceComponents%Hub%Orientation(2,2) = 1.0
ADInterfaceComponents%Hub%Orientation(3,3) = 1.0
IF (.NOT. ALLOCATED( ADInterfaceComponents%Blade ) ) THEN
ALLOCATE( ADInterfaceComponents%Blade( NumBl ), STAT = ErrStat )
IF ( ErrStat /= 0 ) THEN
CALL ProgAbort( ’ Error allocating space for ADInterfaceComponents%Blade.’ )
END IF
END IF
IF (.NOT. ALLOCATED( ADAeroLoads%Blade ) ) THEN
ALLOCATE( ADAeroLoads%Blade(Nelem, NumBl ), STAT = ErrStat )
IF ( ErrStat /= 0 ) THEN
CALL ProgAbort( ’ Error allocating space for ADAeroLoads%Blade.’ )
END IF
END IF
IF (.NOT. ALLOCATED( ADAeroLoads2%Blade ) ) THEN
ALLOCATE( ADAeroLoads2%Blade(Nelem, NumBl ), STAT = ErrStat )
IF ( ErrStat /= 0 ) THEN
CALL ProgAbort( ’ Error allocating space for ADAeroLoads2%Blade.’ )
END IF
END IF
ADInterfaceComponents%Blade(1)%Position(1) = 0.0
ADInterfaceComponents%Blade(1)%Position(2) = 0.0
ADInterfaceComponents%Blade(1)%Position(3) = 56
ADInterfaceComponents%Blade(1)%TranslationVel( = 0.0
ADInterfaceComponents%Blade(1)%RotationVel( = 0.0
ADInterfaceComponents%Blade(1)%Orientation(1,1) = 0
ADInterfaceComponents%Blade(1)%Orientation(2,1) = 0.0
ADInterfaceComponents%Blade(1)%Orientation(3,1) = 1.0
ADInterfaceComponents%Blade(1)%Orientation(1,2) = 0.0
ADInterfaceComponents%Blade(1)%Orientation(2,2) = 1.0
ADInterfaceComponents%Blade(1)%Orientation(3,2) = 0.0
ADInterfaceComponents%Blade(1)%Orientation(1,3) = 0
ADInterfaceComponents%Blade(1)%Orientation(2,3) = 0.0
ADInterfaceComponents%Blade(1)%Orientation(3,3) = 1
ADInterfaceComponents%Blade(2)%Position(1) = 0
ADInterfaceComponents%Blade(2)%Position(2) = 0.0
ADInterfaceComponents%Blade(2)%Position(3) = 54
ADInterfaceComponents%Blade(2)%TranslationVel( = 0.0
ADInterfaceComponents%Blade(2)%RotationVel( = 0.0
ADInterfaceComponents%Blade(2)%Orientation(1,1) = 0
ADInterfaceComponents%Blade(2)%Orientation(2,1) = 0.0
ADInterfaceComponents%Blade(2)%Orientation(3,1) = 1.0
ADInterfaceComponents%Blade(2)%Orientation(1,2) = 0.0
ADInterfaceComponents%Blade(2)%Orientation(2,2) = -1.0
ADInterfaceComponents%Blade(2)%Orientation(3,2) = 0.0
ADInterfaceComponents%Blade(2)%Orientation(1,3) = 0
ADInterfaceComponents%Blade(2)%Orientation(2,3) = 0.0
ADInterfaceComponents%Blade(2)%Orientation(3,3) = -1
ADInterfaceComponents%BladeLength = 15
ADInterfaceComponents%RotorFurl%Position(1) = 0.0
ADInterfaceComponents%RotorFurl%Position(2) = 0.0
ADInterfaceComponents%RotorFurl%Position(3) = 54.5
ADInterfaceComponents%RotorFurl%Orientation(1,1) = 1
ADInterfaceComponents%RotorFurl%Orientation(2,1) = 0.0
ADInterfaceComponents%RotorFurl%Orientation(3,1) = 0.0
ADInterfaceComponents%RotorFurl%Orientation(1,2) = 0.0
ADInterfaceComponents%RotorFurl%Orientation(2,2) = 1.0
ADInterfaceComponents%RotorFurl%Orientation(3,2) = 0.0
ADInterfaceComponents%RotorFurl%Orientation(1,3) = 0.0
ADInterfaceComponents%RotorFurl%Orientation(2,3) = 0.0
ADInterfaceComponents%RotorFurl%Orientation(3,3) = 1
ADInterfaceComponents%RotorFurl%TranslationVel( = 0.0
ADInterfaceComponents%RotorFurl%RotationVel( = 0.0
ADInterfaceComponents%Nacelle%Position(1) = -1
ADInterfaceComponents%Nacelle%Position(2) = 0.0
ADInterfaceComponents%Nacelle%Position(3) = 0
ADInterfaceComponents%Nacelle%Orientation(1,1) = 1
ADInterfaceComponents%Nacelle%Orientation(2,1) = 0.0
ADInterfaceComponents%Nacelle%Orientation(3,1) = 0.0
ADInterfaceComponents%Nacelle%Orientation(1,2) = 0.0
ADInterfaceComponents%Nacelle%Orientation(2,2) = 1.0
ADInterfaceComponents%Nacelle%Orientation(3,2) = 0.0
ADInterfaceComponents%Nacelle%Orientation(1,3) = 0.0
ADInterfaceComponents%Nacelle%Orientation(2,3) = 0.0
ADInterfaceComponents%Nacelle%Orientation(3,3) = 1
ADInterfaceComponents%Nacelle%TranslationVel( = 0.0
ADInterfaceComponents%Nacelle%RotationVel( = 0.0
ADInterfaceComponents%Tower%Position(1) = 0
ADInterfaceComponents%Tower%Position(2) = 0.0
ADInterfaceComponents%Tower%Position(3) = 0
ADInterfaceComponents%Tower%Orientation(1,1) = 0
ADInterfaceComponents%Tower%Orientation(2,1) = 0.0
ADInterfaceComponents%Tower%Orientation(3,1) = 1.0
ADInterfaceComponents%Tower%Orientation(1,2) = 0.0
ADInterfaceComponents%Tower%Orientation(2,2) = 1.0
ADInterfaceComponents%Tower%Orientation(3,2) = 0.0
ADInterfaceComponents%Tower%Orientation(1,3) = 1.0
ADInterfaceComponents%Tower%Orientation(2,3) = 0.0
ADInterfaceComponents%Tower%Orientation(3,3) = 0
ADInterfaceComponents%Tower%TranslationVel( = 0.0
ADInterfaceComponents%Tower%RotationVel( = 0.0
ALLOCATE(ALOptions%SetMulTabLoc(3,2))
ALLOCATE(ALOptions%MulTabLoc(3,2))
ALOptions%SetMulTabLoc(:, = .FALSE.
ALOptions%LinearizeFlag = .FALSE.
ErrStat = 0
time = 0
ADAeroMarkers = AD_Init(ADOptions, ADInterfaceComponents, ErrStat)
write(,) 'Hub radius ’ , DOT_PRODUCT(ADInterfaceComponents%Blade(2)%Position( - ADInterfaceComponents%Hub%Position(:), ADInterfaceComponents%Blade(2)%Orientation(3, )
!write(,) 'Tip radius ’ , ADInterfaceComponents%BladeLength + HubRadius
!! AD_Init gives BLADE FIXED coordinates of the aerodynamic markers, AD_CaculateLoads needs GLOBAL coordinates to function.
Rotatebottom(1,1)=1
Rotatebottom(1,2)=0
Rotatebottom(1,3)=0
Rotatebottom(2,1)=0
Rotatebottom(2,2)=-1
Rotatebottom(2,3)=0
Rotatebottom(3,1)=0
Rotatebottom(3,2)=0
Rotatebottom(3,3)=-1
!Change orientation on bottom blade
do i=1, nelem
ADAeromarkers%Blade(i,2)%Orientation(:,:)=matmul(ADAeromarkers%Blade(i,2)%Orientation(:,:),RotateBottom(:,:))
enddo
do i=1, Nelem
ADAeromarkers%Blade(i,2)%Position=Matmul(Rotatebottom,ADAeromarkers%Blade(i,2)%Position)
enddo
! Offset position for GLOBAL reference frame
do j=1, 3
ADAeroMarkers%Blade(j,1)%Position(3)=ADAeroMarkers%Blade(j,1)%Position(3)+50+hubradius
ADAeroMarkers%Blade(j,2)%Position(3)=ADAeroMarkers%Blade(j,2)%Position(3)+50-hubradius
enddo
!write(,) ‘Rotorfurl’, ADAeroMarkers%RotorFurl(1)%Position(
ADAeroMarkers%Hub%Position(3)=ADAeroMarkers%Hub%Position(3)+50
ADAeroMarkers%RotorFurl%Position(3)=ADAeroMarkers%RotorFurl%Position(3)+50
ADAeroMarkers%Nacelle%Position(3)=ADAeroMarkers%Nacelle%Position(3)+50
ADAeroMarkers%Tower%Position(3)=ADAeroMarkers%Tower%Position(3)+50
ADAeroMarkers%Tail%Position(3)=ADAeroMarkers%Tail%Position(3)+50
!write(,) ADAeromarkers%Blade(3,2)%Position
! Read a value if interested.
!do, i=1,3
!write(,) ( Rotatebottom(i,j), j=1,3 )
!enddo
! Read a value if interested.
!DO i = 1, 3
!PRINT*,(ADAeroMarkers%Blade(3,2)%Position(i))
!END DO
!write(,) ADInterfaceComponents%Rotorfurl%RotationVel
!do, i=1,3
!write(,) ( ADAeromarkers%Blade(1,1)%Orientation(i,j), j=1,3 )
!enddo
do time=0,1,0.02
ADAeroLoads = AD_CalculateLoads(time,ADAeroMarkers,ADInterfaceComponents,ALOptions,ErrStat)
write(,) 'Time is ', time
write(,) ‘Force components’, ADAeroLoads%Blade(1,1)%Force(
write(,) ‘Moment components’, ADAeroLoads%Blade(1,1)%Moment(
!write(,) 'Orientation of el1 bl1 ', ADAeromarkers%Blade(2,2)%Position(:,
end do
time2 = 0
ADAeroLoads2 = AD_CalculateLoads(time2,ADAeroMarkers,ADInterfaceComponents,ALOptions,ErrStat)
write(,) ‘Time is’, time2
write(,) ‘Force components’, ADAeroLoads2%Blade(1,1)%Force(
write(,) ‘Moment components’, ADAeroLoads2%Blade(1,1)%Moment(
CALL AD_Terminate(ErrStat)
end program Aeroding[/code]
Steady wind input file:
! Steady wind file created 7/22/98 7:58:37 PM by YawDynVB Version 2.0
! Time Wind Wind Vert. Horiz. Vert. LinV Gust
! Speed Dir Speed Shear Shear Shear Speed
0.0 5 0 0 0 0 0 0
630.0 20 0 0 0 0 0 0
And finally the AeroDyn input file:
Combined Experiment Baseline for YawDyn version 12.5
SI SysUnits - System of units for used for input and output [must be SI for FAST] (unquoted string)
STEADY StallMod - Dynamic stall included [BEDDOES or STEADY] (unquoted string)
USE_CM UseCm - Use aerodynamic pitching moment model? [USE_CM or NO_CM] (unquoted string)
EQUIL InfModel - Inflow model [DYNIN or EQUIL] (unquoted string)
SWIRL IndModel - Induction-factor model [NONE or WAKE or SWIRL] (unquoted string)
5.0000E-03 AToler - Induction-factor tolerance (convergence criteria) (-)
PRANDtl TLModel - Tip-loss model (EQUIL only) [PRANDtl, GTECH, or NONE] (unquoted string)
PRANDtl HLModel - Hub-loss model (EQUIL only) [PRANDtl or NONE] (unquoted string)
"TurbSim.wnd" WindFile - Name of file containing wind data (quoted string)
55.0 HH - Wind reference (hub) height [TowerHt+Twr2Shft+OverHang*SIN(ShftTilt)] (m)
0 TwrShad - Tower-shadow velocity deficit (-)
9999.9 ShadHWid - Tower-shadow half width (m)
9999.9 T_Shad_Refpt - Tower-shadow reference point (m)
1.225 AirDens - Air density (kg/m^3)
1.625e-5 KinVisc - Kinematic air viscosity (m^2/sec)
0.025 DTAero - Time interval for aerodynamic calculations (sec)
1 NumFoil - Number of airfoil files (-)
"S809_cln.dat" FoilNm - Names of the airfoil files [NumFoil lines] (quoted strings)
3 BldNodes - Number of blade nodes used for analysis (-)
RELM Twist DR Chord NFoil ElPrList { Twist ignored by ADAMS (but placeholders must be present) }
3.5 5.0000 5 1.5000 1 PRINT
8.5 5.0000 5 1.5000 1 PRINT
13.5 5.0000 5 1.5000 1 PRINT