Skip to content

Commit 0c022ff

Browse files
committed
Update OpenFAST and FAST.Farm to give MoorDyn access to the ED Ptfm 6 DOF at initalization
1 parent ddb547d commit 0c022ff

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

glue-codes/fast-farm/src/FAST_Farm_Subs.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -834,9 +834,9 @@ SUBROUTINE Farm_InitMD( farm, ErrStat, ErrMsg )
834834
ALLOCATE( MD_InitInp%PtfmInit(6,farm%p%NumTurbines), MD_InitInp%TurbineRefPos(3,farm%p%NumTurbines), STAT = ErrStat2 )
835835
if (Failed0("MoorDyn PtfmInit and TurbineRefPos initialization inputs in FAST.Farm.")) return;
836836

837-
! gather spatial initialization inputs for Farm-level MoorDyn
838-
DO nt = 1,farm%p%NumTurbines
839-
MD_InitInp%PtfmInit(:,nt) = farm%FWrap(nt)%m%Turbine%MD%m%PtfmInit ! turbine PRP initial positions and rotations in their respective coordinate systems from each FAST/MD instance
837+
! gather spatial initialization inputs for Farm-level MoorDyn (platform locations in their respective coordinate systems and locations of the turbines in the farm global coordinate system)
838+
DO nt = 1,farm%p%NumTurbines
839+
MD_InitInp%PtfmInit(:,nt) = farm%FWrap(nt)%m%Turbine%p_FAST%PlatformPosInit ! platform initial positions in their respective coordinate systems from each FAST/ED instance
840840
MD_InitInp%TurbineRefPos(:,nt) = farm%p%WT_Position(:,nt) ! reference positions of each turbine in the farm global coordinate system
841841
END DO
842842

modules/openfast-library/src/FAST_Registry.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ typedef ^ FAST_ParameterType INTEGER VTK_tWidth - - - "Width of number of files
193193
typedef ^ FAST_ParameterType DbKi VTK_fps - - - "number of frames per second to output VTK data" -
194194
typedef ^ FAST_ParameterType FAST_VTK_SurfaceType VTK_surface - - - "Data for VTK surface visualization"
195195
typedef ^ FAST_ParameterType CHARACTER(4) Tdesc - - - "description of turbine ID (for FAST.Farm) screen printing"
196+
typedef ^ FAST_ParameterType DbKi PlatformPosInit {6} - - "Platform inital 6 DOF position from ED (this is different from TurbinePos)" -
196197

197198
# Parameters for linearization
198199
typedef ^ FAST_ParameterType LOGICAL CalcSteady - - - "Calculate a steady-state periodic operating point before linearization [unused if Linearize=False]" -

modules/openfast-library/src/FAST_Subs.f90

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ SUBROUTINE FAST_InitializeAll( t_initial, p_FAST, y_FAST, m_FAST, ED, SED, BD, S
290290
CALL ED_Init( Init%InData_ED, ED%Input(1), ED%p, ED%x(STATE_CURR), ED%xd(STATE_CURR), ED%z(STATE_CURR), ED%OtherSt(STATE_CURR), &
291291
ED%y, ED%m, p_FAST%dt_module( MODULE_ED ), Init%OutData_ED, ErrStat2, ErrMsg2 )
292292
CALL SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
293+
294+
! Assign the inital positions for use by MoorDyn initalization
295+
p_FAST%PlatformPosInit = Init%OutData_ED%PlatformPos
293296

294297
p_FAST%ModuleInitialized(Module_ED) = .TRUE.
295298
CALL SetModuleSubstepTime(Module_ED, p_FAST, y_FAST, ErrStat2, ErrMsg2)
@@ -1207,7 +1210,7 @@ SUBROUTINE FAST_InitializeAll( t_initial, p_FAST, y_FAST, m_FAST, ED, SED, BD, S
12071210
Init%InData_MD%FileName = p_FAST%MooringFile ! This needs to be set according to what is in the FAST input file.
12081211
Init%InData_MD%RootName = p_FAST%OutFileRoot
12091212

1210-
Init%InData_MD%PtfmInit(:,1) = Init%OutData_ED%PlatformPos ! initial position of the platform (when a FAST module, MoorDyn just takes one row in this matrix)
1213+
Init%InData_MD%PtfmInit(:,1) = p_FAST%PlatformPosInit ! initial position of the platform (when a FAST module, MoorDyn just takes one row in this matrix)
12111214
Init%InData_MD%FarmSize = 0 ! 0 here indicates normal FAST module use of MoorDyn, for a single turbine
12121215
Init%InData_MD%TurbineRefPos(:,1) = 0.0_DbKi ! for normal FAST use, the global reference frame is at 0,0,0
12131216
Init%InData_MD%g = p_FAST%Gravity ! This need to be according to g used in ElastoDyn

modules/openfast-library/src/FAST_Types.f90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ MODULE FAST_Types
207207
REAL(DbKi) :: VTK_fps = 0.0_R8Ki !< number of frames per second to output VTK data [-]
208208
TYPE(FAST_VTK_SurfaceType) :: VTK_surface !< Data for VTK surface visualization [-]
209209
CHARACTER(4) :: Tdesc !< description of turbine ID (for FAST.Farm) screen printing [-]
210+
REAL(DbKi) , DIMENSION(1:6) :: PlatformPosInit = 0.0_R8Ki !< Platform inital 6 DOF position from ED (this is different from TurbinePos) [-]
210211
LOGICAL :: CalcSteady = .false. !< Calculate a steady-state periodic operating point before linearization [unused if Linearize=False] [-]
211212
INTEGER(IntKi) :: TrimCase = 0_IntKi !< Controller parameter to be trimmed {1:yaw; 2:torque; 3:pitch} [unused if Linearize=False; used only if CalcSteady=True] [-]
212213
REAL(ReKi) :: TrimTol = 0.0_ReKi !< Tolerance for the rotational speed convergence (>0) [unused if Linearize=False; used only if CalcSteady=True] [-]
@@ -1487,6 +1488,7 @@ subroutine FAST_CopyParam(SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg)
14871488
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
14881489
if (ErrStat >= AbortErrLev) return
14891490
DstParamData%Tdesc = SrcParamData%Tdesc
1491+
DstParamData%PlatformPosInit = SrcParamData%PlatformPosInit
14901492
DstParamData%CalcSteady = SrcParamData%CalcSteady
14911493
DstParamData%TrimCase = SrcParamData%TrimCase
14921494
DstParamData%TrimTol = SrcParamData%TrimTol
@@ -1657,6 +1659,7 @@ subroutine FAST_PackParam(RF, Indata)
16571659
call RegPack(RF, InData%VTK_fps)
16581660
call FAST_PackVTK_SurfaceType(RF, InData%VTK_surface)
16591661
call RegPack(RF, InData%Tdesc)
1662+
call RegPack(RF, InData%PlatformPosInit)
16601663
call RegPack(RF, InData%CalcSteady)
16611664
call RegPack(RF, InData%TrimCase)
16621665
call RegPack(RF, InData%TrimTol)
@@ -1772,6 +1775,7 @@ subroutine FAST_UnPackParam(RF, OutData)
17721775
call RegUnpack(RF, OutData%VTK_fps); if (RegCheckErr(RF, RoutineName)) return
17731776
call FAST_UnpackVTK_SurfaceType(RF, OutData%VTK_surface) ! VTK_surface
17741777
call RegUnpack(RF, OutData%Tdesc); if (RegCheckErr(RF, RoutineName)) return
1778+
call RegUnpack(RF, OutData%PlatformPosInit); if (RegCheckErr(RF, RoutineName)) return
17751779
call RegUnpack(RF, OutData%CalcSteady); if (RegCheckErr(RF, RoutineName)) return
17761780
call RegUnpack(RF, OutData%TrimCase); if (RegCheckErr(RF, RoutineName)) return
17771781
call RegUnpack(RF, OutData%TrimTol); if (RegCheckErr(RF, RoutineName)) return

0 commit comments

Comments
 (0)