@@ -1976,18 +1976,27 @@ subroutine AD_CalcWind(t, u, FLowField, p, m, o, Inflow, ErrStat, ErrMsg)
19761976 ! OLAF points
19771977 if (allocated (o% WakeLocationPoints) .and. allocated (Inflow% InflowWakeVel)) then
19781978 ! If rotor is MHK, add water depth to z coordinate
1979- if (p% FVW% MHK > 0 ) then
1979+ if (p% FVW% MHK /= MHK_None ) then
19801980 PosOffset = [0.0_ReKi , 0.0_ReKi , p% FVW% WtrDpth]
19811981 else
19821982 PosOffset = 0.0_ReKi
19831983 end if
19841984
1985- call IfW_FlowField_GetVelAcc(FlowField, StartNode, t, &
1986- o% WakeLocationPoints, &
1987- Inflow% InflowWakeVel, &
1988- NoAcc, ErrStat2, ErrMsg2, &
1989- BoxExceedAllow= .true. , PosOffset= PosOffset)
1990- if (Failed()) return
1985+ if (p% FVW% MHK /= MHK_None .and. p% CompSeaSt) then ! MHK turbines with waves
1986+ call WaveField_GetWaveVelAcc_AD(p% WaveField, m% WaveField_m, &
1987+ StartNode, t, &
1988+ o% WakeLocationPoints, &
1989+ Inflow% InflowWakeVel, &
1990+ NoAcc, ErrStat2, ErrMsg2)
1991+ if (Failed()) return
1992+ else
1993+ call IfW_FlowField_GetVelAcc(FlowField, StartNode, t, &
1994+ o% WakeLocationPoints, &
1995+ Inflow% InflowWakeVel, &
1996+ NoAcc, ErrStat2, ErrMsg2, &
1997+ BoxExceedAllow= .true. , PosOffset= PosOffset)
1998+ if (Failed()) return
1999+ end if
19912000 StartNode = StartNode + size (o% WakeLocationPoints)
19922001 end if
19932002
@@ -2034,7 +2043,7 @@ subroutine AD_CalcWind_Rotor(t, u, FlowField, p, p_AD, m, RotInflow, StartNode,
20342043 call WaveField_GetWaveVelAcc_AD(p_AD% WaveField, m% WaveField_m, StartNode, t, &
20352044 real (u% HubMotion% TranslationDisp + u% HubMotion% Position, ReKi), &
20362045 RotInflow% InflowOnHub, NoAcc, ErrStat2, ErrMsg2)
2037- if (Failed()) return
2046+ if (Failed()) return
20382047 else
20392048 RotInflow% InflowOnHub = 0.0_ReKi
20402049 end if
@@ -2085,7 +2094,7 @@ subroutine AD_CalcWind_Rotor(t, u, FlowField, p, p_AD, m, RotInflow, StartNode,
20852094 call IfW_FlowField_GetVelAcc(FlowField, StartNode, t, &
20862095 real (u% HubMotion% TranslationDisp + u% HubMotion% Position, ReKi), &
20872096 RotInflow% InflowOnHub, NoAcc, ErrStat2, ErrMsg2, PosOffset= PosOffset)
2088- if (Failed()) return
2097+ if (Failed()) return
20892098 else
20902099 RotInflow% InflowOnHub = 0.0_ReKi
20912100 end if
@@ -3208,7 +3217,7 @@ end subroutine SetDisturbedInflow
32083217! ! Loop on blade nodes and computed a weighted sector average inflow at each node
32093218subroutine SetSectAvgInflow (t , p , p_AD , u , RotInflow , m , errStat , errMsg )
32103219 real (DbKi), intent (in ) :: t ! < Current simulation time in seconds
3211- type (RotParameterType), intent (in ) :: p ! < AD parameters
3220+ type (RotParameterType), intent (in ) :: p ! < Rotor parameters
32123221 type (AD_ParameterType), intent (in ) :: p_AD ! < AD parameters
32133222 type (RotInputType), intent (in ) :: u ! < AD Inputs at Time
32143223 type (RotInflowType), intent (in ) :: RotInflow ! < Rotor inflow at Time
@@ -3227,6 +3236,7 @@ subroutine SetSectAvgInflow(t, p, p_AD, u, RotInflow, m, errStat, errMsg)
32273236 real (ReKi) :: e_t(3 ) ! < Polar unit vector perpendicular to rHA_perp ("e_theta")
32283237 real (ReKi) :: psi ! < Azimuthal offset in the current sector, runs from -psi_bwd to psi_fwd
32293238 real (ReKi) :: dpsi ! < Azimuthal increment
3239+ real (ReKi) :: PosOffset(3 )! < IfW position offset for MHK turbines
32303240 real (ReKi), allocatable :: SectPos(:,:)! < Points used to define a given sector (for a given blade node A)
32313241 real (ReKi), allocatable :: SectVel(:,:)! < Inflow velocity at a given sector (Undisturbed and then disturbed)
32323242 real (ReKi), allocatable :: SectAcc(:,:)! < Inflow velocity at a given sector (Undisturbed and then disturbed)
@@ -3293,7 +3303,21 @@ subroutine SetSectAvgInflow(t, p, p_AD, u, RotInflow, m, errStat, errMsg)
32933303
32943304 ! --- Inflow on sector points
32953305 ! Undisturbed
3296- call IfW_FlowField_GetVelAcc(p_AD% FlowField, 1 , t, SectPos, SectVel, SectAcc, errStat= errStat2, errMsg= errMsg2); if (Failed()) return
3306+ if (p% MHK /= MHK_None .and. p_AD% CompSeaSt) then ! MHK turbines with waves
3307+ call WaveField_GetWaveVelAcc_AD(p_AD% WaveField, m% WaveField_m, 1_IntKi , t, &
3308+ SectPos, SectVel, SectAcc, ErrStat2, ErrMsg2)
3309+ if (Failed()) return
3310+ else
3311+ if (p% MHK /= MHK_None) then
3312+ PosOffset = [0.0_ReKi , 0.0_ReKi , p% WtrDpth]
3313+ else
3314+ PosOffset = 0.0_ReKi
3315+ end if
3316+ call IfW_FlowField_GetVelAcc(p_AD% FlowField, 1_IntKi , t, &
3317+ SectPos, SectVel, SectAcc, errStat= errStat2, errMsg= errMsg2, &
3318+ PosOffset= PosOffset); if (Failed()) return
3319+ end if
3320+
32973321 ! --- Option 1 Disturbed inflow Before averaging - SectVel is modified in place
32983322 ! if (p%TwrPotent /= TwrPotent_none .or. p%TwrShadow /= TwrShadow_none) then
32993323 ! call TwrInflArray(p, u, RotInflow, m, SectPos, SectVel, errStat2, errMsg2); if(Failed()) return
0 commit comments