Skip to content

Commit

Permalink
AD: FrozenWake <> DBEMT =-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ebranlard committed Nov 30, 2023
1 parent 2112fe0 commit 834a81e
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 54 deletions.
8 changes: 4 additions & 4 deletions docs/source/user/aerodyn/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ tower or FALSE to disable these effects.

During linearization analyses
with AeroDyn coupled OpenFAST and BEM enabled (``WakeMod = 1``), set the
``FrozenWake`` flag to TRUE to employ frozen-wake assumptions during
linearization (i.e. to fix the axial and tangential induces velocities,
and, at their operating-point values during linearization) or FALSE to
recalculate the induction during linearization using BEM theory.
``DBEMT_Mod=-1`` to employ frozen-wake assumptions
(i.e. to fix the axial and tangential induces velocities, and, at their operating-point values during linearization)
or
``DBEMT_Mod=3`` to use the continuous dynamic wake model.

Set the ``CavitCheck`` flag to TRUE to perform a cavitation check for MHK
turbines or FALSE to disable this calculation. If ``CavitCheck`` is
Expand Down
16 changes: 9 additions & 7 deletions docs/source/user/aerodyn/modeling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ Linearization


When coupled to FAST, AeroDyn can be linearized as part of the
linearization of the full coupled solution. When induction is enabled
(``WakeMod = 1``), we recommend to base the linearized solution on the
frozen-wake assumption, by setting ``FrozenWake = TRUE``. The UA
models are not set up to support linearization, so, UA must be disabled
during linearization by setting ``AFAeroMod = 1``. Linearization is not
currently possible when modeling an MHK turbine, but we will attempt to
enable it in an upcoming release.
linearization of the full coupled solution.
A subset of the AeroDyn modules options are available.

Dynamic wake can be linearized with
`DBEMT_Mod=-1` (frozen-wake)
`DBEMT_Mod=3` (dynamic continuous state-space model).

Unsteady aerodynamics can be linearized with:
`UAMod={0, 4, 5, 7`} (no UA, or continuous state-space models).
23 changes: 6 additions & 17 deletions modules/aerodyn/src/AeroDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,10 @@ subroutine AD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut
InputFileData%TwrPotent = TwrPotent_none
InputFileData%TwrShadow = TwrShadow_none
InputFileData%TwrAero = .false.
InputFileData%FrozenWake = .false.
!InputFileData%CavitCheck = .false.
!InputFileData%TFinAero = .false. ! not sure if this needs to be set or not
end do

if (InputFileData%WakeMod == WakeMod_DBEMT) then
! these models (DBEMT and BEMT) should be the same at the first time step, so we'll simplify here
InputFileData%WakeMod = WakeMod_BEMT
end if
InputFileData%DBEMT_Mod = 0
end if

! Validate the inputs
Expand Down Expand Up @@ -1335,19 +1330,13 @@ subroutine SetParameters( InitInp, InputFileData, RotData, p, p_AD, ErrStat, Err

p_AD%DT = InputFileData%DTAero
p_AD%WakeMod = InputFileData%WakeMod
p%DBEMT_Mod = InputFileData%DBEMT_Mod
p%TwrPotent = InputFileData%TwrPotent
p%TwrShadow = InputFileData%TwrShadow
p%TwrAero = InputFileData%TwrAero
p%CavitCheck = InputFileData%CavitCheck
p%Buoyancy = InputFileData%Buoyancy



if (InitInp%Linearize .and. InputFileData%WakeMod == WakeMod_BEMT) then
p%FrozenWake = InputFileData%FrozenWake
else
p%FrozenWake = .FALSE.
end if

p%CompAA = InputFileData%CompAA

Expand Down Expand Up @@ -5494,7 +5483,7 @@ SUBROUTINE Rot_JacobianPInput( t, u, p, p_AD, x, xd, z, OtherState, y, m, m_AD,


! get OP values here (i.e., set inputs for BEMT):
if ( p%FrozenWake ) then
if ( p%DBEMT_Mod == DBEMT_frozen ) then
call SetInputs(t, p, p_AD, u, m, indx, errStat2, errMsg2)
call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName) ! we shouldn't have any errors about allocating memory here so I'm not going to return-on-error until later

Expand Down Expand Up @@ -5812,7 +5801,7 @@ SUBROUTINE RotJacobianPContState( t, u, p, p_AD, x, xd, z, OtherState, y, m, m_A
ErrMsg = ''


if ( p%FrozenWake ) then
if ( p%DBEMT_Mod == DBEMT_frozen ) then
call SetInputs(t, p, p_AD, u, m, indx, errStat2, errMsg2)
call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)

Expand Down Expand Up @@ -6190,7 +6179,7 @@ SUBROUTINE RotJacobianPConstrState( t, u, p, p_AD, x, xd, z, OtherState, y, m, m
call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName) ! we shouldn't have any errors about allocating memory here so I'm not going to return-on-error until later


if ( p%FrozenWake ) then
if ( p%DBEMT_Mod == DBEMT_frozen ) then
! compare arguments with call to BEMT_CalcOutput
call computeFrozenWake(m%BEMT_u(op_indx), p%BEMT, m%BEMT_y, m%BEMT )
m%BEMT%UseFrozenWake = .true.
Expand Down Expand Up @@ -7323,7 +7312,7 @@ SUBROUTINE Init_Jacobian( InputFileData, p, p_AD, u, y, m, InitOut, ErrStat, Err
call Init_Jacobian_y( p, p_AD, y, InitOut, ErrStat, ErrMsg)

! these matrices will be needed for linearization with frozen wake feature
if (p%FrozenWake) then
if ( p%DBEMT_Mod == DBEMT_frozen ) then
call AllocAry(m%BEMT%AxInd_op,p%NumBlNds,p%numBlades,'m%BEMT%AxInd_op', ErrStat2,ErrMsg2); call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
call AllocAry(m%BEMT%TnInd_op,p%NumBlNds,p%numBlades,'m%BEMT%TnInd_op', ErrStat2,ErrMsg2); call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
end if
Expand Down
34 changes: 17 additions & 17 deletions modules/aerodyn/src/AeroDyn_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ SUBROUTINE ParsePrimaryFileInfo( PriPath, InitInp, InputFile, RootName, NumBlade
if (frozenWakeProvided) then
if (InputFileData%FrozenWake) then
call WrScr(' FrozenWake=True -> Setting DBEMT_Mod=-1')
! InputFileData%DBEMT_Mod =-1
InputFileData%DBEMT_Mod = DBEMT_frozen
else
call WrScr(' FrozenWake=False -> Not changing DBEMT_Mod')
endif
Expand Down Expand Up @@ -1624,24 +1624,24 @@ SUBROUTINE AD_PrintSum( InputFileData, p, p_AD, u, y, ErrStat, ErrMsg )
! MaxIter


if (p_AD%WakeMod == WakeMod_DBEMT) then
select case (InputFileData%DBEMT_Mod)
case (DBEMT_tauConst)
Msg = 'constant tau1'
case (DBEMT_tauVaries)
Msg = 'time-dependent tau1'
case (DBEMT_cont_tauConst)
Msg = 'continuous formulation with constant tau1'
case default
Msg = 'unknown'
end select

WRITE (UnSu,Ec_IntFrmt) InputFileData%DBEMT_Mod, 'DBEMT_Mod', 'Type of dynamic BEMT (DBEMT) model: '//TRIM(Msg)
select case (InputFileData%DBEMT_Mod)
case (DBEMT_frozen)
Msg = 'frozen-wake'
case (DBEMT_tauConst)
Msg = 'dynamic - constant tau1'
case (DBEMT_tauVaries)
Msg = 'dynamic - time-dependent tau1'
case (DBEMT_cont_tauConst)
Msg = 'dynamic - continuous formulation with constant tau1'
case default
Msg = 'unknown'
end select

WRITE (UnSu,Ec_IntFrmt) InputFileData%DBEMT_Mod, 'DBEMT_Mod', 'Type of dynamic BEMT (DBEMT) model: '//TRIM(Msg)

if (InputFileData%DBEMT_Mod==DBEMT_tauConst) &
WRITE (UnSu,Ec_ReFrmt) InputFileData%tau1_const, 'tau1_const', 'Time constant for DBEMT (s)'
if (InputFileData%DBEMT_Mod==DBEMT_tauConst) &
WRITE (UnSu,Ec_ReFrmt) InputFileData%tau1_const, 'tau1_const', 'Time constant for DBEMT (s)'

end if

end if

Expand Down
4 changes: 2 additions & 2 deletions modules/aerodyn/src/AeroDyn_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ typedef ^ AD_InputFile IntKi AFAeroMod - - - "Type of blade airfoil aerodynamics
typedef ^ AD_InputFile IntKi TwrPotent - - - "Type of tower influence on wind based on potential flow around the tower {0=none, 1=baseline potential flow, 2=potential flow with Bak correction}" -
typedef ^ AD_InputFile IntKi TwrShadow - - - "Type of tower influence on wind based on downstream tower shadow {0=none, 1=Powles model, 2=Eames model}" -
typedef ^ AD_InputFile LOGICAL TwrAero - - - "Calculate tower aerodynamic loads?" flag
typedef ^ AD_InputFile Logical FrozenWake - - - "Flag that tells this module it should assume a frozen wake during linearization." -
typedef ^ AD_InputFile Logical FrozenWake - - - "LEGACY - Flag that tells this module it should assume a frozen wake during linearization." -
typedef ^ AD_InputFile Logical CavitCheck - - - "Flag that tells us if we want to check for cavitation" -
typedef ^ AD_InputFile Logical Buoyancy - - - "Include buoyancy effects?" flag
typedef ^ AD_InputFile Logical CompAA - - - "Compute AeroAcoustic noise" flag
Expand Down Expand Up @@ -378,7 +378,7 @@ typedef ^ RotParameterType Integer NumBl_Lin - - - "
typedef ^ RotParameterType IntKi TwrPotent - - - "Type of tower influence on wind based on potential flow around the tower {0=none, 1=baseline potential flow, 2=potential flow with Bak correction}" -
typedef ^ RotParameterType IntKi TwrShadow - - - "Type of tower influence on wind based on downstream tower shadow {0=none, 1=Powles model, 2=Eames model}" -
typedef ^ RotParameterType LOGICAL TwrAero - - - "Calculate tower aerodynamic loads?" flag
typedef ^ RotParameterType Logical FrozenWake - - - "Flag that tells this module it should assume a frozen wake during linearization." -
typedef ^ RotParameterType Integer DBEMT_Mod - - - "DBEMT_Mod" -
typedef ^ RotParameterType Logical CavitCheck - - - "Flag that tells us if we want to check for cavitation" -
typedef ^ RotParameterType Logical Buoyancy - - - "Include buoyancy effects?" flag
typedef ^ RotParameterType IntKi MHK - - - "MHK" flag
Expand Down
10 changes: 5 additions & 5 deletions modules/aerodyn/src/AeroDyn_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ MODULE AeroDyn_Types
INTEGER(IntKi) :: TwrPotent = 0_IntKi !< Type of tower influence on wind based on potential flow around the tower {0=none, 1=baseline potential flow, 2=potential flow with Bak correction} [-]
INTEGER(IntKi) :: TwrShadow = 0_IntKi !< Type of tower influence on wind based on downstream tower shadow {0=none, 1=Powles model, 2=Eames model} [-]
LOGICAL :: TwrAero = .false. !< Calculate tower aerodynamic loads? [flag]
LOGICAL :: FrozenWake = .false. !< Flag that tells this module it should assume a frozen wake during linearization. [-]
LOGICAL :: FrozenWake = .false. !< LEGACY - Flag that tells this module it should assume a frozen wake during linearization. [-]
LOGICAL :: CavitCheck = .false. !< Flag that tells us if we want to check for cavitation [-]
LOGICAL :: Buoyancy = .false. !< Include buoyancy effects? [flag]
LOGICAL :: CompAA = .false. !< Compute AeroAcoustic noise [flag]
Expand Down Expand Up @@ -417,7 +417,7 @@ MODULE AeroDyn_Types
INTEGER(IntKi) :: TwrPotent = 0_IntKi !< Type of tower influence on wind based on potential flow around the tower {0=none, 1=baseline potential flow, 2=potential flow with Bak correction} [-]
INTEGER(IntKi) :: TwrShadow = 0_IntKi !< Type of tower influence on wind based on downstream tower shadow {0=none, 1=Powles model, 2=Eames model} [-]
LOGICAL :: TwrAero = .false. !< Calculate tower aerodynamic loads? [flag]
LOGICAL :: FrozenWake = .false. !< Flag that tells this module it should assume a frozen wake during linearization. [-]
INTEGER(IntKi) :: DBEMT_Mod = 0_IntKi !< DBEMT_Mod [-]
LOGICAL :: CavitCheck = .false. !< Flag that tells us if we want to check for cavitation [-]
LOGICAL :: Buoyancy = .false. !< Include buoyancy effects? [flag]
INTEGER(IntKi) :: MHK = 0_IntKi !< MHK [flag]
Expand Down Expand Up @@ -5660,7 +5660,7 @@ subroutine AD_CopyRotParameterType(SrcRotParameterTypeData, DstRotParameterTypeD
DstRotParameterTypeData%TwrPotent = SrcRotParameterTypeData%TwrPotent
DstRotParameterTypeData%TwrShadow = SrcRotParameterTypeData%TwrShadow
DstRotParameterTypeData%TwrAero = SrcRotParameterTypeData%TwrAero
DstRotParameterTypeData%FrozenWake = SrcRotParameterTypeData%FrozenWake
DstRotParameterTypeData%DBEMT_Mod = SrcRotParameterTypeData%DBEMT_Mod
DstRotParameterTypeData%CavitCheck = SrcRotParameterTypeData%CavitCheck
DstRotParameterTypeData%Buoyancy = SrcRotParameterTypeData%Buoyancy
DstRotParameterTypeData%MHK = SrcRotParameterTypeData%MHK
Expand Down Expand Up @@ -5941,7 +5941,7 @@ subroutine AD_PackRotParameterType(Buf, Indata)
call RegPack(Buf, InData%TwrPotent)
call RegPack(Buf, InData%TwrShadow)
call RegPack(Buf, InData%TwrAero)
call RegPack(Buf, InData%FrozenWake)
call RegPack(Buf, InData%DBEMT_Mod)
call RegPack(Buf, InData%CavitCheck)
call RegPack(Buf, InData%Buoyancy)
call RegPack(Buf, InData%MHK)
Expand Down Expand Up @@ -6284,7 +6284,7 @@ subroutine AD_UnPackRotParameterType(Buf, OutData)
if (RegCheckErr(Buf, RoutineName)) return
call RegUnpack(Buf, OutData%TwrAero)
if (RegCheckErr(Buf, RoutineName)) return
call RegUnpack(Buf, OutData%FrozenWake)
call RegUnpack(Buf, OutData%DBEMT_Mod)
if (RegCheckErr(Buf, RoutineName)) return
call RegUnpack(Buf, OutData%CavitCheck)
if (RegCheckErr(Buf, RoutineName)) return
Expand Down
5 changes: 3 additions & 2 deletions modules/aerodyn/src/BEMT.f90
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,8 @@ subroutine BEMT_Init( InitInp, u, p, x, xd, z, OtherState, AFInfo, y, misc, Inte
call BEMT_InitOtherStates( OtherState, p, errStat, errMsg ) ! initialize the other states
if (errStat >= AbortErrLev) return

if ( p%DBEMT_Mod /= DBEMT_none ) then
InitInp_DBEMT%DBEMT_Mod = p%DBEMT_Mod
if ( p%DBEMT_Mod > DBEMT_none ) then
InitInp_DBEMT%DBEMT_Mod = p%DBEMT_Mod
InitInp_DBEMT%numBlades = p%numBlades
InitInp_DBEMT%numNodes = p%numBladeNodes
Expand Down Expand Up @@ -735,7 +736,7 @@ subroutine BEMT_ReInit(p,x,xd,z,OtherState,misc,ErrStat,ErrMsg)
if (p%UseInduction) then
OtherState%ValidPhi = .true.

if (p%DBEMT_Mod /= DBEMT_none ) then
if (p%DBEMT_Mod > DBEMT_none ) then
call DBEMT_ReInit(p%DBEMT, x%DBEMT, OtherState%DBEMT, misc%DBEMT)
end if

Expand Down
1 change: 1 addition & 0 deletions modules/aerodyn/src/DBEMT_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# ...... Include files (definitions from NWTC Library) ............................................................................
include Registry_NWTC_Library.txt

param DBEMT/DBEMT - INTEGER DBEMT_frozen - -1 - "use frozen-wake for linearization (not DBEMT)" -
param DBEMT/DBEMT - INTEGER DBEMT_none - 0 - "use BEMT instead (not DBEMT)" -
param DBEMT/DBEMT - INTEGER DBEMT_tauConst - 1 - "use constant tau1" -
param DBEMT/DBEMT - INTEGER DBEMT_tauVaries - 2 - "use time-dependent tau1" -
Expand Down
1 change: 1 addition & 0 deletions modules/aerodyn/src/DBEMT_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ MODULE DBEMT_Types
!---------------------------------------------------------------------------------------------------------------------------------
USE NWTC_Library
IMPLICIT NONE
INTEGER(IntKi), PUBLIC, PARAMETER :: DBEMT_frozen = -1 ! use frozen-wake for linearization (not DBEMT) [-]
INTEGER(IntKi), PUBLIC, PARAMETER :: DBEMT_none = 0 ! use BEMT instead (not DBEMT) [-]
INTEGER(IntKi), PUBLIC, PARAMETER :: DBEMT_tauConst = 1 ! use constant tau1 [-]
INTEGER(IntKi), PUBLIC, PARAMETER :: DBEMT_tauVaries = 2 ! use time-dependent tau1 [-]
Expand Down

0 comments on commit 834a81e

Please sign in to comment.