Skip to content

Commit

Permalink
UA: output to binary file, removed .UA
Browse files Browse the repository at this point in the history
  • Loading branch information
ebranlard committed Oct 27, 2023
1 parent 9a3642d commit 9b4117b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions modules/aerodyn/src/UA_Dvr_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ subroutine ReadDriverInputFile( FileName, InitInp, ErrStat, ErrMsg )

! --- Triggers
call GetRoot(FileName, InitInp%OutRootName) ! OutRootName is inferred from current filename.
InitInp%OutRootName=trim(InitInp%OutRootName)//'.UA' ! For backward compatibility
!InitInp%OutRootName=trim(InitInp%OutRootName)//'.UA' ! For backward compatibility
!if (PathIsRelative(InitInp%OutRootName)) InitInp%OutRootName = TRIM(PriPath)//TRIM(InitInp%OutRootName)
if (PathIsRelative(InitInp%Airfoil1)) InitInp%Airfoil1 = TRIM(PriPath)//TRIM(InitInp%Airfoil1)
if (PathIsRelative(InitInp%AeroTSFile )) InitInp%AeroTSFile = TRIM(PriPath)//TRIM(InitInp%AeroTSFile )
Expand Down Expand Up @@ -733,7 +733,7 @@ subroutine Dvr_EndSim(dvr, errStat, errMsg)
endif
if (out%fileFmt==idFmt_Both .or. out%fileFmt == idFmt_Binary) then
call WrScr(' Writing output file: '//trim(out%Root)//'.outb')
call WrBinFAST(trim(out%Root)//'.out', FileFmtID_ChanLen_In, 'AeroDynDriver', out%WriteOutputHdr, out%WriteOutputUnt, (/0.0_DbKi, dvr%p%dt/), out%storage(:,:), errStat2, errMsg2)
call WrBinFAST(trim(out%Root)//'.outb', FileFmtID_ChanLen_In, 'AeroDynDriver', out%WriteOutputHdr, out%WriteOutputUnt, (/0.0_DbKi, dvr%p%dt/), out%storage(:,:), errStat2, errMsg2)
call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName)
endif
end subroutine Dvr_EndSim
Expand Down Expand Up @@ -1084,7 +1084,7 @@ subroutine WriteAFITables(AFI_Params, OutRootName, UseCm, UA_f_cn)
CALL GetNewUnit( unOutFile, ErrStat, ErrMsg )
IF ( ErrStat /= ErrID_None ) RETURN

CALL OpenFOutFile ( unOutFile, trim(OutRootName)//'.UA.Coefs.'//trim(num2lstr(iTab))//'.out', ErrStat, ErrMsg )
CALL OpenFOutFile ( unOutFile, trim(OutRootName)//'.Coefs.'//trim(num2lstr(iTab))//'.out', ErrStat, ErrMsg )
if (ErrStat >= AbortErrLev) then
call WrScr(Trim(ErrMsg))
return
Expand Down
3 changes: 2 additions & 1 deletion modules/aerodyn/src/UnsteadyAero.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3874,6 +3874,7 @@ subroutine UA_WriteOutputToFile(t, p, y)

end subroutine UA_WriteOutputToFile
!==============================================================================
! TODO Somehow merge this content with the unsteady aero driver summary file?
subroutine UA_WriteAFIParamsToFile(InitInp, AFInfo, ErrStat, ErrMsg)
type(AFI_ParameterType), intent(in ) :: AFInfo(:) ! The airfoil parameter data (for all airfoils)
type(UA_InitInputType), intent(in ) :: InitInp ! input data for initialization routine
Expand Down Expand Up @@ -3953,7 +3954,7 @@ subroutine UA_WriteAFIParamsToFile(InitInp, AFInfo, ErrStat, ErrMsg)
CALL GetNewUnit( unOutFile, ErrStat, ErrMsg )
IF ( ErrStat /= ErrID_None ) RETURN

CALL OpenFOutFile ( unOutFile, trim(InitInp%OutRootName)//'.UA.sum', ErrStat2, ErrMsg2 )
CALL OpenFOutFile ( unOutFile, trim(InitInp%OutRootName)//'.sum', ErrStat2, ErrMsg2 )
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
if (ErrStat >= AbortErrLev) return

Expand Down
6 changes: 3 additions & 3 deletions reg_tests/executeUnsteadyAeroRegressionCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@


# create the local output directory and initialize it with input files
renameDict={'UA'+str(i)+'.UA.out':'UA'+str(i)+'.UA_ref.out' for i in [2,3,4,5,6,7]}
renameDict={'UA'+str(i)+'.outb':'UA'+str(i)+'_ref.outb' for i in [2,3,4,5,6,7]}

rtl.copyTree(inputsDirectory, testBuildDirectory, renameDict=renameDict
, excludeExt=['.sum'])
Expand All @@ -116,8 +116,8 @@ def Error(msg):
### Compare output with
for dvrf in dvrFiles:
simName = os.path.splitext(os.path.basename(dvrf))[0]
localOutFile = os.path.join(testBuildDirectory, simName + '.UA.out')
baselineOutFile = os.path.join(inputsDirectory, simName + '.UA.out')
localOutFile = os.path.join(testBuildDirectory, simName + '.outb')
baselineOutFile = os.path.join(inputsDirectory, simName + '.out') # TODO TODO

if not os.path.exists(localOutFile):
Error('File does not exist: {}'.format(localOutFile))
Expand Down
2 changes: 1 addition & 1 deletion reg_tests/r-test

0 comments on commit 9b4117b

Please sign in to comment.