From 8719168eac0f97c356f9d544f0e21092328867b9 Mon Sep 17 00:00:00 2001 From: AbhineetGupta Date: Wed, 9 Aug 2023 14:39:51 -0600 Subject: [PATCH 1/8] Add unsteady aerodynamic model for turbine tail fin --- docs/source/user/aerodyn/bibliography.bib | 7 ++ docs/source/user/aerodyn/theory_tailfin.rst | 19 +++- modules/aerodyn/src/AeroDyn.f90 | 53 +++++++--- modules/aerodyn/src/AeroDyn_IO.f90 | 12 ++- modules/aerodyn/src/AeroDyn_Registry.txt | 12 +++ modules/aerodyn/src/AeroDyn_Types.f90 | 108 ++++++++++++++++++++ 6 files changed, 191 insertions(+), 20 deletions(-) diff --git a/docs/source/user/aerodyn/bibliography.bib b/docs/source/user/aerodyn/bibliography.bib index dc79859eb4..af96a4a2fe 100644 --- a/docs/source/user/aerodyn/bibliography.bib +++ b/docs/source/user/aerodyn/bibliography.bib @@ -108,3 +108,10 @@ @article{ad-hammam2022 volume= 1, number=1 } + +@techreport{ad-hammam_NREL:2023, + title={Modeling the Yaw Behavior of Tail Fins for Small Wind Turbines: November 22, 2021-May 21, 2024}, + author={Hammam, Mohamed M and Wood, David and Summerville, Brent}, + year={2023}, + institution={National Renewable Energy Laboratory (NREL), Golden, CO (United States)} +} diff --git a/docs/source/user/aerodyn/theory_tailfin.rst b/docs/source/user/aerodyn/theory_tailfin.rst index 5c5a356a7e..dd2c510eef 100644 --- a/docs/source/user/aerodyn/theory_tailfin.rst +++ b/docs/source/user/aerodyn/theory_tailfin.rst @@ -150,8 +150,6 @@ Where :math:`\boldsymbol{V}_{\text{ind},\text{blade}}[i_b, i_r]` is the induced More advanced models could set the induced velocity to zero when outside of the wake boundary, or include a tower-shadow-like wake model. Such option is not yet available. - - Polar-based model ----------------- @@ -160,12 +158,23 @@ The tabulated data are provided as part of the list of airfoils given with `AFNa The user only needs to indicate the index `TFinAFIndex` within the list `AFNames` to indicate which polar to use for the tail fin. -Unsteady slender body model +Unsteady model --------------------------- -The unsteady slender body (USB) model is documented in :cite:`ad-hammam2022`. +The unsteady aerodynamics of the tail fin is modeled based on Unsteady Slender Body Theory. +The theory is extended to include the effect of high yaw angle :cite:`ad-hammam_NREL:2023`. + +The normal force on the tail fin can be described as + +.. math:: :label: TFUSBForce + + N = \frac{\rho}{2} A_{tf} K_p x_1 V_x V_y + \frac{\rho}{2} A_{tf} \Big[x_2 K_v+(1- x_3)C_{Dc} \Big] V_y|V_y|. + -The theory will be implemented and documented in a future release. +And the moment on the tail fin about the apex can be described as: +.. math:: :label: TFUSBMoment + M_a = \frac{\rho}{2}A_{tf}x_{cp}x_1 K_p V_x V_y + \frac{\rho}{2}A_{tf}x_{cp}\Big[x_2K_v + (1-x_3)C_{Dc}\Big]V_y|V_y| +where :math:`A_{tf}` is the tail fin area, :math:`K_p` is the potential flow constant and :math:`K_v` is the vortex flow cosntant, :math:`x_i` are the separation function, and :math:`C_{Dc}` is the drag coefficient. \ No newline at end of file diff --git a/modules/aerodyn/src/AeroDyn.f90 b/modules/aerodyn/src/AeroDyn.f90 index 6a38b9d60d..10213904a4 100644 --- a/modules/aerodyn/src/AeroDyn.f90 +++ b/modules/aerodyn/src/AeroDyn.f90 @@ -392,6 +392,12 @@ subroutine AD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut p%rotors(iR)%TFin%TFinArea = InputFileData%rotors(iR)%TFin%TFinArea p%rotors(iR)%TFin%TFinIndMod = InputFileData%rotors(iR)%TFin%TFinIndMod p%rotors(iR)%TFin%TFinAFID = InputFileData%rotors(iR)%TFin%TFinAFID + p%rotors(iR)%TFin%TFinKp = InputFileData%rotors(iR)%TFin%TFinKp + p%rotors(iR)%TFin%TFinCp = InputFileData%rotors(iR)%TFin%TFinCp + p%rotors(iR)%TFin%TFinSigma = InputFileData%rotors(iR)%TFin%TFinSigma + p%rotors(iR)%TFin%TFinAStar = InputFileData%rotors(iR)%TFin%TFinAStar + p%rotors(iR)%TFin%TFinKv = InputFileData%rotors(iR)%TFin%TFinKv + p%rotors(iR)%TFin%TFinCDc = InputFileData%rotors(iR)%TFin%TFinCDc enddo !............................................................................................ @@ -4358,7 +4364,10 @@ SUBROUTINE TFin_CalcOutput(p, p_AD, u, m, y, ErrStat, ErrMsg ) real(ReKi) :: V_str(3) ! structural velocity real(ReKi) :: force_tf(3) ! force in tf system real(ReKi) :: moment_tf(3) ! moment in tf system - real(ReKi) :: alpha, Re, Cx, Cy, q ! Cl, Cd, Cm, + real(ReKi) :: alpha, Re, Cx, Cy, q, tfingamma ! Cl, Cd, Cm, + ! USB variables + real(ReKi) :: x1, x2, x3 ! scaling functions for different contributions on CN + type(AFI_OutputType) :: AFI_interp ! Resulting values from lookup table integer(intKi) :: ErrStat2 character(ErrMsgLen) :: ErrMsg2 @@ -4382,13 +4391,18 @@ SUBROUTINE TFin_CalcOutput(p, p_AD, u, m, y, ErrStat, ErrMsg ) STOP ! Will never happen endif V_rel = V_wnd - V_str + V_ind + print *,'V_wnd' + print *,V_wnd V_rel_tf = matmul(u%TFinMotion%Orientation(:,:,1), V_rel) ! from inertial to tf system alpha = atan2( V_rel_tf(2), V_rel_tf(1)) ! angle of attack V_rel_orth2 = V_rel_tf(1)**2 + V_rel_tf(2)**2 ! square norm of Vrel in tf system + + force_tf(:) = 0.0_ReKi + moment_tf(:) = 0.0_ReKi + if (p%TFin%TFinMod==TFinAero_none) then - y%TFinLoad%Force(1:3,1) = 0.0_ReKi - y%TFinLoad%Moment(1:3,1) = 0.0_ReKi + ! Do nothing elseif (p%TFin%TFinMod==TFinAero_polar) then ! Airfoil coefficients @@ -4399,21 +4413,35 @@ SUBROUTINE TFin_CalcOutput(p, p_AD, u, m, y, ErrStat, ErrMsg ) Cy = AFI_interp%Cl * cos(alpha) + AFI_interp%Cd * sin(alpha) ! Forces in tailfin system q = 0.5 * p%airDens * V_rel_orth2 * p%TFin%TFinArea - force_tf(:) = 0.0_ReKi - moment_tf(:) = 0.0_ReKi + force_tf(1) = Cx * q force_tf(2) = Cy * q - force_tf(3) = 0.0_ReKi - moment_tf(1:2) = 0.0_ReKi moment_tf(3) = AFI_interp%Cm * q * p%TFin%TFinChord - ! Transfer to global - y%TFinLoad%Force(1:3,1) = matmul(transpose(u%TFinMotion%Orientation(:,:,1)), force_tf) - y%TFinLoad%Moment(1:3,1) = matmul(transpose(u%TFinMotion%Orientation(:,:,1)), moment_tf) elseif (p%TFin%TFinMod==TFinAero_USB) then - call SetErrStat(ErrID_Fatal, 'Tail fin USB model not yet available', ErrStat, ErrMsg, RoutineName ) - return + !Calculate separation functions + !x1 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(1)*((ABS(alpha)*180.0_ReKi/pi)-p%TFin%TFinAStar(1)))) + !x2 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(2)*((ABS(alpha)*180.0_ReKi/pi)-p%TFin%TFinAStar(2)))) + !x3 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(3)*((ABS(alpha)*180.0_ReKi/pi)-p%TFin%TFinAStar(3)))) + + tfingamma = atan2(u%TFinMotion%orientation(2,1,1),u%TFinMotion%orientation(1,1,1)) + x1 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(1)*((ABS(tfingamma)*180.0_ReKi/pi)-p%TFin%TFinAStar(1)))) + x2 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(2)*((ABS(tfingamma)*180.0_ReKi/pi)-p%TFin%TFinAStar(2)))) + x3 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(3)*((ABS(tfingamma)*180.0_ReKi/pi)-p%TFin%TFinAStar(3)))) + + ! print *,alpha*180.0_ReKi/pi + ! print *,alpha + + force_tf(2) = 0.5_ReKi * p%AirDens * p%TFin%TFinArea * & + (p%TFin%TFinKp * x1 * V_rel_tf(1) * V_rel_tf(2) + & + (x2 * p%TFin%TFinKv + (1-x3)*p%TFin%TFinCDc) * V_rel_tf(2) * ABS(V_rel_tf(2))) + ! moment_tf(3) = force_tf(2) * p%Tfin%TFinCp * p%TFin%TFinChord + endif + + ! Transfer to global + y%TFinLoad%Force(1:3,1) = matmul(transpose(u%TFinMotion%Orientation(:,:,1)), force_tf) + y%TFinLoad%Moment(1:3,1) = matmul(transpose(u%TFinMotion%Orientation(:,:,1)), moment_tf) ! --- Store m%TFinAlpha = alpha @@ -4427,6 +4455,7 @@ SUBROUTINE TFin_CalcOutput(p, p_AD, u, m, y, ErrStat, ErrMsg ) m%TFinM_i = y%TFinLoad%Moment(1:3,1) END SUBROUTINE TFin_CalcOutput + !---------------------------------------------------------------------------------------------------------------------------------- !> This subroutine calculates the tower loads for the AeroDyn TowerLoad output mesh. SUBROUTINE ADTwr_CalcOutput(p, u, m, y, ErrStat, ErrMsg ) diff --git a/modules/aerodyn/src/AeroDyn_IO.f90 b/modules/aerodyn/src/AeroDyn_IO.f90 index 9a95dc4aa3..853b2bdce3 100644 --- a/modules/aerodyn/src/AeroDyn_IO.f90 +++ b/modules/aerodyn/src/AeroDyn_IO.f90 @@ -1266,15 +1266,21 @@ SUBROUTINE ReadTailFinInputs(FileName, TFData, UnEc, ErrStat, ErrMsg) call ParseVar(FileInfo_In, iLine, 'TFinAFID' , TFData%TFinAFID , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; !====== Unsteady slender body model ===================== [used only when TFinMod=2] call ParseCom(FileInfo_in, iLine, DummyLine , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; + call ParseVar(FileInfo_In, iLine, 'TFinKp' , TFData%TFinKp , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; + call ParseVar(FileInfo_In, iLine, 'TFinCp' , TFData%TFinCp , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; + call ParseAry(FileInfo_In, iLine, 'TFinSigma' , TFData%TFinSigma, 3 , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; + call ParseAry(FileInfo_In, iLine, 'TFinAStar', TFData%TFinAStar, 3 , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; + call ParseVar(FileInfo_In, iLine, 'TFinKv' , TFData%TFinKv , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; + call ParseVar(FileInfo_In, iLine, 'TFinCDc' , TFData%TFinCDc , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; + ! TODO ! --- Triggers TFData%TFinAngles = TFData%TFinAngles*D2R ! deg2rad ! --- Validation on the fly - !if (all((/TFinAero_none,TFinAero_polar, TFinAero_USB/) /= TFData%TFinMod)) then - if (all((/TFinAero_none,TFinAero_polar/) /= TFData%TFinMod)) then - call Fatal('TFinMod needs to be 0, or 1') + if (all((/TFinAero_none,TFinAero_polar,TFinAero_USB/) /= TFData%TFinMod)) then + call Fatal('TFinMod needs to be 0, 1 or 2') endif !if (all((/TFinIndMod_none,TFinIndMod_rotavg/) /= TFData%TFinIndMod)) then if (all((/TFinIndMod_none/) /= TFData%TFinIndMod)) then diff --git a/modules/aerodyn/src/AeroDyn_Registry.txt b/modules/aerodyn/src/AeroDyn_Registry.txt index 87d7233eee..df8ce178d5 100644 --- a/modules/aerodyn/src/AeroDyn_Registry.txt +++ b/modules/aerodyn/src/AeroDyn_Registry.txt @@ -54,6 +54,12 @@ typedef ^ TFinParameterType ReKi TFinChord - - - "Tail fin chord [u typedef ^ TFinParameterType ReKi TFinArea - - - "Tail fin planform area [used only when TFinMod=1]" m^2 typedef ^ TFinParameterType IntKi TFinIndMod - - - "Model for induced velocity calculation {0=none, 1=rotor-average}" (switch) typedef ^ TFinParameterType IntKi TFinAFID - - - "Index of Tail fin airfoil number [1 to NumAFfiles]" - +typedef ^ TFinParameterType ReKi TFinKp - - - "Tail fin emperical constant for vortex separation functions [used only when TFMod=2]" - +typedef ^ TFinParameterType ReKi TFinCp - - - "Tail fin emperical constant for vortex separation functions [used only when TFMod=2]" - +typedef ^ TFinParameterType ReKi TFinSigma 3 - - "Tail fin emperical constants for vortex separation functions [used only when TFMod=2]" - +typedef ^ TFinParameterType ReKi TFinAStar 3 - - "Tail fin initial angles for vortex separation functions [used only when TFMod=2]" deg +typedef ^ TFinParameterType ReKi TFinKv - - - "Tail fin vortex lift coefficient [used only when TFMod=2]" - +typedef ^ TFinParameterType ReKi TFinCDc - - - "Tail fin drag coefficient [used only when TFMod=2]" - # Tail Fin input file typedef ^ TFinInputFileType IntKi TFinMod - - 0 "Tail fin aerodynamics model {0=none, 1=polar-based, 2=USB-based}" (switch) @@ -63,6 +69,12 @@ typedef ^ TFinInputFileType ReKi TFinRefP_n 3 - - "Undeflected posit typedef ^ TFinInputFileType ReKi TFinAngles 3 - - "Tail fin chordline skew, tilt, and bank angles about the reference point" (deg) typedef ^ TFinInputFileType IntKi TFinIndMod - - - "Model for induced velocity calculation {0=none, 1=rotor-average}" (switch) typedef ^ TFinInputFileType IntKi TFinAFID - - - "Index of Tail fin airfoil number [1 to NumAFfiles]" - +typedef ^ TFinInputFileType ReKi TFinKp - - - "Tail fin emperical constant for vortex separation functions [used only when TFMod=2]" - +typedef ^ TFinInputFileType ReKi TFinCp - - - "Tail fin emperical constant for vortex separation functions [used only when TFMod=2]" - +typedef ^ TFinInputFileType ReKi TFinSigma 3 - - "Tail fin emperical constants for vortex separation functions [used only when TFMod=2]" - +typedef ^ TFinInputFileType ReKi TFinAStar 3 - - "Tail fin initial angles for vortex separation functions [used only when TFMod=2]" deg +typedef ^ TFinInputFileType ReKi TFinKv - - - "Tail fin vortex lift coefficient [used only when TFMod=2]" - +typedef ^ TFinInputFileType ReKi TFinCDc - - - "Tail fin drag coefficient [used only when TFMod=2]" - diff --git a/modules/aerodyn/src/AeroDyn_Types.f90 b/modules/aerodyn/src/AeroDyn_Types.f90 index b0957a03a7..1dedf4d6c1 100644 --- a/modules/aerodyn/src/AeroDyn_Types.f90 +++ b/modules/aerodyn/src/AeroDyn_Types.f90 @@ -66,6 +66,12 @@ MODULE AeroDyn_Types REAL(ReKi) :: TFinArea !< Tail fin planform area [used only when TFinMod=1] [m^2] INTEGER(IntKi) :: TFinIndMod !< Model for induced velocity calculation {0=none, 1=rotor-average} [(switch)] INTEGER(IntKi) :: TFinAFID !< Index of Tail fin airfoil number [1 to NumAFfiles] [-] + REAL(ReKi) :: TFinKp !< Tail fin emperical constant for vortex separation functions [used only when TFMod=2] [-] + REAL(ReKi) :: TFinCp !< Tail fin emperical constant for vortex separation functions [used only when TFMod=2] [-] + REAL(ReKi) , DIMENSION(1:3) :: TFinSigma !< Tail fin emperical constants for vortex separation functions [used only when TFMod=2] [-] + REAL(ReKi) , DIMENSION(1:3) :: TFinAStar !< Tail fin initial angles for vortex separation functions [used only when TFMod=2] [deg] + REAL(ReKi) :: TFinKv !< Tail fin vortex lift coefficient [used only when TFMod=2] [-] + REAL(ReKi) :: TFinCDc !< Tail fin drag coefficient [used only when TFMod=2] [-] END TYPE TFinParameterType ! ======================= ! ========= TFinInputFileType ======= @@ -77,6 +83,12 @@ MODULE AeroDyn_Types REAL(ReKi) , DIMENSION(1:3) :: TFinAngles !< Tail fin chordline skew, tilt, and bank angles about the reference point [(deg)] INTEGER(IntKi) :: TFinIndMod !< Model for induced velocity calculation {0=none, 1=rotor-average} [(switch)] INTEGER(IntKi) :: TFinAFID !< Index of Tail fin airfoil number [1 to NumAFfiles] [-] + REAL(ReKi) :: TFinKp !< Tail fin emperical constant for vortex separation functions [used only when TFMod=2] [-] + REAL(ReKi) :: TFinCp !< Tail fin emperical constant for vortex separation functions [used only when TFMod=2] [-] + REAL(ReKi) , DIMENSION(1:3) :: TFinSigma !< Tail fin emperical constants for vortex separation functions [used only when TFMod=2] [-] + REAL(ReKi) , DIMENSION(1:3) :: TFinAStar !< Tail fin initial angles for vortex separation functions [used only when TFMod=2] [deg] + REAL(ReKi) :: TFinKv !< Tail fin vortex lift coefficient [used only when TFMod=2] [-] + REAL(ReKi) :: TFinCDc !< Tail fin drag coefficient [used only when TFMod=2] [-] END TYPE TFinInputFileType ! ======================= ! ========= AD_VTK_BLSurfaceType ======= @@ -508,6 +520,12 @@ SUBROUTINE AD_CopyTFinParameterType( SrcTFinParameterTypeData, DstTFinParameterT DstTFinParameterTypeData%TFinArea = SrcTFinParameterTypeData%TFinArea DstTFinParameterTypeData%TFinIndMod = SrcTFinParameterTypeData%TFinIndMod DstTFinParameterTypeData%TFinAFID = SrcTFinParameterTypeData%TFinAFID + DstTFinParameterTypeData%TFinKp = SrcTFinParameterTypeData%TFinKp + DstTFinParameterTypeData%TFinCp = SrcTFinParameterTypeData%TFinCp + DstTFinParameterTypeData%TFinSigma = SrcTFinParameterTypeData%TFinSigma + DstTFinParameterTypeData%TFinAStar = SrcTFinParameterTypeData%TFinAStar + DstTFinParameterTypeData%TFinKv = SrcTFinParameterTypeData%TFinKv + DstTFinParameterTypeData%TFinCDc = SrcTFinParameterTypeData%TFinCDc END SUBROUTINE AD_CopyTFinParameterType SUBROUTINE AD_DestroyTFinParameterType( TFinParameterTypeData, ErrStat, ErrMsg, DEALLOCATEpointers ) @@ -573,6 +591,12 @@ SUBROUTINE AD_PackTFinParameterType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat Re_BufSz = Re_BufSz + 1 ! TFinArea Int_BufSz = Int_BufSz + 1 ! TFinIndMod Int_BufSz = Int_BufSz + 1 ! TFinAFID + Re_BufSz = Re_BufSz + 1 ! TFinKp + Re_BufSz = Re_BufSz + 1 ! TFinCp + Re_BufSz = Re_BufSz + SIZE(InData%TFinSigma) ! TFinSigma + Re_BufSz = Re_BufSz + SIZE(InData%TFinAStar) ! TFinAStar + Re_BufSz = Re_BufSz + 1 ! TFinKv + Re_BufSz = Re_BufSz + 1 ! TFinCDc IF ( Re_BufSz .GT. 0 ) THEN ALLOCATE( ReKiBuf( Re_BufSz ), STAT=ErrStat2 ) IF (ErrStat2 /= 0) THEN @@ -610,6 +634,22 @@ SUBROUTINE AD_PackTFinParameterType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat Int_Xferred = Int_Xferred + 1 IntKiBuf(Int_Xferred) = InData%TFinAFID Int_Xferred = Int_Xferred + 1 + ReKiBuf(Re_Xferred) = InData%TFinKp + Re_Xferred = Re_Xferred + 1 + ReKiBuf(Re_Xferred) = InData%TFinCp + Re_Xferred = Re_Xferred + 1 + DO i1 = LBOUND(InData%TFinSigma,1), UBOUND(InData%TFinSigma,1) + ReKiBuf(Re_Xferred) = InData%TFinSigma(i1) + Re_Xferred = Re_Xferred + 1 + END DO + DO i1 = LBOUND(InData%TFinAStar,1), UBOUND(InData%TFinAStar,1) + ReKiBuf(Re_Xferred) = InData%TFinAStar(i1) + Re_Xferred = Re_Xferred + 1 + END DO + ReKiBuf(Re_Xferred) = InData%TFinKv + Re_Xferred = Re_Xferred + 1 + ReKiBuf(Re_Xferred) = InData%TFinCDc + Re_Xferred = Re_Xferred + 1 END SUBROUTINE AD_PackTFinParameterType SUBROUTINE AD_UnPackTFinParameterType( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) @@ -652,6 +692,26 @@ SUBROUTINE AD_UnPackTFinParameterType( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrS Int_Xferred = Int_Xferred + 1 OutData%TFinAFID = IntKiBuf(Int_Xferred) Int_Xferred = Int_Xferred + 1 + OutData%TFinKp = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + OutData%TFinCp = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + i1_l = LBOUND(OutData%TFinSigma,1) + i1_u = UBOUND(OutData%TFinSigma,1) + DO i1 = LBOUND(OutData%TFinSigma,1), UBOUND(OutData%TFinSigma,1) + OutData%TFinSigma(i1) = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + END DO + i1_l = LBOUND(OutData%TFinAStar,1) + i1_u = UBOUND(OutData%TFinAStar,1) + DO i1 = LBOUND(OutData%TFinAStar,1), UBOUND(OutData%TFinAStar,1) + OutData%TFinAStar(i1) = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + END DO + OutData%TFinKv = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + OutData%TFinCDc = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 END SUBROUTINE AD_UnPackTFinParameterType SUBROUTINE AD_CopyTFinInputFileType( SrcTFinInputFileTypeData, DstTFinInputFileTypeData, CtrlCode, ErrStat, ErrMsg ) @@ -676,6 +736,12 @@ SUBROUTINE AD_CopyTFinInputFileType( SrcTFinInputFileTypeData, DstTFinInputFileT DstTFinInputFileTypeData%TFinAngles = SrcTFinInputFileTypeData%TFinAngles DstTFinInputFileTypeData%TFinIndMod = SrcTFinInputFileTypeData%TFinIndMod DstTFinInputFileTypeData%TFinAFID = SrcTFinInputFileTypeData%TFinAFID + DstTFinInputFileTypeData%TFinKp = SrcTFinInputFileTypeData%TFinKp + DstTFinInputFileTypeData%TFinCp = SrcTFinInputFileTypeData%TFinCp + DstTFinInputFileTypeData%TFinSigma = SrcTFinInputFileTypeData%TFinSigma + DstTFinInputFileTypeData%TFinAStar = SrcTFinInputFileTypeData%TFinAStar + DstTFinInputFileTypeData%TFinKv = SrcTFinInputFileTypeData%TFinKv + DstTFinInputFileTypeData%TFinCDc = SrcTFinInputFileTypeData%TFinCDc END SUBROUTINE AD_CopyTFinInputFileType SUBROUTINE AD_DestroyTFinInputFileType( TFinInputFileTypeData, ErrStat, ErrMsg, DEALLOCATEpointers ) @@ -743,6 +809,12 @@ SUBROUTINE AD_PackTFinInputFileType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat Re_BufSz = Re_BufSz + SIZE(InData%TFinAngles) ! TFinAngles Int_BufSz = Int_BufSz + 1 ! TFinIndMod Int_BufSz = Int_BufSz + 1 ! TFinAFID + Re_BufSz = Re_BufSz + 1 ! TFinKp + Re_BufSz = Re_BufSz + 1 ! TFinCp + Re_BufSz = Re_BufSz + SIZE(InData%TFinSigma) ! TFinSigma + Re_BufSz = Re_BufSz + SIZE(InData%TFinAStar) ! TFinAStar + Re_BufSz = Re_BufSz + 1 ! TFinKv + Re_BufSz = Re_BufSz + 1 ! TFinCDc IF ( Re_BufSz .GT. 0 ) THEN ALLOCATE( ReKiBuf( Re_BufSz ), STAT=ErrStat2 ) IF (ErrStat2 /= 0) THEN @@ -788,6 +860,22 @@ SUBROUTINE AD_PackTFinInputFileType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat Int_Xferred = Int_Xferred + 1 IntKiBuf(Int_Xferred) = InData%TFinAFID Int_Xferred = Int_Xferred + 1 + ReKiBuf(Re_Xferred) = InData%TFinKp + Re_Xferred = Re_Xferred + 1 + ReKiBuf(Re_Xferred) = InData%TFinCp + Re_Xferred = Re_Xferred + 1 + DO i1 = LBOUND(InData%TFinSigma,1), UBOUND(InData%TFinSigma,1) + ReKiBuf(Re_Xferred) = InData%TFinSigma(i1) + Re_Xferred = Re_Xferred + 1 + END DO + DO i1 = LBOUND(InData%TFinAStar,1), UBOUND(InData%TFinAStar,1) + ReKiBuf(Re_Xferred) = InData%TFinAStar(i1) + Re_Xferred = Re_Xferred + 1 + END DO + ReKiBuf(Re_Xferred) = InData%TFinKv + Re_Xferred = Re_Xferred + 1 + ReKiBuf(Re_Xferred) = InData%TFinCDc + Re_Xferred = Re_Xferred + 1 END SUBROUTINE AD_PackTFinInputFileType SUBROUTINE AD_UnPackTFinInputFileType( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) @@ -839,6 +927,26 @@ SUBROUTINE AD_UnPackTFinInputFileType( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrS Int_Xferred = Int_Xferred + 1 OutData%TFinAFID = IntKiBuf(Int_Xferred) Int_Xferred = Int_Xferred + 1 + OutData%TFinKp = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + OutData%TFinCp = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + i1_l = LBOUND(OutData%TFinSigma,1) + i1_u = UBOUND(OutData%TFinSigma,1) + DO i1 = LBOUND(OutData%TFinSigma,1), UBOUND(OutData%TFinSigma,1) + OutData%TFinSigma(i1) = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + END DO + i1_l = LBOUND(OutData%TFinAStar,1) + i1_u = UBOUND(OutData%TFinAStar,1) + DO i1 = LBOUND(OutData%TFinAStar,1), UBOUND(OutData%TFinAStar,1) + OutData%TFinAStar(i1) = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + END DO + OutData%TFinKv = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + OutData%TFinCDc = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 END SUBROUTINE AD_UnPackTFinInputFileType SUBROUTINE AD_CopyVTK_BLSurfaceType( SrcVTK_BLSurfaceTypeData, DstVTK_BLSurfaceTypeData, CtrlCode, ErrStat, ErrMsg ) From 128ff34ea20aa9d658f29040e316e609edd001ba Mon Sep 17 00:00:00 2001 From: AbhineetGupta Date: Thu, 7 Dec 2023 09:34:24 -0700 Subject: [PATCH 2/8] Add modify tail fin USB model to use gamma instead of alpha --- modules/aerodyn/src/AeroDyn.f90 | 44 +++++++++++------------- modules/aerodyn/src/AeroDyn_IO.f90 | 1 - modules/aerodyn/src/AeroDyn_Registry.txt | 6 ++-- modules/aerodyn/src/AeroDyn_Types.f90 | 18 ++-------- reg_tests/r-test | 2 +- 5 files changed, 25 insertions(+), 46 deletions(-) diff --git a/modules/aerodyn/src/AeroDyn.f90 b/modules/aerodyn/src/AeroDyn.f90 index 10213904a4..62d8636331 100644 --- a/modules/aerodyn/src/AeroDyn.f90 +++ b/modules/aerodyn/src/AeroDyn.f90 @@ -393,7 +393,6 @@ subroutine AD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut p%rotors(iR)%TFin%TFinIndMod = InputFileData%rotors(iR)%TFin%TFinIndMod p%rotors(iR)%TFin%TFinAFID = InputFileData%rotors(iR)%TFin%TFinAFID p%rotors(iR)%TFin%TFinKp = InputFileData%rotors(iR)%TFin%TFinKp - p%rotors(iR)%TFin%TFinCp = InputFileData%rotors(iR)%TFin%TFinCp p%rotors(iR)%TFin%TFinSigma = InputFileData%rotors(iR)%TFin%TFinSigma p%rotors(iR)%TFin%TFinAStar = InputFileData%rotors(iR)%TFin%TFinAStar p%rotors(iR)%TFin%TFinKv = InputFileData%rotors(iR)%TFin%TFinKv @@ -4362,11 +4361,11 @@ SUBROUTINE TFin_CalcOutput(p, p_AD, u, m, y, ErrStat, ErrMsg ) real(ReKi) :: V_wnd(3) ! wind velocity real(ReKi) :: V_ind(3) ! induced velocity real(ReKi) :: V_str(3) ! structural velocity + real(ReKi) :: V_wnd_tf(3) ! wind velocity real(ReKi) :: force_tf(3) ! force in tf system real(ReKi) :: moment_tf(3) ! moment in tf system - real(ReKi) :: alpha, Re, Cx, Cy, q, tfingamma ! Cl, Cd, Cm, - ! USB variables - real(ReKi) :: x1, x2, x3 ! scaling functions for different contributions on CN + real(ReKi) :: alpha, Re, Cx, Cy, q ! Cl, Cd, Cm, + real(ReKi) :: x1, x2, x3,gamma_tf! scaling functions, gamma for unsteady modeling type(AFI_OutputType) :: AFI_interp ! Resulting values from lookup table integer(intKi) :: ErrStat2 @@ -4383,29 +4382,33 @@ SUBROUTINE TFin_CalcOutput(p, p_AD, u, m, y, ErrStat, ErrMsg ) if (p%TFin%TFinIndMod==TFinIndMod_none) then V_ind = 0.0_ReKi + elseif(p%TFin%TFinIndMod==TFinIndMod_rotavg) then ! TODO TODO print*,'TODO TailFin: compute rotor average induced velocity' V_ind = 0.0_ReKi + else STOP ! Will never happen + endif - V_rel = V_wnd - V_str + V_ind - print *,'V_wnd' - print *,V_wnd + + V_rel = V_wnd - V_str + V_ind ! relative wind on tail fin V_rel_tf = matmul(u%TFinMotion%Orientation(:,:,1), V_rel) ! from inertial to tf system - alpha = atan2( V_rel_tf(2), V_rel_tf(1)) ! angle of attack + alpha = atan2(V_rel_tf(2), V_rel_tf(1)) ! angle of attack + v_wnd_tf = matmul(u%TFinMotion%Orientation(:,:,1), V_wnd) ! only used for calculation of x1,x2,x3 + gamma_tf = atan2(v_wnd_tf(2), v_wnd_tf(1)) ! only used for calculation of x1,x2,x3 V_rel_orth2 = V_rel_tf(1)**2 + V_rel_tf(2)**2 ! square norm of Vrel in tf system - + ! Initialize the tail fin forces to zero force_tf(:) = 0.0_ReKi - moment_tf(:) = 0.0_ReKi + moment_tf(:) = 0.0_ReKi if (p%TFin%TFinMod==TFinAero_none) then ! Do nothing elseif (p%TFin%TFinMod==TFinAero_polar) then - ! Airfoil coefficients + ! Airfoil coefficients based model Re = sqrt(V_rel_orth2) * p%TFin%TFinChord/p%KinVisc call AFI_ComputeAirfoilCoefs( alpha, Re, 0.0_ReKi, p_AD%AFI(p%TFin%TFinAFID), AFI_interp, ErrStat2, ErrMsg2) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) @@ -4419,24 +4422,17 @@ SUBROUTINE TFin_CalcOutput(p, p_AD, u, m, y, ErrStat, ErrMsg ) moment_tf(3) = AFI_interp%Cm * q * p%TFin%TFinChord elseif (p%TFin%TFinMod==TFinAero_USB) then - !Calculate separation functions - !x1 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(1)*((ABS(alpha)*180.0_ReKi/pi)-p%TFin%TFinAStar(1)))) - !x2 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(2)*((ABS(alpha)*180.0_ReKi/pi)-p%TFin%TFinAStar(2)))) - !x3 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(3)*((ABS(alpha)*180.0_ReKi/pi)-p%TFin%TFinAStar(3)))) + ! Unsteady aerodynamic model - tfingamma = atan2(u%TFinMotion%orientation(2,1,1),u%TFinMotion%orientation(1,1,1)) - x1 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(1)*((ABS(tfingamma)*180.0_ReKi/pi)-p%TFin%TFinAStar(1)))) - x2 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(2)*((ABS(tfingamma)*180.0_ReKi/pi)-p%TFin%TFinAStar(2)))) - x3 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(3)*((ABS(tfingamma)*180.0_ReKi/pi)-p%TFin%TFinAStar(3)))) - - ! print *,alpha*180.0_ReKi/pi - ! print *,alpha + ! Calculate separation function (quasi-steady) + x1 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(1)*((ABS(gamma_tf)*180.0_ReKi/pi)-p%TFin%TFinAStar(1)))) + x2 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(2)*((ABS(gamma_tf)*180.0_ReKi/pi)-p%TFin%TFinAStar(2)))) + x3 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(3)*((ABS(gamma_tf)*180.0_ReKi/pi)-p%TFin%TFinAStar(3)))) + ! Calculate unsteady force on tain fin force_tf(2) = 0.5_ReKi * p%AirDens * p%TFin%TFinArea * & (p%TFin%TFinKp * x1 * V_rel_tf(1) * V_rel_tf(2) + & (x2 * p%TFin%TFinKv + (1-x3)*p%TFin%TFinCDc) * V_rel_tf(2) * ABS(V_rel_tf(2))) - ! moment_tf(3) = force_tf(2) * p%Tfin%TFinCp * p%TFin%TFinChord - endif ! Transfer to global diff --git a/modules/aerodyn/src/AeroDyn_IO.f90 b/modules/aerodyn/src/AeroDyn_IO.f90 index 853b2bdce3..6c576aff88 100644 --- a/modules/aerodyn/src/AeroDyn_IO.f90 +++ b/modules/aerodyn/src/AeroDyn_IO.f90 @@ -1267,7 +1267,6 @@ SUBROUTINE ReadTailFinInputs(FileName, TFData, UnEc, ErrStat, ErrMsg) !====== Unsteady slender body model ===================== [used only when TFinMod=2] call ParseCom(FileInfo_in, iLine, DummyLine , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; call ParseVar(FileInfo_In, iLine, 'TFinKp' , TFData%TFinKp , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; - call ParseVar(FileInfo_In, iLine, 'TFinCp' , TFData%TFinCp , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; call ParseAry(FileInfo_In, iLine, 'TFinSigma' , TFData%TFinSigma, 3 , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; call ParseAry(FileInfo_In, iLine, 'TFinAStar', TFData%TFinAStar, 3 , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; call ParseVar(FileInfo_In, iLine, 'TFinKv' , TFData%TFinKv , ErrStat2, ErrMsg2, UnEc); if (Failed()) return; diff --git a/modules/aerodyn/src/AeroDyn_Registry.txt b/modules/aerodyn/src/AeroDyn_Registry.txt index df8ce178d5..046aef7bc0 100644 --- a/modules/aerodyn/src/AeroDyn_Registry.txt +++ b/modules/aerodyn/src/AeroDyn_Registry.txt @@ -54,8 +54,7 @@ typedef ^ TFinParameterType ReKi TFinChord - - - "Tail fin chord [u typedef ^ TFinParameterType ReKi TFinArea - - - "Tail fin planform area [used only when TFinMod=1]" m^2 typedef ^ TFinParameterType IntKi TFinIndMod - - - "Model for induced velocity calculation {0=none, 1=rotor-average}" (switch) typedef ^ TFinParameterType IntKi TFinAFID - - - "Index of Tail fin airfoil number [1 to NumAFfiles]" - -typedef ^ TFinParameterType ReKi TFinKp - - - "Tail fin emperical constant for vortex separation functions [used only when TFMod=2]" - -typedef ^ TFinParameterType ReKi TFinCp - - - "Tail fin emperical constant for vortex separation functions [used only when TFMod=2]" - +typedef ^ TFinParameterType ReKi TFinKp - - - "Tail fin potential flow constant [used only when TFMod=2]" - typedef ^ TFinParameterType ReKi TFinSigma 3 - - "Tail fin emperical constants for vortex separation functions [used only when TFMod=2]" - typedef ^ TFinParameterType ReKi TFinAStar 3 - - "Tail fin initial angles for vortex separation functions [used only when TFMod=2]" deg typedef ^ TFinParameterType ReKi TFinKv - - - "Tail fin vortex lift coefficient [used only when TFMod=2]" - @@ -69,8 +68,7 @@ typedef ^ TFinInputFileType ReKi TFinRefP_n 3 - - "Undeflected posit typedef ^ TFinInputFileType ReKi TFinAngles 3 - - "Tail fin chordline skew, tilt, and bank angles about the reference point" (deg) typedef ^ TFinInputFileType IntKi TFinIndMod - - - "Model for induced velocity calculation {0=none, 1=rotor-average}" (switch) typedef ^ TFinInputFileType IntKi TFinAFID - - - "Index of Tail fin airfoil number [1 to NumAFfiles]" - -typedef ^ TFinInputFileType ReKi TFinKp - - - "Tail fin emperical constant for vortex separation functions [used only when TFMod=2]" - -typedef ^ TFinInputFileType ReKi TFinCp - - - "Tail fin emperical constant for vortex separation functions [used only when TFMod=2]" - +typedef ^ TFinInputFileType ReKi TFinKp - - - "Tail fin potential flow constant [used only when TFMod=2]" - typedef ^ TFinInputFileType ReKi TFinSigma 3 - - "Tail fin emperical constants for vortex separation functions [used only when TFMod=2]" - typedef ^ TFinInputFileType ReKi TFinAStar 3 - - "Tail fin initial angles for vortex separation functions [used only when TFMod=2]" deg typedef ^ TFinInputFileType ReKi TFinKv - - - "Tail fin vortex lift coefficient [used only when TFMod=2]" - diff --git a/modules/aerodyn/src/AeroDyn_Types.f90 b/modules/aerodyn/src/AeroDyn_Types.f90 index 1dedf4d6c1..a05e7b746f 100644 --- a/modules/aerodyn/src/AeroDyn_Types.f90 +++ b/modules/aerodyn/src/AeroDyn_Types.f90 @@ -66,8 +66,7 @@ MODULE AeroDyn_Types REAL(ReKi) :: TFinArea !< Tail fin planform area [used only when TFinMod=1] [m^2] INTEGER(IntKi) :: TFinIndMod !< Model for induced velocity calculation {0=none, 1=rotor-average} [(switch)] INTEGER(IntKi) :: TFinAFID !< Index of Tail fin airfoil number [1 to NumAFfiles] [-] - REAL(ReKi) :: TFinKp !< Tail fin emperical constant for vortex separation functions [used only when TFMod=2] [-] - REAL(ReKi) :: TFinCp !< Tail fin emperical constant for vortex separation functions [used only when TFMod=2] [-] + REAL(ReKi) :: TFinKp !< Tail fin potential flow constant [used only when TFMod=2] [-] REAL(ReKi) , DIMENSION(1:3) :: TFinSigma !< Tail fin emperical constants for vortex separation functions [used only when TFMod=2] [-] REAL(ReKi) , DIMENSION(1:3) :: TFinAStar !< Tail fin initial angles for vortex separation functions [used only when TFMod=2] [deg] REAL(ReKi) :: TFinKv !< Tail fin vortex lift coefficient [used only when TFMod=2] [-] @@ -83,8 +82,7 @@ MODULE AeroDyn_Types REAL(ReKi) , DIMENSION(1:3) :: TFinAngles !< Tail fin chordline skew, tilt, and bank angles about the reference point [(deg)] INTEGER(IntKi) :: TFinIndMod !< Model for induced velocity calculation {0=none, 1=rotor-average} [(switch)] INTEGER(IntKi) :: TFinAFID !< Index of Tail fin airfoil number [1 to NumAFfiles] [-] - REAL(ReKi) :: TFinKp !< Tail fin emperical constant for vortex separation functions [used only when TFMod=2] [-] - REAL(ReKi) :: TFinCp !< Tail fin emperical constant for vortex separation functions [used only when TFMod=2] [-] + REAL(ReKi) :: TFinKp !< Tail fin potential flow constant [used only when TFMod=2] [-] REAL(ReKi) , DIMENSION(1:3) :: TFinSigma !< Tail fin emperical constants for vortex separation functions [used only when TFMod=2] [-] REAL(ReKi) , DIMENSION(1:3) :: TFinAStar !< Tail fin initial angles for vortex separation functions [used only when TFMod=2] [deg] REAL(ReKi) :: TFinKv !< Tail fin vortex lift coefficient [used only when TFMod=2] [-] @@ -521,7 +519,6 @@ SUBROUTINE AD_CopyTFinParameterType( SrcTFinParameterTypeData, DstTFinParameterT DstTFinParameterTypeData%TFinIndMod = SrcTFinParameterTypeData%TFinIndMod DstTFinParameterTypeData%TFinAFID = SrcTFinParameterTypeData%TFinAFID DstTFinParameterTypeData%TFinKp = SrcTFinParameterTypeData%TFinKp - DstTFinParameterTypeData%TFinCp = SrcTFinParameterTypeData%TFinCp DstTFinParameterTypeData%TFinSigma = SrcTFinParameterTypeData%TFinSigma DstTFinParameterTypeData%TFinAStar = SrcTFinParameterTypeData%TFinAStar DstTFinParameterTypeData%TFinKv = SrcTFinParameterTypeData%TFinKv @@ -592,7 +589,6 @@ SUBROUTINE AD_PackTFinParameterType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat Int_BufSz = Int_BufSz + 1 ! TFinIndMod Int_BufSz = Int_BufSz + 1 ! TFinAFID Re_BufSz = Re_BufSz + 1 ! TFinKp - Re_BufSz = Re_BufSz + 1 ! TFinCp Re_BufSz = Re_BufSz + SIZE(InData%TFinSigma) ! TFinSigma Re_BufSz = Re_BufSz + SIZE(InData%TFinAStar) ! TFinAStar Re_BufSz = Re_BufSz + 1 ! TFinKv @@ -636,8 +632,6 @@ SUBROUTINE AD_PackTFinParameterType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat Int_Xferred = Int_Xferred + 1 ReKiBuf(Re_Xferred) = InData%TFinKp Re_Xferred = Re_Xferred + 1 - ReKiBuf(Re_Xferred) = InData%TFinCp - Re_Xferred = Re_Xferred + 1 DO i1 = LBOUND(InData%TFinSigma,1), UBOUND(InData%TFinSigma,1) ReKiBuf(Re_Xferred) = InData%TFinSigma(i1) Re_Xferred = Re_Xferred + 1 @@ -694,8 +688,6 @@ SUBROUTINE AD_UnPackTFinParameterType( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrS Int_Xferred = Int_Xferred + 1 OutData%TFinKp = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 - OutData%TFinCp = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 i1_l = LBOUND(OutData%TFinSigma,1) i1_u = UBOUND(OutData%TFinSigma,1) DO i1 = LBOUND(OutData%TFinSigma,1), UBOUND(OutData%TFinSigma,1) @@ -737,7 +729,6 @@ SUBROUTINE AD_CopyTFinInputFileType( SrcTFinInputFileTypeData, DstTFinInputFileT DstTFinInputFileTypeData%TFinIndMod = SrcTFinInputFileTypeData%TFinIndMod DstTFinInputFileTypeData%TFinAFID = SrcTFinInputFileTypeData%TFinAFID DstTFinInputFileTypeData%TFinKp = SrcTFinInputFileTypeData%TFinKp - DstTFinInputFileTypeData%TFinCp = SrcTFinInputFileTypeData%TFinCp DstTFinInputFileTypeData%TFinSigma = SrcTFinInputFileTypeData%TFinSigma DstTFinInputFileTypeData%TFinAStar = SrcTFinInputFileTypeData%TFinAStar DstTFinInputFileTypeData%TFinKv = SrcTFinInputFileTypeData%TFinKv @@ -810,7 +801,6 @@ SUBROUTINE AD_PackTFinInputFileType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat Int_BufSz = Int_BufSz + 1 ! TFinIndMod Int_BufSz = Int_BufSz + 1 ! TFinAFID Re_BufSz = Re_BufSz + 1 ! TFinKp - Re_BufSz = Re_BufSz + 1 ! TFinCp Re_BufSz = Re_BufSz + SIZE(InData%TFinSigma) ! TFinSigma Re_BufSz = Re_BufSz + SIZE(InData%TFinAStar) ! TFinAStar Re_BufSz = Re_BufSz + 1 ! TFinKv @@ -862,8 +852,6 @@ SUBROUTINE AD_PackTFinInputFileType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat Int_Xferred = Int_Xferred + 1 ReKiBuf(Re_Xferred) = InData%TFinKp Re_Xferred = Re_Xferred + 1 - ReKiBuf(Re_Xferred) = InData%TFinCp - Re_Xferred = Re_Xferred + 1 DO i1 = LBOUND(InData%TFinSigma,1), UBOUND(InData%TFinSigma,1) ReKiBuf(Re_Xferred) = InData%TFinSigma(i1) Re_Xferred = Re_Xferred + 1 @@ -929,8 +917,6 @@ SUBROUTINE AD_UnPackTFinInputFileType( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrS Int_Xferred = Int_Xferred + 1 OutData%TFinKp = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 - OutData%TFinCp = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 i1_l = LBOUND(OutData%TFinSigma,1) i1_u = UBOUND(OutData%TFinSigma,1) DO i1 = LBOUND(OutData%TFinSigma,1), UBOUND(OutData%TFinSigma,1) diff --git a/reg_tests/r-test b/reg_tests/r-test index 9a42b24203..1cbf6a1ae9 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit 9a42b2420312ab5dfd49065e7ddab6fb69dc7d3f +Subproject commit 1cbf6a1ae96655e2a7fa2a6865ccc99fc39bf6c8 From 0bd0c50646d741dc8760382da63ad178978a39c2 Mon Sep 17 00:00:00 2001 From: AbhineetGupta Date: Thu, 7 Dec 2023 14:01:31 -0700 Subject: [PATCH 3/8] Fixed reg-test link --- reg_tests/r-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/r-test b/reg_tests/r-test index 1cbf6a1ae9..9a42b24203 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit 1cbf6a1ae96655e2a7fa2a6865ccc99fc39bf6c8 +Subproject commit 9a42b2420312ab5dfd49065e7ddab6fb69dc7d3f From af30fd879da091104e1a37787630c3ac91ef6fbc Mon Sep 17 00:00:00 2001 From: AbhineetGupta Date: Fri, 8 Dec 2023 13:15:57 -0700 Subject: [PATCH 4/8] Add documentation about tail fin unsteady model --- docs/source/user/aerodyn/input.rst | 36 +++++++++++++++------ docs/source/user/aerodyn/theory_tailfin.rst | 16 +++++---- modules/aerodyn/src/AeroDyn_Registry.txt | 20 ++++++------ 3 files changed, 47 insertions(+), 25 deletions(-) diff --git a/docs/source/user/aerodyn/input.rst b/docs/source/user/aerodyn/input.rst index 3fe7ff7a38..eb6ea535ea 100644 --- a/docs/source/user/aerodyn/input.rst +++ b/docs/source/user/aerodyn/input.rst @@ -883,22 +883,26 @@ An example of tail fin input file is given below: 0 TFinIndMod - Model for induced velocity calculation {0: none, 1:rotor-average} (switch) ====== Polar-based model ================================ [used only when TFinMod=1] 1 TFinAFID - Index of Tail fin airfoil number [1 to NumAFfiles] - ====== Unsteady slender body model ===================== [used only when TFinMod=2] - [TODO inputs for model 2] + ====== Unsteady slender body model ===================== [used only when TFinMod=2] + 0.9 TFinKp - Tail fin moment of area about reference point [used only when TFMod=2] + 0.3,0.1,0.1 TFinSigma - Tail fin emperical constant for vortex separation functions [used only when TFMod=2] + 40,60,60 TFinAStar - Tail fin initial angles for vortex separation functions [used only when TFMod=2] (deg) + 3.1416 TFinKv - Tail fin vortex lift coefficient [used only when TFMod=2] + 1.3 TFinCDc - Tail fin drag coefficient [used only when TFMod=2] General inputs ~~~~~~~~~~~~~~ -**TFinMod** Switch to select a model for the tail fin aerodynamics: +``TFinMod`` is a switch to select a model for the tail fin aerodynamics: 0) none (the aerodynamic forces are zero), 1) polar-based, 2) USB-based (see :numref:`TF-aerotheory`). (switch) -**TFinArea** Area of the tail fin. (m^2) +``TFinArea`` is the area of the tail fin. (m^2) This is the plan form area of the tail fin plate used to relate the local dynamic pressure and airfoil coefficients to aerodynamic loads. This value must not be negative and is only used when TFinMod is set to 1. (m^2) -**TFinRefP_n** Undeflected position (:math:`x_{\text{ref},x_n},x_{\text{ref},y_n}, x_{\text{ref},z_n}`) of the tail fin from the tower top in nacelle coordinates. +``TFinRefP_n`` is the undeflected position (:math:`x_{\text{ref},x_n},x_{\text{ref},y_n}, x_{\text{ref},z_n}`) of the tail fin from the tower top in nacelle coordinates. (formerly defined using ``TFinCPxn``, ``TFinCPyn``, ``TFinCPzn``). The distances defines the configuration for a furl angle of zero. For a typical upwind wind turbine, @@ -908,7 +912,7 @@ For a typical upwind wind turbine, See :numref:`figTFGeom` and :numref:`figTFcoord1`. (m) -**TFinAngles** Angles (:math:`\theta_\text{skew},\theta_\text{tilt}, \theta_\text{bank}`) of the tail fin +``TFinAngles`` are the angles (:math:`\theta_\text{skew},\theta_\text{tilt}, \theta_\text{bank}`) of the tail fin (formerly defined as ``TFinSkew``, ``TFinTilt``, ``TFinBank``). See :numref:`figTFGeom` and :numref:`figTFcoord1`. These angles define the chordline at a furl angle of zero, where the chordline is assumed to be passing through the reference point. @@ -925,7 +929,7 @@ This value must be greater than -180 and less than or equal to 180 degrees. -**TFinIndMod** +``TFinIndMod`` Switch to select a model for the calculation of the velocity induced by the rotor and its wake on the tailfin (not the induced velocity from the tailfin wing). The options available are: 0) none (the induced velocity is zero) @@ -936,7 +940,7 @@ The options available are: Polar-based model inputs ~~~~~~~~~~~~~~~~~~~~~~~~ -**TFinAFID** +``TFinAFID`` This integer tells AeroDyn which of the input airfoil files (``AFNames``) is assigned to the tail fin. For instance, a value of 2 means that the tail fin will use ``AFNames(2)`` for the local tail fin airfoil. This value must be @@ -945,7 +949,21 @@ between 1 and ``NumAFfiles`` and is only used when TFinMod is set to 1. (-) Unsteady slender body (USB) model inputs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Refer to :numref:`TF-aerotheory` and :cite:`ad-hammam_NREL:2023` for guidance on how to select parameters for the unsteady slender body theory based model. -This option is currently not available and will be documented in a future release. +``TFinKp`` +Potential lift coefficient for unsteady aerodynamics. ``TFinKp`` is used to calculate the potential flow contribution to the unsteady aerodynamic force on the tail fin. +``TFinSigma`` +Tail fin emperical constants characterizing the decay of separation functions used in the unsteady aerodynamic model. The separation functions and their dependence on ``TFinSigma`` are described in :numref:`TF-aerotheory`. + +``TFinAStar`` +Tail fin characteristics angles for separation functions used in the unsteady aerodynamic model. The separation functions and their dependence on ``TFinAStar`` are described in :numref:`TF-aerotheory`. + + +``TFinKv`` +Vortex lift coefficient for unsteady aerodynamics. ``TFinKv`` is used to calculate the vortex flow contribution to the unsteady aerodynamic force on the tail fin. + +``TFinCDc`` +Tail fin drag coefficient used for unsteady aerodynamic model. The drag on the tail fin significantly contributes to the normal force at high yaw angles. diff --git a/docs/source/user/aerodyn/theory_tailfin.rst b/docs/source/user/aerodyn/theory_tailfin.rst index dd2c510eef..a8240250ab 100644 --- a/docs/source/user/aerodyn/theory_tailfin.rst +++ b/docs/source/user/aerodyn/theory_tailfin.rst @@ -158,7 +158,7 @@ The tabulated data are provided as part of the list of airfoils given with `AFNa The user only needs to indicate the index `TFinAFIndex` within the list `AFNames` to indicate which polar to use for the tail fin. -Unsteady model +Unsteady slender body model --------------------------- The unsteady aerodynamics of the tail fin is modeled based on Unsteady Slender Body Theory. @@ -168,13 +168,17 @@ The normal force on the tail fin can be described as .. math:: :label: TFUSBForce - N = \frac{\rho}{2} A_{tf} K_p x_1 V_x V_y + \frac{\rho}{2} A_{tf} \Big[x_2 K_v+(1- x_3)C_{Dc} \Big] V_y|V_y|. + N = \frac{\rho}{2} A_{tf} \bigg( K_p x_1 V_{\text{rel},x} V_{\text{rel},y} + \Big[x_2 K_v+(1- x_3)C_{Dc} \Big] V_{\text{rel},y}\big|V_{\text{rel},y}\big|\bigg) -And the moment on the tail fin about the apex can be described as: +where :math:`\rho` is the density of air, :math:`A_{tf}` is the tail fin area, :math:`K_p` is the potential lift coefficient and :math:`K_v` is the vortex lift coefficient, and :math:`C_{Dc}` is the drag coefficient. +:math:`x_i` are the separation functions calculated using a quasi-steady approximation as: -.. math:: :label: TFUSBMoment +.. math:: :label: TFUSBxiEquation - M_a = \frac{\rho}{2}A_{tf}x_{cp}x_1 K_p V_x V_y + \frac{\rho}{2}A_{tf}x_{cp}\Big[x_2K_v + (1-x_3)C_{Dc}\Big]V_y|V_y| + x_i = (1+exp{[\sigma_i (|\gamma_{tf}|-\alpha^*_i)]})^{-1} -where :math:`A_{tf}` is the tail fin area, :math:`K_p` is the potential flow constant and :math:`K_v` is the vortex flow cosntant, :math:`x_i` are the separation function, and :math:`C_{Dc}` is the drag coefficient. \ No newline at end of file + +where :math:`\sigma_i` are emperical constants characterizing the decay of separation functions, :math:`\gamma_{tf}` is the yaw angle of the tail fin with respect to the free-stream wind (:math:`V_{\text{wind}}`), :math:`\alpha^*_i` are the characteristics angles for separation functions. + +The normal force is assumed to act at the user defined reference point on the tail fin and the moment of the normal force is calculated accordingly. \ No newline at end of file diff --git a/modules/aerodyn/src/AeroDyn_Registry.txt b/modules/aerodyn/src/AeroDyn_Registry.txt index 046aef7bc0..b2690c4d1e 100644 --- a/modules/aerodyn/src/AeroDyn_Registry.txt +++ b/modules/aerodyn/src/AeroDyn_Registry.txt @@ -54,11 +54,11 @@ typedef ^ TFinParameterType ReKi TFinChord - - - "Tail fin chord [u typedef ^ TFinParameterType ReKi TFinArea - - - "Tail fin planform area [used only when TFinMod=1]" m^2 typedef ^ TFinParameterType IntKi TFinIndMod - - - "Model for induced velocity calculation {0=none, 1=rotor-average}" (switch) typedef ^ TFinParameterType IntKi TFinAFID - - - "Index of Tail fin airfoil number [1 to NumAFfiles]" - -typedef ^ TFinParameterType ReKi TFinKp - - - "Tail fin potential flow constant [used only when TFMod=2]" - -typedef ^ TFinParameterType ReKi TFinSigma 3 - - "Tail fin emperical constants for vortex separation functions [used only when TFMod=2]" - -typedef ^ TFinParameterType ReKi TFinAStar 3 - - "Tail fin initial angles for vortex separation functions [used only when TFMod=2]" deg -typedef ^ TFinParameterType ReKi TFinKv - - - "Tail fin vortex lift coefficient [used only when TFMod=2]" - -typedef ^ TFinParameterType ReKi TFinCDc - - - "Tail fin drag coefficient [used only when TFMod=2]" - +typedef ^ TFinParameterType ReKi TFinKp - - - "Tail fin potential lift coefficient for unsteady aerodynamics [used only when TFMod=2]" - +typedef ^ TFinParameterType ReKi TFinSigma 3 - - "Tail fin emperical constants characterizing the decay of separation functions [used only when TFMod=2]" - +typedef ^ TFinParameterType ReKi TFinAStar 3 - - "Tail fin characteristics angles for separation functions [used only when TFMod=2]" deg +typedef ^ TFinParameterType ReKi TFinKv - - - "Tail fin vortex lift coefficient for unsteady aerodynamics [used only when TFMod=2]" - +typedef ^ TFinParameterType ReKi TFinCDc - - - "Tail fin drag coefficient for unsteady aerodynamics [used only when TFMod=2]" - # Tail Fin input file typedef ^ TFinInputFileType IntKi TFinMod - - 0 "Tail fin aerodynamics model {0=none, 1=polar-based, 2=USB-based}" (switch) @@ -68,11 +68,11 @@ typedef ^ TFinInputFileType ReKi TFinRefP_n 3 - - "Undeflected posit typedef ^ TFinInputFileType ReKi TFinAngles 3 - - "Tail fin chordline skew, tilt, and bank angles about the reference point" (deg) typedef ^ TFinInputFileType IntKi TFinIndMod - - - "Model for induced velocity calculation {0=none, 1=rotor-average}" (switch) typedef ^ TFinInputFileType IntKi TFinAFID - - - "Index of Tail fin airfoil number [1 to NumAFfiles]" - -typedef ^ TFinInputFileType ReKi TFinKp - - - "Tail fin potential flow constant [used only when TFMod=2]" - -typedef ^ TFinInputFileType ReKi TFinSigma 3 - - "Tail fin emperical constants for vortex separation functions [used only when TFMod=2]" - -typedef ^ TFinInputFileType ReKi TFinAStar 3 - - "Tail fin initial angles for vortex separation functions [used only when TFMod=2]" deg -typedef ^ TFinInputFileType ReKi TFinKv - - - "Tail fin vortex lift coefficient [used only when TFMod=2]" - -typedef ^ TFinInputFileType ReKi TFinCDc - - - "Tail fin drag coefficient [used only when TFMod=2]" - +typedef ^ TFinInputFileType ReKi TFinKp - - - "Tail fin potential lift coefficient for unsteady aerodynamics [used only when TFMod=2]" - +typedef ^ TFinInputFileType ReKi TFinSigma 3 - - "Tail fin emperical constants characterizing the decay of separation functions [used only when TFMod=2]" - +typedef ^ TFinInputFileType ReKi TFinAStar 3 - - "Tail fin characteristics angles for separation functions [used only when TFMod=2]" deg +typedef ^ TFinInputFileType ReKi TFinKv - - - "Tail fin vortex lift coefficient for unsteady aerodynamics [used only when TFMod=2]" - +typedef ^ TFinInputFileType ReKi TFinCDc - - - "Tail fin drag coefficient for unsteady aerodynamics [used only when TFMod=2]" - From a261f56d9aaeec392aa2dddaee53449a3840c363 Mon Sep 17 00:00:00 2001 From: AbhineetGupta Date: Wed, 31 Jan 2024 17:31:35 -0700 Subject: [PATCH 5/8] Address comments on PR 1874 by Emmanuel Branlard --- docs/source/user/aerodyn/input.rst | 12 ++++++------ docs/source/user/aerodyn/theory_tailfin.rst | 7 ++++--- modules/aerodyn/src/AeroDyn.f90 | 4 ++-- modules/aerodyn/src/AeroDyn_Registry.txt | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/docs/source/user/aerodyn/input.rst b/docs/source/user/aerodyn/input.rst index eb6ea535ea..c5d45a51f6 100644 --- a/docs/source/user/aerodyn/input.rst +++ b/docs/source/user/aerodyn/input.rst @@ -884,11 +884,11 @@ An example of tail fin input file is given below: ====== Polar-based model ================================ [used only when TFinMod=1] 1 TFinAFID - Index of Tail fin airfoil number [1 to NumAFfiles] ====== Unsteady slender body model ===================== [used only when TFinMod=2] - 0.9 TFinKp - Tail fin moment of area about reference point [used only when TFMod=2] - 0.3,0.1,0.1 TFinSigma - Tail fin emperical constant for vortex separation functions [used only when TFMod=2] - 40,60,60 TFinAStar - Tail fin initial angles for vortex separation functions [used only when TFMod=2] (deg) - 3.1416 TFinKv - Tail fin vortex lift coefficient [used only when TFMod=2] - 1.3 TFinCDc - Tail fin drag coefficient [used only when TFMod=2] + 0.9 TFinKp - Tail fin moment of area about reference point + 0.3,0.1,0.1 TFinSigma - Tail fin empirical constant for vortex separation functions + 40,60,60 TFinAStar - Tail fin initial angles for vortex separation functions (deg) + 3.1416 TFinKv - Tail fin vortex lift coefficient + 1.3 TFinCDc - Tail fin drag coefficient General inputs ~~~~~~~~~~~~~~ @@ -955,7 +955,7 @@ Refer to :numref:`TF-aerotheory` and :cite:`ad-hammam_NREL:2023` for guidance on Potential lift coefficient for unsteady aerodynamics. ``TFinKp`` is used to calculate the potential flow contribution to the unsteady aerodynamic force on the tail fin. ``TFinSigma`` -Tail fin emperical constants characterizing the decay of separation functions used in the unsteady aerodynamic model. The separation functions and their dependence on ``TFinSigma`` are described in :numref:`TF-aerotheory`. +Tail fin empirical constants characterizing the decay of separation functions used in the unsteady aerodynamic model. The separation functions and their dependence on ``TFinSigma`` are described in :numref:`TF-aerotheory`. ``TFinAStar`` diff --git a/docs/source/user/aerodyn/theory_tailfin.rst b/docs/source/user/aerodyn/theory_tailfin.rst index a8240250ab..0d18740aca 100644 --- a/docs/source/user/aerodyn/theory_tailfin.rst +++ b/docs/source/user/aerodyn/theory_tailfin.rst @@ -164,7 +164,7 @@ Unsteady slender body model The unsteady aerodynamics of the tail fin is modeled based on Unsteady Slender Body Theory. The theory is extended to include the effect of high yaw angle :cite:`ad-hammam_NREL:2023`. -The normal force on the tail fin can be described as +The normal force on the tail fin can be described as the sum of three contributions (potential lift, vortex lift, and drag), weighted by separation functions :math:`x_i` as: .. math:: :label: TFUSBForce @@ -179,6 +179,7 @@ where :math:`\rho` is the density of air, :math:`A_{tf}` is the tail fin area, : x_i = (1+exp{[\sigma_i (|\gamma_{tf}|-\alpha^*_i)]})^{-1} -where :math:`\sigma_i` are emperical constants characterizing the decay of separation functions, :math:`\gamma_{tf}` is the yaw angle of the tail fin with respect to the free-stream wind (:math:`V_{\text{wind}}`), :math:`\alpha^*_i` are the characteristics angles for separation functions. +where :math:`\sigma_i` are empirical constants characterizing the decay of separation functions, :math:`\gamma_{tf}` is the yaw angle of the tail fin with respect to the free-stream wind (:math:`V_{\text{wind}}`), :math:`\alpha^*_i` are the characteristics angles for separation functions. +:math:`x_i` takes on a value between 0 and 1, and are used to activate or deactivate a the contribution of potential lift, vortex lift and draft to the normal force on the tail fin. -The normal force is assumed to act at the user defined reference point on the tail fin and the moment of the normal force is calculated accordingly. \ No newline at end of file +The normal force is assumed to act at the user defined reference point on the tail fin and the moment of the normal force is calculated accordingly. diff --git a/modules/aerodyn/src/AeroDyn.f90 b/modules/aerodyn/src/AeroDyn.f90 index 62d8636331..3d61463861 100644 --- a/modules/aerodyn/src/AeroDyn.f90 +++ b/modules/aerodyn/src/AeroDyn.f90 @@ -4389,7 +4389,7 @@ SUBROUTINE TFin_CalcOutput(p, p_AD, u, m, y, ErrStat, ErrMsg ) V_ind = 0.0_ReKi else - STOP ! Will never happen + setErrStat(ErrID_Fatal, 'TailFin model unsupported', ErrStat, ErrMsg, 'TFin_CalcOutput') endif @@ -4429,7 +4429,7 @@ SUBROUTINE TFin_CalcOutput(p, p_AD, u, m, y, ErrStat, ErrMsg ) x2 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(2)*((ABS(gamma_tf)*180.0_ReKi/pi)-p%TFin%TFinAStar(2)))) x3 = 1.0_Reki/(1.0_Reki+exp(p%TFin%TFinSigma(3)*((ABS(gamma_tf)*180.0_ReKi/pi)-p%TFin%TFinAStar(3)))) - ! Calculate unsteady force on tain fin + ! Calculate unsteady force on tail fin force_tf(2) = 0.5_ReKi * p%AirDens * p%TFin%TFinArea * & (p%TFin%TFinKp * x1 * V_rel_tf(1) * V_rel_tf(2) + & (x2 * p%TFin%TFinKv + (1-x3)*p%TFin%TFinCDc) * V_rel_tf(2) * ABS(V_rel_tf(2))) diff --git a/modules/aerodyn/src/AeroDyn_Registry.txt b/modules/aerodyn/src/AeroDyn_Registry.txt index b2690c4d1e..1b95884e31 100644 --- a/modules/aerodyn/src/AeroDyn_Registry.txt +++ b/modules/aerodyn/src/AeroDyn_Registry.txt @@ -55,7 +55,7 @@ typedef ^ TFinParameterType ReKi TFinArea - - - "Tail fin planform typedef ^ TFinParameterType IntKi TFinIndMod - - - "Model for induced velocity calculation {0=none, 1=rotor-average}" (switch) typedef ^ TFinParameterType IntKi TFinAFID - - - "Index of Tail fin airfoil number [1 to NumAFfiles]" - typedef ^ TFinParameterType ReKi TFinKp - - - "Tail fin potential lift coefficient for unsteady aerodynamics [used only when TFMod=2]" - -typedef ^ TFinParameterType ReKi TFinSigma 3 - - "Tail fin emperical constants characterizing the decay of separation functions [used only when TFMod=2]" - +typedef ^ TFinParameterType ReKi TFinSigma 3 - - "Tail fin empirical constants characterizing the decay of separation functions [used only when TFMod=2]" - typedef ^ TFinParameterType ReKi TFinAStar 3 - - "Tail fin characteristics angles for separation functions [used only when TFMod=2]" deg typedef ^ TFinParameterType ReKi TFinKv - - - "Tail fin vortex lift coefficient for unsteady aerodynamics [used only when TFMod=2]" - typedef ^ TFinParameterType ReKi TFinCDc - - - "Tail fin drag coefficient for unsteady aerodynamics [used only when TFMod=2]" - @@ -69,7 +69,7 @@ typedef ^ TFinInputFileType ReKi TFinAngles 3 - - "Tail fin chordlin typedef ^ TFinInputFileType IntKi TFinIndMod - - - "Model for induced velocity calculation {0=none, 1=rotor-average}" (switch) typedef ^ TFinInputFileType IntKi TFinAFID - - - "Index of Tail fin airfoil number [1 to NumAFfiles]" - typedef ^ TFinInputFileType ReKi TFinKp - - - "Tail fin potential lift coefficient for unsteady aerodynamics [used only when TFMod=2]" - -typedef ^ TFinInputFileType ReKi TFinSigma 3 - - "Tail fin emperical constants characterizing the decay of separation functions [used only when TFMod=2]" - +typedef ^ TFinInputFileType ReKi TFinSigma 3 - - "Tail fin empirical constants characterizing the decay of separation functions [used only when TFMod=2]" - typedef ^ TFinInputFileType ReKi TFinAStar 3 - - "Tail fin characteristics angles for separation functions [used only when TFMod=2]" deg typedef ^ TFinInputFileType ReKi TFinKv - - - "Tail fin vortex lift coefficient for unsteady aerodynamics [used only when TFMod=2]" - typedef ^ TFinInputFileType ReKi TFinCDc - - - "Tail fin drag coefficient for unsteady aerodynamics [used only when TFMod=2]" - From 6e5f71b34219cf22c6b5b7563cc971a53fffa8f7 Mon Sep 17 00:00:00 2001 From: AbhineetGupta Date: Thu, 15 Feb 2024 14:35:35 -0700 Subject: [PATCH 6/8] TailFinUnsteadyAero: Add regression tests and fix a small bug in AeroDyn.f90 --- modules/aerodyn/src/AeroDyn.f90 | 2 +- modules/aerodyn/src/AeroDyn_Types.f90 | 20 ++++++++++---------- reg_tests/CTestList.cmake | 1 + reg_tests/r-test | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/aerodyn/src/AeroDyn.f90 b/modules/aerodyn/src/AeroDyn.f90 index 3d61463861..12ccaa0acc 100644 --- a/modules/aerodyn/src/AeroDyn.f90 +++ b/modules/aerodyn/src/AeroDyn.f90 @@ -4389,7 +4389,7 @@ SUBROUTINE TFin_CalcOutput(p, p_AD, u, m, y, ErrStat, ErrMsg ) V_ind = 0.0_ReKi else - setErrStat(ErrID_Fatal, 'TailFin model unsupported', ErrStat, ErrMsg, 'TFin_CalcOutput') + call setErrStat(ErrID_Fatal, 'TailFin model unsupported', ErrStat, ErrMsg, 'TFin_CalcOutput') endif diff --git a/modules/aerodyn/src/AeroDyn_Types.f90 b/modules/aerodyn/src/AeroDyn_Types.f90 index a05e7b746f..f08904e2fe 100644 --- a/modules/aerodyn/src/AeroDyn_Types.f90 +++ b/modules/aerodyn/src/AeroDyn_Types.f90 @@ -66,11 +66,11 @@ MODULE AeroDyn_Types REAL(ReKi) :: TFinArea !< Tail fin planform area [used only when TFinMod=1] [m^2] INTEGER(IntKi) :: TFinIndMod !< Model for induced velocity calculation {0=none, 1=rotor-average} [(switch)] INTEGER(IntKi) :: TFinAFID !< Index of Tail fin airfoil number [1 to NumAFfiles] [-] - REAL(ReKi) :: TFinKp !< Tail fin potential flow constant [used only when TFMod=2] [-] - REAL(ReKi) , DIMENSION(1:3) :: TFinSigma !< Tail fin emperical constants for vortex separation functions [used only when TFMod=2] [-] - REAL(ReKi) , DIMENSION(1:3) :: TFinAStar !< Tail fin initial angles for vortex separation functions [used only when TFMod=2] [deg] - REAL(ReKi) :: TFinKv !< Tail fin vortex lift coefficient [used only when TFMod=2] [-] - REAL(ReKi) :: TFinCDc !< Tail fin drag coefficient [used only when TFMod=2] [-] + REAL(ReKi) :: TFinKp !< Tail fin potential lift coefficient for unsteady aerodynamics [used only when TFMod=2] [-] + REAL(ReKi) , DIMENSION(1:3) :: TFinSigma !< Tail fin empirical constants characterizing the decay of separation functions [used only when TFMod=2] [-] + REAL(ReKi) , DIMENSION(1:3) :: TFinAStar !< Tail fin characteristics angles for separation functions [used only when TFMod=2] [deg] + REAL(ReKi) :: TFinKv !< Tail fin vortex lift coefficient for unsteady aerodynamics [used only when TFMod=2] [-] + REAL(ReKi) :: TFinCDc !< Tail fin drag coefficient for unsteady aerodynamics [used only when TFMod=2] [-] END TYPE TFinParameterType ! ======================= ! ========= TFinInputFileType ======= @@ -82,11 +82,11 @@ MODULE AeroDyn_Types REAL(ReKi) , DIMENSION(1:3) :: TFinAngles !< Tail fin chordline skew, tilt, and bank angles about the reference point [(deg)] INTEGER(IntKi) :: TFinIndMod !< Model for induced velocity calculation {0=none, 1=rotor-average} [(switch)] INTEGER(IntKi) :: TFinAFID !< Index of Tail fin airfoil number [1 to NumAFfiles] [-] - REAL(ReKi) :: TFinKp !< Tail fin potential flow constant [used only when TFMod=2] [-] - REAL(ReKi) , DIMENSION(1:3) :: TFinSigma !< Tail fin emperical constants for vortex separation functions [used only when TFMod=2] [-] - REAL(ReKi) , DIMENSION(1:3) :: TFinAStar !< Tail fin initial angles for vortex separation functions [used only when TFMod=2] [deg] - REAL(ReKi) :: TFinKv !< Tail fin vortex lift coefficient [used only when TFMod=2] [-] - REAL(ReKi) :: TFinCDc !< Tail fin drag coefficient [used only when TFMod=2] [-] + REAL(ReKi) :: TFinKp !< Tail fin potential lift coefficient for unsteady aerodynamics [used only when TFMod=2] [-] + REAL(ReKi) , DIMENSION(1:3) :: TFinSigma !< Tail fin empirical constants characterizing the decay of separation functions [used only when TFMod=2] [-] + REAL(ReKi) , DIMENSION(1:3) :: TFinAStar !< Tail fin characteristics angles for separation functions [used only when TFMod=2] [deg] + REAL(ReKi) :: TFinKv !< Tail fin vortex lift coefficient for unsteady aerodynamics [used only when TFMod=2] [-] + REAL(ReKi) :: TFinCDc !< Tail fin drag coefficient for unsteady aerodynamics [used only when TFMod=2] [-] END TYPE TFinInputFileType ! ======================= ! ========= AD_VTK_BLSurfaceType ======= diff --git a/reg_tests/CTestList.cmake b/reg_tests/CTestList.cmake index 9d9006ebbe..6b27d9c2d9 100644 --- a/reg_tests/CTestList.cmake +++ b/reg_tests/CTestList.cmake @@ -307,6 +307,7 @@ of_regression("StC_test_OC4Semi" "openfast;servodyn;hydrod of_regression("MHK_RM1_Fixed" "openfast;elastodyn;aerodyn15;mhk") of_regression("MHK_RM1_Floating" "openfast;elastodyn;aerodyn15;hydrodyn;moordyn;mhk") of_regression("Tailfin_FreeYaw1DOF_PolarBased" "openfast;elastodyn;aerodyn15") +of_regression("Tailfin_FreeYaw1DOF_Unsteady" "openfast;elastodyn;aerodyn15") of_aeromap_regression("5MW_Land_AeroMap" "aeromap;elastodyn;aerodyn15") diff --git a/reg_tests/r-test b/reg_tests/r-test index 9a42b24203..426a976b30 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit 9a42b2420312ab5dfd49065e7ddab6fb69dc7d3f +Subproject commit 426a976b30c437e50e353beeddbfbedc73d4dbad From 1b3f797852a642cb24914498b8c65c41e52981e0 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Fri, 8 Mar 2024 12:20:18 -0700 Subject: [PATCH 7/8] AD: code alignment (noted in PR) --- modules/aerodyn/src/AeroDyn.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/aerodyn/src/AeroDyn.f90 b/modules/aerodyn/src/AeroDyn.f90 index 12ccaa0acc..e31fcc7c07 100644 --- a/modules/aerodyn/src/AeroDyn.f90 +++ b/modules/aerodyn/src/AeroDyn.f90 @@ -393,8 +393,8 @@ subroutine AD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut p%rotors(iR)%TFin%TFinIndMod = InputFileData%rotors(iR)%TFin%TFinIndMod p%rotors(iR)%TFin%TFinAFID = InputFileData%rotors(iR)%TFin%TFinAFID p%rotors(iR)%TFin%TFinKp = InputFileData%rotors(iR)%TFin%TFinKp - p%rotors(iR)%TFin%TFinSigma = InputFileData%rotors(iR)%TFin%TFinSigma - p%rotors(iR)%TFin%TFinAStar = InputFileData%rotors(iR)%TFin%TFinAStar + p%rotors(iR)%TFin%TFinSigma = InputFileData%rotors(iR)%TFin%TFinSigma + p%rotors(iR)%TFin%TFinAStar = InputFileData%rotors(iR)%TFin%TFinAStar p%rotors(iR)%TFin%TFinKv = InputFileData%rotors(iR)%TFin%TFinKv p%rotors(iR)%TFin%TFinCDc = InputFileData%rotors(iR)%TFin%TFinCDc enddo From 97256476a166181af5fcf62886e4c354019ef730 Mon Sep 17 00:00:00 2001 From: AbhineetGupta Date: Fri, 8 Mar 2024 14:46:28 -0700 Subject: [PATCH 8/8] Update input file for Tailfin_FreeYaw1DOF_Unsteady --- reg_tests/r-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/r-test b/reg_tests/r-test index 00583871db..bcfbf14e98 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit 00583871db0df2628a64ba44fe20477130378b56 +Subproject commit bcfbf14e98262e27724d17f929b8e152d7f13599