Skip to content

Commit 2bb9471

Browse files
ADI_c: set OutputAccel flag for IfW with MHK (#27)
* ADI_c: set `OutputAccel` flag for IfW with MHK * ADI cbind: pass the OutputAccel flag through AeroDyn_Inflow.f90 * AD driver: set OutputAccel flag for IfW * Remove hard coded OutputAccel flag in favor of input file --------- Co-authored-by: Rafael M Mudafort <[email protected]>
1 parent c5c4dff commit 2bb9471

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

modules/aerodyn/src/AeroDyn_Driver_Subs.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ subroutine Init_ADI_ForDriver(iCase, ADI, dvr, FED, dt, needInitIW, errStat, err
477477
InitInp%IW_InitInp%RefHt = dvr%IW_InitInp%RefHt
478478
InitInp%IW_InitInp%PLExp = dvr%IW_InitInp%PLExp
479479
InitInp%IW_InitInp%MHK = dvr%MHK
480+
InitInp%IW_InitInp%OutputAccel= dvr%MHK /= MHK_None
480481
InitInp%IW_InitInp%FilePassingMethod = 0_IntKi ! read input file instead of passed file data
481482
! AeroDyn
482483
InitInp%AD%Gravity = 9.80665_ReKi

modules/aerodyn/src/AeroDyn_Inflow.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,11 @@ subroutine ADI_InitInflowWind(Root, i_IW, u_AD, o_AD, IW, dt, InitOutData, errSt
388388
endif
389389
InitInData%RootName = trim(Root)//'.IfW'
390390
InitInData%MHK = i_IW%MHK
391-
InitInData%OutputAccel = .TRUE. ! TODO: Set via input file or c driver flag
392391
! OLAF might be used in AD, in which case we need to allow out of bounds for some calcs. To do that
393392
! the average values for the entire wind profile must be calculated and stored (we don't know if OLAF
394393
! is used until after AD_Init below).
395394
InitInData%BoxExceedAllow = .true.
395+
InitInData%OutputAccel = i_IW%OutputAccel
396396
CALL InflowWind_Init( InitInData, IW%u, IW%p, &
397397
IW%x, IW%xd, IW%z, IW%OtherSt, &
398398
IW%y, IW%m, dt, InitOutData, errStat2, errMsg2 )

modules/aerodyn/src/AeroDyn_Inflow_C_Binding.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ subroutine ADI_C_PreInit( &
386386
! Set whether these are MHK turbines
387387
InitInp%AD%MHK = MHK_in
388388
InitInp%IW_InitInp%MHK = MHK_in
389+
InitInp%IW_InitInp%OutputAccel = MHK_in /= MHK_None
389390

390391
! Offset the origin to account for water depth for MHK turbines
391392
do iWT=1,Sim%NumTurbines

modules/aerodyn/src/AeroDyn_Inflow_Registry.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ typedef ^ ^ IntKi FilePass
4141
typedef ^ ^ FileInfoType PassedFileInfo - - - "If we don't use the input file, pass everything through this as a FileInfo structure" -
4242
typedef ^ ^ InflowWind_InputFile PassedFileData - - - "If we don't use the input file, pass everything through this as an IfW InputFile structure" -
4343
typedef ^ ^ LOGICAL Linearize - .FALSE. - "Flag that tells this module if the glue code wants to linearize." -
44+
typedef ^ ^ LOGICAL OutputAccel - .FALSE. - "Flag to output wind acceleration" -
45+
4446

4547

4648
# ..... InitIn ....................................................................................................................

modules/aerodyn/src/AeroDyn_Inflow_Types.f90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ MODULE AeroDyn_Inflow_Types
6363
TYPE(FileInfoType) :: PassedFileInfo !< If we don't use the input file, pass everything through this as a FileInfo structure [-]
6464
TYPE(InflowWind_InputFile) :: PassedFileData !< If we don't use the input file, pass everything through this as an IfW InputFile structure [-]
6565
LOGICAL :: Linearize = .FALSE. !< Flag that tells this module if the glue code wants to linearize. [-]
66+
LOGICAL :: OutputAccel = .FALSE. !< Flag to output wind acceleration [-]
6667
END TYPE ADI_IW_InputData
6768
! =======================
6869
! ========= ADI_InitInputType =======
@@ -309,6 +310,7 @@ subroutine ADI_CopyIW_InputData(SrcIW_InputDataData, DstIW_InputDataData, CtrlCo
309310
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
310311
if (ErrStat >= AbortErrLev) return
311312
DstIW_InputDataData%Linearize = SrcIW_InputDataData%Linearize
313+
DstIW_InputDataData%OutputAccel = SrcIW_InputDataData%OutputAccel
312314
end subroutine
313315

314316
subroutine ADI_DestroyIW_InputData(IW_InputDataData, ErrStat, ErrMsg)
@@ -341,6 +343,7 @@ subroutine ADI_PackIW_InputData(RF, Indata)
341343
call NWTC_Library_PackFileInfoType(RF, InData%PassedFileInfo)
342344
call InflowWind_PackInputFile(RF, InData%PassedFileData)
343345
call RegPack(RF, InData%Linearize)
346+
call RegPack(RF, InData%OutputAccel)
344347
if (RegCheckErr(RF, RoutineName)) return
345348
end subroutine
346349

@@ -359,6 +362,7 @@ subroutine ADI_UnPackIW_InputData(RF, OutData)
359362
call NWTC_Library_UnpackFileInfoType(RF, OutData%PassedFileInfo) ! PassedFileInfo
360363
call InflowWind_UnpackInputFile(RF, OutData%PassedFileData) ! PassedFileData
361364
call RegUnpack(RF, OutData%Linearize); if (RegCheckErr(RF, RoutineName)) return
365+
call RegUnpack(RF, OutData%OutputAccel); if (RegCheckErr(RF, RoutineName)) return
362366
end subroutine
363367

364368
subroutine ADI_CopyInitInput(SrcInitInputData, DstInitInputData, CtrlCode, ErrStat, ErrMsg)

0 commit comments

Comments
 (0)