Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
513 changes: 490 additions & 23 deletions modules/aerodyn/src/AeroDyn.f90

Large diffs are not rendered by default.

185 changes: 176 additions & 9 deletions modules/aerodyn/src/AeroDyn_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ SUBROUTINE ParsePrimaryFileInfo( PriPath, InitInp, InputFile, RootName, NumBlade
character(ErrMsgLen) :: ErrMsg2 !< Temporary Error message
character(ErrMsgLen) :: ErrMsg_NoAllBldNdOuts
integer(IntKi) :: CurLine !< current entry in FileInfo_In%Lines array
real(ReKi) :: TmpRe7(7) !< temporary 8 number array for reading values in
real(ReKi) :: TmpRe10(10) !< temporary 10 number array for reading values in
logical :: TwrAeroLogical !< convert TwrAero from logical (input file) to integer (new)
character(1024) :: sDummy !< temporary string
character(1024) :: tmpOutStr !< temporary string for writing to screen
Expand Down Expand Up @@ -1111,18 +1111,84 @@ SUBROUTINE ParsePrimaryFileInfo( PriPath, InitInp, InputFile, RootName, NumBlade
CALL AllocAry( InputFileData%rotors(iR)%TwrCa, InputFileData%rotors(iR)%NumTwrNds, 'TwrCa', ErrStat2, ErrMsg2)
if (Failed()) return
do I=1,InputFileData%rotors(iR)%NumTwrNds
call ParseAry ( FileInfo_In, CurLine, 'Properties for tower node '//trim( Int2LStr( I ) )//'.', TmpRe7, 7, ErrStat2, ErrMsg2, UnEc )
call ParseAry ( FileInfo_In, CurLine, 'Properties for tower node '//trim( Int2LStr( I ) )//'.', TmpRe10, 7, ErrStat2, ErrMsg2, UnEc )
if (Failed()) return;
InputFileData%rotors(iR)%TwrElev(I) = TmpRe7( 1)
InputFileData%rotors(iR)%TwrDiam(I) = TmpRe7( 2)
InputFileData%rotors(iR)%TwrCd(I) = TmpRe7( 3)
InputFileData%rotors(iR)%TwrTI(I) = TmpRe7( 4)
InputFileData%rotors(iR)%TwrCb(I) = TmpRe7( 5)
InputFileData%rotors(iR)%TwrCp(I) = TmpRe7( 6)
InputFileData%rotors(iR)%TwrCa(I) = TmpRe7( 7)
InputFileData%rotors(iR)%TwrElev(I) = TmpRe10( 1)
InputFileData%rotors(iR)%TwrDiam(I) = TmpRe10( 2)
InputFileData%rotors(iR)%TwrCd(I) = TmpRe10( 3)
InputFileData%rotors(iR)%TwrTI(I) = TmpRe10( 4)
InputFileData%rotors(iR)%TwrCb(I) = TmpRe10( 5)
InputFileData%rotors(iR)%TwrCp(I) = TmpRe10( 6)
InputFileData%rotors(iR)%TwrCa(I) = TmpRe10( 7)
end do
enddo

!====== General support structure joints ============================================================
if ( InputFileData%Echo ) WRITE(UnEc, '(A)') FileInfo_In%Lines(CurLine) ! Write section break to echo
CurLine = CurLine + 1
! NumGSJoints - Number of general support joints used in the analysis (-)
call ParseVar( FileInfo_In, CurLine, "NumGSJoints", InputFileData%GS%NJoints, ErrStat2, ErrMsg2, UnEc )
if (Failed()) return
!GSJointID GSJointXi GSJointYi GSJointZi
if ( InputFileData%Echo ) WRITE(UnEc, '(A)') 'GS Joint Table Header: '//FileInfo_In%Lines(CurLine) ! Write section break to echo
CurLine = CurLine + 1
!(-) (m) (m) (m)
if ( InputFileData%Echo ) WRITE(UnEc, '(A)') 'GS Joint Table Header: '//FileInfo_In%Lines(CurLine) ! Write section break to echo
CurLine = CurLine + 1

! Allocate space for general support joint table
allocate( InputFileData%GS%InpJoints(InputFileData%GS%NJoints), STAT = ErrStat2)
if ( ErrStat2 /= 0 ) then
ErrStat2 = ErrID_Fatal
ErrMsg2 = 'Error allocating space for GSInpJoints array.'
if (Failed()) return;
end if

do I=1,InputFileData%GS%NJoints
call ParseAry ( FileInfo_In, CurLine, 'General support joint '//trim( Int2LStr( I ) )//'.', TmpRe10, 4, ErrStat2, ErrMsg2, UnEc )
if (Failed()) return;
InputFileData%GS%InpJoints(I)%JointID = NINT(TmpRe10(1))
InputFileData%GS%InpJoints(I)%position(1) = TmpRe10(2)
InputFileData%GS%InpJoints(I)%position(2) = TmpRe10(3)
InputFileData%GS%InpJoints(I)%position(3) = TmpRe10(4)
end do

!====== General support structure members ============================================================
if ( InputFileData%Echo ) WRITE(UnEc, '(A)') FileInfo_In%Lines(CurLine) ! Write section break to echo
CurLine = CurLine + 1
! NumGSMembers - Number of general support members used in the analysis (-)
call ParseVar( FileInfo_In, CurLine, "NumGSMembers", InputFileData%GS%NMembers, ErrStat2, ErrMsg2, UnEc )
if (Failed()) return
!GSMemberID GSMJointID1 GSMJointID2 GSMDia1 GSMDia2 GSMCd1 GSMCd2 GSMTI1 GSMTI2 GSMDiv
if ( InputFileData%Echo ) WRITE(UnEc, '(A)') 'GS Joint Table Header: '//FileInfo_In%Lines(CurLine) ! Write section break to echo
CurLine = CurLine + 1
!(-) (-) (-) (m) (m) (-) (-) (-) (-) (-)
if ( InputFileData%Echo ) WRITE(UnEc, '(A)') 'GS Joint Table Header: '//FileInfo_In%Lines(CurLine) ! Write section break to echo
CurLine = CurLine + 1

! Allocate space for general support joint table
allocate( InputFileData%GS%InpMembers(InputFileData%GS%NMembers), STAT = ErrStat2)
if ( ErrStat2 /= 0 ) then
ErrStat2 = ErrID_Fatal
ErrMsg2 = 'Error allocating space for GSInpMembers array.'
if (Failed()) return;
end if

do I=1,InputFileData%GS%NMembers
call ParseAry ( FileInfo_In, CurLine, 'General support member '//trim( Int2LStr( I ) )//'.', TmpRe10, 10, ErrStat2, ErrMsg2, UnEc )
if (Failed()) return;
InputFileData%GS%InpMembers(I)%MemberID = NINT(TmpRe10( 1))
InputFileData%GS%InpMembers(I)%MJointID1 = NINT(TmpRe10( 2))
InputFileData%GS%InpMembers(I)%MJointID2 = NINT(TmpRe10( 3))
InputFileData%GS%InpMembers(I)%MDiam1 = TmpRe10( 4)
InputFileData%GS%InpMembers(I)%MDiam2 = TmpRe10( 5)
InputFileData%GS%InpMembers(I)%MCd1 = TmpRe10( 6)
InputFileData%GS%InpMembers(I)%MCd2 = TmpRe10( 7)
InputFileData%GS%InpMembers(I)%MTI1 = TmpRe10( 8)
InputFileData%GS%InpMembers(I)%MTI2 = TmpRe10( 9)
InputFileData%GS%InpMembers(I)%MDivSize = TmpRe10(10)
end do

!====== Outputs ====================================================================================
if ( InputFileData%Echo ) WRITE(UnEc, '(A)') FileInfo_In%Lines(CurLine) ! Write section break to echo
CurLine = CurLine + 1
Expand Down Expand Up @@ -2104,6 +2170,107 @@ END SUBROUTINE AD_PrintSum
!----------------------------------------------------------------------------------------------------------------------------------


!----------------------------------------------------------------------------------------------------------------------------------
SUBROUTINE AD_PrintSum_GS( p, p_AD, u, y, ErrStat, ErrMsg )
! This routine generates the summary file, which contains a summary of input file options.
use YAML, only: yaml_write_var
! passed variables
TYPE(GSParameterType), INTENT(IN) :: p ! Parameters
TYPE(AD_ParameterType), INTENT(IN) :: p_AD ! Parameters
TYPE(RotInputType), INTENT(IN) :: u ! inputs
TYPE(RotOutputType), INTENT(IN) :: y ! outputs

INTEGER(IntKi), INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg

! Local variables.

INTEGER(IntKi) :: I, J ! Generic loop counter
INTEGER(IntKi) :: JointID, NodeIndx
INTEGER(IntKi) :: UnSu ! I/O unit number for the summary output file
CHARACTER(100) :: Msg ! temporary string for writing appropriate text to summary file

if (p%NMembers<=0_IntKi) return

! Open the summary file and give it a heading.

!$OMP critical(fileopen_critical)
CALL GetNewUnit( UnSu, ErrStat, ErrMsg )
CALL OpenFOutFile ( UnSu, TRIM( p_AD%RootName )//'.GS.sum', ErrStat, ErrMsg )
!$OMP end critical(fileopen_critical)
IF ( ErrStat >= AbortErrLev ) RETURN

! Heading:
WRITE (UnSu,'(/,A)') 'This summary information was generated by '//TRIM( GetNVD(AD_Ver) )// &
' on '//CurDate()//' at '//CurTime()//'.'

WRITE (UnSu,'(/,/,A)') '====== General support structure =================================================================='

select case (p%GSPotent)
case (GSPotent_none)
Msg = 'none'
case (GSPotent_baseline)
Msg = 'baseline model'
case (GSPotent_bak)
Msg = "Bak correction"
case default
Msg = 'unknown'
end select
WRITE (UnSu,'(/,A)') 'Potential-flow influence model: '//trim(num2lstr(p%GSPotent))//' ('//trim(Msg)//')'

select case (p%GSShadow)
case (GSShadow_none)
Msg = 'none'
case (GSShadow_Powles)
Msg = 'Powles model'
case (GSShadow_Eames)
Msg = "Eames model"
case default
Msg = 'unknown'
end select
WRITE (UnSu,'(A)') 'Downstream shadow/wake model: '//trim(num2lstr(p%GSShadow))//' ('//trim(Msg)//')'

select case (p%GSAero)
case (GSAero_none)
Msg = 'none'
case (GSAero_NoVIV)
Msg = 'drag only'
case default
Msg = 'unknown'
end select
WRITE (UnSu,'(A)') 'Flow-induced load model: '//trim(num2lstr(p%GSAero))//' ('//trim(Msg)//')'

WRITE (UnSu,'(/,A)') 'Number of joints: '//trim(num2lstr(p%NJoints))
WRITE (UnSu,'(A)') 'Number of members: '//trim(num2lstr(p%NMembers))
WRITE (UnSu,'(A)') 'Number of nodes: '//trim(num2lstr(u%GSMotion%Nnodes))//' (joints + member interior nodes)'

WRITE (UnSu,'(/,A)') 'In the table below, a member interior node will have joint ID -1.'

! MemberID, JointID, NodeIndx, NodeX, NodeY, NodeZ, R, Cd, TI
WRITE (UnSu,'(/,9(1x,A14))') 'MemberID', 'JointID', 'NodeIndx', 'Node_xi', 'Node_yi', 'Node_zi', 'Node_R', 'Node_Cd', 'Node_TI'
WRITE (UnSu,'(9(1x,A14))') ' (-)', ' (-)', ' (-)', ' (m)', ' (m)', ' (m)', ' (m)', ' (-)', ' (-)'
DO I=1,p%NMembers
associate(mem=>p%Members(I))
DO J=1,p%Members(I)%NElements+1
NodeIndx = mem%NodeIndx(J)
IF (NodeIndx<=p%NJoints) THEN
JointID = p%Joints(NodeIndx)%JointID
ELSE
JointID = -1
END IF
WRITE(UnSu,'(3(I15),6(F15.6))') &
mem%MemberID, JointID, NodeIndx, &
u%GSMotion%position(1,NodeIndx), u%GSMotion%position(2,NodeIndx), u%GSMotion%position(3,NodeIndx), &
mem%R(J),mem%Cd(J),mem%TI(J)
END DO
end associate
END DO
CLOSE(UnSu)
RETURN
END SUBROUTINE AD_PrintSum_GS
!----------------------------------------------------------------------------------------------------------------------------------


!**********************************************************************************************************************************
! NOTE: The following lines of code were generated by a Matlab script called "Write_ChckOutLst.m"
! using the parameters listed in the "OutListParameters.xlsx" Excel file. Any changes to these
Expand Down
40 changes: 29 additions & 11 deletions modules/aerodyn/src/AeroDyn_Inflow_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,19 @@ MODULE AeroDyn_Inflow_Types
integer(IntKi), public, parameter :: ADI_u_AD_rotors_BladeRootMotion = 15 ! ADI%AD%rotors(DL%i1)%BladeRootMotion(DL%i2)
integer(IntKi), public, parameter :: ADI_u_AD_rotors_BladeMotion = 16 ! ADI%AD%rotors(DL%i1)%BladeMotion(DL%i2)
integer(IntKi), public, parameter :: ADI_u_AD_rotors_TFinMotion = 17 ! ADI%AD%rotors(DL%i1)%TFinMotion
integer(IntKi), public, parameter :: ADI_u_AD_rotors_UserProp = 18 ! ADI%AD%rotors(DL%i1)%UserProp
integer(IntKi), public, parameter :: ADI_y_AD_rotors_NacelleLoad = 19 ! ADI%AD%rotors(DL%i1)%NacelleLoad
integer(IntKi), public, parameter :: ADI_y_AD_rotors_HubLoad = 20 ! ADI%AD%rotors(DL%i1)%HubLoad
integer(IntKi), public, parameter :: ADI_y_AD_rotors_TowerLoad = 21 ! ADI%AD%rotors(DL%i1)%TowerLoad
integer(IntKi), public, parameter :: ADI_y_AD_rotors_BladeLoad = 22 ! ADI%AD%rotors(DL%i1)%BladeLoad(DL%i2)
integer(IntKi), public, parameter :: ADI_y_AD_rotors_TFinLoad = 23 ! ADI%AD%rotors(DL%i1)%TFinLoad
integer(IntKi), public, parameter :: ADI_y_AD_rotors_WriteOutput = 24 ! ADI%AD%rotors(DL%i1)%WriteOutput
integer(IntKi), public, parameter :: ADI_y_HHVel = 25 ! ADI%HHVel
integer(IntKi), public, parameter :: ADI_y_PLExp = 26 ! ADI%PLExp
integer(IntKi), public, parameter :: ADI_y_IW_WriteOutput = 27 ! ADI%IW_WriteOutput
integer(IntKi), public, parameter :: ADI_y_WriteOutput = 28 ! ADI%WriteOutput
integer(IntKi), public, parameter :: ADI_u_AD_rotors_GSMotion = 18 ! ADI%AD%rotors(DL%i1)%GSMotion
integer(IntKi), public, parameter :: ADI_u_AD_rotors_UserProp = 19 ! ADI%AD%rotors(DL%i1)%UserProp
integer(IntKi), public, parameter :: ADI_y_AD_rotors_NacelleLoad = 20 ! ADI%AD%rotors(DL%i1)%NacelleLoad
integer(IntKi), public, parameter :: ADI_y_AD_rotors_HubLoad = 21 ! ADI%AD%rotors(DL%i1)%HubLoad
integer(IntKi), public, parameter :: ADI_y_AD_rotors_TowerLoad = 22 ! ADI%AD%rotors(DL%i1)%TowerLoad
integer(IntKi), public, parameter :: ADI_y_AD_rotors_BladeLoad = 23 ! ADI%AD%rotors(DL%i1)%BladeLoad(DL%i2)
integer(IntKi), public, parameter :: ADI_y_AD_rotors_TFinLoad = 24 ! ADI%AD%rotors(DL%i1)%TFinLoad
integer(IntKi), public, parameter :: ADI_y_AD_rotors_GSLoad = 25 ! ADI%AD%rotors(DL%i1)%GSLoad
integer(IntKi), public, parameter :: ADI_y_AD_rotors_WriteOutput = 26 ! ADI%AD%rotors(DL%i1)%WriteOutput
integer(IntKi), public, parameter :: ADI_y_HHVel = 27 ! ADI%HHVel
integer(IntKi), public, parameter :: ADI_y_PLExp = 28 ! ADI%PLExp
integer(IntKi), public, parameter :: ADI_y_IW_WriteOutput = 29 ! ADI%IW_WriteOutput
integer(IntKi), public, parameter :: ADI_y_WriteOutput = 30 ! ADI%WriteOutput

contains

Expand Down Expand Up @@ -1980,6 +1982,8 @@ function ADI_InputMeshPointer(u, DL) result(Mesh)
Mesh => u%AD%rotors(DL%i1)%BladeMotion(DL%i2)
case (ADI_u_AD_rotors_TFinMotion)
Mesh => u%AD%rotors(DL%i1)%TFinMotion
case (ADI_u_AD_rotors_GSMotion)
Mesh => u%AD%rotors(DL%i1)%GSMotion
end select
end function

Expand All @@ -1999,6 +2003,8 @@ function ADI_OutputMeshPointer(y, DL) result(Mesh)
Mesh => y%AD%rotors(DL%i1)%BladeLoad(DL%i2)
case (ADI_y_AD_rotors_TFinLoad)
Mesh => y%AD%rotors(DL%i1)%TFinLoad
case (ADI_y_AD_rotors_GSLoad)
Mesh => y%AD%rotors(DL%i1)%GSLoad
end select
end function

Expand Down Expand Up @@ -2191,6 +2197,8 @@ subroutine ADI_VarPackInput(V, u, ValAry)
call MV_PackMesh(V, u%AD%rotors(DL%i1)%BladeMotion(DL%i2), ValAry) ! Mesh
case (ADI_u_AD_rotors_TFinMotion)
call MV_PackMesh(V, u%AD%rotors(DL%i1)%TFinMotion, ValAry) ! Mesh
case (ADI_u_AD_rotors_GSMotion)
call MV_PackMesh(V, u%AD%rotors(DL%i1)%GSMotion, ValAry) ! Mesh
case (ADI_u_AD_rotors_UserProp)
VarVals = u%AD%rotors(DL%i1)%UserProp(V%iLB:V%iUB,V%j) ! Rank 2 Array
case default
Expand Down Expand Up @@ -2227,6 +2235,8 @@ subroutine ADI_VarUnpackInput(V, ValAry, u)
call MV_UnpackMesh(V, ValAry, u%AD%rotors(DL%i1)%BladeMotion(DL%i2)) ! Mesh
case (ADI_u_AD_rotors_TFinMotion)
call MV_UnpackMesh(V, ValAry, u%AD%rotors(DL%i1)%TFinMotion) ! Mesh
case (ADI_u_AD_rotors_GSMotion)
call MV_UnpackMesh(V, ValAry, u%AD%rotors(DL%i1)%GSMotion) ! Mesh
case (ADI_u_AD_rotors_UserProp)
u%AD%rotors(DL%i1)%UserProp(V%iLB:V%iUB, V%j) = VarVals ! Rank 2 Array
end select
Expand All @@ -2249,6 +2259,8 @@ function ADI_InputFieldName(DL) result(Name)
Name = "u%AD%rotors("//trim(Num2LStr(DL%i1))//")%BladeMotion("//trim(Num2LStr(DL%i2))//")"
case (ADI_u_AD_rotors_TFinMotion)
Name = "u%AD%rotors("//trim(Num2LStr(DL%i1))//")%TFinMotion"
case (ADI_u_AD_rotors_GSMotion)
Name = "u%AD%rotors("//trim(Num2LStr(DL%i1))//")%GSMotion"
case (ADI_u_AD_rotors_UserProp)
Name = "u%AD%rotors("//trim(Num2LStr(DL%i1))//")%UserProp"
case default
Expand Down Expand Up @@ -2282,6 +2294,8 @@ subroutine ADI_VarPackOutput(V, y, ValAry)
call MV_PackMesh(V, y%AD%rotors(DL%i1)%BladeLoad(DL%i2), ValAry) ! Mesh
case (ADI_y_AD_rotors_TFinLoad)
call MV_PackMesh(V, y%AD%rotors(DL%i1)%TFinLoad, ValAry) ! Mesh
case (ADI_y_AD_rotors_GSLoad)
call MV_PackMesh(V, y%AD%rotors(DL%i1)%GSLoad, ValAry) ! Mesh
case (ADI_y_AD_rotors_WriteOutput)
VarVals = y%AD%rotors(DL%i1)%WriteOutput(V%iLB:V%iUB) ! Rank 1 Array
case (ADI_y_HHVel)
Expand Down Expand Up @@ -2324,6 +2338,8 @@ subroutine ADI_VarUnpackOutput(V, ValAry, y)
call MV_UnpackMesh(V, ValAry, y%AD%rotors(DL%i1)%BladeLoad(DL%i2)) ! Mesh
case (ADI_y_AD_rotors_TFinLoad)
call MV_UnpackMesh(V, ValAry, y%AD%rotors(DL%i1)%TFinLoad) ! Mesh
case (ADI_y_AD_rotors_GSLoad)
call MV_UnpackMesh(V, ValAry, y%AD%rotors(DL%i1)%GSLoad) ! Mesh
case (ADI_y_AD_rotors_WriteOutput)
y%AD%rotors(DL%i1)%WriteOutput(V%iLB:V%iUB) = VarVals ! Rank 1 Array
case (ADI_y_HHVel)
Expand Down Expand Up @@ -2352,6 +2368,8 @@ function ADI_OutputFieldName(DL) result(Name)
Name = "y%AD%rotors("//trim(Num2LStr(DL%i1))//")%BladeLoad("//trim(Num2LStr(DL%i2))//")"
case (ADI_y_AD_rotors_TFinLoad)
Name = "y%AD%rotors("//trim(Num2LStr(DL%i1))//")%TFinLoad"
case (ADI_y_AD_rotors_GSLoad)
Name = "y%AD%rotors("//trim(Num2LStr(DL%i1))//")%GSLoad"
case (ADI_y_AD_rotors_WriteOutput)
Name = "y%AD%rotors("//trim(Num2LStr(DL%i1))//")%WriteOutput"
case (ADI_y_HHVel)
Expand Down
Loading
Loading