Skip to content

Commit 7f5b3a1

Browse files
authored
Merge pull request #3104 from andrew-platt/b/FF_WAT_scalebox
FF WAT: change default WAT_Scalebox to True
2 parents f90d379 + d02ee8c commit 7f5b3a1

File tree

6 files changed

+61
-13
lines changed

6 files changed

+61
-13
lines changed

docs/source/user/fast.farm/InputFiles.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,11 +637,14 @@ These are used only if WAT=2.
637637
**WAT_DxDyDz**: [three floats, comma separated]
638638
Distances (in meters) between points in the x, y, and z directions of the WAT_BoxFile
639639
These are used only if WAT=2.
640-
When **WAT=1** the dimensions in each directions are taken as :math:`dx=dy=dz=0.03*\text{RotorDiamRef}`.
640+
When **WAT=1** the dimensions will be set to **[dX_high, dY_high, dZ_high]** if
641+
that is the same for all turbines, otherwise the dimeinaiona will be calculated
642+
using the guidance with :math:`dx=dy=dz=0.03*\text{RotorDiamRef}`.
643+
641644

642645
**WAT_ScaleBox**: [flag]
643646
When set to True, the input turbulence box is scaled so that it has zero mean and unit standard deviation at every node.
644-
DEFAULT is False.
647+
DEFAULT is True.
645648

646649
**WAT_k_Def** [five floats, comma separated] :math:`[k_\text{def}, k_\text{FMin}, k_\text{DMin}, k_\text{DMax}, e]`
647650
Tuning parameters for quasi-steady wake deficit effect in the wake-added

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

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,23 @@ SUBROUTINE Farm_PrintSum( farm, WD_InputFileData, ErrStat, ErrMsg )
168168
end select
169169
WRITE (UnSum,'(2X,A)') 'Calibrated parameter for wake meandering (-): '//trim(Num2LStr(farm%AWAE%p%C_Meander))
170170

171-
!FIXME: add summary info about WAT
171+
if (farm%p%WAT == 0) then
172+
write (UnSum,'(/,2X,A)') 'Wake added turbulence: off'
173+
else
174+
write (UnSum,'(/,2X,A)') 'Wake-Added Turbulence (WAT):'
175+
write (UnSum,'(4X,A,3(I8,1X))') 'WAT_NxNyNz: ',farm%p%WAT_NxNyNz(1:3)
176+
write (UnSum,'(4X,A,3(f9.3))') 'WAT_DxDyDz: ',farm%p%WAT_DxDyDz(1:3)
177+
if (farm%p%WAT_ScaleBox) then
178+
write (UnSum,'(4X,A,A)') 'WAT_ScaleBox: ','.TRUE.'
179+
else
180+
write (UnSum,'(4X,A,A)') 'WAT_ScaleBox: ','.FALSE.'
181+
endif
182+
write (UnSum,'(4X,A)') 'coefficients:'
183+
write (UnSum,'(16X,A)') 'k_c f_min D_min D_max e'
184+
write (UnSum,'(A12,5(f9.3))') 'k_Def', WD_InputFileData%WAT_k_Def_k_c, WD_InputFileData%WAT_k_Def_FMin, WD_InputFileData%WAT_k_Def_DMin, WD_InputFileData%WAT_k_Def_DMax, WD_InputFileData%WAT_k_Def_Exp
185+
write (UnSum,'(A12,5(f9.3))') 'k_Grad',WD_InputFileData%WAT_k_Grad_k_c,WD_InputFileData%WAT_k_Grad_FMin,WD_InputFileData%WAT_k_Grad_DMin,WD_InputFileData%WAT_k_Grad_DMax,WD_InputFileData%WAT_k_Grad_Exp
186+
endif
187+
172188

173189
WRITE (UnSum,'(/,A)' ) 'Time Steps'
174190
WRITE (UnSum,'(2X,A)') 'Component Time Step Subcyles'
@@ -837,7 +853,7 @@ SUBROUTINE Farm_ReadPrimaryFile( InputFile, p, WD_InitInp, AWAE_InitInp, OutList
837853
CALL ReadVar( UnIn, InputFile, p%WAT_BoxFile, 'WAT_BoxFile', "Filepath to the file containing the u-component of the turbulence box (either predefined or user-defined) (quoted string)", ErrStat2, ErrMsg2, UnEc ); if(failed()) return
838854
call ReadAry( UnIn, InputFile, p%WAT_NxNyNz, 3, "WAT_NxNyNz", "Number of points in the x, y, and z directions of the WAT_BoxFile [used only if WAT=2] (m)", ErrStat2, ErrMsg2, UnEc ); if(failed()) return
839855
call ReadAry( UnIn, InputFile, p%WAT_DxDyDz, 3, "WAT_DxDyDz", "Distance (in meters) between points in the x, y, and z directions of the WAT_BoxFile [used only if WAT=2] (m)", ErrStat2, ErrMsg2, UnEc ); if(failed()) return
840-
call ReadVarWDefault( UnIn, InputFile, p%WAT_ScaleBox, "WAT_ScaleBox", "Flag to scale the input turbulence box to zero mean and unit standard deviation at every node", .False., ErrStat2, ErrMsg2, UnEc); if(failed()) return
856+
call ReadVarWDefault( UnIn, InputFile, p%WAT_ScaleBox, "WAT_ScaleBox", "Flag to scale the input turbulence box to zero mean and unit standard deviation at every node", .True., ErrStat2, ErrMsg2, UnEc); if(failed()) return
841857
call ReadAryWDefault( UnIn, InputFile, TmpRAry5, 5, "WAT_k_Def", &
842858
"Calibrated parameters for the influence of the maximum wake deficit on wake-added turbulence (set of 5 parameters: k_Def , DMin, DMax, FMin, Exp) (-) [>=0.0, >=0.0, >DMin, >=0.0 and <=1.0, >=0.0] or DEFAULT [DEFAULT=[0.6, 0.0, 0.0, 2.0, 1.0 ]]", &
843859
(/0.6_ReKi, 0.0_ReKi, 0.0_ReKi, 2.0_ReKi, 1.00_ReKi/), ErrStat2, ErrMsg2, UnEc); if(failed()) return
@@ -1086,9 +1102,9 @@ SUBROUTINE Farm_ValidateInput( p, WD_InitInp, AWAE_InitInp, ErrStat, ErrMsg )
10861102
! summary table
10871103
call WrScr(' Wake-Added Turbulence (WAT): coefficients:')
10881104
call WrScr(' k_c f_min D_min D_max e')
1089-
write(tmpStr,'(A6,A6,6(f9.3))') '','k_Def', WD_InitInp%WAT_k_Def_k_c, WD_InitInp%WAT_k_Def_FMin, WD_InitInp%WAT_k_Def_DMin, WD_InitInp%WAT_k_Def_DMax, WD_InitInp%WAT_k_Def_Exp
1105+
write(tmpStr,'(A12,5(f9.3))') 'k_Def', WD_InitInp%WAT_k_Def_k_c, WD_InitInp%WAT_k_Def_FMin, WD_InitInp%WAT_k_Def_DMin, WD_InitInp%WAT_k_Def_DMax, WD_InitInp%WAT_k_Def_Exp
10901106
call WrScr(tmpStr)
1091-
write(tmpStr,'(A6,A6,6(f9.3))') '','k_Grad',WD_InitInp%WAT_k_Grad_k_c,WD_InitInp%WAT_k_Grad_FMin,WD_InitInp%WAT_k_Grad_DMin,WD_InitInp%WAT_k_Grad_DMax,WD_InitInp%WAT_k_Grad_Exp
1107+
write(tmpStr,'(A12,5(f9.3))') 'k_Grad',WD_InitInp%WAT_k_Grad_k_c,WD_InitInp%WAT_k_Grad_FMin,WD_InitInp%WAT_k_Grad_DMin,WD_InitInp%WAT_k_Grad_DMax,WD_InitInp%WAT_k_Grad_Exp
10921108
call WrScr(tmpStr)
10931109
endif
10941110

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

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,7 @@ SUBROUTINE WAT_init( p, WAT_IfW, AWAE_InitInput, ErrStat, ErrMsg )
345345
call MannLibDims(BoxFileRoot, p%RotorDiamRef, p%WAT_NxNyNz, p%WAT_DxDyDz, ErrStat2, ErrMsg2); if (Failed()) return
346346
write(sDummy, '(3(I8,1X))') p%WAT_NxNyNz
347347
call WrScr(' WAT: NxNyNz set to: '//trim(sDummy)//' (inferred from filename)')
348-
write(sDummy, '(3(F8.3,1X))') p%WAT_DxDyDz
349-
call WrScr(' WAT: DxDyDz set to: '//trim(sDummy)//' (based on rotor diameter)')
348+
call Set_WAT_DxDyDz() ! Use turbine high res deltas if all same
350349
endif
351350
! Sanity check
352351
if (any(p%WAT_NxNyNz<2)) then
@@ -481,7 +480,7 @@ subroutine MannLibDims(BoxFileRoot,RotorDiamRef,Nxyz,Dxyz,ErrStat3,ErrMsg3)
481480
ErrStat3 = ErrID_None
482481
ErrMsg3 = ""
483482

484-
! Set Dxyz
483+
! Calculate Dxyz based on guidance
485484
Dxyz=real(RotorDiamRef,ReKi)*ScaleFact
486485

487486
! --- Create a string made of digits and "x" only, starting from the end of the filename
@@ -518,6 +517,38 @@ subroutine MannLibDims(BoxFileRoot,RotorDiamRef,Nxyz,Dxyz,ErrStat3,ErrMsg3)
518517
ErrStat3=ErrID_None
519518
ErrMsg3 =""
520519
end subroutine MannLibDims
520+
subroutine Set_WAT_DxDyDz()
521+
real(ReKi) :: TmpDx,TmpDy,TmpDz
522+
logical :: HResDimsSame
523+
! If Mod_AmbWind<2, we don't read high res discretizations
524+
if (AWAE_InitInput%InputFileData%Mod_AmbWind < 2) then
525+
write(sDummy, '(3(F8.3,1X))') p%WAT_DxDyDz
526+
call WrScr(' WAT: DxDyDz set to: '//trim(sDummy)//' (calculated based on guidance for Mod_AmbWind==1)')
527+
return
528+
endif
529+
! Check if all turbines use the same high res deltas
530+
HResDimsSame = .true.
531+
TmpDx = AWAE_InitInput%InputFileData%dX_high(1)
532+
TmpDy = AWAE_InitInput%InputFileData%dY_high(1)
533+
TmpDz = AWAE_InitInput%InputFileData%dZ_high(1)
534+
do i=2,size(AWAE_InitInput%InputFileData%dX_high)
535+
if (.not. EqualRealNos(TmpDx,AWAE_InitInput%InputFileData%dX_high(i))) HResDimsSame = .false.
536+
if (.not. EqualRealNos(TmpDy,AWAE_InitInput%InputFileData%dY_high(i))) HResDimsSame = .false.
537+
if (.not. EqualRealNos(TmpDz,AWAE_InitInput%InputFileData%dZ_high(i))) HResDimsSame = .false.
538+
enddo
539+
! if all turbines use same high res spacing, use that for WAT spacing
540+
if (HResDimsSame) then
541+
p%WAT_DxDyDz(1) = TmpDx
542+
p%WAT_DxDyDz(2) = TmpDy
543+
p%WAT_DxDyDz(3) = TmpDz
544+
write(sDummy, '(3(F8.3,1X))') p%WAT_DxDyDz
545+
call WrScr(' WAT: DxDyDz set to: '//trim(sDummy)//' (using high res grid resolution)')
546+
! otherwise fall back to calculated values from MannLibDims
547+
else
548+
write(sDummy, '(3(F8.3,1X))') p%WAT_DxDyDz
549+
call WrScr(' WAT: DxDyDz set to: '//trim(sDummy)//' (high res grids are not identical for all turbines, calculated based on guidance instead)')
550+
endif
551+
end subroutine Set_WAT_DxDyDz
521552
end subroutine WAT_init
522553

523554
!> Remove mean from all grid nodes and set standard deviation to 1 at all nodes

modules/elastodyn/src/ElastoDyn_Types.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ MODULE ElastoDyn_Types
700700
REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: FirstMom !< First mass moment of inertia of blades wrt the root [-]
701701
REAL(ReKi) :: GenIner = 0.0_ReKi !< Generator inertia about HSS [-]
702702
REAL(ReKi) :: Hubf1Iner = 0.0_ReKi !< Inertia of hub about f1-axis (rotor centerline) [-]
703-
REAL(ReKi) :: Hubf2Iner = 0.0_ReKi !< Inertia of hub about f2-axis (transverse to the hub and passing through its c.g.) [-]
703+
REAL(ReKi) :: Hubf2Iner = 0.0_ReKi !< Inertia of hub about f2-axis (teeter axis) [-]
704704
REAL(ReKi) :: HubMass = 0.0_ReKi !< Hub mass [-]
705705
REAL(ReKi) :: Nacd2Iner = 0.0_ReKi !< Inertia of nacelle about the d2-axis whose origin is the nacelle center of mass [-]
706706
REAL(ReKi) :: NacMass = 0.0_ReKi !< Nacelle mass [-]

modules/wakedynamics/src/WakeDynamics_Registry.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ typedef ^ WD_InputFileType ReKi k_vCurl - -
5555
typedef ^ WD_InputFileType Logical OutAllPlanes - - - "Output all planes" -
5656
# wake added turbulence (WAT) inputs
5757
typedef ^ WD_InputFileType Logical WAT - - - "Switch for turning on and off wake-added turbulence" -
58-
#typedef ^ WD_InputFileType ReKi WAT_k_Def {5} - - "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 ]]" -
5958
typedef ^ WD_InputFileType ReKi WAT_k_Def_k_c - - - "Calibrated parameter for the influence of the maximum wake deficit on wake-added turblence (-) [>=0] or DEFAULT [DEFAULT=0.6]" -
6059
typedef ^ WD_InputFileType ReKi WAT_k_Def_FMin - - - "Calibrated parameter in the eddy viscosity filter function for the WAT maximum wake deficit defining the value in the minimum region [>=0.0 and <=1.0] or DEFAULT [DEFAULT=0.0]" -
6160
typedef ^ WD_InputFileType ReKi WAT_k_Def_DMin - - - "Calibrated parameter in the eddy viscosity filter function for the WAT maximum wake deficit defining the transitional diameter fraction between the minimum and exponential regions [>=0.0] or DEFAULT [DEFAULT=0.0]" -
@@ -183,7 +182,6 @@ typedef ^ ParameterType CHARACTER(1024) OutFileVTKDir - - - "The parent di
183182
typedef ^ ParameterType IntKi TurbNum - 0 - "Turbine ID number (start with 1; end with number of turbines)" -
184183
# wake added turbulence (WAT) parameters
185184
typedef ^ ParameterType Logical WAT - - - "Switch for turning on and off wake-added turbulence" -
186-
#typedef ^ ParameterType ReKi WAT_k_Def {5} - - "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 ]]" -
187185
typedef ^ ParameterType ReKi WAT_k_Def_k_c - - - "Calibrated parameter for the influence of the maximum wake deficit on wake-added turblence (-) [>=0] or DEFAULT [DEFAULT=0.6]" -
188186
typedef ^ ParameterType ReKi WAT_k_Def_FMin - - - "Calibrated parameter in the eddy viscosity filter function for the WAT maximum wake deficit defining the value in the minimum region [>=0.0 and <=1.0] or DEFAULT [DEFAULT=0.0]" -
189187
typedef ^ ParameterType ReKi WAT_k_Def_DMin - - - "Calibrated parameter in the eddy viscosity filter function for the WAT maximum wake deficit defining the transitional diameter fraction between the minimum and exponential regions [>=0.0] or DEFAULT [DEFAULT=0.0]" -

0 commit comments

Comments
 (0)