From 479bd620ac90499459311a236e2d9d10e69eed07 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Tue, 30 Apr 2024 15:24:23 -0600 Subject: [PATCH] AD15: add ElemInflowType for blades and tower Simplification based on comment from @bjonkman --- modules/aerodyn/src/AeroDyn.f90 | 42 ++-- .../aerodyn/src/AeroDyn_AllBldNdOuts_IO.f90 | 30 +-- modules/aerodyn/src/AeroDyn_IO.f90 | 4 +- modules/aerodyn/src/AeroDyn_Registry.txt | 9 +- modules/aerodyn/src/AeroDyn_Types.f90 | 218 ++++++++---------- 5 files changed, 135 insertions(+), 168 deletions(-) diff --git a/modules/aerodyn/src/AeroDyn.f90 b/modules/aerodyn/src/AeroDyn.f90 index 60a91cb24..b8ac55572 100644 --- a/modules/aerodyn/src/AeroDyn.f90 +++ b/modules/aerodyn/src/AeroDyn.f90 @@ -657,7 +657,7 @@ subroutine Init_MiscVars(m, p, u, y, errStat, errMsg) errStat = ErrID_None errMsg = "" - call AllocAry( m%DisturbedInflow, 3_IntKi, p%NumBlNds, p%numBlades, 'm%DisturbedInflow', ErrStat2, ErrMsg2 ) ! must be same size as u%InflowOnBlade + call AllocAry( m%DisturbedInflow, 3_IntKi, p%NumBlNds, p%numBlades, 'm%DisturbedInflow', ErrStat2, ErrMsg2 ) ! must be same size as RotInflow%Blade(k)%InflowVel call SetErrStat( errStat2, errMsg2, errStat, errMsg, RoutineName ) call AllocAry( m%orientationAnnulus, 3_IntKi, 3_IntKi, p%NumBlNds, p%numBlades, 'm%orientationAnnulus', ErrStat2, ErrMsg2 ) call SetErrStat( errStat2, errMsg2, errStat, errMsg, RoutineName ) @@ -1308,29 +1308,29 @@ subroutine Init_RotInflow( p, RotInflow, errStat, ErrMsg ) ErrMsg = "" ! Arrays for InflowWind inputs: - allocate(RotInflow%Bld(p%numBlades), stat=ErrStat2) + allocate(RotInflow%Blade(p%numBlades), stat=ErrStat2) if (ErrStat2 /= 0) then - call SetErrStat( ErrID_Fatal, 'Error allocating RotInflow%Bld', errStat, errMsg, RoutineName ) + call SetErrStat( ErrID_Fatal, 'Error allocating RotInflow%Blade', errStat, errMsg, RoutineName ) if (Failed()) return end if do k = 1, p%NumBlades - call AllocAry( RotInflow%Bld(k)%InflowOnBlade, 3_IntKi, p%NumBlNds, 'RotInflow%Bld(k)%InflowOnBlade', ErrStat2, ErrMsg2 ) + call AllocAry( RotInflow%Blade(k)%InflowVel, 3_IntKi, p%NumBlNds, 'RotInflow%Blade(k)%InflowVel', ErrStat2, ErrMsg2 ) if (Failed()) return - RotInflow%Bld(k)%InflowOnBlade = 0.0_ReKi + RotInflow%Blade(k)%InflowVel = 0.0_ReKi if (p%MHK > 0) then - call AllocAry( RotInflow%Bld(k)%AccelOnBlade, 3_IntKi, p%NumBlNds, 'RotInflow%Bld(k)%AccelOnBlade', ErrStat2, ErrMsg2 ) + call AllocAry( RotInflow%Blade(k)%InflowAcc, 3_IntKi, p%NumBlNds, 'RotInflow%Blade(k)%InflowAcc', ErrStat2, ErrMsg2 ) if (Failed()) return - RotInflow%Bld(k)%AccelOnBlade = 0.0_ReKi + RotInflow%Blade(k)%InflowAcc = 0.0_ReKi end if end do - call AllocAry( RotInflow%InflowOnTower, 3_IntKi, p%NumTwrNds, 'RotInflow%InflowOnTower', ErrStat2, ErrMsg2 ) ! could be size zero + call AllocAry( RotInflow%Tower%InflowVel, 3_IntKi, p%NumTwrNds, 'RotInflow%Tower%InflowVel', ErrStat2, ErrMsg2 ) ! could be size zero if (Failed()) return if (p%MHK > 0) then - call AllocAry( RotInflow%AccelOnTower, 3_IntKi, p%NumTwrNds, 'RotInflow%AccelOnTower', ErrStat2, ErrMsg2 ) ! could be size zero + call AllocAry( RotInflow%Tower%InflowAcc, 3_IntKi, p%NumTwrNds, 'RotInflow%Tower%InflowAcc', ErrStat2, ErrMsg2 ) ! could be size zero if (Failed()) return end if @@ -1339,7 +1339,7 @@ subroutine Init_RotInflow( p, RotInflow, errStat, ErrMsg ) RotInflow%InflowOnNacelle = 0.0_ReKi RotInflow%InflowOnTailFin = 0.0_ReKi RotInflow%AvgDiskVel = 0.0_ReKi - RotInflow%InflowOnTower = 0.0_ReKi + RotInflow%Tower%InflowVel = 0.0_ReKi contains logical function Failed() @@ -1869,7 +1869,7 @@ subroutine AD_CalcWind_Rotor(t, u, FlowField, p, RotInflow, StartNode, ErrStat, do k = 1, p%NumBlades call IfW_FlowField_GetVelAcc(FlowField, StartNode, t, & real(u%BladeMotion(k)%TranslationDisp + u%BladeMotion(k)%Position, ReKi), & - RotInflow%Bld(k)%InflowOnBlade, RotInflow%Bld(k)%AccelOnBlade, ErrStat2, ErrMsg2, PosOffset=PosOffset) + RotInflow%Blade(k)%InflowVel, RotInflow%Blade(k)%InflowAcc, ErrStat2, ErrMsg2, PosOffset=PosOffset) if(Failed()) return StartNode = StartNode + p%NumBlNds end do @@ -1878,7 +1878,7 @@ subroutine AD_CalcWind_Rotor(t, u, FlowField, p, RotInflow, StartNode, ErrStat, if (u%TowerMotion%Nnodes > 0) then call IfW_FlowField_GetVelAcc(FlowField, StartNode, t, & real(u%TowerMotion%TranslationDisp + u%TowerMotion%Position, ReKi), & - RotInflow%InflowOnTower, RotInflow%AccelOnTower, ErrStat2, ErrMsg2, PosOffset=PosOffset) + RotInflow%Tower%InflowVel, RotInflow%Tower%InflowAcc, ErrStat2, ErrMsg2, PosOffset=PosOffset) if(Failed()) return StartNode = StartNode + p%NumTwrNds end if @@ -2780,7 +2780,7 @@ subroutine SetDisturbedInflow(p, p_AD, u, RotInflow, m, errStat, errMsg) call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName) else do k = 1, p%NumBlades - m%DisturbedInflow(:,:,k) = RotInflow%Bld(k)%InflowOnBlade + m%DisturbedInflow(:,:,k) = RotInflow%Blade(k)%InflowVel end do end if @@ -3141,7 +3141,7 @@ subroutine DiskAvgValues(p, u, RotInflow, m, x_hat_disk, y_hat_disk, z_hat_disk, do k=1,p%NumBlades do j=1,p%NumBlNds m%AvgDiskVelDist = m%AvgDiskVelDist + m%DisturbedInflow(:,j,k) - m%AvgDiskVel = m%AvgDiskVel + RotInflow%Bld(k)%InflowOnBlade(:,j) + m%AvgDiskVel = m%AvgDiskVel + RotInflow%Blade(k)%InflowVel(:,j) end do end do m%AvgDiskVelDist = m%AvgDiskVelDist / real( p%NumBlades * p%NumBlNds, ReKi ) @@ -3499,7 +3499,7 @@ subroutine SetInputsForAA(p, u, RotInflow, m, errStat, errMsg) m%AA_u%AoANoise(i,j) = m%BEMT_y%AOA(i,j) ! Set the blade element undisturbed flow - m%AA_u%Inflow(:,i,j) = RotInflow%Bld(j)%InflowonBlade(:,i) + m%AA_u%Inflow(:,i,j) = RotInflow%Blade(j)%InflowVel(:,i) end do end do end subroutine SetInputsForAA @@ -4738,7 +4738,7 @@ SUBROUTINE ADTwr_CalcOutput(p, u, RotInflow, m, y, ErrStat, ErrMsg ) do j=1,p%NumTwrNds - V_rel = RotInflow%InflowOnTower(:,j) - u%TowerMotion%TranslationVel(:,j) ! relative wind speed at tower node + V_rel = RotInflow%Tower%InflowVel(:,j) - u%TowerMotion%TranslationVel(:,j) ! relative wind speed at tower node tmp = u%TowerMotion%Orientation(1,:,j) VL(1) = dot_product( V_Rel, tmp ) ! relative local x-component of wind speed of the jth node in the tower @@ -4858,9 +4858,9 @@ SUBROUTINE TwrInfl( p, u, RotInflow, m, ErrStat, ErrMsg ) if ( DisturbInflow ) then v = CalculateTowerInfluence(p, xbar, ybar, zbar, W_tower, TwrCd, TwrTI) - m%DisturbedInflow(:,j,k) = RotInflow%Bld(k)%InflowOnBlade(:,j) + matmul( theta_tower_trans, v ) + m%DisturbedInflow(:,j,k) = RotInflow%Blade(k)%InflowVel(:,j) + matmul( theta_tower_trans, v ) else - m%DisturbedInflow(:,j,k) = RotInflow%Bld(k)%InflowOnBlade(:,j) + m%DisturbedInflow(:,j,k) = RotInflow%Blade(k)%InflowVel(:,j) end if end do !j=NumBlNds @@ -5169,8 +5169,8 @@ SUBROUTINE TwrInfl_NearestLine2Element(p, u, RotInflow, BladeNodePosition, r_Tow found = .true. min_dist = dist - V_rel_tower = ( RotInflow%InflowOnTower(:,n1) - u%TowerMotion%TranslationVel(:,n1) ) * elem_position2 & - + ( RotInflow%InflowOnTower(:,n2) - u%TowerMotion%TranslationVel(:,n2) ) * elem_position + V_rel_tower = ( RotInflow%Tower%InflowVel(:,n1) - u%TowerMotion%TranslationVel(:,n1) ) * elem_position2 & + + ( RotInflow%Tower%InflowVel(:,n2) - u%TowerMotion%TranslationVel(:,n2) ) * elem_position TwrDiam = elem_position2*p%TwrDiam(n1) + elem_position*p%TwrDiam(n2) TwrCd = elem_position2*p%TwrCd( n1) + elem_position*p%TwrCd( n2) @@ -5285,7 +5285,7 @@ SUBROUTINE TwrInfl_NearestPoint(p, u, RotInflow, BladeNodePosition, r_TowerBlade n1 = node_with_min_distance r_TowerBlade = BladeNodePosition - u%TowerMotion%Position(:,n1) - u%TowerMotion%TranslationDisp(:,n1) - V_rel_tower = RotInflow%InflowOnTower(:,n1) - u%TowerMotion%TranslationVel(:,n1) + V_rel_tower = RotInflow%Tower%InflowVel(:,n1) - u%TowerMotion%TranslationVel(:,n1) TwrDiam = p%TwrDiam(n1) TwrCd = p%TwrCd( n1) TwrTI = p%TwrTI( n1) diff --git a/modules/aerodyn/src/AeroDyn_AllBldNdOuts_IO.f90 b/modules/aerodyn/src/AeroDyn_AllBldNdOuts_IO.f90 index 261a9ce0c..5eb865926 100644 --- a/modules/aerodyn/src/AeroDyn_AllBldNdOuts_IO.f90 +++ b/modules/aerodyn/src/AeroDyn_AllBldNdOuts_IO.f90 @@ -336,26 +336,26 @@ SUBROUTINE Calc_WriteAllBldNdOutput( p, p_AD, u, m, m_AD, x, y, OtherState, RotI CASE (0 ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = 0.0_ReKi; iOut = iOut + 1; enddo;enddo ! ***** Undisturbed wind velocity in inertial, polar, local and airfoil systems***** - CASE( BldNd_VUndxi ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = RotInflow%Bld(iB)%InflowOnBlade(1,iNd); iOut = iOut + 1; enddo;enddo - CASE( BldNd_VUndyi ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = RotInflow%Bld(iB)%InflowOnBlade(2,iNd); iOut = iOut + 1; enddo;enddo - CASE( BldNd_VUndzi ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = RotInflow%Bld(iB)%InflowOnBlade(3,iNd); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndxi ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = RotInflow%Blade(iB)%InflowVel(1,iNd); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndyi ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = RotInflow%Blade(iB)%InflowVel(2,iNd); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndzi ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = RotInflow%Blade(iB)%InflowVel(3,iNd); iOut = iOut + 1; enddo;enddo - CASE( BldNd_VUndxp ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Bld(iB)%InflowOnBlade(:,iNd), R_pi(1,:,iB) ); iOut = iOut + 1; enddo;enddo - CASE( BldNd_VUndyp ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Bld(iB)%InflowOnBlade(:,iNd), R_pi(2,:,iB) ); iOut = iOut + 1; enddo;enddo - CASE( BldNd_VUndzp ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Bld(iB)%InflowOnBlade(:,iNd), R_pi(3,:,iB) ); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndxp ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Blade(iB)%InflowVel(:,iNd), R_pi(1,:,iB) ); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndyp ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Blade(iB)%InflowVel(:,iNd), R_pi(2,:,iB) ); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndzp ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Blade(iB)%InflowVel(:,iNd), R_pi(3,:,iB) ); iOut = iOut + 1; enddo;enddo - CASE( BldNd_VUndxl ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Bld(iB)%InflowOnBlade(:,iNd), R_li(1,:,iNd,iB) ); iOut = iOut + 1; enddo;enddo - CASE( BldNd_VUndyl ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Bld(iB)%InflowOnBlade(:,iNd), R_li(2,:,iNd,iB) ); iOut = iOut + 1; enddo;enddo - CASE( BldNd_VUndzl ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Bld(iB)%InflowOnBlade(:,iNd), R_li(3,:,iNd,iB) ); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndxl ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Blade(iB)%InflowVel(:,iNd), R_li(1,:,iNd,iB) ); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndyl ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Blade(iB)%InflowVel(:,iNd), R_li(2,:,iNd,iB) ); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndzl ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Blade(iB)%InflowVel(:,iNd), R_li(3,:,iNd,iB) ); iOut = iOut + 1; enddo;enddo - CASE( BldNd_VUndxa ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Bld(iB)%InflowOnBlade(:,iNd), u%BladeMotion(iB)%Orientation(1,:,iNd) ); iOut = iOut + 1; enddo;enddo - CASE( BldNd_VUndya ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Bld(iB)%InflowOnBlade(:,iNd), u%BladeMotion(iB)%Orientation(2,:,iNd) ); iOut = iOut + 1; enddo;enddo - CASE( BldNd_VUndza ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Bld(iB)%InflowOnBlade(:,iNd), u%BladeMotion(iB)%Orientation(3,:,iNd) ); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndxa ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Blade(iB)%InflowVel(:,iNd), u%BladeMotion(iB)%Orientation(1,:,iNd) ); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndya ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Blade(iB)%InflowVel(:,iNd), u%BladeMotion(iB)%Orientation(2,:,iNd) ); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndza ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Blade(iB)%InflowVel(:,iNd), u%BladeMotion(iB)%Orientation(3,:,iNd) ); iOut = iOut + 1; enddo;enddo ! TODO: deprecate this - CASE( BldNd_VUndx ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Bld(iB)%InflowOnBlade(:,iNd), R_wi(1,:,iNd,iB) ); iOut = iOut + 1; enddo;enddo - CASE( BldNd_VUndy ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Bld(iB)%InflowOnBlade(:,iNd), R_wi(2,:,iNd,iB) ); iOut = iOut + 1; enddo;enddo - CASE( BldNd_VUndz ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Bld(iB)%InflowOnBlade(:,iNd), R_wi(3,:,iNd,iB) ); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndx ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Blade(iB)%InflowVel(:,iNd), R_wi(1,:,iNd,iB) ); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndy ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Blade(iB)%InflowVel(:,iNd), R_wi(2,:,iNd,iB) ); iOut = iOut + 1; enddo;enddo + CASE( BldNd_VUndz ); do iB=1,nB; do iNd=1,nNd; y%WriteOutput(iOut) = dot_product( RotInflow%Blade(iB)%InflowVel(:,iNd), R_wi(3,:,iNd,iB) ); iOut = iOut + 1; enddo;enddo ! ***** Disturbed wind velocity in inertial, polar, local and airfoil systems***** diff --git a/modules/aerodyn/src/AeroDyn_IO.f90 b/modules/aerodyn/src/AeroDyn_IO.f90 index 0158a1f67..6653f8874 100644 --- a/modules/aerodyn/src/AeroDyn_IO.f90 +++ b/modules/aerodyn/src/AeroDyn_IO.f90 @@ -163,7 +163,7 @@ subroutine Calc_WriteOutput_AD() do beta=1,p%NTwOuts j = p%TwOutNd(beta) - tmp = matmul( u%TowerMotion%Orientation(:,:,j) , RotInflow%InflowOnTower(:,j) ) + tmp = matmul( u%TowerMotion%Orientation(:,:,j) , RotInflow%Tower%InflowVel(:,j) ) m%AllOuts( TwNVUnd(:,beta) ) = tmp tmp = matmul( u%TowerMotion%Orientation(:,:,j) , u%TowerMotion%TranslationVel(:,j) ) @@ -221,7 +221,7 @@ subroutine Calc_WriteOutput_AD() do beta=1,p%NBlOuts j=p%BlOutNd(beta) - tmp = matmul( m%orientationAnnulus(:,:,j,k), RotInflow%Bld(k)%InflowOnBlade(:,j) ) + tmp = matmul( m%orientationAnnulus(:,:,j,k), RotInflow%Blade(k)%InflowVel(:,j) ) m%AllOuts( BNVUndx(beta,k) ) = tmp(1) m%AllOuts( BNVUndy(beta,k) ) = tmp(2) m%AllOuts( BNVUndz(beta,k) ) = tmp(3) diff --git a/modules/aerodyn/src/AeroDyn_Registry.txt b/modules/aerodyn/src/AeroDyn_Registry.txt index d8a67e6f6..b8c42855f 100644 --- a/modules/aerodyn/src/AeroDyn_Registry.txt +++ b/modules/aerodyn/src/AeroDyn_Registry.txt @@ -341,11 +341,10 @@ typedef ^ MiscVarType ReKi WindVel {:}{:} - - "XYZ components of wind typedef ^ MiscVarType ReKi WindAcc {:}{:} - - "XYZ components of wind acceleration" - # Inflow data storage -typedef ^ BldInflowType 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 ^ BldInflowType 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 -typedef ^ RotInflowType BldInflowType Bld {:} - - "Blade Inputs" - -typedef ^ RotInflowType ReKi InflowOnTower {:}{:} - - "U,V,W at nodes on the tower" m/s -typedef ^ RotInflowType ReKi AccelOnTower {:}{:} - - "Wind acceleration at nodes on the tower" m/s +typedef ^ ElemInflowType ReKi InflowVel {:}{:} - - "U,V,W at nodes on element (note if we change the requirement that NumNodes is the same for each blade, this will need to change)" m/s +typedef ^ ElemInflowType ReKi InflowAcc {:}{:} - - "Wind acceleration at nodes on element (blade or tower) (note if we change the requirement that NumNodes is the same for each blade, this will need to change)" m/s +typedef ^ RotInflowType ElemInflowType Blade {:} - - "Blade wind inputs" - +typedef ^ RotInflowType ElemInflowType Tower - - - "Blade wind inputs" - typedef ^ RotInflowType ReKi InflowOnHub {3}{1} - - "U,V,W at hub" m/s typedef ^ RotInflowType ReKi InflowOnNacelle {3}{1} - - "U,V,W at nacelle" m/s typedef ^ RotInflowType ReKi InflowOnTailFin {3}{1} - - "U,V,W at tailfin" m/s diff --git a/modules/aerodyn/src/AeroDyn_Types.f90 b/modules/aerodyn/src/AeroDyn_Types.f90 index 12475f624..44b836588 100644 --- a/modules/aerodyn/src/AeroDyn_Types.f90 +++ b/modules/aerodyn/src/AeroDyn_Types.f90 @@ -384,17 +384,16 @@ MODULE AeroDyn_Types TYPE(AD_InflowType) , DIMENSION(:), ALLOCATABLE :: Inflow !< Inflow storage (size of u for history of inputs) [-] END TYPE AD_MiscVarType ! ======================= -! ========= BldInflowType ======= - TYPE, PUBLIC :: BldInflowType - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: 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] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: 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] - END TYPE BldInflowType +! ========= ElemInflowType ======= + TYPE, PUBLIC :: ElemInflowType + REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: InflowVel !< U,V,W at nodes on element (note if we change the requirement that NumNodes is the same for each blade, this will need to change) [m/s] + REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: InflowAcc !< Wind acceleration at nodes on element (blade or tower) (note if we change the requirement that NumNodes is the same for each blade, this will need to change) [m/s] + END TYPE ElemInflowType ! ======================= ! ========= RotInflowType ======= TYPE, PUBLIC :: RotInflowType - TYPE(BldInflowType) , DIMENSION(:), ALLOCATABLE :: Bld !< Blade Inputs [-] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: InflowOnTower !< U,V,W at nodes on the tower [m/s] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: AccelOnTower !< Wind acceleration at nodes on the tower [m/s] + TYPE(ElemInflowType) , DIMENSION(:), ALLOCATABLE :: Blade !< Blade wind inputs [-] + TYPE(ElemInflowType) :: Tower !< Blade wind inputs [-] REAL(ReKi) , DIMENSION(1:3,1:1) :: InflowOnHub = 0.0_ReKi !< U,V,W at hub [m/s] REAL(ReKi) , DIMENSION(1:3,1:1) :: InflowOnNacelle = 0.0_ReKi !< U,V,W at nacelle [m/s] REAL(ReKi) , DIMENSION(1:3,1:1) :: InflowOnTailFin = 0.0_ReKi !< U,V,W at tailfin [m/s] @@ -4196,78 +4195,78 @@ subroutine AD_UnPackMisc(RF, OutData) end if end subroutine -subroutine AD_CopyBldInflowType(SrcBldInflowTypeData, DstBldInflowTypeData, CtrlCode, ErrStat, ErrMsg) - type(BldInflowType), intent(in) :: SrcBldInflowTypeData - type(BldInflowType), intent(inout) :: DstBldInflowTypeData +subroutine AD_CopyElemInflowType(SrcElemInflowTypeData, DstElemInflowTypeData, CtrlCode, ErrStat, ErrMsg) + type(ElemInflowType), intent(in) :: SrcElemInflowTypeData + type(ElemInflowType), intent(inout) :: DstElemInflowTypeData integer(IntKi), intent(in ) :: CtrlCode integer(IntKi), intent( out) :: ErrStat character(*), intent( out) :: ErrMsg integer(B8Ki) :: LB(2), UB(2) integer(IntKi) :: ErrStat2 - character(*), parameter :: RoutineName = 'AD_CopyBldInflowType' + character(*), parameter :: RoutineName = 'AD_CopyElemInflowType' ErrStat = ErrID_None ErrMsg = '' - if (allocated(SrcBldInflowTypeData%InflowOnBlade)) then - LB(1:2) = lbound(SrcBldInflowTypeData%InflowOnBlade, kind=B8Ki) - UB(1:2) = ubound(SrcBldInflowTypeData%InflowOnBlade, kind=B8Ki) - if (.not. allocated(DstBldInflowTypeData%InflowOnBlade)) then - allocate(DstBldInflowTypeData%InflowOnBlade(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) + if (allocated(SrcElemInflowTypeData%InflowVel)) then + LB(1:2) = lbound(SrcElemInflowTypeData%InflowVel, kind=B8Ki) + UB(1:2) = ubound(SrcElemInflowTypeData%InflowVel, kind=B8Ki) + if (.not. allocated(DstElemInflowTypeData%InflowVel)) then + allocate(DstElemInflowTypeData%InflowVel(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstBldInflowTypeData%InflowOnBlade.', ErrStat, ErrMsg, RoutineName) + call SetErrStat(ErrID_Fatal, 'Error allocating DstElemInflowTypeData%InflowVel.', ErrStat, ErrMsg, RoutineName) return end if end if - DstBldInflowTypeData%InflowOnBlade = SrcBldInflowTypeData%InflowOnBlade + DstElemInflowTypeData%InflowVel = SrcElemInflowTypeData%InflowVel end if - if (allocated(SrcBldInflowTypeData%AccelOnBlade)) then - LB(1:2) = lbound(SrcBldInflowTypeData%AccelOnBlade, kind=B8Ki) - UB(1:2) = ubound(SrcBldInflowTypeData%AccelOnBlade, kind=B8Ki) - if (.not. allocated(DstBldInflowTypeData%AccelOnBlade)) then - allocate(DstBldInflowTypeData%AccelOnBlade(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) + if (allocated(SrcElemInflowTypeData%InflowAcc)) then + LB(1:2) = lbound(SrcElemInflowTypeData%InflowAcc, kind=B8Ki) + UB(1:2) = ubound(SrcElemInflowTypeData%InflowAcc, kind=B8Ki) + if (.not. allocated(DstElemInflowTypeData%InflowAcc)) then + allocate(DstElemInflowTypeData%InflowAcc(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstBldInflowTypeData%AccelOnBlade.', ErrStat, ErrMsg, RoutineName) + call SetErrStat(ErrID_Fatal, 'Error allocating DstElemInflowTypeData%InflowAcc.', ErrStat, ErrMsg, RoutineName) return end if end if - DstBldInflowTypeData%AccelOnBlade = SrcBldInflowTypeData%AccelOnBlade + DstElemInflowTypeData%InflowAcc = SrcElemInflowTypeData%InflowAcc end if end subroutine -subroutine AD_DestroyBldInflowType(BldInflowTypeData, ErrStat, ErrMsg) - type(BldInflowType), intent(inout) :: BldInflowTypeData +subroutine AD_DestroyElemInflowType(ElemInflowTypeData, ErrStat, ErrMsg) + type(ElemInflowType), intent(inout) :: ElemInflowTypeData integer(IntKi), intent( out) :: ErrStat character(*), intent( out) :: ErrMsg - character(*), parameter :: RoutineName = 'AD_DestroyBldInflowType' + character(*), parameter :: RoutineName = 'AD_DestroyElemInflowType' ErrStat = ErrID_None ErrMsg = '' - if (allocated(BldInflowTypeData%InflowOnBlade)) then - deallocate(BldInflowTypeData%InflowOnBlade) + if (allocated(ElemInflowTypeData%InflowVel)) then + deallocate(ElemInflowTypeData%InflowVel) end if - if (allocated(BldInflowTypeData%AccelOnBlade)) then - deallocate(BldInflowTypeData%AccelOnBlade) + if (allocated(ElemInflowTypeData%InflowAcc)) then + deallocate(ElemInflowTypeData%InflowAcc) end if end subroutine -subroutine AD_PackBldInflowType(RF, Indata) +subroutine AD_PackElemInflowType(RF, Indata) type(RegFile), intent(inout) :: RF - type(BldInflowType), intent(in) :: InData - character(*), parameter :: RoutineName = 'AD_PackBldInflowType' + type(ElemInflowType), intent(in) :: InData + character(*), parameter :: RoutineName = 'AD_PackElemInflowType' if (RF%ErrStat >= AbortErrLev) return - call RegPackAlloc(RF, InData%InflowOnBlade) - call RegPackAlloc(RF, InData%AccelOnBlade) + call RegPackAlloc(RF, InData%InflowVel) + call RegPackAlloc(RF, InData%InflowAcc) if (RegCheckErr(RF, RoutineName)) return end subroutine -subroutine AD_UnPackBldInflowType(RF, OutData) +subroutine AD_UnPackElemInflowType(RF, OutData) type(RegFile), intent(inout) :: RF - type(BldInflowType), intent(inout) :: OutData - character(*), parameter :: RoutineName = 'AD_UnPackBldInflowType' + type(ElemInflowType), intent(inout) :: OutData + character(*), parameter :: RoutineName = 'AD_UnPackElemInflowType' integer(B8Ki) :: LB(2), UB(2) integer(IntKi) :: stat logical :: IsAllocAssoc if (RF%ErrStat /= ErrID_None) return - call RegUnpackAlloc(RF, OutData%InflowOnBlade); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%AccelOnBlade); if (RegCheckErr(RF, RoutineName)) return + call RegUnpackAlloc(RF, OutData%InflowVel); if (RegCheckErr(RF, RoutineName)) return + call RegUnpackAlloc(RF, OutData%InflowAcc); if (RegCheckErr(RF, RoutineName)) return end subroutine subroutine AD_CopyRotInflowType(SrcRotInflowTypeData, DstRotInflowTypeData, CtrlCode, ErrStat, ErrMsg) @@ -4283,46 +4282,25 @@ subroutine AD_CopyRotInflowType(SrcRotInflowTypeData, DstRotInflowTypeData, Ctrl character(*), parameter :: RoutineName = 'AD_CopyRotInflowType' ErrStat = ErrID_None ErrMsg = '' - if (allocated(SrcRotInflowTypeData%Bld)) then - LB(1:1) = lbound(SrcRotInflowTypeData%Bld, kind=B8Ki) - UB(1:1) = ubound(SrcRotInflowTypeData%Bld, kind=B8Ki) - if (.not. allocated(DstRotInflowTypeData%Bld)) then - allocate(DstRotInflowTypeData%Bld(LB(1):UB(1)), stat=ErrStat2) + if (allocated(SrcRotInflowTypeData%Blade)) then + LB(1:1) = lbound(SrcRotInflowTypeData%Blade, kind=B8Ki) + UB(1:1) = ubound(SrcRotInflowTypeData%Blade, kind=B8Ki) + if (.not. allocated(DstRotInflowTypeData%Blade)) then + allocate(DstRotInflowTypeData%Blade(LB(1):UB(1)), stat=ErrStat2) if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstRotInflowTypeData%Bld.', ErrStat, ErrMsg, RoutineName) + call SetErrStat(ErrID_Fatal, 'Error allocating DstRotInflowTypeData%Blade.', ErrStat, ErrMsg, RoutineName) return end if end if do i1 = LB(1), UB(1) - call AD_CopyBldInflowType(SrcRotInflowTypeData%Bld(i1), DstRotInflowTypeData%Bld(i1), CtrlCode, ErrStat2, ErrMsg2) + call AD_CopyElemInflowType(SrcRotInflowTypeData%Blade(i1), DstRotInflowTypeData%Blade(i1), CtrlCode, ErrStat2, ErrMsg2) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) if (ErrStat >= AbortErrLev) return end do end if - if (allocated(SrcRotInflowTypeData%InflowOnTower)) then - LB(1:2) = lbound(SrcRotInflowTypeData%InflowOnTower, kind=B8Ki) - UB(1:2) = ubound(SrcRotInflowTypeData%InflowOnTower, kind=B8Ki) - if (.not. allocated(DstRotInflowTypeData%InflowOnTower)) then - allocate(DstRotInflowTypeData%InflowOnTower(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstRotInflowTypeData%InflowOnTower.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstRotInflowTypeData%InflowOnTower = SrcRotInflowTypeData%InflowOnTower - end if - if (allocated(SrcRotInflowTypeData%AccelOnTower)) then - LB(1:2) = lbound(SrcRotInflowTypeData%AccelOnTower, kind=B8Ki) - UB(1:2) = ubound(SrcRotInflowTypeData%AccelOnTower, kind=B8Ki) - if (.not. allocated(DstRotInflowTypeData%AccelOnTower)) then - allocate(DstRotInflowTypeData%AccelOnTower(LB(1):UB(1),LB(2):UB(2)), stat=ErrStat2) - if (ErrStat2 /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating DstRotInflowTypeData%AccelOnTower.', ErrStat, ErrMsg, RoutineName) - return - end if - end if - DstRotInflowTypeData%AccelOnTower = SrcRotInflowTypeData%AccelOnTower - end if + call AD_CopyElemInflowType(SrcRotInflowTypeData%Tower, DstRotInflowTypeData%Tower, CtrlCode, ErrStat2, ErrMsg2) + call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) + if (ErrStat >= AbortErrLev) return DstRotInflowTypeData%InflowOnHub = SrcRotInflowTypeData%InflowOnHub DstRotInflowTypeData%InflowOnNacelle = SrcRotInflowTypeData%InflowOnNacelle DstRotInflowTypeData%InflowOnTailFin = SrcRotInflowTypeData%InflowOnTailFin @@ -4340,21 +4318,17 @@ subroutine AD_DestroyRotInflowType(RotInflowTypeData, ErrStat, ErrMsg) character(*), parameter :: RoutineName = 'AD_DestroyRotInflowType' ErrStat = ErrID_None ErrMsg = '' - if (allocated(RotInflowTypeData%Bld)) then - LB(1:1) = lbound(RotInflowTypeData%Bld, kind=B8Ki) - UB(1:1) = ubound(RotInflowTypeData%Bld, kind=B8Ki) + if (allocated(RotInflowTypeData%Blade)) then + LB(1:1) = lbound(RotInflowTypeData%Blade, kind=B8Ki) + UB(1:1) = ubound(RotInflowTypeData%Blade, kind=B8Ki) do i1 = LB(1), UB(1) - call AD_DestroyBldInflowType(RotInflowTypeData%Bld(i1), ErrStat2, ErrMsg2) + call AD_DestroyElemInflowType(RotInflowTypeData%Blade(i1), ErrStat2, ErrMsg2) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) end do - deallocate(RotInflowTypeData%Bld) - end if - if (allocated(RotInflowTypeData%InflowOnTower)) then - deallocate(RotInflowTypeData%InflowOnTower) - end if - if (allocated(RotInflowTypeData%AccelOnTower)) then - deallocate(RotInflowTypeData%AccelOnTower) + deallocate(RotInflowTypeData%Blade) end if + call AD_DestroyElemInflowType(RotInflowTypeData%Tower, ErrStat2, ErrMsg2) + call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) end subroutine subroutine AD_PackRotInflowType(RF, Indata) @@ -4364,17 +4338,16 @@ subroutine AD_PackRotInflowType(RF, Indata) integer(B8Ki) :: i1, i2 integer(B8Ki) :: LB(2), UB(2) if (RF%ErrStat >= AbortErrLev) return - call RegPack(RF, allocated(InData%Bld)) - if (allocated(InData%Bld)) then - call RegPackBounds(RF, 1, lbound(InData%Bld, kind=B8Ki), ubound(InData%Bld, kind=B8Ki)) - LB(1:1) = lbound(InData%Bld, kind=B8Ki) - UB(1:1) = ubound(InData%Bld, kind=B8Ki) + call RegPack(RF, allocated(InData%Blade)) + if (allocated(InData%Blade)) then + call RegPackBounds(RF, 1, lbound(InData%Blade, kind=B8Ki), ubound(InData%Blade, kind=B8Ki)) + LB(1:1) = lbound(InData%Blade, kind=B8Ki) + UB(1:1) = ubound(InData%Blade, kind=B8Ki) do i1 = LB(1), UB(1) - call AD_PackBldInflowType(RF, InData%Bld(i1)) + call AD_PackElemInflowType(RF, InData%Blade(i1)) end do end if - call RegPackAlloc(RF, InData%InflowOnTower) - call RegPackAlloc(RF, InData%AccelOnTower) + call AD_PackElemInflowType(RF, InData%Tower) call RegPack(RF, InData%InflowOnHub) call RegPack(RF, InData%InflowOnNacelle) call RegPack(RF, InData%InflowOnTailFin) @@ -4391,21 +4364,20 @@ subroutine AD_UnPackRotInflowType(RF, OutData) integer(IntKi) :: stat logical :: IsAllocAssoc if (RF%ErrStat /= ErrID_None) return - if (allocated(OutData%Bld)) deallocate(OutData%Bld) + if (allocated(OutData%Blade)) deallocate(OutData%Blade) call RegUnpack(RF, IsAllocAssoc); if (RegCheckErr(RF, RoutineName)) return if (IsAllocAssoc) then call RegUnpackBounds(RF, 1, LB, UB); if (RegCheckErr(RF, RoutineName)) return - allocate(OutData%Bld(LB(1):UB(1)),stat=stat) + allocate(OutData%Blade(LB(1):UB(1)),stat=stat) if (stat /= 0) then - call SetErrStat(ErrID_Fatal, 'Error allocating OutData%Bld.', RF%ErrStat, RF%ErrMsg, RoutineName) + call SetErrStat(ErrID_Fatal, 'Error allocating OutData%Blade.', RF%ErrStat, RF%ErrMsg, RoutineName) return end if do i1 = LB(1), UB(1) - call AD_UnpackBldInflowType(RF, OutData%Bld(i1)) ! Bld + call AD_UnpackElemInflowType(RF, OutData%Blade(i1)) ! Blade end do end if - call RegUnpackAlloc(RF, OutData%InflowOnTower); if (RegCheckErr(RF, RoutineName)) return - call RegUnpackAlloc(RF, OutData%AccelOnTower); if (RegCheckErr(RF, RoutineName)) return + call AD_UnpackElemInflowType(RF, OutData%Tower) ! Tower call RegUnpack(RF, OutData%InflowOnHub); if (RegCheckErr(RF, RoutineName)) return call RegUnpack(RF, OutData%InflowOnNacelle); if (RegCheckErr(RF, RoutineName)) return call RegUnpack(RF, OutData%InflowOnTailFin); if (RegCheckErr(RF, RoutineName)) return @@ -6536,27 +6508,25 @@ SUBROUTINE AD_InflowType_ExtrapInterp1(u1, u2, tin, u_out, tin_out, ErrStat, Err END IF ! check if allocated IF (ALLOCATED(u_out%RotInflow) .AND. ALLOCATED(u1%RotInflow)) THEN DO i01 = LBOUND(u_out%RotInflow,1, kind=B8Ki),UBOUND(u_out%RotInflow,1, kind=B8Ki) - IF (ALLOCATED(u_out%RotInflow(i01)%Bld) .AND. ALLOCATED(u1%RotInflow(i01)%Bld)) THEN - DO i11 = LBOUND(u_out%RotInflow(i01)%Bld,1, kind=B8Ki),UBOUND(u_out%RotInflow(i01)%Bld,1, kind=B8Ki) - IF (ALLOCATED(u_out%RotInflow(i01)%Bld(i11)%InflowOnBlade) .AND. ALLOCATED(u1%RotInflow(i01)%Bld(i11)%InflowOnBlade)) THEN - u_out%RotInflow(i01)%Bld(i11)%InflowOnBlade = a1*u1%RotInflow(i01)%Bld(i11)%InflowOnBlade + a2*u2%RotInflow(i01)%Bld(i11)%InflowOnBlade + IF (ALLOCATED(u_out%RotInflow(i01)%Blade) .AND. ALLOCATED(u1%RotInflow(i01)%Blade)) THEN + DO i11 = LBOUND(u_out%RotInflow(i01)%Blade,1, kind=B8Ki),UBOUND(u_out%RotInflow(i01)%Blade,1, kind=B8Ki) + IF (ALLOCATED(u_out%RotInflow(i01)%Blade(i11)%InflowVel) .AND. ALLOCATED(u1%RotInflow(i01)%Blade(i11)%InflowVel)) THEN + u_out%RotInflow(i01)%Blade(i11)%InflowVel = a1*u1%RotInflow(i01)%Blade(i11)%InflowVel + a2*u2%RotInflow(i01)%Blade(i11)%InflowVel END IF ! check if allocated END DO - DO i11 = LBOUND(u_out%RotInflow(i01)%Bld,1, kind=B8Ki),UBOUND(u_out%RotInflow(i01)%Bld,1, kind=B8Ki) - IF (ALLOCATED(u_out%RotInflow(i01)%Bld(i11)%AccelOnBlade) .AND. ALLOCATED(u1%RotInflow(i01)%Bld(i11)%AccelOnBlade)) THEN - u_out%RotInflow(i01)%Bld(i11)%AccelOnBlade = a1*u1%RotInflow(i01)%Bld(i11)%AccelOnBlade + a2*u2%RotInflow(i01)%Bld(i11)%AccelOnBlade + DO i11 = LBOUND(u_out%RotInflow(i01)%Blade,1, kind=B8Ki),UBOUND(u_out%RotInflow(i01)%Blade,1, kind=B8Ki) + IF (ALLOCATED(u_out%RotInflow(i01)%Blade(i11)%InflowAcc) .AND. ALLOCATED(u1%RotInflow(i01)%Blade(i11)%InflowAcc)) THEN + u_out%RotInflow(i01)%Blade(i11)%InflowAcc = a1*u1%RotInflow(i01)%Blade(i11)%InflowAcc + a2*u2%RotInflow(i01)%Blade(i11)%InflowAcc END IF ! check if allocated END DO END IF ! check if allocated END DO DO i01 = LBOUND(u_out%RotInflow,1, kind=B8Ki),UBOUND(u_out%RotInflow,1, kind=B8Ki) - IF (ALLOCATED(u_out%RotInflow(i01)%InflowOnTower) .AND. ALLOCATED(u1%RotInflow(i01)%InflowOnTower)) THEN - u_out%RotInflow(i01)%InflowOnTower = a1*u1%RotInflow(i01)%InflowOnTower + a2*u2%RotInflow(i01)%InflowOnTower + IF (ALLOCATED(u_out%RotInflow(i01)%Tower%InflowVel) .AND. ALLOCATED(u1%RotInflow(i01)%Tower%InflowVel)) THEN + u_out%RotInflow(i01)%Tower%InflowVel = a1*u1%RotInflow(i01)%Tower%InflowVel + a2*u2%RotInflow(i01)%Tower%InflowVel END IF ! check if allocated - END DO - DO i01 = LBOUND(u_out%RotInflow,1, kind=B8Ki),UBOUND(u_out%RotInflow,1, kind=B8Ki) - IF (ALLOCATED(u_out%RotInflow(i01)%AccelOnTower) .AND. ALLOCATED(u1%RotInflow(i01)%AccelOnTower)) THEN - u_out%RotInflow(i01)%AccelOnTower = a1*u1%RotInflow(i01)%AccelOnTower + a2*u2%RotInflow(i01)%AccelOnTower + IF (ALLOCATED(u_out%RotInflow(i01)%Tower%InflowAcc) .AND. ALLOCATED(u1%RotInflow(i01)%Tower%InflowAcc)) THEN + u_out%RotInflow(i01)%Tower%InflowAcc = a1*u1%RotInflow(i01)%Tower%InflowAcc + a2*u2%RotInflow(i01)%Tower%InflowAcc END IF ! check if allocated END DO DO i01 = LBOUND(u_out%RotInflow,1, kind=B8Ki),UBOUND(u_out%RotInflow,1, kind=B8Ki) @@ -6638,27 +6608,25 @@ SUBROUTINE AD_InflowType_ExtrapInterp2(u1, u2, u3, tin, u_out, tin_out, ErrStat, END IF ! check if allocated IF (ALLOCATED(u_out%RotInflow) .AND. ALLOCATED(u1%RotInflow)) THEN DO i01 = LBOUND(u_out%RotInflow,1, kind=B8Ki),UBOUND(u_out%RotInflow,1, kind=B8Ki) - IF (ALLOCATED(u_out%RotInflow(i01)%Bld) .AND. ALLOCATED(u1%RotInflow(i01)%Bld)) THEN - DO i11 = LBOUND(u_out%RotInflow(i01)%Bld,1, kind=B8Ki),UBOUND(u_out%RotInflow(i01)%Bld,1, kind=B8Ki) - IF (ALLOCATED(u_out%RotInflow(i01)%Bld(i11)%InflowOnBlade) .AND. ALLOCATED(u1%RotInflow(i01)%Bld(i11)%InflowOnBlade)) THEN - u_out%RotInflow(i01)%Bld(i11)%InflowOnBlade = a1*u1%RotInflow(i01)%Bld(i11)%InflowOnBlade + a2*u2%RotInflow(i01)%Bld(i11)%InflowOnBlade + a3*u3%RotInflow(i01)%Bld(i11)%InflowOnBlade + IF (ALLOCATED(u_out%RotInflow(i01)%Blade) .AND. ALLOCATED(u1%RotInflow(i01)%Blade)) THEN + DO i11 = LBOUND(u_out%RotInflow(i01)%Blade,1, kind=B8Ki),UBOUND(u_out%RotInflow(i01)%Blade,1, kind=B8Ki) + IF (ALLOCATED(u_out%RotInflow(i01)%Blade(i11)%InflowVel) .AND. ALLOCATED(u1%RotInflow(i01)%Blade(i11)%InflowVel)) THEN + u_out%RotInflow(i01)%Blade(i11)%InflowVel = a1*u1%RotInflow(i01)%Blade(i11)%InflowVel + a2*u2%RotInflow(i01)%Blade(i11)%InflowVel + a3*u3%RotInflow(i01)%Blade(i11)%InflowVel END IF ! check if allocated END DO - DO i11 = LBOUND(u_out%RotInflow(i01)%Bld,1, kind=B8Ki),UBOUND(u_out%RotInflow(i01)%Bld,1, kind=B8Ki) - IF (ALLOCATED(u_out%RotInflow(i01)%Bld(i11)%AccelOnBlade) .AND. ALLOCATED(u1%RotInflow(i01)%Bld(i11)%AccelOnBlade)) THEN - u_out%RotInflow(i01)%Bld(i11)%AccelOnBlade = a1*u1%RotInflow(i01)%Bld(i11)%AccelOnBlade + a2*u2%RotInflow(i01)%Bld(i11)%AccelOnBlade + a3*u3%RotInflow(i01)%Bld(i11)%AccelOnBlade + DO i11 = LBOUND(u_out%RotInflow(i01)%Blade,1, kind=B8Ki),UBOUND(u_out%RotInflow(i01)%Blade,1, kind=B8Ki) + IF (ALLOCATED(u_out%RotInflow(i01)%Blade(i11)%InflowAcc) .AND. ALLOCATED(u1%RotInflow(i01)%Blade(i11)%InflowAcc)) THEN + u_out%RotInflow(i01)%Blade(i11)%InflowAcc = a1*u1%RotInflow(i01)%Blade(i11)%InflowAcc + a2*u2%RotInflow(i01)%Blade(i11)%InflowAcc + a3*u3%RotInflow(i01)%Blade(i11)%InflowAcc END IF ! check if allocated END DO END IF ! check if allocated END DO DO i01 = LBOUND(u_out%RotInflow,1, kind=B8Ki),UBOUND(u_out%RotInflow,1, kind=B8Ki) - IF (ALLOCATED(u_out%RotInflow(i01)%InflowOnTower) .AND. ALLOCATED(u1%RotInflow(i01)%InflowOnTower)) THEN - u_out%RotInflow(i01)%InflowOnTower = a1*u1%RotInflow(i01)%InflowOnTower + a2*u2%RotInflow(i01)%InflowOnTower + a3*u3%RotInflow(i01)%InflowOnTower + IF (ALLOCATED(u_out%RotInflow(i01)%Tower%InflowVel) .AND. ALLOCATED(u1%RotInflow(i01)%Tower%InflowVel)) THEN + u_out%RotInflow(i01)%Tower%InflowVel = a1*u1%RotInflow(i01)%Tower%InflowVel + a2*u2%RotInflow(i01)%Tower%InflowVel + a3*u3%RotInflow(i01)%Tower%InflowVel END IF ! check if allocated - END DO - DO i01 = LBOUND(u_out%RotInflow,1, kind=B8Ki),UBOUND(u_out%RotInflow,1, kind=B8Ki) - IF (ALLOCATED(u_out%RotInflow(i01)%AccelOnTower) .AND. ALLOCATED(u1%RotInflow(i01)%AccelOnTower)) THEN - u_out%RotInflow(i01)%AccelOnTower = a1*u1%RotInflow(i01)%AccelOnTower + a2*u2%RotInflow(i01)%AccelOnTower + a3*u3%RotInflow(i01)%AccelOnTower + IF (ALLOCATED(u_out%RotInflow(i01)%Tower%InflowAcc) .AND. ALLOCATED(u1%RotInflow(i01)%Tower%InflowAcc)) THEN + u_out%RotInflow(i01)%Tower%InflowAcc = a1*u1%RotInflow(i01)%Tower%InflowAcc + a2*u2%RotInflow(i01)%Tower%InflowAcc + a3*u3%RotInflow(i01)%Tower%InflowAcc END IF ! check if allocated END DO DO i01 = LBOUND(u_out%RotInflow,1, kind=B8Ki),UBOUND(u_out%RotInflow,1, kind=B8Ki)