Skip to content

Commit d9d0098

Browse files
authored
Merge pull request #2948 from bjonkman/b/AeroAcoustics
AeroAcoustics code cleanup
2 parents 9d66ab3 + 63243f1 commit d9d0098

File tree

12 files changed

+1612
-2078
lines changed

12 files changed

+1612
-2078
lines changed

docs/source/user/aerodyn-aeroacoustics/App-usage.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,22 @@ Finally, the set Outputs contains a few options for the output data:
112112
levels are reported with (True) or without (False) the A-weighting
113113
correction; see :numref:`aa-sec-ModelUsage`.
114114

115-
- **NAAOutFile** – Integer 1/2/3: flag to set the desired output file. When
115+
- **NAAOutFile** – Integer 1/2/3/4: flag to set the desired output file. When
116116
set to 1, a value of overall sound pressure level at every **DT_AA** time
117117
step per observer is printed to file. When set to 2, the first output
118118
is accompanied by a second file where the total sound pressure level
119119
spectrum is printed per time step per observer. When set to
120-
3, the two first outputs are accompanied by a third file where the
120+
3, the two first output files are accompanied by a third file where the
121121
sound pressure level spectrum per noise mechanism is printed per time
122122
step per observer. When set to 4, a fourth file is generated with the
123123
values of overall sound pressure levels per node, per blade,
124124
per observer, and per time step.
125125

126-
- The following line contains the file name used to store the outputs.
127-
The file name is attached with a 1, 2, 3, and 4 flag based on the
128-
**NAAOutFile** options.
126+
- The following line, **AAOutFile**, contains the root name for the files
127+
used to store the outputs. If set to "default", the default output file
128+
root name will be used.
129+
The file name is appended with a 1, 2, 3, and 4 flag based on the
130+
**NAAOutFile** options.
129131

130132
The file must be closed by an END command.
131133

docs/source/user/aerodyn-aeroacoustics/example/AeroAcousticsInput.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ True RoundedTip - Logical indicating rounded tip (flag) [Only used if
2424
====== Outputs ====================================================================================
2525
False AWeighting - A-weighting Flag (flag)
2626
3 NrOutFile - Number of Output files. 1 for Time Dependent Overall SPL, 2 for both 1 and Frequency and Time Dependent SPL as well, or 3 for both 1 and 2 and Acoustics mechanism dependent, 4 for 1-3 and the overall sound pressure levels per blade per node per observer
27-
"IEA_LB_RWT-AeroAcoustics_" AAOutFile - No Extension needed the resulting file will have .out Name of file containing
27+
"IEA_LB_RWT-AeroAcoustics_" AAOutFile - No Extension needed; the resulting file(s) will end in #.out. Use "Default" to use the default output file name from OpenFAST.
2828
END of input file (the word "END" must appear in the first 3 columns of this last OutList line)
2929
---------------------------------------------------------------------------------------

modules/aerodyn/src/AeroAcoustics.f90

Lines changed: 929 additions & 1046 deletions
Large diffs are not rendered by default.

modules/aerodyn/src/AeroAcoustics_IO.f90

Lines changed: 394 additions & 411 deletions
Large diffs are not rendered by default.

modules/aerodyn/src/AeroAcoustics_Registry.txt

Lines changed: 25 additions & 51 deletions
Large diffs are not rendered by default.

modules/aerodyn/src/AeroAcoustics_TNO.f90

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ MODULE TNO
55
use NWTC_SLATEC ! slatec_qk61 -- which is all that is in that library right now.
66

77
implicit none
8+
PRIVATE
89
PUBLIC :: SPL_integrate
910

1011
INTEGER, PARAMETER :: TNOKi = ReKi
@@ -63,8 +64,10 @@ function SPL_integrate(Omega,limits,ISSUCTION, &
6364
! Set module values from input
6465
ISSUCTION_TNO = ISSUCTION
6566
Omega_TNO = real(Omega,TNOKi)
67+
6668
! Mach number of segment
6769
Mach_TNO = real(Mach,TNOKi)
70+
6871
! Atmospheric values
6972
co = real(SpdSound, TNOKi)
7073
rho = real(AirDens, TNOKi)
@@ -158,10 +161,10 @@ FUNCTION f_int1(x2)
158161
END FUNCTION f_int1
159162

160163

161-
FUNCTION f_int2(k1) ! changed name from 'int2' to avoid conflicts with intrinsic of same name
162-
REAL (TNOKi), intent(in) :: k1
164+
FUNCTION f_int2(k1_in) ! changed name from 'int2' to avoid conflicts with intrinsic of same name
165+
REAL (TNOKi), intent(in) :: k1_in
163166
REAL (TNOKi) :: f_int2
164-
f_int2 = Omega_TNO/co/k1*Pressure(k1)
167+
f_int2 = Omega_TNO/co/k1_in*Pressure(k1_in)
165168
RETURN
166169
END FUNCTION f_int2
167170

modules/aerodyn/src/AeroAcoustics_Types.f90

Lines changed: 152 additions & 520 deletions
Large diffs are not rendered by default.

modules/aerodyn/src/AeroDyn.f90

Lines changed: 91 additions & 33 deletions
Large diffs are not rendered by default.

modules/aerodyn/src/AeroDyn_AllBldNdOuts_IO.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ SUBROUTINE AllBldNdOuts_InitOut( InitOut, p, InputFileData, ErrStat, ErrMsg )
234234
! Populate the header an unit lines for all blades and nodes
235235
! First set a counter so we know where in the output array we are in
236236
! NOTE: we populate invalid names as well (some names are not valid outputs for certain configurations). That means we will have zeros in those values.
237-
INDX = p%NumOuts + 1 ! p%NumOuts is the number of outputs from the normal AeroDyn output. The WriteOutput array is sized to p%NumOuts + num(AllBldNdOuts)
237+
INDX = p%NumOuts + p%AA%numOuts + 1 ! The WriteOutput array is sized to p%NumOuts + p%AA%numOuts + AllBldNdOuts
238238

239239
DO IdxChan=1,p%BldNd_NumOuts
240240

@@ -327,7 +327,7 @@ SUBROUTINE Calc_WriteAllBldNdOutput( p, p_AD, u, m, m_AD, x, y, OtherState, RotI
327327

328328
! Populate the header an unit lines for all blades and nodes
329329
! First set a counter so we know where in the output array we are in
330-
iOut = p%NumOuts + 1 ! p%NumOuts is the number of outputs from the normal AeroDyn output. The WriteOutput array is sized to p%NumOuts + num(AllBldNdOuts)
330+
iOut = p%NumOuts + p%AA%numOuts + 1 ! p%NumOuts is the number of outputs from the normal AeroDyn output. The WriteOutput array is sized to p%NumOuts + p%AA%numOuts + num(AllBldNdOuts)
331331

332332

333333
! Case to assign output to this channel and populate based on Indx value (this indicates what the channel is)

modules/aerodyn/src/AeroDyn_Driver_Subs.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,17 +449,17 @@ subroutine Init_ADI_ForDriver(iCase, ADI, dvr, FED, dt, needInitIW, errStat, err
449449
! UA does not like changes of dt between cases
450450
if ( .not. EqualRealNos(ADI%p%AD%DT, dt) ) then
451451
call WrScr('Info: dt is changing between cases, AeroDyn will be re-initialized')
452-
call ADI_End( ADI%u(1:1), ADI%p, ADI%x(1), ADI%xd(1), ADI%z(1), ADI%OtherState(1), ADI%y, ADI%m, errStat2, errMsg2); call SetErrStat(errStat2, errMsg2, errStat, errMsg, 'Init_ADI_ForDriver'); if(Failed()) return
453-
!call AD_Dvr_DestroyAeroDyn_Data (AD , errStat2, errMsg2); call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName)
454452
needInit=.true.
455453
endif
456454
if (ADI%p%AD%Wake_Mod == WakeMod_FVW) then
457455
call WrScr('[INFO] OLAF is used, AeroDyn will be re-initialized')
458456
needInit=.true.
459457
endif
458+
460459
if (needInit) then
461460
call ADI_End( ADI%u(1:1), ADI%p, ADI%x(1), ADI%xd(1), ADI%z(1), ADI%OtherState(1), ADI%y, ADI%m, errStat2, errMsg2); call SetErrStat(errStat2, errMsg2, errStat, errMsg, 'Init_ADI_ForDriver'); if(Failed()) return
462461
endif
462+
463463
endif
464464

465465
! if wind profile changed in a combined case, need to re-init

0 commit comments

Comments
 (0)