Skip to content

Commit

Permalink
ADI: add debugging info on blade mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-platt committed Jan 24, 2025
1 parent 507014d commit a2ce2c3
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions modules/aerodyn/src/AeroDyn_Inflow_C_Binding.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,9 @@ subroutine ADI_C_SetupRotor(iWT_c, TurbineIsHAWT_c, TurbOrigin_C, &
if (Failed()) return
endif

! check Mesh points for blade specification
call CheckMeshPts(iWT); if (Failed()) return

call SetupMotionMesh()

! Set error status
Expand Down Expand Up @@ -1541,8 +1544,9 @@ end function Failed0
!> This subroutine prints out all the variables that are passed in. Use this only
!! for debugging the interface on the Fortran side.
subroutine ShowPassedData()
character(1) :: TmpFlag
integer :: i,j
character(1) :: TmpFlag
integer :: i,j
character(35) :: TmpStr
call WrSCr("")
call WrScr("-----------------------------------------------------------")
call WrScr("Interface debugging: Variables passed in through interface")
Expand Down Expand Up @@ -1584,10 +1588,28 @@ subroutine ShowPassedData()
j=9*(i-1)
call WrMatrix(InitMeshOri_C(j+1:j+9),CU,'(9(ES23.15e2))')
enddo
call WrScr(" Node mapping")
call WrScr(" MeshPt Blade")
do i=1,int(NumMeshPts_C,IntKi)
write(TmpStr,'(15X,I5,10X,I5)') i,int(MeshPtToBladeNum_C(i),IntKi)
call WrScr(TmpStr)
enddo
endif
call WrScr("-----------------------------------------------------------")
end subroutine ShowPassedData

!> very basic checks on mesh points
subroutine CheckMeshPts(iWT)
integer(IntKi), intent(in) :: iWT
do i=1,size(MeshPtToBladeNum_C)
if ((MeshPtToBladeNum_C(i) < 1_c_int) .or. (MeshPtToBladeNum_C(i) > int(Sim%WT(iWT)%NumBlades))) then
ErrStat2=ErrID_Fatal
ErrMsg2 = 'Mesh Point '//trim(Num2LStr(i))//' assigned to invalid blade '//trim(Num2LStr(MeshPtToBladeNum_C(i)))//' on rotor '//trim(Num2LStr(iWT))
if (Failed()) return
endif
enddo
end subroutine CheckMeshPts

subroutine SetupMotionMesh()
real(ReKi) :: InitPos(3)
real(R8Ki) :: Orient(3,3)
Expand Down

0 comments on commit a2ce2c3

Please sign in to comment.