diff --git a/docs/source/user/api_change.rst b/docs/source/user/api_change.rst index 30d3a351f..90ff8d2aa 100644 --- a/docs/source/user/api_change.rst +++ b/docs/source/user/api_change.rst @@ -38,18 +38,19 @@ SubDyn 56\* SubDyn 57\* NSpringPropSets 0 - Number of spring properties SubDyn 58\* PropSetID k11 k12 k13 k14 k15 k16 k22 k23 k24 k25 k26 k33 k34 k35 k36 k44 k45 k46 k55 k56 k66 SubDyn 59\* (-) (N/m) (N/m) (N/m) (N/rad) (N/rad) (N/rad) (N/m) (N/m) (N/rad) (N/rad) (N/rad) (N/m) (N/rad) (N/rad) (N/rad) (Nm/rad) (Nm/rad) (Nm/rad) (Nm/rad) (Nm/rad) (Nm/rad) -FAST.Farm 47 RotorDiamRef 125 RotorDiamRef - Reference turbine rotor diameter for wake calculations (m) [>0.0] -FAST.Farm 57 k_vAmb DEFAULT k_vAmb - Calibrated parameters for the influence of the ambient turbulence in the eddy viscosity (set of 5 parameters: k, FMin, DMin, DMax, Exp) (-) [>=0.0, >=0.0 and <=1.0, >=0.0, >DMin, >0.0] or DEFAULT [DEFAULT=0.05, 1.0, 0.0, 1.0, 0.01] -FAST.Farm 58 kvShr DEFAULT k_vShr - Calibrated parameters for the influence of the shear layer in the eddy viscosity (set of 5 parameters: k, FMin, DMin, DMax, Exp) (-) [>=0.0, >=0.0 and <=1.0, >=0.0, >DMin, >0.0] or DEFAULT [DEFAULT=0.016, 0.2, 3.0, 25.0, 0.1] -FAST.Farm 59-66 --removed-- -FAST.Farm 71 --- WAKE-ADDED TURBULENCE --- -FAST.Farm 72 WAT 2 WAT - Switch between wake-added turbulence box options {0: no wake added turbulence, 1: predefined turbulence box, 2: user defined turbulence box} (switch) -FAST.Farm 73 WAT_BoxFile "../WAT_MannBoxDB/FFDB_D100_512x512x64.u" WAT_BoxFile - Filepath to the file containing the u-component of the turbulence box (either predefined or user-defined) (quoted string) -FAST.Farm 74 WAT_NxNyNz 512, 512, 64 WAT_NxNyNz - Number of points in the x, y, and z directions of the WAT_BoxFile [used only if WAT=2, derived value if WAT=1] (-) -FAST.Farm 75 WAT_DxDyDz 5.0, 5.0, 5.0 WAT_DxDyDz - Distance (in meters) between points in the x, y, and z directions of the WAT_BoxFile [used only if WAT=2, derived value if WAT=1] (m) -FAST.Farm 76 WAT_ScaleBox default WAT_ScaleBox - Flag to scale the input turbulence box to zero mean and unit standard deviation at every node [DEFAULT=False] (flag) -FAST.Farm 77 WAT_k_Def default WAT_k_Def - Calibrated parameters for the influence of the maximum wake deficit on wake-added turbulence (set of 5 parameters: k_Def, FMin, DMin, DMax, Exp) (-) [>=0.0, >=0.0 and <=1.0, >=0.0, >DMin, >0.0] or DEFAULT [DEFAULT=[0.6, 0.0, 0.0, 2.0, 1.0 ]] -FAST.Farm 78 WAT_k_Grad default WAT_k_Grad - Calibrated parameters for the influence of the radial velocity gradient of the wake deficit on wake-added turbulence (set of 5 parameters: k_Grad, FMin, DMin, DMax, Exp) (-) [>=0.0, >=0.0 and <=1.0, >=0.0, >DMin, >0.0] or DEFAULT [DEFAULT=[3.0, 0.0, 0.0, 12.0, 0.65] +FAST.Farm 16 WrMooringVis true WrMooringVis - Write shared mooring visualization, at DT_Mooring timestep (-) [only used for Mod_SharedMooring=3] +FAST.Farm 48 RotorDiamRef 125 RotorDiamRef - Reference turbine rotor diameter for wake calculations (m) [>0.0] +FAST.Farm 58 k_vAmb DEFAULT k_vAmb - Calibrated parameters for the influence of the ambient turbulence in the eddy viscosity (set of 5 parameters: k, FMin, DMin, DMax, Exp) (-) [>=0.0, >=0.0 and <=1.0, >=0.0, >DMin, >0.0] or DEFAULT [DEFAULT=0.05, 1.0, 0.0, 1.0, 0.01] +FAST.Farm 59 kvShr DEFAULT k_vShr - Calibrated parameters for the influence of the shear layer in the eddy viscosity (set of 5 parameters: k, FMin, DMin, DMax, Exp) (-) [>=0.0, >=0.0 and <=1.0, >=0.0, >DMin, >0.0] or DEFAULT [DEFAULT=0.016, 0.2, 3.0, 25.0, 0.1] +FAST.Farm 60-66 --removed-- +FAST.Farm 72 --- WAKE-ADDED TURBULENCE --- +FAST.Farm 73 WAT 2 WAT - Switch between wake-added turbulence box options {0: no wake added turbulence, 1: predefined turbulence box, 2: user defined turbulence box} (switch) +FAST.Farm 74 WAT_BoxFile "../WAT_MannBoxDB/FFDB_D100_512x512x64.u" WAT_BoxFile - Filepath to the file containing the u-component of the turbulence box (either predefined or user-defined) (quoted string) +FAST.Farm 75 WAT_NxNyNz 512, 512, 64 WAT_NxNyNz - Number of points in the x, y, and z directions of the WAT_BoxFile [used only if WAT=2, derived value if WAT=1] (-) +FAST.Farm 76 WAT_DxDyDz 5.0, 5.0, 5.0 WAT_DxDyDz - Distance (in meters) between points in the x, y, and z directions of the WAT_BoxFile [used only if WAT=2, derived value if WAT=1] (m) +FAST.Farm 77 WAT_ScaleBox default WAT_ScaleBox - Flag to scale the input turbulence box to zero mean and unit standard deviation at every node [DEFAULT=False] (flag) +FAST.Farm 78 WAT_k_Def default WAT_k_Def - Calibrated parameters for the influence of the maximum wake deficit on wake-added turbulence (set of 5 parameters: k_Def, FMin, DMin, DMax, Exp) (-) [>=0.0, >=0.0 and <=1.0, >=0.0, >DMin, >0.0] or DEFAULT [DEFAULT=[0.6, 0.0, 0.0, 2.0, 1.0 ]] +FAST.Farm 79 WAT_k_Grad default WAT_k_Grad - Calibrated parameters for the influence of the radial velocity gradient of the wake deficit on wake-added turbulence (set of 5 parameters: k_Grad, FMin, DMin, DMax, Exp) (-) [>=0.0, >=0.0 and <=1.0, >=0.0, >DMin, >0.0] or DEFAULT [DEFAULT=[3.0, 0.0, 0.0, 12.0, 0.65] AeroDyn 80\* NacArea 0, 0, 0 NacArea - Projected area of the nacelle in X, Y, Z in the nacelle coordinate system (m^2) AeroDyn 81\* NacCd 0, 0, 0 NacCd - Drag coefficient for the nacelle areas defined above (-) AeroDyn 82\* NacDragAC 0, 0, 0 NacDragAC - Position of aerodynamic center of nacelle drag in nacelle coordinates (m) diff --git a/docs/source/user/fast.farm/InputFiles.rst b/docs/source/user/fast.farm/InputFiles.rst index 665c6e3b7..e8b0decb2 100644 --- a/docs/source/user/fast.farm/InputFiles.rst +++ b/docs/source/user/fast.farm/InputFiles.rst @@ -138,6 +138,10 @@ documentation for details on the input file at the farm level. **DT_Mooring** (sec) sets the timestep for the shared mooring connections with MoorDyn. +**WrMooringVis** [swithch] Write shared mooring line visualization, at +DT_Mooring timestep + + .. _FF:Input:VTK: Ambient Wind: Precursor in Visualization Toolkit Format diff --git a/glue-codes/fast-farm/src/FAST_Farm_IO.f90 b/glue-codes/fast-farm/src/FAST_Farm_IO.f90 index 8b7937b2a..7f5822cf0 100644 --- a/glue-codes/fast-farm/src/FAST_Farm_IO.f90 +++ b/glue-codes/fast-farm/src/FAST_Farm_IO.f90 @@ -643,6 +643,7 @@ SUBROUTINE Farm_ReadPrimaryFile( InputFile, p, WD_InitInp, AWAE_InitInp, SC_Init CALL ReadVar( UnIn, InputFile, p%MD_FileName, "MD_FileName", "Name/location of the dynamic library {.dll [Windows] or .so [Linux]} containing the Super Controller algorithms (quoated string)", ErrStat2, ErrMsg2, UnEc); if (Failed()) return IF ( PathIsRelative( p%MD_FileName ) ) p%MD_FileName = TRIM(PriPath)//TRIM(p%MD_FileName) CALL ReadVar( UnIn, InputFile, p%DT_mooring, "DT_Mooring", "Time step for farm-levem mooring coupling with each turbine [used only when Mod_SharedMooring > 0] (s) [>0.0]", ErrStat2, ErrMsg2, UnEc); if (Failed()) return + CALL ReadVar( UnIn, InputFile, p%WrMooringVis, "MooringVis","Write shared mooring visualization, at DT_Mooring timestep (-) [only used for Mod_SharedMooring=3]", ErrStat2, ErrMsg2, UnEc); if (Failed()) return !---------------------- AMBIENT WIND: PRECURSOR IN VTK FORMAT --------------------------------------------- CALL ReadCom( UnIn, InputFile, 'Section Header: Ambient Wind: Precursor in VTK Format', ErrStat2, ErrMsg2, UnEc ); if (Failed()) return diff --git a/glue-codes/fast-farm/src/FAST_Farm_Registry.txt b/glue-codes/fast-farm/src/FAST_Farm_Registry.txt index 02e90e21b..a05215d21 100644 --- a/glue-codes/fast-farm/src/FAST_Farm_Registry.txt +++ b/glue-codes/fast-farm/src/FAST_Farm_Registry.txt @@ -41,6 +41,7 @@ typedef ^ ParameterType LOGICAL UseSC - typedef ^ ParameterType ReKi WT_Position {:}{:} - - "X-Y-Z position of each wind turbine; index 1 = XYZ; index 2 = turbine number" meters typedef ^ ParameterType IntKi WaveFieldMod - - - "Wave field handling (-) (switch) {0: use individual HydroDyn inputs without adjustment, 1: adjust wave phases based on turbine offsets from farm origin}" - typedef ^ ParameterType IntKi MooringMod - - - "Mod_SharedMooring is a flag for array-level mooring. (switch) {0: none, 3: yes/MoorDyn}" - +typedef ^ ParameterType logical WrMooringVis - - - "Write shared mooring visualization (-) [only used for Mod_SharedMooring=3]" - typedef ^ ParameterType CHARACTER(1024) MD_FileName - - - "Name/location of the farm-level MoorDyn input file" - typedef ^ ParameterType DbKi DT_mooring - - - "Time step for farm-levem mooring coupling with each turbine [used only when Mod_SharedMooring > 0]" seconds typedef ^ ParameterType IntKi n_mooring - - - "Number of FAST and MoorDyn time steps per FAST.Farm timestep when mooring > 0" - @@ -157,6 +158,9 @@ typedef ^ ^ DbKi InputTimes {:} - typedef ^ ^ MD_OutputType y - - - "System outputs" typedef ^ ^ MD_MiscVarType m - - - "Misc/optimization variables" typedef ^ ^ logical IsInitialized - .FALSE. - "Has MD_Init been called" +typedef ^ ^ IntKi VTK_count - 0 - "Counter for VTK output of shared moorings" +typedef ^ ^ IntKi VTK_TWidth - - - "width for VTK_count field in output name" +typedef ^ ^ character(1024) VTK_OutFileRoot - - - "Rootfilename for VTK output" # ..... WAT InflowWind data ............................................................................................ typedef ^ WAT_IfW_data InflowWind_ContinuousStateType x - - - "Continuous states" typedef ^ ^ InflowWind_DiscreteStateType xd - - - "Discrete states" diff --git a/glue-codes/fast-farm/src/FAST_Farm_Subs.f90 b/glue-codes/fast-farm/src/FAST_Farm_Subs.f90 index 606742092..a2911ccd5 100644 --- a/glue-codes/fast-farm/src/FAST_Farm_Subs.f90 +++ b/glue-codes/fast-farm/src/FAST_Farm_Subs.f90 @@ -783,6 +783,7 @@ SUBROUTINE Farm_InitMD( farm, ErrStat, ErrMsg ) type(MD_InitInputType) :: MD_InitInp type(MD_InitOutputType) :: MD_InitOut + character(1025) :: Path, FileRoot ! for vtk outputs INTEGER(IntKi) :: nt ! loop counter for rotor number INTEGER(IntKi) :: ErrStat2 ! Temporary Error status CHARACTER(ErrMsgLen) :: ErrMsg2 ! Temporary Error message @@ -844,6 +845,16 @@ SUBROUTINE Farm_InitMD( farm, ErrStat, ErrMsg ) MD_InitInp%rhoW = 1025.0 MD_InitInp%WtrDepth = 0.0 !TODO: eventually connect this to a global depth input variable <<< + ! Visualization of shared moorings + if (farm%p%WrMooringVis) then + MD_InitInp%VisMeshes=.true. + farm%MD%VTK_Count = 0 + call GetPath ( MD_InitInp%RootName, Path, FileRoot ) ! the returned DVR_Outs%VTK_OutFileRoot includes a file separator character at the end + farm%MD%VTK_OutFileRoot = trim(Path)//PathSep//'vtk'//PathSep//trim(FileRoot) +print*,'MD rootName ',MD_InitInp%RootName +print*,'VTK_OutFileRoot ',farm%MD%VTK_OutFileRoot + farm%MD%VTK_TWidth = 5 !FIXME: this should be set based on sim length + endif ! allocate MoorDyn inputs (assuming size 2 for linear interpolation/extrapolation... > ALLOCATE( farm%MD%Input( 2 ), farm%MD%InputTimes( 2 ), STAT = ErrStat2 ) @@ -1006,7 +1017,7 @@ subroutine FARM_MD_Increment(t, n, farm, ErrStat, ErrMsg) end if end do - + contains logical function Failed() @@ -1657,7 +1668,7 @@ subroutine FARM_CalcOutput(t, farm, ErrStat, ErrMsg) INTEGER(IntKi), INTENT( OUT) :: ErrStat !< Error status CHARACTER(*), INTENT( OUT) :: ErrMsg !< Error message - INTEGER(IntKi) :: nt + INTEGER(IntKi) :: nt,j INTEGER(IntKi) :: ErrStat2 ! Temporary Error status CHARACTER(ErrMsgLen) :: ErrMsg2 ! Temporary Error message CHARACTER(*), PARAMETER :: RoutineName = 'FARM_CalcOutput' @@ -1755,6 +1766,32 @@ subroutine FARM_CalcOutput(t, farm, ErrStat, ErrMsg) call Farm_WriteOutput(n, t, farm, ErrStat2, ErrMsg2) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) + !....................................................................................... + ! Write shared moorings visualization + !....................................................................................... + + ! Write visualization meshes + if (farm%p%MooringMod == 3) then + if (farm%MD%p%VisMeshes) then +print*,' writing MD shared vis meshes' + if (allocated(farm%MD%y%VisLinesMesh)) then + do j=1,size(farm%MD%y%VisLinesMesh) + if (farm%MD%y%VisLinesMesh(j)%Committed) then + call MeshWrVTK((/0.0_ReKi,0.0_ReKi,0.0_ReKi/), farm%MD%y%VisLinesMesh(j), trim(farm%MD%VTK_OutFileRoot)//'.MD_Line'//trim(Num2LStr(j)), farm%MD%VTK_count, .false., ErrSTat2, ErrMsg2, farm%MD%VTK_tWidth ) + endif + enddo + endif + if (allocated(farm%MD%y%VisRodsMesh)) then + do j=1,size(farm%MD%y%VisRodsMesh) + if (farm%MD%y%VisRodsMesh(j)%Committed) then + call MeshWrVTK((/0.0_ReKi,0.0_ReKi,0.0_ReKi/), farm%MD%y%VisRodsMesh(j), trim(farm%MD%VTK_OutFileRoot)//'.MD_Rod'//trim(Num2LStr(j)), farm%MD%VTK_count, .false., ErrSTat2, ErrMsg2, farm%MD%VTK_tWidth ) + endif + enddo + endif + farm%MD%VTK_Count = farm%MD%VTK_Count + 1 + endif + endif + ! write(*,*) 'Total Farm_CO-serial took '//trim(num2lstr(omp_get_wtime()-tm1))//' seconds.' end subroutine FARM_CalcOutput diff --git a/glue-codes/fast-farm/src/FAST_Farm_Types.f90 b/glue-codes/fast-farm/src/FAST_Farm_Types.f90 index a03b686f1..f2a0fce0e 100644 --- a/glue-codes/fast-farm/src/FAST_Farm_Types.f90 +++ b/glue-codes/fast-farm/src/FAST_Farm_Types.f90 @@ -60,6 +60,7 @@ MODULE FAST_Farm_Types REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: WT_Position !< X-Y-Z position of each wind turbine; index 1 = XYZ; index 2 = turbine number [meters] INTEGER(IntKi) :: WaveFieldMod = 0_IntKi !< Wave field handling (-) (switch) {0: use individual HydroDyn inputs without adjustment, 1: adjust wave phases based on turbine offsets from farm origin} [-] INTEGER(IntKi) :: MooringMod = 0_IntKi !< Mod_SharedMooring is a flag for array-level mooring. (switch) {0: none, 3: yes/MoorDyn} [-] + LOGICAL :: WrMooringVis = .false. !< Write shared mooring visualization (-) [only used for Mod_SharedMooring=3] [-] CHARACTER(1024) :: MD_FileName !< Name/location of the farm-level MoorDyn input file [-] REAL(DbKi) :: DT_mooring = 0.0_R8Ki !< Time step for farm-levem mooring coupling with each turbine [used only when Mod_SharedMooring > 0] [seconds] INTEGER(IntKi) :: n_mooring = 0_IntKi !< Number of FAST and MoorDyn time steps per FAST.Farm timestep when mooring > 0 [-] @@ -185,6 +186,9 @@ MODULE FAST_Farm_Types TYPE(MD_OutputType) :: y !< System outputs [-] TYPE(MD_MiscVarType) :: m !< Misc/optimization variables [-] LOGICAL :: IsInitialized = .FALSE. !< Has MD_Init been called [-] + INTEGER(IntKi) :: VTK_count = 0 !< Counter for VTK output of shared moorings [-] + INTEGER(IntKi) :: VTK_TWidth = 0_IntKi !< width for VTK_count field in output name [-] + character(1024) :: VTK_OutFileRoot !< Rootfilename for VTK output [-] END TYPE MD_Data ! ======================= ! ========= WAT_IfW_data ======= @@ -249,6 +253,7 @@ subroutine Farm_CopyParam(SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg) end if DstParamData%WaveFieldMod = SrcParamData%WaveFieldMod DstParamData%MooringMod = SrcParamData%MooringMod + DstParamData%WrMooringVis = SrcParamData%WrMooringVis DstParamData%MD_FileName = SrcParamData%MD_FileName DstParamData%DT_mooring = SrcParamData%DT_mooring DstParamData%n_mooring = SrcParamData%n_mooring @@ -452,6 +457,7 @@ subroutine Farm_PackParam(RF, Indata) call RegPackAlloc(RF, InData%WT_Position) call RegPack(RF, InData%WaveFieldMod) call RegPack(RF, InData%MooringMod) + call RegPack(RF, InData%WrMooringVis) call RegPack(RF, InData%MD_FileName) call RegPack(RF, InData%DT_mooring) call RegPack(RF, InData%n_mooring) @@ -534,6 +540,7 @@ subroutine Farm_UnPackParam(RF, OutData) call RegUnpackAlloc(RF, OutData%WT_Position); if (RegCheckErr(RF, RoutineName)) return call RegUnpack(RF, OutData%WaveFieldMod); if (RegCheckErr(RF, RoutineName)) return call RegUnpack(RF, OutData%MooringMod); if (RegCheckErr(RF, RoutineName)) return + call RegUnpack(RF, OutData%WrMooringVis); if (RegCheckErr(RF, RoutineName)) return call RegUnpack(RF, OutData%MD_FileName); if (RegCheckErr(RF, RoutineName)) return call RegUnpack(RF, OutData%DT_mooring); if (RegCheckErr(RF, RoutineName)) return call RegUnpack(RF, OutData%n_mooring); if (RegCheckErr(RF, RoutineName)) return @@ -1257,6 +1264,9 @@ subroutine Farm_CopyMD_Data(SrcMD_DataData, DstMD_DataData, CtrlCode, ErrStat, E call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) if (ErrStat >= AbortErrLev) return DstMD_DataData%IsInitialized = SrcMD_DataData%IsInitialized + DstMD_DataData%VTK_count = SrcMD_DataData%VTK_count + DstMD_DataData%VTK_TWidth = SrcMD_DataData%VTK_TWidth + DstMD_DataData%VTK_OutFileRoot = SrcMD_DataData%VTK_OutFileRoot end subroutine subroutine Farm_DestroyMD_Data(MD_DataData, ErrStat, ErrMsg) @@ -1326,6 +1336,9 @@ subroutine Farm_PackMD_Data(RF, Indata) call MD_PackOutput(RF, InData%y) call MD_PackMisc(RF, InData%m) call RegPack(RF, InData%IsInitialized) + call RegPack(RF, InData%VTK_count) + call RegPack(RF, InData%VTK_TWidth) + call RegPack(RF, InData%VTK_OutFileRoot) if (RegCheckErr(RF, RoutineName)) return end subroutine @@ -1361,6 +1374,9 @@ subroutine Farm_UnPackMD_Data(RF, OutData) call MD_UnpackOutput(RF, OutData%y) ! y call MD_UnpackMisc(RF, OutData%m) ! m call RegUnpack(RF, OutData%IsInitialized); if (RegCheckErr(RF, RoutineName)) return + call RegUnpack(RF, OutData%VTK_count); if (RegCheckErr(RF, RoutineName)) return + call RegUnpack(RF, OutData%VTK_TWidth); if (RegCheckErr(RF, RoutineName)) return + call RegUnpack(RF, OutData%VTK_OutFileRoot); if (RegCheckErr(RF, RoutineName)) return end subroutine subroutine Farm_CopyWAT_IfW_data(SrcWAT_IfW_dataData, DstWAT_IfW_dataData, CtrlCode, ErrStat, ErrMsg) diff --git a/reg_tests/CTestList.cmake b/reg_tests/CTestList.cmake index 8d48adcc3..19ad3797a 100644 --- a/reg_tests/CTestList.cmake +++ b/reg_tests/CTestList.cmake @@ -386,12 +386,13 @@ of_regression_linear("5MW_OC3Mnpl_Linear" "" "openfas # FAST Farm regression tests if(BUILD_FASTFARM) - ff_regression("TSinflow" "fastfarm") - ff_regression("LESinflow" "fastfarm") -# ff_regression("Uninflow_curl" "fastfarm") - ff_regression("TSinflow_curl" "fastfarm") - ff_regression("ModAmb_3" "fastfarm") - ff_regression("TSinflowADskSED" "fastfarm;aerodisk;simple-elastodyn") + ff_regression("TSinflow" "fastfarm") + ff_regression("LESinflow" "fastfarm") +# ff_regression("Uninflow_curl" "fastfarm") + ff_regression("TSinflow_curl" "fastfarm") + ff_regression("ModAmb_3" "fastfarm") + ff_regression("TSinflowADskSED" "fastfarm;aerodisk;simple-elastodyn") + ff_regression("MD_Shared" "fastfarm;moordyn") endif() # AeroDyn regression tests diff --git a/reg_tests/r-test b/reg_tests/r-test index d641aeb7d..b69e2fe2f 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit d641aeb7df530a0249b0679ac5de6829069c58c4 +Subproject commit b69e2fe2f1deffdbd8c56e6064d5322a29335ec4