Skip to content

Commit

Permalink
Disable LiDAR in IfW at FAST.Farm level
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-platt committed Dec 18, 2024
1 parent 5656574 commit cafbf80
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/inflowwind/src/InflowWind.f90
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,12 @@ SUBROUTINE InflowWind_Init( InitInp, InputGuess, p, ContStates, DiscStates, Cons
p%lidar%PulseSpacing = InputFileData%PulseSpacing
p%lidar%URefLid = InputFileData%URefLid
p%lidar%ConsiderHubMotion = InputFileData%ConsiderHubMotion


! Disable Lidar if not allowed (FAST.Farm doesn't allow this)
if (InitInp%LidarDisable) then
p%lidar%SensorType = SensorType_None
endif


CALL Lidar_Init( InitInp, InputGuess, p, ContStates, DiscStates, ConstrStateGuess, OtherStates, &
y, m, TimeInterval, InitOutData, TmpErrStat, TmpErrMsg )
Expand Down
1 change: 1 addition & 0 deletions modules/inflowwind/src/InflowWind.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ typedef ^ ^ ReKi WtrDpth
typedef ^ ^ ReKi MSL2SWL - - - "Mean sea level to still water level" m
typedef ^ ^ IntKi BoxExceedAllowIdx - -1 - "Extrapolate winds outside box starting at this index (for OLAF wakes and LidarSim)" -
typedef ^ ^ LOGICAL BoxExceedAllowF - .FALSE. - "Flag to allow Extrapolation winds outside box starting at this index (for OLAF wakes and LidarSim)" -
typedef ^ ^ LOGICAL LidarDisable - .true. - "Disable LiDAR for this instance of InflowWind? (FAST.Farm not compatible)" -


# Init Output
Expand Down
5 changes: 5 additions & 0 deletions modules/inflowwind/src/InflowWind_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,11 @@ SUBROUTINE InflowWind_ValidateInput( InitInp, InputFileData, ErrStat, ErrMsg )
CALL CTTS_ValidateInput()
ENDIF

if (InitInp%LidarDisable) then
if (InitInp%lidar%SensorType /= SensorType_None) then
call SetErrStat(ErrID_Warn, 'LiDAR cannot be used with this instance of InflowWind (not usable with FAST.Farm). Disabling LiDAR.', ErrStat, ErrMsg, RoutineName)
end if
endif

RETURN

Expand Down
7 changes: 7 additions & 0 deletions modules/inflowwind/src/InflowWind_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ MODULE InflowWind_Types
REAL(ReKi) :: MSL2SWL !< Mean sea level to still water level [m]
INTEGER(IntKi) :: BoxExceedAllowIdx = -1 !< Extrapolate winds outside box starting at this index (for OLAF wakes and LidarSim) [-]
LOGICAL :: BoxExceedAllowF = .FALSE. !< Flag to allow Extrapolation winds outside box starting at this index (for OLAF wakes and LidarSim) [-]
LOGICAL :: LidarDisable = .true. !< Disable LiDAR for this instance of InflowWind? (FAST.Farm not compatible) [-]
END TYPE InflowWind_InitInputType
! =======================
! ========= InflowWind_InitOutputType =======
Expand Down Expand Up @@ -1110,6 +1111,7 @@ SUBROUTINE InflowWind_CopyInitInput( SrcInitInputData, DstInitInputData, CtrlCod
DstInitInputData%MSL2SWL = SrcInitInputData%MSL2SWL
DstInitInputData%BoxExceedAllowIdx = SrcInitInputData%BoxExceedAllowIdx
DstInitInputData%BoxExceedAllowF = SrcInitInputData%BoxExceedAllowF
DstInitInputData%LidarDisable = SrcInitInputData%LidarDisable
END SUBROUTINE InflowWind_CopyInitInput

SUBROUTINE InflowWind_DestroyInitInput( InitInputData, ErrStat, ErrMsg, DEALLOCATEpointers )
Expand Down Expand Up @@ -1263,6 +1265,7 @@ SUBROUTINE InflowWind_PackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat
Re_BufSz = Re_BufSz + 1 ! MSL2SWL
Int_BufSz = Int_BufSz + 1 ! BoxExceedAllowIdx
Int_BufSz = Int_BufSz + 1 ! BoxExceedAllowF
Int_BufSz = Int_BufSz + 1 ! LidarDisable
IF ( Re_BufSz .GT. 0 ) THEN
ALLOCATE( ReKiBuf( Re_BufSz ), STAT=ErrStat2 )
IF (ErrStat2 /= 0) THEN
Expand Down Expand Up @@ -1438,6 +1441,8 @@ SUBROUTINE InflowWind_PackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat
Int_Xferred = Int_Xferred + 1
IntKiBuf(Int_Xferred) = TRANSFER(InData%BoxExceedAllowF, IntKiBuf(1))
Int_Xferred = Int_Xferred + 1
IntKiBuf(Int_Xferred) = TRANSFER(InData%LidarDisable, IntKiBuf(1))
Int_Xferred = Int_Xferred + 1
END SUBROUTINE InflowWind_PackInitInput

SUBROUTINE InflowWind_UnPackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg )
Expand Down Expand Up @@ -1662,6 +1667,8 @@ SUBROUTINE InflowWind_UnPackInitInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrS
Int_Xferred = Int_Xferred + 1
OutData%BoxExceedAllowF = TRANSFER(IntKiBuf(Int_Xferred), OutData%BoxExceedAllowF)
Int_Xferred = Int_Xferred + 1
OutData%LidarDisable = TRANSFER(IntKiBuf(Int_Xferred), OutData%LidarDisable)
Int_Xferred = Int_Xferred + 1
END SUBROUTINE InflowWind_UnPackInitInput

SUBROUTINE InflowWind_CopyInitOutput( SrcInitOutputData, DstInitOutputData, CtrlCode, ErrStat, ErrMsg )
Expand Down
1 change: 1 addition & 0 deletions modules/openfast-library/src/FAST_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ SUBROUTINE FAST_InitializeAll( t_initial, p_FAST, y_FAST, m_FAST, ED, BD, SrvD,
END IF

! lidar
Init%InData_IfW%LidarDisable = .false. ! allowed with OF, but not FF
Init%InData_IfW%lidar%Tmax = p_FAST%TMax
Init%InData_IfW%lidar%HubPosition = ED%y%HubPtMotion%Position(:,1)

Expand Down

0 comments on commit cafbf80

Please sign in to comment.