Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Bug Fix: AeroDyn driver output files contained wrong channel names #2287

Merged
merged 3 commits into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/aerodyn/src/AeroDyn_Driver_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ usefrom AeroDyn_Registry.txt
usefrom AeroDyn_Inflow_Registry.txt
#
# ..... Table of combined cases to run .......................................................................................................
typedef AeroDyn_Driver/AD_Dvr Dvr_Case ReKi HWindSpeed - - - "Hub wind speed" "m/s"
typedef AeroDyn_Driver/AD_Dvr Dvr_Case ReKi HWindSpeed - - - "Hub wind speed" "m/s"
typedef ^ ^ ReKi PLExp - - - "Power law wind-shear exponent" "-"
typedef ^ ^ ReKi rotSpeed - - - "Rotor speed" "rad/s"
typedef ^ ^ ReKi bldPitch - - - "Pitch angle" "rad"
Expand All @@ -36,7 +36,7 @@ typedef ^ DvrVTK_SurfaceType SiKi BaseBox {3}{8} - -
# typedef ^ DvrVTK_SurfaceType DvrVTK_BLSurfaceType BladeShape {:} - - "AirfoilCoords for each blade" m

# ..... Data for driver output file .......................................................................................................
typedef AeroDyn_Driver/AD_Dvr Dvr_Outputs ProgDesc AD_ver - - - "AeroDyn version information" -
typedef AeroDyn_Driver/AD_Dvr Dvr_Outputs ProgDesc AD_ver - - - "AeroDyn version information" -
typedef ^ ^ IntKi unOutFile : - - "unit number for writing output file for each rotor" "-"
typedef ^ ^ IntKi ActualChanLen - - - "Actual length of channels written to text file (less than or equal to ChanLen)" "-"
typedef ^ ^ IntKi nDvrOutputs - - - "Number of outputs for the driver (without AD and IW)" "-"
Expand Down
15 changes: 8 additions & 7 deletions modules/aerodyn/src/AeroDyn_Driver_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ subroutine Dvr_EndCase(dvr, ADI, initialized, errStat, errMsg)
else
sWT = ''
endif
call WrBinFAST(trim(dvr%out%Root)//trim(sWT)//'.outb', FileFmtID_ChanLen_In, 'AeroDynDriver', dvr%out%WriteOutputHdr, dvr%out%WriteOutputUnt, (/0.0_DbKi, dvr%dt/), dvr%out%storage(:,:,iWT), errStat2, errMsg2)
call WrBinFAST(trim(dvr%out%Root)//trim(sWT)//'.outb', FileFmtID_ChanLen_In, GetVersion(version), dvr%out%WriteOutputHdr, dvr%out%WriteOutputUnt, (/0.0_DbKi, dvr%dt/), dvr%out%storage(:,:,iWT), errStat2, errMsg2)
call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName)
enddo
endif
Expand Down Expand Up @@ -516,7 +516,8 @@ subroutine Init_ADI_ForDriver(iCase, ADI, dvr, FED, dt, errStat, errMsg)
enddo

call ADI_Init(InitInp, ADI%u(1), ADI%p, ADI%x(1), ADI%xd(1), ADI%z(1), ADI%OtherState(1), ADI%y, ADI%m, dt, InitOut, errStat, errMsg)

dvr%out%AD_ver = InitOut%Ver

! Set output headers
if (iCase==1) then
call concatOutputHeaders(dvr%out%WriteOutputHdr, dvr%out%WriteOutputUnt, InitOut%WriteOutputHdr, InitOut%WriteOutputUnt, errStat2, errMsg2); if(Failed()) return
Expand Down Expand Up @@ -548,7 +549,7 @@ logical function Failed0(txt)
if (errStat /= 0) then
ErrStat2 = ErrID_Fatal
ErrMsg2 = "Could not allocate "//trim(txt)
call SetErrStat(errStat2, errMsg2, errStat, errMsg, 'Dvr_InitCase')
call SetErrStat(errStat2, errMsg2, errStat, errMsg, 'Init_ADI_ForDriver')
endif
Failed0 = errStat >= AbortErrLev
if(Failed0) call cleanUp()
Expand Down Expand Up @@ -1451,7 +1452,7 @@ subroutine Dvr_InitializeOutputs(nWT, out, numSteps, errStat, errMsg)
end if
call OpenFOutFile ( out%unOutFile(iWT), trim(out%Root)//trim(sWT)//'.out', errStat, errMsg )
if ( errStat >= AbortErrLev ) return
write (out%unOutFile(iWT),'(/,A)') 'Predictions were generated on '//CurDate()//' at '//CurTime()//' using '//trim( version%Name )
write (out%unOutFile(iWT),'(/,A)') 'Predictions were generated on '//CurDate()//' at '//CurTime()//' using '//trim( GetVersion(version) )
write (out%unOutFile(iWT),'(1X,A)') trim(GetNVD(out%AD_ver))
write (out%unOutFile(iWT),'()' ) !print a blank line
write (out%unOutFile(iWT),'()' ) !print a blank line
Expand Down Expand Up @@ -1667,8 +1668,8 @@ subroutine Dvr_WriteOutputs(nt, t, dvr, out, yADI, errStat, errMsg)
out%outLine(1:nDV) = dvr%wt(iWT)%WriteOutput(1:nDV) ! Driver Write Outputs
! out%outLine(11) = dvr%WT(iWT)%hub%azimuth ! azimuth already stored a nt-1

out%outLine(nDV+1:nDV+nAD) = yADI%AD%rotors(iWT)%WriteOutput ! AeroDyn WriteOutputs
out%outLine(nDV+nAD+1:) = yADI%IW_WriteOutput ! InflowWind WriteOutputs
out%outLine(nDV+1:nDV+nIW) = yADI%IW_WriteOutput ! InflowWind WriteOutputs
out%outLine(nDV+nIW+1:) = yADI%AD%rotors(iWT)%WriteOutput ! AeroDyn WriteOutputs

if (out%fileFmt==idFmtBoth .or. out%fileFmt == idFmtAscii) then
! ASCII
Expand All @@ -1681,7 +1682,7 @@ subroutine Dvr_WriteOutputs(nt, t, dvr, out, yADI, errStat, errMsg)
endif
if (out%fileFmt==idFmtBoth .or. out%fileFmt == idFmtBinary) then
! Store for binary
out%storage(1:nDV+nAD+nIW, nt, iWT) = out%outLine(1:nDV+nAD+nIW)
out%storage(1:nDV+nIW+nAD, nt, iWT) = out%outLine(1:nDV+nIW+nAD)
endif
endif
enddo
Expand Down
Loading