From 85365c417b8b07822962994ae480db5d0bcb09d1 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Mon, 29 Jan 2024 15:14:43 -0700 Subject: [PATCH] Pass pointer into AD15 during init. Also modify call order in the ADI library --- modules/aerodyn/src/.AeroDyn_Inflow.f90.swp | Bin 0 -> 53248 bytes modules/aerodyn/src/AeroDyn.f90 | 3 ++ modules/aerodyn/src/AeroDyn_Inflow.f90 | 20 +++++++------ modules/aerodyn/src/AeroDyn_Registry.txt | 1 + modules/aerodyn/src/AeroDyn_Types.f90 | 31 ++++++++++++++++++++ modules/openfast-library/src/FAST_Subs.f90 | 6 ++-- 6 files changed, 49 insertions(+), 12 deletions(-) create mode 100644 modules/aerodyn/src/.AeroDyn_Inflow.f90.swp diff --git a/modules/aerodyn/src/.AeroDyn_Inflow.f90.swp b/modules/aerodyn/src/.AeroDyn_Inflow.f90.swp new file mode 100644 index 0000000000000000000000000000000000000000..1fdd9e7a1e2cdd5f24908a6c8a13dc47457394a7 GIT binary patch literal 53248 zcmeI54U}X@b>E-B2xEj%Btr}Y^LouPJ<{y#S3ueovv_uARy)#sX?J#)56eT(^qZMR z{gwXE>?{O)Y-EJPiGdg&At1+gjFk`!aU3U*bCO^VcEALTEL%1v24nCc-~>p{0ULzv z{O+x)_v*cV-7`CkK*#jk{r7agSD&})Ro#2*)~%I87iQ+dW8;Scu4{wf8_#)P^!C5_ zz_srl3xZO!TIzJxI|pyA zbk1~F4mO%meXZ2)99ZeDAFMUX-D=c6Sc+PW@>cy|yR~|7lJ8Sn_2rrRTD7q`zIIGY zJ|NfOqag)`6bQPVwF5UlB{+KIu)Z)qx~~vkf8F^ZVTKeKQea4dAq9pM7*b$JfguHk z6c|$Adx!#^=97chP~XSdI?vj_S7rWQZGXFPGnwa4u)kfn?DOxl&nN8PY(7u4_b2V& zH`>3h9N(XL{$S?$lkD$B`}aB<(Z&A(d*9`|l6n4Q`+Uy+eNX23HJSL2WS&3XKEK8O zz10%Rhc0z(Q6DKMnKkO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Y(hHO?Z8jKBbx;c8RQaMWPwEag2Xx!Ka#u!sino33w#mk;pCqqR z;EhITy#WV;A^>Jfoq5g4z+5WnP7JJ6oZHc{%ILw4Q&|Tt3HvuaJj4%e20a>A?``+h z+lbF;j7RDpYM4&!aiDk;ty&&-*&H zgqS^@UrXsCB`;gtzC95bJj+JlQ<<&l)(nf5zpw)?+vTfWB|S7z3Z@!F<%y9w*_410NIg7!Xg|eSTZ{0;OM#qh>L_8#R*mZG z_}my!q{%5Mlv~9${lerY8m InitInp%FlowField + !............................................................................................ ! Define and initialize inputs here diff --git a/modules/aerodyn/src/AeroDyn_Inflow.f90 b/modules/aerodyn/src/AeroDyn_Inflow.f90 index 16dac6bd5b..bd7bfdc390 100644 --- a/modules/aerodyn/src/AeroDyn_Inflow.f90 +++ b/modules/aerodyn/src/AeroDyn_Inflow.f90 @@ -62,6 +62,10 @@ subroutine ADI_Init(InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut ! Display the module information call DispNVD( ADI_Ver ) + ! Clear writeoutputs + if (allocated(InitOut%WriteOutputHdr)) deallocate(InitOut%WriteOutputHdr) + if (allocated(InitOut%WriteOutputUnt)) deallocate(InitOut%WriteOutputUnt) + ! Set parameters p%dt = interval p%storeHHVel = InitInp%storeHHVel @@ -69,9 +73,14 @@ subroutine ADI_Init(InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut p%MHK = InitInp%AD%MHK p%WtrDpth = InitInp%AD%WtrDpth + ! --- Initialize Inflow Wind + call ADI_InitInflowWind(InitInp%RootName, InitInp%IW_InitInp, u%AD, OtherState%AD, m%IW, Interval, InitOut_IW, errStat2, errMsg2); if (Failed()) return + ! Concatenate AD outputs to IW outputs + call concatOutputHeaders(InitOut%WriteOutputHdr, InitOut%WriteOutputUnt, InitOut_IW%WriteOutputHdr, InitOut_IW%WriteOutputUnt, errStat2, errMsg2); if(Failed()) return + ! --- Initialize AeroDyn - if (allocated(InitOut%WriteOutputHdr)) deallocate(InitOut%WriteOutputHdr) - if (allocated(InitOut%WriteOutputUnt)) deallocate(InitOut%WriteOutputUnt) + ! Link InflowWind's FlowField to AeroDyn's FlowField + InitInp%AD%FlowField => InitOut_IW%FlowField call AD_Init(InitInp%AD, u%AD, p%AD, x%AD, xd%AD, z%AD, OtherState%AD, y%AD, m%AD, Interval, InitOut_AD, errStat2, errMsg2); if (Failed()) return InitOut%Ver = InitOut_AD%ver @@ -79,13 +88,6 @@ subroutine ADI_Init(InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut !TODO: this header is too short if we add more rotors. Should also add a rotor identifier call concatOutputHeaders(InitOut%WriteOutputHdr, InitOut%WriteOutputUnt, InitOut_AD%rotors(1)%WriteOutputHdr, InitOut_AD%rotors(1)%WriteOutputUnt, errStat2, errMsg2); if(Failed()) return - ! --- Initialize Inflow Wind - call ADI_InitInflowWind(InitInp%RootName, InitInp%IW_InitInp, u%AD, OtherState%AD, m%IW, Interval, InitOut_IW, errStat2, errMsg2); if (Failed()) return - ! Concatenate AD outputs to IW outputs - call concatOutputHeaders(InitOut%WriteOutputHdr, InitOut%WriteOutputUnt, InitOut_IW%WriteOutputHdr, InitOut_IW%WriteOutputUnt, errStat2, errMsg2); if(Failed()) return - ! Link InflowWind's FlowField to AeroDyn's FlowField - p%AD%FlowField => InitOut_IW%FlowField - ! --- Initialize grouped outputs !TODO: assumes one rotor p%NumOuts = p%AD%rotors(1)%NumOuts + p%AD%rotors(1)%BldNd_TotNumOuts + m%IW%p%NumOuts diff --git a/modules/aerodyn/src/AeroDyn_Registry.txt b/modules/aerodyn/src/AeroDyn_Registry.txt index 78783c7f1f..e41ce2dacb 100644 --- a/modules/aerodyn/src/AeroDyn_Registry.txt +++ b/modules/aerodyn/src/AeroDyn_Registry.txt @@ -104,6 +104,7 @@ typedef ^ InitInputType ReKi defPatm - - - "Default atmospheric typedef ^ InitInputType ReKi defPvap - - - "Default vapor pressure from the driver; may be overwritten" Pa typedef ^ InitInputType ReKi WtrDpth - - - "Water depth" m typedef ^ InitInputType ReKi MSL2SWL - - - "Offset between still-water level and mean sea level" m +typedef ^ InitInputType FlowFieldType *FlowField - - - "Pointer of InflowWinds flow field data type" - # This is data defined in the Input File for this module (or could otherwise be passed in) # ..... Blade Input file data ..................................................................................................... diff --git a/modules/aerodyn/src/AeroDyn_Types.f90 b/modules/aerodyn/src/AeroDyn_Types.f90 index dcfa08ca35..974f5b5a4a 100644 --- a/modules/aerodyn/src/AeroDyn_Types.f90 +++ b/modules/aerodyn/src/AeroDyn_Types.f90 @@ -124,6 +124,7 @@ MODULE AeroDyn_Types REAL(ReKi) :: defPvap = 0.0_ReKi !< Default vapor pressure from the driver; may be overwritten [Pa] REAL(ReKi) :: WtrDpth = 0.0_ReKi !< Water depth [m] REAL(ReKi) :: MSL2SWL = 0.0_ReKi !< Offset between still-water level and mean sea level [m] + TYPE(FlowFieldType) , POINTER :: FlowField => NULL() !< Pointer of InflowWinds flow field data type [-] END TYPE AD_InitInputType ! ======================= ! ========= AD_BladePropsType ======= @@ -946,6 +947,7 @@ subroutine AD_CopyInitInput(SrcInitInputData, DstInitInputData, CtrlCode, ErrSta DstInitInputData%defPvap = SrcInitInputData%defPvap DstInitInputData%WtrDpth = SrcInitInputData%WtrDpth DstInitInputData%MSL2SWL = SrcInitInputData%MSL2SWL + DstInitInputData%FlowField => SrcInitInputData%FlowField end subroutine subroutine AD_DestroyInitInput(InitInputData, ErrStat, ErrMsg) @@ -970,6 +972,7 @@ subroutine AD_DestroyInitInput(InitInputData, ErrStat, ErrMsg) end if call NWTC_Library_DestroyFileInfoType(InitInputData%PassedPrimaryInputData, ErrStat2, ErrMsg2) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) + nullify(InitInputData%FlowField) end subroutine subroutine AD_PackInitInput(RF, Indata) @@ -978,6 +981,7 @@ subroutine AD_PackInitInput(RF, Indata) character(*), parameter :: RoutineName = 'AD_PackInitInput' integer(B8Ki) :: i1 integer(B8Ki) :: LB(1), UB(1) + logical :: PtrInIndex if (RF%ErrStat >= AbortErrLev) return call RegPack(RF, allocated(InData%rotors)) if (allocated(InData%rotors)) then @@ -1003,6 +1007,13 @@ subroutine AD_PackInitInput(RF, Indata) call RegPack(RF, InData%defPvap) call RegPack(RF, InData%WtrDpth) call RegPack(RF, InData%MSL2SWL) + call RegPack(RF, associated(InData%FlowField)) + if (associated(InData%FlowField)) then + call RegPackPointer(RF, c_loc(InData%FlowField), PtrInIndex) + if (.not. PtrInIndex) then + call IfW_FlowField_PackFlowFieldType(RF, InData%FlowField) + end if + end if if (RegCheckErr(RF, RoutineName)) return end subroutine @@ -1014,6 +1025,8 @@ subroutine AD_UnPackInitInput(RF, OutData) integer(B8Ki) :: LB(1), UB(1) integer(IntKi) :: stat logical :: IsAllocAssoc + integer(B8Ki) :: PtrIdx + type(c_ptr) :: Ptr if (RF%ErrStat /= ErrID_None) return if (allocated(OutData%rotors)) deallocate(OutData%rotors) call RegUnpack(RF, IsAllocAssoc); if (RegCheckErr(RF, RoutineName)) return @@ -1043,6 +1056,24 @@ subroutine AD_UnPackInitInput(RF, OutData) call RegUnpack(RF, OutData%defPvap); if (RegCheckErr(RF, RoutineName)) return call RegUnpack(RF, OutData%WtrDpth); if (RegCheckErr(RF, RoutineName)) return call RegUnpack(RF, OutData%MSL2SWL); if (RegCheckErr(RF, RoutineName)) return + if (associated(OutData%FlowField)) deallocate(OutData%FlowField) + call RegUnpack(RF, IsAllocAssoc); if (RegCheckErr(RF, RoutineName)) return + if (IsAllocAssoc) then + call RegUnpackPointer(RF, Ptr, PtrIdx); if (RegCheckErr(RF, RoutineName)) return + if (c_associated(Ptr)) then + call c_f_pointer(Ptr, OutData%FlowField) + else + allocate(OutData%FlowField,stat=stat) + if (stat /= 0) then + call SetErrStat(ErrID_Fatal, 'Error allocating OutData%FlowField.', RF%ErrStat, RF%ErrMsg, RoutineName) + return + end if + RF%Pointers(PtrIdx) = c_loc(OutData%FlowField) + call IfW_FlowField_UnpackFlowFieldType(RF, OutData%FlowField) ! FlowField + end if + else + OutData%FlowField => null() + end if end subroutine subroutine AD_CopyBladePropsType(SrcBladePropsTypeData, DstBladePropsTypeData, CtrlCode, ErrStat, ErrMsg) diff --git a/modules/openfast-library/src/FAST_Subs.f90 b/modules/openfast-library/src/FAST_Subs.f90 index 8064c46996..f3dbd998ee 100644 --- a/modules/openfast-library/src/FAST_Subs.f90 +++ b/modules/openfast-library/src/FAST_Subs.f90 @@ -555,9 +555,6 @@ SUBROUTINE FAST_InitializeAll( t_initial, p_FAST, y_FAST, m_FAST, ED, BD, SrvD, CALL SetModuleSubstepTime(Module_IfW, p_FAST, y_FAST, ErrStat2, ErrMsg2) CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName) - ! Set pointers to flowfield - IF (p_FAST%CompAero == Module_AD) AD%p%FlowField => Init%OutData_IfW%FlowField - allocate( y_FAST%Lin%Modules(MODULE_IfW)%Instance(1), stat=ErrStat2) if (ErrStat2 /= 0 ) then call SetErrStat(ErrID_Fatal, "Error allocating Lin%Modules(IfW).", ErrStat, ErrMsg, RoutineName ) @@ -820,6 +817,9 @@ SUBROUTINE FAST_InitializeAll( t_initial, p_FAST, y_FAST, m_FAST, ED, BD, SrvD, Init%InData_AD%rotors(1)%BladeRootOrientation(:,:,k) = ED%y%BladeRootMotion(k)%RefOrientation(:,:,1) end do + ! Set pointers to flowfield + IF (p_FAST%CompInflow == Module_IfW) Init%InData_AD%FlowField => Init%OutData_IfW%FlowField + CALL AD_Init( Init%InData_AD, AD%Input(1), AD%p, AD%x(STATE_CURR), AD%xd(STATE_CURR), AD%z(STATE_CURR), & AD%OtherSt(STATE_CURR), AD%y, AD%m, p_FAST%dt_module( MODULE_AD ), Init%OutData_AD, ErrStat2, ErrMsg2 ) CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)