Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,12 @@ openfast_io/openfast_io/_version.py
*.code-workspace
docker-compose.yml
.devcontainer/

# AI steering files for specific users
.kiro/*

# vs-build files
Comment thread
andrew-platt marked this conversation as resolved.
.vs
*.user
*.u2d
gitVersionInfo.h
273 changes: 192 additions & 81 deletions modules/aerodyn/src/AeroAcoustics.f90

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions modules/aerodyn/src/AeroAcoustics_Driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@
! See the License for the specific language governing permissions and
! limitations under the License.
!

!there will also be various control flags... this may be updated as needed:
!TBLflag = {'BPM','TNO'}
!bluntnessFlag = {'DTU','BPM'}
!BPMBLflag = {'true','false'}
!useOrigModelAtSepOnset = {'true','false'}





!**********************************************************************************************************************************
program AeroAcoustics_Driver
use AeroAcoustics_Driver_Subs
Expand Down
6 changes: 3 additions & 3 deletions modules/aerodyn/src/AeroAcoustics_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ MODULE AeroAcoustics_IO

integer(intKi), parameter :: ITURB_None = 0 ! TBLTE noise is not calculated
integer(intKi), parameter :: ITURB_BPM = 1 ! TBLTE noise is calculated with BPM
integer(intKi), parameter :: ITURB_TNO = 2 ! TBLTE noise is calculated with TNO
integer(intKi), parameter :: ITURB_TNO = 2 ! TBLTE noise is calculated with TNO (and part of BPM)

integer(intKi), parameter :: IInflow_None = 0 ! IInflow noise is not calculated
integer(intKi), parameter :: IInflow_BPM = 1 ! IInflow noise is calculated with BPM
Expand Down Expand Up @@ -452,7 +452,7 @@ SUBROUTINE ValidateInputData( InputFileData, NumBl, ErrStat, ErrMsg )

if (InputFileData%IBLUNT /= IBLUNT_None .and. InputFileData%IBLUNT /= IBLUNT_BPM) then
call SetErrStat ( ErrID_Fatal, &
'IBLUNT must '//trim(num2lstr(IBLUNT_None))//' (none) or '//trim(num2lstr(IBLUNT_BPM))//' (Bluntness noise calculated).', ErrStat, ErrMsg, RoutineName )
'IBLUNT must be '//trim(num2lstr(IBLUNT_None))//' (none) or '//trim(num2lstr(IBLUNT_BPM))//' (Bluntness noise calculated).', ErrStat, ErrMsg, RoutineName )
endif
if (InputFileData%ILAM /= ILAM_None .and. InputFileData%ilam /= ILAM_BPM) then
call SetErrStat ( ErrID_Fatal, 'ILAM must be '//trim(num2lstr(ILAM_None))//' No calculation '//&
Expand All @@ -467,7 +467,7 @@ SUBROUTINE ValidateInputData( InputFileData, NumBl, ErrStat, ErrMsg )
' (heavily tripped BL Calculation) or '//trim(num2lstr(ITRIP_Light))//' (lightly tripped BL)' ,ErrStat, ErrMsg, RoutineName )
end if
if (InputFileData%ITURB /= ITURB_None .and. InputFileData%ITURB /= ITURB_BPM .and. InputFileData%ITURB /= ITURB_TNO) then
call SetErrStat ( ErrID_Fatal, 'ITURB must be 0 (off) or 1 (BPM) or 2 (TNO) .', ErrStat, ErrMsg, RoutineName )
call SetErrStat ( ErrID_Fatal, 'ITURB must be 0 (off) or 1 (BPM) or 2 (TNO with BPM alpha) .', ErrStat, ErrMsg, RoutineName )
end if
if (InputFileData%IInflow /= IInflow_None .and. InputFileData%IInflow /= IInflow_BPM &
.and. InputFileData%IInflow /= IInflow_FullGuidati .and. InputFileData%IInflow /= IInflow_SimpleGuidati ) then
Expand Down
350 changes: 283 additions & 67 deletions modules/aerodyn/src/AeroAcoustics_TNO.f90

Large diffs are not rendered by default.

210 changes: 210 additions & 0 deletions modules/aerodyn/src/AirfoilInfo_Driver.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
!**********************************************************************************************************************************
! AFI_Driver: This code tests a stand-alone version of the AFI module
!..................................................................................................................................
! LICENSING
! Copyright (C) 2018 Envision Energy
!
! This file is part of AirfoilInfo.
!
! Licensed under the Apache License, Version 2.0 (the "License");
! you may not use this file except in compliance with the License.
! You may obtain a copy of the License at
!
! http://www.apache.org/licenses/LICENSE-2.0
!
! Unless required by applicable law or agreed to in writing, software
! distributed under the License is distributed on an "AS IS" BASIS,
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! See the License for the specific language governing permissions and
! limitations under the License.
!
!**********************************************************************************************************************************



program AFI_Driver

use NWTC_Library
use VersionInfo
use AirfoilInfo
use AirfoilInfo_Types

implicit none


TYPE(ProgDesc), PARAMETER :: AFI_Ver = ProgDesc( 'AFI_driver', '', '' )


! Variables
type(AFI_InitInputType) :: AFI_InitInputs ! Input data for initialization
integer, parameter :: NumAFI = 1;
type(AFI_ParameterType) :: AFI_p(NumAFI) ! Parameters
type(AFI_OutputType) :: AFI_interp ! interpolated AFI output values
integer(IntKi) :: ErrStat ! Status of error message
character(1024) :: ErrMsg ! Error message if ErrStat /= ErrID_None

character(1024) :: afName
character(1024) :: outFileName
integer :: unOutFile(3) = -1
character(*), parameter :: NumFmt = 'ES16.9E2'
character(*), parameter :: Frmt = '(1x,'//NumFmt//')'
character(*), parameter :: Ext(3) = (/ '.cl','.cd','.cm' /)
character(*), parameter :: delim = ' '

integer :: i, j, k, iFile

real(ReKi), allocatable :: Re(:)
real(ReKi) :: alpha
real(ReKi), parameter :: UserProp = 0.0_ReKi


! Initialize the NWTC library
call NWTC_Init(AFI_Ver%Name)

! Initialize error handling variables
ErrMsg = ''
ErrStat = ErrID_None


CALL DispNVD(AFI_Ver)


! Check for command line arguments.
afName = '' ! default name for input file
CALL CheckArgs( afName )

CALL GetRoot( afName, outFileName )
outFileName = trim(outFileName)//'.interp.out'


! Setup Airfoil InitInput data structure (should come from an input file):
AFI_InitInputs%AFTabMod = AFITable_1 ! AFITable_2Re !
AFI_InitInputs%InCol_Alfa = 1
AFI_InitInputs%InCol_Cl = 2
AFI_InitInputs%InCol_Cd = 3
AFI_InitInputs%InCol_Cm = 4
AFI_InitInputs%InCol_Cpmin = 0
AFI_InitInputs%FileName = afName
AFI_InitInputs%UAMod = UA_Gonzalez


! Write UA parameters to file:
call AFI_WrHeader(delim, trim(outFileName)//'.AFI.sum', unOutFile(1), ErrStat, ErrMsg)

do iFile=1,NumAFI
if (NumAFI > 1) then
if (iFile < 10) then
AFI_InitInputs%FileName = 'af00'//trim(num2lstr(iFile))//'.dat'
else
AFI_InitInputs%FileName = 'af0'//trim(num2lstr(iFile))//'.dat'
end if
end if

! Initialize the Airfoil Info Params
call AFI_Init ( AFI_InitInputs, AFI_p(iFile), ErrStat, ErrMsg )
call checkError()

if (ErrStat < AbortErrLev) then
call AFI_WrData(iFile, unOutFile(1), delim, AFI_p(iFile))

call AFI_WrTables(AFI_p(iFile), AFI_InitInputs%UAMod, trim(AFI_InitInputs%FileName) )

end if
end do
close(unOutFile(1))

iFile = 1
! allocate Re array, based on Re in the tables
call allocAry( Re, AFI_p(iFile)%NumTabs*2 + 1, 'Re', ErrStat, ErrMsg )
call checkError()

Re(1) = AFI_p(iFile)%Table(1)%Re / 2.0_ReKi
do i = 1, AFI_p(iFile)%NumTabs
Re(2*i) = AFI_p(iFile)%Table(i)%Re
end do
do i = 1, AFI_p(iFile)%NumTabs-1
Re(2*i+1) = (AFI_p(iFile)%Table(i)%Re + AFI_p(iFile)%Table(i+1)%Re)/2.0_ReKi
end do
Re(size(Re)) = AFI_p(iFile)%Table(AFI_p(iFile)%NumTabs)%Re * 2


! ------------
do k=1,size(Ext)
call GetNewUnit( unOutFile(k) )
call OpenFOutFile ( unOutFile(k), trim(outFileName)//Ext(k), errStat, errMsg )
call checkError()

write( unOutFile(k), '('//trim(num2lstr(size(Re)+1))//Frmt//')' ) NaN, Re
end do


! time marching loop
do i = -180, 180 ! alpha
alpha = Real(i, ReKi) ! degrees

do k=1,size(Ext)
write(unOutFile(k), Frmt, ADVANCE='no') alpha
end do

alpha = alpha*pi/180.0_ReKi ! radians

do j=1, size(Re)

call AFI_ComputeAirfoilCoefs( alpha, Re(j), UserProp, AFI_p(iFile), AFI_interp, ErrStat, ErrMsg)
call checkError()

write(unOutFile(1), Frmt, ADVANCE='no') AFI_interp%cl
write(unOutFile(2), Frmt, ADVANCE='no') AFI_interp%cd
write(unOutFile(3), Frmt, ADVANCE='no') AFI_interp%cm

end do

do k=1,size(Ext)
write (unOutFile(k),'()', IOSTAT=ErrStat) ! write the line return
end do

end do


!-------------------------------------------------------------------------------------------------
! Close our output files
!-------------------------------------------------------------------------------------------------


call Cleanup()
call NormStop()

contains

!====================================================================================================
subroutine Cleanup()
! The routine closes any open files.
!----------------------------------------------------------------------------------------------------
integer :: ie

do ie=1,size(Ext)
if (unOutFile(ie) > 0) close( unOutFile(ie), IOSTAT = ErrStat )
end do

end subroutine Cleanup

!----------------------------------------------------------------------------------------------------
subroutine checkError()

if (ErrStat >= AbortErrLev) then

call Cleanup()
call ProgAbort(ErrMsg)

elseif ( ErrStat /= ErrID_None ) then

call WrScr( trim(ErrMsg) )

end if

end subroutine checkError
!----------------------------------------------------------------------------------------------------


end program AFI_Driver

28 changes: 14 additions & 14 deletions modules/nwtc-library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,20 @@ set(NWTCLIBS_SOURCES
src/NetLib/scalapack/NWTC_ScaLAPACK.f90

# NetLib SLATEC sources
src/NetLib/slatec/NWTC_SLATEC.f90
src/NetLib/slatec/dqk61.f
src/NetLib/slatec/qk61.f
src/NetLib/slatec/d1mach.f
src/NetLib/slatec/r1mach.f
src/NetLib/slatec/xercnt.f
src/NetLib/slatec/xerhlt.f
src/NetLib/slatec/xerprn.f
src/NetLib/slatec/xersve.f
src/NetLib/slatec/fdump.f
src/NetLib/slatec/i1mach.f
src/NetLib/slatec/j4save.f
src/NetLib/slatec/xgetua.f
src/NetLib/slatec/xermsg.f
#src/NetLib/slatec/NWTC_SLATEC.f90
#src/NetLib/slatec/dqk61.f
#src/NetLib/slatec/qk61.f
#src/NetLib/slatec/d1mach.f
#src/NetLib/slatec/r1mach.f
#src/NetLib/slatec/xercnt.f
#src/NetLib/slatec/xerhlt.f
#src/NetLib/slatec/xerprn.f
#src/NetLib/slatec/xersve.f
#src/NetLib/slatec/fdump.f
#src/NetLib/slatec/i1mach.f
#src/NetLib/slatec/j4save.f
#src/NetLib/slatec/xgetua.f
#src/NetLib/slatec/xermsg.f
)

get_filename_component(FCNAME ${CMAKE_Fortran_COMPILER} NAME)
Expand Down
4 changes: 2 additions & 2 deletions modules/subdyn/src/SubDyn_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ MODULE SubDyn_Types
REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: MemberSpin !< Member spin angle about its axis - for rectangular members [rad]
REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: MemberDivSize !< Optional maximum element length for each member [m]
INTEGER(IntKi) , DIMENSION(:), ALLOCATABLE :: MemberNDiv !< Resolved number of finite elements per member [-]
INTEGER(IntKi) , DIMENSION(:), ALLOCATABLE :: MemberElemStart !< First element index for each member in p%Elems [-]
INTEGER(IntKi) , DIMENSION(:), ALLOCATABLE :: MemberElemStart !< First element index for each member in p%Elems [-]
CHARACTER(ChanLen) , DIMENSION(:), ALLOCATABLE :: SSOutList !< List of Output Channels [-]
LOGICAL :: OutCOSM = .false. !< Output Cos-matrices Flag [-]
LOGICAL :: TabDelim = .false. !< Generate a tab-delimited output file in OutJckF-Flag [-]
Expand All @@ -196,7 +196,7 @@ MODULE SubDyn_Types
REAL(R8Ki) , DIMENSION(:,:), ALLOCATABLE :: K !< System stiffness matrix [-]
REAL(R8Ki) , DIMENSION(:,:), ALLOCATABLE :: M !< System mass matrix [-]
REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: ElemProps !< Element properties(A, L, Ixx, Iyy, Jzz, Shear, Kappa, E, G, Rho, DirCos(1,1), DirCos(2, 1), ....., DirCos(3, 3) ) [-]
INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: MemberNodes !< Member number and list of nodes making up a member (>2 if subdivided) [-]
INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: MemberNodes !< Member number and endpoint node IDs (interior member nodes reconstructed from connectivity) [-]
INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: NodesConnN !< Nodes that connect to a common node [-]
INTEGER(IntKi) , DIMENSION(:,:), ALLOCATABLE :: NodesConnE !< Elements that connect to a common node [-]
LOGICAL :: SSSum = .false. !< SubDyn Summary File Flag [-]
Expand Down
4 changes: 0 additions & 4 deletions vs-build/.gitignore

This file was deleted.

Loading