Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InflowWind pointers in AeroDyn, OpenFOAM, and Lidar #1639

Merged
merged 5 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
360 changes: 120 additions & 240 deletions modules/aerodyn/src/AeroDyn.f90

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions modules/aerodyn/src/AeroDyn_AllBldNdOuts_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ SUBROUTINE Calc_WriteAllBldNdOutput( p, p_AD, u, m, m_AD, x, y, OtherState, Indx
CASE ( BldNd_VUndx )
DO IdxBlade=1,p%BldNd_BladesOut
DO IdxNode=1,p%NumBlNds
y%WriteOutput( OutIdx ) = dot_product( m%orientationAnnulus(1,:,IdxNode,IdxBlade), u%InflowOnBlade(:,IdxNode,IdxBlade) )
y%WriteOutput( OutIdx ) = dot_product( m%orientationAnnulus(1,:,IdxNode,IdxBlade), u%Bld(IdxBlade)%InflowOnBlade(:,IdxNode) )
OutIdx = OutIdx + 1
END DO
END DO
Expand All @@ -261,15 +261,15 @@ SUBROUTINE Calc_WriteAllBldNdOutput( p, p_AD, u, m, m_AD, x, y, OtherState, Indx
CASE ( BldNd_VUndy )
DO IdxBlade=1,p%BldNd_BladesOut
DO IdxNode=1,p%NumBlNds
y%WriteOutput( OutIdx ) = dot_product( m%orientationAnnulus(2,:,IdxNode,IdxBlade), u%InflowOnBlade(:,IdxNode,IdxBlade) )
y%WriteOutput( OutIdx ) = dot_product( m%orientationAnnulus(2,:,IdxNode,IdxBlade), u%Bld(IdxBlade)%InflowOnBlade(:,IdxNode) )
OutIdx = OutIdx + 1
END DO
END DO

CASE ( BldNd_VUndz )
DO IdxBlade=1,p%BldNd_BladesOut
DO IdxNode=1,p%NumBlNds
y%WriteOutput( OutIdx ) = dot_product( m%orientationAnnulus(3,:,IdxNode,IdxBlade), u%InflowOnBlade(:,IdxNode,IdxBlade) )
y%WriteOutput( OutIdx ) = dot_product( m%orientationAnnulus(3,:,IdxNode,IdxBlade), u%Bld(IdxBlade)%InflowOnBlade(:,IdxNode) )
OutIdx = OutIdx + 1
END DO
END DO
Expand All @@ -280,7 +280,7 @@ SUBROUTINE Calc_WriteAllBldNdOutput( p, p_AD, u, m, m_AD, x, y, OtherState, Indx
CASE ( BldNd_VUndxi )
DO IdxBlade=1,p%BldNd_BladesOut
DO IdxNode=1,p%NumBlNds
y%WriteOutput( OutIdx ) = u%InflowOnBlade(1,IdxNode,IdxBlade)
y%WriteOutput( OutIdx ) = u%Bld(IdxBlade)%InflowOnBlade(1,IdxNode)
OutIdx = OutIdx + 1
END DO
END DO
Expand All @@ -289,15 +289,15 @@ SUBROUTINE Calc_WriteAllBldNdOutput( p, p_AD, u, m, m_AD, x, y, OtherState, Indx
CASE ( BldNd_VUndyi )
DO IdxBlade=1,p%BldNd_BladesOut
DO IdxNode=1,p%NumBlNds
y%WriteOutput( OutIdx ) = u%InflowOnBlade(2,IdxNode,IdxBlade)
y%WriteOutput( OutIdx ) = u%Bld(IdxBlade)%InflowOnBlade(2,IdxNode)
OutIdx = OutIdx + 1
END DO
END DO

CASE ( BldNd_VUndzi )
DO IdxBlade=1,p%BldNd_BladesOut
DO IdxNode=1,p%NumBlNds
y%WriteOutput( OutIdx ) = u%InflowOnBlade(3,IdxNode,IdxBlade)
y%WriteOutput( OutIdx ) = u%Bld(IdxBlade)%InflowOnBlade(3,IdxNode)
OutIdx = OutIdx + 1
END DO
END DO
Expand Down
2 changes: 1 addition & 1 deletion modules/aerodyn/src/AeroDyn_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ subroutine Calc_WriteOutput_AD()
do beta=1,p%NBlOuts
j=p%BlOutNd(beta)

tmp = matmul( m%orientationAnnulus(:,:,j,k), u%InflowOnBlade(:,j,k) )
tmp = matmul( m%orientationAnnulus(:,:,j,k), u%Bld(k)%InflowOnBlade(:,j) )
m%AllOuts( BNVUndx(beta,k) ) = tmp(1)
m%AllOuts( BNVUndy(beta,k) ) = tmp(2)
m%AllOuts( BNVUndz(beta,k) ) = tmp(3)
Expand Down
34 changes: 10 additions & 24 deletions modules/aerodyn/src/AeroDyn_Inflow.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module AeroDyn_Inflow
use AeroDyn_Inflow_Types
use AeroDyn_Types
use AeroDyn, only: AD_Init, AD_ReInit, AD_CalcOutput, AD_UpdateStates, AD_End
use AeroDyn, only: AD_CalcWind
use AeroDyn_IO, only: AD_SetVTKSurface
use InflowWind, only: InflowWind_Init, InflowWind_CalcOutput, InflowWind_End

Expand Down Expand Up @@ -280,29 +279,6 @@ subroutine ADI_CalcOutput(t, u, p, x, xd, z, OtherState, y, m, errStat, errMsg)
y%IW_WriteOutput(:) = m%IW%y%WriteOutput(:)
end if

!----------------------------------------------------------------------------
! Calculate hub height wind velocity if requested
!----------------------------------------------------------------------------

if (p%storeHHVel) then

! Set hub positions
node = 0
do iWT = 1, size(u%AD%rotors)
node = node + 1
m%AD%WindPos(:,node) = u%AD%rotors(iWT)%hubMotion%Position(:,1) + &
u%AD%rotors(iWT)%hubMotion%TranslationDisp(:,1)
if (p%AD%rotors(iWT)%MHK == 1 .or. p%AD%rotors(iWT)%MHK == 2) then
m%AD%WindPos(3,node) = m%AD%WindPos(3,node) + p%AD%rotors(iWT)%WtrDpth
end if
enddo

! Calculate wind velocity at positions
call IfW_FlowField_GetVelAcc(p%AD%FlowField, 1, t, m%AD%WindPos(:,:node), &
y%HHVel, m%AD%WindAcc, errStat2, errMsg2)
if(Failed()) return
endif

!----------------------------------------------------------------------------
! Calculate aerodyn output
!----------------------------------------------------------------------------
Expand All @@ -321,6 +297,16 @@ subroutine ADI_CalcOutput(t, u, p, x, xd, z, OtherState, y, m, errStat, errMsg)
y%WriteOutput(AD_NumOuts+1:p%NumOuts) = y%IW_WriteOutput(1:m%IW%p%NumOuts)
end associate

!----------------------------------------------------------------------------
! Store hub height velocity calculated in CalcOutput
!----------------------------------------------------------------------------

if (p%storeHHVel) then
do iWT = 1, size(u%AD%rotors)
y%HHVel(:,iWT) = u%AD%rotors(iWT)%InflowOnHub(:,1)
end do
endif

contains

subroutine CleanUp()
Expand Down
11 changes: 7 additions & 4 deletions modules/aerodyn/src/AeroDyn_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ typedef ^ ParameterType FlowFieldType *FlowField - - - "Pointer of Inf


# ..... Inputs ....................................................................................................................
typedef ^ BldInputType ReKi InflowOnBlade {:}{:} - - "U,V,W at nodes on each blade (note if we change the requirement that NumNodes is the same for each blade, this will need to change)" m/s
typedef ^ BldInputType ReKi AccelOnBlade {:}{:} - - "Wind acceleration at nodes on each blade (note if we change the requirement that NumNodes is the same for each blade, this will need to change)" m/s
# Define inputs that are contained on a mesh here:
typedef ^ RotInputType MeshType NacelleMotion - - - "motion on the nacelle" -
typedef ^ RotInputType MeshType TowerMotion - - - "motion on the tower" -
Expand All @@ -421,11 +423,12 @@ typedef ^ RotInputType MeshType BladeRootMotion {:} - - "motion on each blade ro
typedef ^ RotInputType MeshType BladeMotion {:} - - "motion on each blade" -
typedef ^ RotInputType MeshType TFinMotion - - - "motion of tail fin (at tail fin ref point)" -
# Define inputs that are not on a mesh here:
typedef ^ RotInputType ReKi InflowOnBlade {:}{:}{:} - - "U,V,W at nodes on each blade (note if we change the requirement that NumNodes is the same for each blade, this will need to change)" m/s
typedef ^ RotInputType BldInputType Bld {:} - - "Blade Inputs" -
typedef ^ RotInputType ReKi InflowOnTower {:}{:} - - "U,V,W at nodes on the tower" m/s
typedef ^ RotInputType ReKi InflowOnHub {3} - - "U,V,W at hub" m/s
typedef ^ RotInputType ReKi InflowOnNacelle {3} - - "U,V,W at nacelle" m/s
typedef ^ RotInputType ReKi InflowOnTailFin {3} - - "U,V,W at tailfin" m/s
typedef ^ RotInputType ReKi AccelOnTower {:}{:} - - "Wind acceleration at nodes on the tower" m/s
typedef ^ RotInputType ReKi InflowOnHub {3}{1} - - "U,V,W at hub" m/s
typedef ^ RotInputType ReKi InflowOnNacelle {3}{1} - - "U,V,W at nacelle" m/s
typedef ^ RotInputType ReKi InflowOnTailFin {3}{1} - - "U,V,W at tailfin" m/s
typedef ^ RotInputType ReKi UserProp {:}{:} - - "Optional user property for interpolating airfoils (per element per blade)" -


Expand Down
Loading