Skip to content
Merged
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
19 changes: 14 additions & 5 deletions glue-codes/fast-farm/src/FASTWrapper.f90
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ SUBROUTINE FWrap_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, Init

TYPE(FAST_ExternInitType) :: ExternInitData
INTEGER(IntKi) :: j,k,nb
REAL(ReKi) :: p0(3) ! hub location (in FAST with 0,0,0 as turbine reference)
REAL(R8Ki) :: orientation(3,3) ! temp orientation array

INTEGER(IntKi) :: ErrStat2 ! local error status
CHARACTER(ErrMsgLen) :: ErrMsg2 ! local error message
Expand Down Expand Up @@ -196,12 +198,19 @@ SUBROUTINE FWrap_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, Init
)
if (Failed()) return;

! set node initial position/orientation
! shortcut for
! call MeshPositionNode(m%ADRotorDisk(k), j, [0,0,r(j)], errStat2, errMsg2)
m%ADRotorDisk(k)%Position(3,:) = p%r ! this will get overwritten later, but we check that we have no zero-length elements in MeshCommit()
! set node initial position/orientation
! NOTE: the mesh data for ADRotorDisk gets overwritten before use so it isn't actually important
! that this match the method used later in the code. We can't use the method from later
! in the code since the `hub_theta_x_root` is not known at this point. So instead, we
! will use the input blade root orientation to set the direction. This does not result
! in a flat disk, but should allow the mesh mapping to work.
p0 = m%Turbine%AD%Input(1)%rotors(1)%HubMotion%Position(:,1) + m%Turbine%AD%Input(1)%rotors(1)%HubMotion%TranslationDisp(:,1)
m%ADRotorDisk(k)%RefOrientation(:,:,1) = m%Turbine%AD%Input(1)%rotors(1)%BladeRootMotion(k)%Orientation(:,:,1)
do j=1,p%nr
m%ADRotorDisk(k)%Position(:,j) = p0 + p%r(j)*m%ADRotorDisk(k)%RefOrientation(3,:,1)
end do
m%ADRotorDisk(k)%TranslationDisp = 0.0_R8Ki ! this happens by default, anyway....

! create line2 elements
do j=1,p%nr-1
call MeshConstructElement( m%ADRotorDisk(k), ELEMENT_LINE2, errStat2, errMsg2, p1=j, p2=j+1 ); if (Failed()) return;
Expand Down