Skip to content

Commit

Permalink
AD: respecting Skew_Mod and SkewRedistr_Mod
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Branlard committed May 6, 2024
1 parent 791956d commit c41c62e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
9 changes: 8 additions & 1 deletion modules/aerodyn/src/AeroDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4369,9 +4369,17 @@ SUBROUTINE Init_BEMTmodule( InputFileData, RotInputFileData, u_AD, u, p, p_AD, x

InitInp%airDens = InputFileData%AirDens
InitInp%kinVisc = InputFileData%KinVisc
! --- Skew
InitInp%skewWakeMod = InputFileData%Skew_Mod
InitInp%skewRedistrMod = InputFileData%SkewRedistr_Mod
InitInp%yawCorrFactor = InputFileData%SkewModFactor
InitInp%MomentumCorr = InputFileData%SkewMomCorr
! Safety
if (InputFileData%Skew_Mod /= Skew_Mod_Active) then
InitInp%skewRedistrMod = SkewRedistrMod_None
InitInp%MomentumCorr = .False.
endif
! --- Algo
InitInp%aTol = InputFileData%IndToler
InitInp%useTipLoss = InputFileData%TipLoss
InitInp%useHubLoss = InputFileData%HubLoss
Expand Down Expand Up @@ -4482,7 +4490,6 @@ SUBROUTINE Init_BEMTmodule( InputFileData, RotInputFileData, u_AD, u, p, p_AD, x
InitInp%SumPrint = InputFileData%SumPrint
InitInp%RootName = p%RootName
InitInp%BEM_Mod = InputFileData%BEM_Mod
InitInp%MomentumCorr = InputFileData%SkewMomCorr
p%BEM_Mod = InputFileData%BEM_Mod ! TODO try to get rid of me

! --- Print BEM formulation to screen
Expand Down
6 changes: 3 additions & 3 deletions modules/aerodyn/src/BEMT.f90
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,10 @@ subroutine BEMT_SetParameters( InitInp, p, errStat, errMsg )
p%kinVisc = InitInp%kinVisc
p%skewWakeMod = InitInp%skewWakeMod
if (p%skewWakeMod==Skew_Mod_Active) then
p%skewRedistrMod = InitInp%skewRedistrMod
p%SkewRedistrMod = InitInp%SkewRedistrMod
p%MomentumCorr = InitInp%MomentumCorr
else
p%skewRedistrMod = SkewRedistrMod_None
p%SkewRedistrMod = SkewRedistrMod_None
p%MomentumCorr = .false.
endif
p%yawCorrFactor = InitInp%yawCorrFactor
Expand Down Expand Up @@ -1608,7 +1608,7 @@ subroutine ApplySkewedWakeCorrection_AllNodes(p, u, m, x, phi, OtherState, axInd
do i = 1,p%numBladeNodes ! Loop through the blade nodes / elements
if ( .not. p%FixedInductions(i,j) ) then
F = getHubTipLossCorrection(p%BEM_Mod, p%useHubLoss, p%useTipLoss, p%hubLossConst(i,j), p%tipLossConst(i,j), phi(i,j), u%cantAngle(i,j) )
call ApplySkewedWakeCorrection( p%BEM_Mod, p%skewRedistrMod, p%yawCorrFactor, F, u%psi_s(j), u%psiSkewOffset, u%chi0, u%rlocal(i,j)/m%Rtip(j), axInduction(i,j), chi(i,j), m%FirstWarn_Skew )
call ApplySkewedWakeCorrection( p%BEM_Mod, p%SkewRedistrMod, p%yawCorrFactor, F, u%psi_s(j), u%psiSkewOffset, u%chi0, u%rlocal(i,j)/m%Rtip(j), axInduction(i,j), chi(i,j), m%FirstWarn_Skew )
end if ! .not. p%FixedInductions (special case for tip and/or hub loss)
enddo ! I - Blade nodes / elements
enddo ! J - All blades
Expand Down
6 changes: 5 additions & 1 deletion modules/aerodyn/src/BEMTUncoupled.f90
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ subroutine ApplySkewedWakeCorrection(BEM_Mod, SkewRedistrMod, yawCorrFactor, F,
! Local variables
real(ReKi) :: yawCorr
real(ReKi) :: yawCorr_tan ! magnitude of the tan(chi/2) correction term (with possible limits)

if (SkewRedistrMod==SkewRedistrMod_None) then
return
endif

! Skewed wake correction
if(BEM_Mod==BEMMod_2D) then
Expand All @@ -480,7 +484,7 @@ subroutine ApplySkewedWakeCorrection(BEM_Mod, SkewRedistrMod, yawCorrFactor, F,

if (FirstWarn) then
call WrScr( 'Warning: SkewedWakeCorrection encountered a large value of chi ('//trim(num2lstr(chi*R2D))// &
' deg), so the yaw correction will be limited. This warning will not be repeated though the condition may persist. See the AD15 chi output channels, and'// &
' deg), so the yaw correction will be limited. This warning will not be repeated though the condition may persist. See the AD chi output channels, and'// &
' consider turning off the Pitt/Peters skew model (set SkewMod=1) if this condition persists.'//NewLine)
FirstWarn = .false.
end if
Expand Down

0 comments on commit c41c62e

Please sign in to comment.