diff --git a/modules/aerodyn/src/BEMT.f90 b/modules/aerodyn/src/BEMT.f90 index 9c50d3fcdc..b99c3a6658 100644 --- a/modules/aerodyn/src/BEMT.f90 +++ b/modules/aerodyn/src/BEMT.f90 @@ -126,7 +126,7 @@ subroutine BEMT_Set_UA_InitData( InitInp, interval, Init_UA_Data, errStat, errMs call move_alloc(InitInp%UAOff_outerNode, Init_UA_Data%UAOff_outerNode) Init_UA_Data%dt = interval - Init_UA_Data%OutRootName = InitInp%RootName ! was 'Debug.UA' + Init_UA_Data%OutRootName = trim(InitInp%RootName)//'.UA' Init_UA_Data%numBlades = InitInp%numBlades Init_UA_Data%nNodesPerBlade = InitInp%numBladeNodes @@ -137,6 +137,9 @@ subroutine BEMT_Set_UA_InitData( InitInp, interval, Init_UA_Data, errStat, errMs Init_UA_Data%ShedEffect = .true. ! This should be true when coupled to BEM Init_UA_Data%WrSum = InitInp%SumPrint + Init_UA_Data%UA_OUTS = 0 + Init_UA_Data%d_34_to_ac = 0.5_ReKi + end subroutine BEMT_Set_UA_InitData diff --git a/modules/aerodyn/src/FVW.f90 b/modules/aerodyn/src/FVW.f90 index 616d96ffc7..9c454c0388 100644 --- a/modules/aerodyn/src/FVW.f90 +++ b/modules/aerodyn/src/FVW.f90 @@ -1591,7 +1591,7 @@ subroutine UA_Init_Wrapper(AFInfo, InitInp, interval, p, x, xd, OtherState, m, E Init_UA_Data%c(i,1) = p%W(iW)%chord_LL(i) ! NOTE: InitInp chord move-allocd to p end do Init_UA_Data%dt = interval - Init_UA_Data%OutRootName = trim(InitInp%RootName)//'W'//num2lstr(iW) + Init_UA_Data%OutRootName = trim(InitInp%RootName)//'W'//num2lstr(iW)//'.UA' Init_UA_Data%numBlades = 1 Init_UA_Data%nNodesPerBlade = InitInp%numBladeNodes ! At AeroDyn ndoes, not CP @@ -1600,6 +1600,9 @@ subroutine UA_Init_Wrapper(AFInfo, InitInp, interval, p, x, xd, OtherState, m, E Init_UA_Data%a_s = InitInp%a_s ! Speed of sound, m/s Init_UA_Data%ShedEffect = .False. ! Important, when coupling UA wih vortex code, shed vorticity is inherently accounted for Init_UA_Data%WrSum = InitInp%SumPrint + Init_UA_Data%UA_OUTS = 0 + Init_UA_Data%d_34_to_ac = 0.5_ReKi + allocate(Init_UA_Data%UAOff_innerNode(1), stat=errStat2) allocate(Init_UA_Data%UAOff_outerNode(1), stat=errStat2) Init_UA_Data%UAOff_innerNode(1) = InitInp%W(iW)%UAOff_innerNode diff --git a/modules/aerodyn/src/UA_Dvr_Subs.f90 b/modules/aerodyn/src/UA_Dvr_Subs.f90 index 323f62c52b..1d7e12f955 100644 --- a/modules/aerodyn/src/UA_Dvr_Subs.f90 +++ b/modules/aerodyn/src/UA_Dvr_Subs.f90 @@ -193,7 +193,7 @@ subroutine ReadDriverInputFile( FileName, InitInp, ErrStat, ErrMsg ) type(FileInfoType) :: FI !< The derived type for holding the file information. integer(IntKi) :: errStat2 ! Status of error message character(1024) :: errMsg2 ! Error message if ErrStat /= ErrID_None - character(*), parameter :: RoutineName = 'ReadDriverfilename' + character(*), parameter :: RoutineName = 'ReadDriverInputFile' ! Initialize the echo file unit to -1 which is the default to prevent echoing, we will alter this based on user input UnEcho = -1 ErrStat = ErrID_None @@ -401,6 +401,10 @@ subroutine driverInputsToUAInitData(p, InitInData, AFI_Params, AFIndx, errStat, errStat = ErrID_None errMsg = '' InitInData%UA_OUTS = 1 ! 0=None, 1=Write Outputs, 2=Separate File +#ifdef ADD_UA_OUTS + InitInData%UA_OUTS = 2 ! Compiler Flag Override, 2=Write a separate file +#endif + ! -- UA Init Input Data InitInData%nNodesPerBlade = 1 @@ -416,7 +420,7 @@ subroutine driverInputsToUAInitData(p, InitInData, AFI_Params, AFIndx, errStat, InitInData%c(1,1) = p%Chord InitInData%UAMod = p%UAMod InitInData%Flookup = p%Flookup - InitInData%OutRootName = p%OutRootName + InitInData%OutRootName = trim(p%OutRootName)//'.UA' InitInData%WrSum = p%SumPrint InitInData%d_34_to_ac = p%d_34_to_ac ! d_34_to_ac = d_QT ~0.5 [-], Approximated using y coordinate @@ -959,36 +963,36 @@ subroutine Dvr_WriteOutputs(nt, t, dvr, out, errStat, errMsg) ! Driver outputs j = 1 if (dvr%p%SimMod==3) then - ! TODO harmonization - out%outLine(j) = dvr%U0(1, 1) ; j=j+1 ! Ux - out%outLine(j) = dvr%U0(1, 2) ; j=j+1 ! Uy - out%outLine(j) = dvr%m%Vst_Q(1) ; j=j+1 ! VSTx_Q - out%outLine(j) = dvr%m%Vst_Q(2) ; j=j+1 ! VSTy_Q - out%outLine(j) = dvr%m%Vst_T(1) ; j=j+1 ! VSTx_T - out%outLine(j) = dvr%m%Vst_T(2) ; j=j+1 ! VSTy_T - out%outLine(j) = dvr%m%Vrel_Q(1) ; j=j+1 ! Vrelx_Q - out%outLine(j) = dvr%m%Vrel_Q(2) ; j=j+1 ! Vrely_Q - out%outLine(j) = dvr%m%Vrel_T(1) ; j=j+1 ! Vrelx_T - out%outLine(j) = dvr%m%Vrel_T(2) ; j=j+1 ! Vrely_T - out%outLine(j) = sqrt(dvr%m%Vrel_norm2_Q) ; j=j+1 ! Vrel_Q - out%outLine(j) = sqrt(dvr%m%Vrel_norm2_T) ; j=j+1 ! Vrel_T - out%outLine(j) = dvr%m%alpha_Q*R2D ; j=j+1 ! alpha_Q - out%outLine(j) = dvr%m%alpha_T*R2D ; j=j+1 ! alpha_T - out%outLine(j) = dvr%m%phi_Q *R2D ; j=j+1 ! phi_Q - out%outLine(j) = dvr%m%phi_T *R2D ; j=j+1 ! phi_T - out%outLine(j) = dvr%m%twist_full*R2D ; j=j+1 ! twist_full - out%outLine(j) = dvr%m%Re ; j=j+1 ! Re_T - out%outLine(j) = dvr%m%L ; j=j+1 ! L - out%outLine(j) = dvr%m%D ; j=j+1 ! D - out%outLine(j) = dvr%m%tau_Q ; j=j+1 ! M - out%outLine(j) = dvr%m%FxA ; j=j+1 ! Fx_A - out%outLine(j) = dvr%m%FyA ; j=j+1 ! Fy_A - out%outLine(j) = dvr%m%tau_A ; j=j+1 ! M_A - out%outLine(j) = dvr%m%GF(1) ; j=j+1 ! GFx - out%outLine(j) = dvr%m%GF(2) ; j=j+1 ! GFy - out%outLine(j) = dvr%m%GF(3) ; j=j+1 ! GFM - ! LD Outputs - out%outLine(nDV+1:nDV+nLD) = dvr%LD_y%WriteOutput(1:nLD) + ! TODO harmonization + out%outLine(j) = dvr%U0(1, 1) ; j=j+1 ! Ux + out%outLine(j) = dvr%U0(1, 2) ; j=j+1 ! Uy + out%outLine(j) = dvr%m%Vst_Q(1) ; j=j+1 ! VSTx_Q + out%outLine(j) = dvr%m%Vst_Q(2) ; j=j+1 ! VSTy_Q + out%outLine(j) = dvr%m%Vst_T(1) ; j=j+1 ! VSTx_T + out%outLine(j) = dvr%m%Vst_T(2) ; j=j+1 ! VSTy_T + out%outLine(j) = dvr%m%Vrel_Q(1) ; j=j+1 ! Vrelx_Q + out%outLine(j) = dvr%m%Vrel_Q(2) ; j=j+1 ! Vrely_Q + out%outLine(j) = dvr%m%Vrel_T(1) ; j=j+1 ! Vrelx_T + out%outLine(j) = dvr%m%Vrel_T(2) ; j=j+1 ! Vrely_T + out%outLine(j) = sqrt(dvr%m%Vrel_norm2_Q) ; j=j+1 ! Vrel_Q + out%outLine(j) = sqrt(dvr%m%Vrel_norm2_T) ; j=j+1 ! Vrel_T + out%outLine(j) = dvr%m%alpha_Q*R2D ; j=j+1 ! alpha_Q + out%outLine(j) = dvr%m%alpha_T*R2D ; j=j+1 ! alpha_T + out%outLine(j) = dvr%m%phi_Q *R2D ; j=j+1 ! phi_Q + out%outLine(j) = dvr%m%phi_T *R2D ; j=j+1 ! phi_T + out%outLine(j) = dvr%m%twist_full*R2D ; j=j+1 ! twist_full + out%outLine(j) = dvr%m%Re ; j=j+1 ! Re_T + out%outLine(j) = dvr%m%L ; j=j+1 ! L + out%outLine(j) = dvr%m%D ; j=j+1 ! D + out%outLine(j) = dvr%m%tau_Q ; j=j+1 ! M + out%outLine(j) = dvr%m%FxA ; j=j+1 ! Fx_A + out%outLine(j) = dvr%m%FyA ; j=j+1 ! Fy_A + out%outLine(j) = dvr%m%tau_A ; j=j+1 ! M_A + out%outLine(j) = dvr%m%GF(1) ; j=j+1 ! GFx + out%outLine(j) = dvr%m%GF(2) ; j=j+1 ! GFy + out%outLine(j) = dvr%m%GF(3) ; j=j+1 ! GFM + ! LD Outputs + out%outLine(nDV+1:nDV+nLD) = dvr%LD_y%WriteOutput(1:nLD) endif ! UA Outputs out%outLine(nDV+nLD+1:nDV+nLD+nUA) = dvr%UA_y%WriteOutput(1:nUA) diff --git a/modules/aerodyn/src/UnsteadyAero.f90 b/modules/aerodyn/src/UnsteadyAero.f90 index 63118ccab8..8cebfedb42 100644 --- a/modules/aerodyn/src/UnsteadyAero.f90 +++ b/modules/aerodyn/src/UnsteadyAero.f90 @@ -522,7 +522,7 @@ subroutine ComputeKelvinChain( i, j, u, p, xd, OtherState, misc, AFInfo, KC, BL_ KC%Cn_q_circ = KC%C_nalpha_circ*KC%q_f_cur/2.0 - KC%X3 - KC%X4 ! Eqn 1.16 - else ! these aren't used (they are possibly output to UA output file (when UA_OUTS defined) file, though) + else ! these aren't used (they are possibly output to UA output file when UA_OUTS is > 0 file, though) KC%X3 = 0.0_ReKi KC%X4 = 0.0_ReKi KC%Cn_q_circ = 0.0_ReKi @@ -748,9 +748,6 @@ subroutine UA_SetParameters( dt, InitInp, p, AFInfo, AFIndx, ErrStat, ErrMsg ) p%Flookup = InitInp%Flookup p%ShedEffect = InitInp%ShedEffect p%UA_OUTS = InitInp%UA_OUTS -#ifdef UA_OUTS - p%UA_OUTS = 2 ! Compiler Flag Override, 2=Write a separate file -#endif if (p%UAMod==UA_HGM .or. p%UAMod==UA_HGMV) then UA_NumLinStates = 4 @@ -1419,11 +1416,11 @@ subroutine UA_Init_Outputs(InitInp, p, y, InitOut, errStat, errMsg) ! --- Write to File if ((p%NumOuts > 0) .and. p%UA_OUTS==2) then - call WrScr(' UA: Writing separate output file: '//trim((InitInp%OutRootName)//'.UA.out')) + call WrScr(' UA: Writing separate output file: '//trim((InitInp%OutRootName)//'.out')) CALL GetNewUnit( p%unOutFile, ErrStat2, ErrMsg2 ) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) if (ErrStat >= AbortErrLev) return - CALL OpenFOutFile ( p%unOutFile, trim(InitInp%OutRootName)//'.UA.out', ErrStat2, ErrMsg2 ) + CALL OpenFOutFile ( p%unOutFile, trim(InitInp%OutRootName)//'.out', ErrStat2, ErrMsg2 ) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) if (ErrStat >= AbortErrLev) return @@ -1443,7 +1440,7 @@ subroutine UA_Init_Outputs(InitInp, p, y, InitOut, errStat, errMsg) WRITE (p%unOutFile,'(:,A,'//trim( p%OutSFmt )//')', ADVANCE='no' ) p%Delim, trim(InitOut%WriteOutputUnt(i)) end do WRITE (p%unOutFile,'()', IOSTAT=ErrStat2) ! write the line return - elseif ((p%NumOuts > 0) .and. p%UA_OUTS==2) then + else call WrScr(' UA: saving write outputs') @@ -3844,9 +3841,9 @@ subroutine BV_CalcOutput() ! --- Recompute variables, for temporary output to file only ! Calculate deltas to negative and positive stall angle (delN, and delP) if (p%UA_OUTS>0) then - call BV_delNP(adotnorm, alpha_34, alphaLag_D, BL_p, OtherState%activeD(i,j), delN, delP) - call BV_getGammas(tc=AFInfo%RelThickness, umach=0.0_ReKi, gammaL=gammaL, gammaD=gammaD) - TransA = BV_TransA(BL_p) + call BV_delNP(adotnorm, alpha_34, alphaLag_D, BL_p, OtherState%activeD(i,j), delN, delP) + call BV_getGammas(tc=AFInfo%RelThickness, umach=0.0_ReKi, gammaL=gammaL, gammaD=gammaD) + TransA = BV_TransA(BL_p) endif ! --- Cl, _, at effective angle of attack alphaE diff --git a/modules/lindyn/src/LinDyn_Registry.txt b/modules/lindyn/src/LinDyn_Registry.txt index a5dd46dee8..6140a54fab 100644 --- a/modules/lindyn/src/LinDyn_Registry.txt +++ b/modules/lindyn/src/LinDyn_Registry.txt @@ -39,10 +39,10 @@ typedef ^ ^ IntKi typedef ^ ContinuousStateType ReKi q {:} - - "Continuous states q =(x,xdot)" "-" # Discrete (non-differentiable) states: -typedef ^ DiscreteStateType Logical Dummy - - - "" - +typedef ^ DiscreteStateType SiKi Dummy - - - "" - # Constraint states: -typedef ^ ConstraintStateType Logical Dummy - - - "" - +typedef ^ ConstraintStateType SiKi Dummy - - - "" - # Other states: typedef ^ OtherStateType LD_ContinuousStateType xdot {:} - - "Previous state derivs for m-step time integrator" diff --git a/modules/lindyn/src/LinDyn_Types.f90 b/modules/lindyn/src/LinDyn_Types.f90 index ef28a6f104..778bb39cee 100644 --- a/modules/lindyn/src/LinDyn_Types.f90 +++ b/modules/lindyn/src/LinDyn_Types.f90 @@ -72,12 +72,12 @@ MODULE LinDyn_Types ! ======================= ! ========= LD_DiscreteStateType ======= TYPE, PUBLIC :: LD_DiscreteStateType - LOGICAL :: Dummy !< [-] + REAL(SiKi) :: Dummy !< [-] END TYPE LD_DiscreteStateType ! ======================= ! ========= LD_ConstraintStateType ======= TYPE, PUBLIC :: LD_ConstraintStateType - LOGICAL :: Dummy !< [-] + REAL(SiKi) :: Dummy !< [-] END TYPE LD_ConstraintStateType ! ======================= ! ========= LD_OtherStateType ======= @@ -1800,7 +1800,7 @@ SUBROUTINE LD_PackDiscState( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg Re_BufSz = 0 Db_BufSz = 0 Int_BufSz = 0 - Int_BufSz = Int_BufSz + 1 ! Dummy + Re_BufSz = Re_BufSz + 1 ! Dummy IF ( Re_BufSz .GT. 0 ) THEN ALLOCATE( ReKiBuf( Re_BufSz ), STAT=ErrStat2 ) IF (ErrStat2 /= 0) THEN @@ -1828,8 +1828,8 @@ SUBROUTINE LD_PackDiscState( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg Db_Xferred = 1 Int_Xferred = 1 - IntKiBuf(Int_Xferred) = TRANSFER(InData%Dummy, IntKiBuf(1)) - Int_Xferred = Int_Xferred + 1 + ReKiBuf(Re_Xferred) = InData%Dummy + Re_Xferred = Re_Xferred + 1 END SUBROUTINE LD_PackDiscState SUBROUTINE LD_UnPackDiscState( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) @@ -1858,8 +1858,8 @@ SUBROUTINE LD_UnPackDiscState( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, Err Re_Xferred = 1 Db_Xferred = 1 Int_Xferred = 1 - OutData%Dummy = TRANSFER(IntKiBuf(Int_Xferred), OutData%Dummy) - Int_Xferred = Int_Xferred + 1 + OutData%Dummy = REAL(ReKiBuf(Re_Xferred), SiKi) + Re_Xferred = Re_Xferred + 1 END SUBROUTINE LD_UnPackDiscState SUBROUTINE LD_CopyConstrState( SrcConstrStateData, DstConstrStateData, CtrlCode, ErrStat, ErrMsg ) @@ -1937,7 +1937,7 @@ SUBROUTINE LD_PackConstrState( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrM Re_BufSz = 0 Db_BufSz = 0 Int_BufSz = 0 - Int_BufSz = Int_BufSz + 1 ! Dummy + Re_BufSz = Re_BufSz + 1 ! Dummy IF ( Re_BufSz .GT. 0 ) THEN ALLOCATE( ReKiBuf( Re_BufSz ), STAT=ErrStat2 ) IF (ErrStat2 /= 0) THEN @@ -1965,8 +1965,8 @@ SUBROUTINE LD_PackConstrState( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrM Db_Xferred = 1 Int_Xferred = 1 - IntKiBuf(Int_Xferred) = TRANSFER(InData%Dummy, IntKiBuf(1)) - Int_Xferred = Int_Xferred + 1 + ReKiBuf(Re_Xferred) = InData%Dummy + Re_Xferred = Re_Xferred + 1 END SUBROUTINE LD_PackConstrState SUBROUTINE LD_UnPackConstrState( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) @@ -1995,8 +1995,8 @@ SUBROUTINE LD_UnPackConstrState( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, E Re_Xferred = 1 Db_Xferred = 1 Int_Xferred = 1 - OutData%Dummy = TRANSFER(IntKiBuf(Int_Xferred), OutData%Dummy) - Int_Xferred = Int_Xferred + 1 + OutData%Dummy = REAL(ReKiBuf(Re_Xferred), SiKi) + Re_Xferred = Re_Xferred + 1 END SUBROUTINE LD_UnPackConstrState SUBROUTINE LD_CopyOtherState( SrcOtherStateData, DstOtherStateData, CtrlCode, ErrStat, ErrMsg ) diff --git a/modules/nwtc-library/src/NWTC_Num.f90 b/modules/nwtc-library/src/NWTC_Num.f90 index 3c2be77d25..66148d1e3d 100644 --- a/modules/nwtc-library/src/NWTC_Num.f90 +++ b/modules/nwtc-library/src/NWTC_Num.f90 @@ -4984,7 +4984,7 @@ FUNCTION RegCubicSplineInterpM ( X, XAry, YAry, DelX, Coef, ErrStat, ErrMsg ) RE RETURN END FUNCTION RegCubicSplineInterpM ! ( X, XAry, YAry, DelX, Coef, ErrStat, ErrMsg ) !======================================================================= -!> This routine is used to integrate funciton f over the interval [a, b]. This routine +!> This routine is used to integrate function f over the interval [a, b]. This routine !! is useful for sufficiently smooth (e.g., analytic) integrands, integrated over !! intervals which contain no singularities, and where the endpoints are also nonsingular. !! diff --git a/vs-build/RunRegistry.bat b/vs-build/RunRegistry.bat index 2649627f6b..af15365556 100644 --- a/vs-build/RunRegistry.bat +++ b/vs-build/RunRegistry.bat @@ -44,6 +44,8 @@ SET SrvD_Loc=%Modules_Loc%\servodyn\src SET BD_Loc=%Modules_Loc%\beamdyn\src SET SC_Loc=%Modules_Loc%\supercontroller\src +SET LD_Loc=%Modules_Loc%\lindyn\src + SET AWAE_Loc=%Modules_Loc%\awae\src SET WD_Loc=%Modules_Loc%\wakedynamics\src SET Farm_Loc=%Root_Loc%\glue-codes\fast-farm\src @@ -165,6 +167,12 @@ SET Output_Loc=%CURR_LOC% %REGISTRY% "%CURR_LOC%\UnsteadyAero_Registry.txt" -I "%NWTC_Lib_Loc%" -I "%CURR_LOC%" -O "%Output_Loc%" GOTO checkError +:LD +SET CURR_LOC=%LD_Loc% +SET Output_Loc=%CURR_LOC% +%REGISTRY% "%CURR_LOC%\LinDyn_Registry.txt" -I "%NWTC_Lib_Loc%" -I "%CURR_LOC%" -O "%Output_Loc%" +GOTO checkError + :FVW SET CURR_LOC=%AD_Loc% SET Output_Loc=%CURR_LOC% diff --git a/vs-build/UnsteadyAero/UnsteadyAero.vfproj b/vs-build/UnsteadyAero/UnsteadyAero.vfproj index 321fd8c587..066fc3feb7 100644 --- a/vs-build/UnsteadyAero/UnsteadyAero.vfproj +++ b/vs-build/UnsteadyAero/UnsteadyAero.vfproj @@ -5,7 +5,7 @@ - + @@ -15,7 +15,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -120,6 +120,27 @@ + + + + + + + + + + + + + + + + + + + + +