@@ -784,6 +784,12 @@ subroutine AA_CalcOutput( t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg)
784784
785785end subroutine AA_CalcOutput
786786!- ---------------------------------------------------------------------------------------------------------------------------------
787+ REAL(ReKi) FUNCTION Log10AA (X ) RESULT(F)
788+ REAL (ReKi),INTENT (IN ) :: X
789+
790+ F = LOG10 ( MAX (AA_EPSILON, X) )
791+
792+ END FUNCTION Log10AA
787793!- ---------------------------------------------------------------------------------------------------------------------------------!
788794SUBROUTINE Calc_LE_Location_Array (p ,m ,u )
789795 TYPE (AA_ParameterType), intent (in ) :: p ! < Parameters
@@ -1190,8 +1196,7 @@ SUBROUTINE LBLVS(ALPSTAR,C,U,THETA,PHI,L,R,p,d99Var2,dstarVar1,dstarVar2,SPLLAM,
11901196 ! compute peak scaled spectrum level
11911197 D = RC / RC0 ! Used in Eq 58 from BPM Airfoil Self-noise and Prediction paper
11921198 if (D .LE. .3237 ) then
1193- D = MAX (AA_Epsilon,D)
1194- G2 = 77.852 * LOG10 (D)+ 15.328 ! Begin Eq 58 from BPM Airfoil Self-noise and Prediction paper
1199+ G2 = 77.852 * LOG10AA(D)+ 15.328 ! Begin Eq 58 from BPM Airfoil Self-noise and Prediction paper
11951200 elseif (D .LE. .5689 ) then
11961201 G2 = 65.188 * LOG10 (D) + 9.125
11971202 elseif (D .LE. 1.7579 ) then
@@ -1204,15 +1209,14 @@ SUBROUTINE LBLVS(ALPSTAR,C,U,THETA,PHI,L,R,p,d99Var2,dstarVar1,dstarVar2,SPLLAM,
12041209
12051210 ! compute angle-dependent level for shape curve
12061211 G3 = 171.04 - 3.03 * ALPSTAR ! Eq 60 from BPM Airfoil Self-noise and Prediction paper
1207- SCALE = 10 . * LOG10 ( MAX (AA_EPSILON, DELTAP* M** 5 * DBARH* L/ R** 2 ) ) ! From Eq 53 from BPM Airfoil Self-noise and Prediction paper
1212+ SCALE = 10 . * Log10AA( DELTAP* M** 5 * DBARH* L/ R** 2 ) ! From Eq 53 from BPM Airfoil Self-noise and Prediction paper
12081213
12091214 ! Compute scaled sound pressure levels for each strouhal number
12101215 DO I= 1 ,SIZE (p% FreqList)
12111216 STPRIM = p% FreqList(I) * DELTAP / U ! Eq 54 from BPM Airfoil Self-noise and Prediction paper
12121217 E = STPRIM / STPKPRM ! Used in Eq 57 from BPM Airfoil Self-noise and Prediction paper
12131218 IF (E .LE. .5974 ) then
1214- E = MAX (AA_EPSILON,E)
1215- G1 = 39.8 * LOG10 (E)- 11.12 ! Begin Eq 57 from BPM Airfoil Self-noise and Prediction paper
1219+ G1 = 39.8 * LOG10AA(E)- 11.12 ! Begin Eq 57 from BPM Airfoil Self-noise and Prediction paper
12161220 ELSEIF (E .LE. .8545 ) then
12171221 G1 = 98.409 * LOG10 (E) + 2.0
12181222 ELSEIF (E .LE. 1.17 ) then
@@ -1297,7 +1301,6 @@ SUBROUTINE TBLTE(ALPSTAR,C,U,THETA,PHI,L,R,p,d99Var2,dstarVar1,dstarVar2,StallVa
12971301 real (ReKi) :: XCHECK ! USED TO CHECK FOR ANGLE OF ATTACK CONTRIBUTION
12981302 real (ReKi) :: DBARH ! HIGH FREQUENCY DIRECTIVITY ---
12991303 real (ReKi) :: DBARL ! LOW FREQUENCY DIRECTIVITY ---
1300- REAL (ReKi) :: LogVal ! temp value to avoid taking LOG of 0
13011304
13021305 integer (intKi) :: I ! I A generic index for DO loops.
13031306
@@ -1371,17 +1374,15 @@ SUBROUTINE TBLTE(ALPSTAR,C,U,THETA,PHI,L,R,p,d99Var2,dstarVar1,dstarVar2,StallVa
13711374 ! For each center frequency, compute an 'a' prediction for the pressure side
13721375 STPEAK = ST1
13731376 IF (RC .LT. 2.47E+05 ) then
1374- RC = MAX (AA_EPSILON,RC)
1375- K1 = - 4.31 * LOG10 (RC) + 156.3 ! Begin Eq 47 from BPM Airfoil Self-noise and Prediction paper
1377+ K1 = - 4.31 * LOG10AA(RC) + 156.3 ! Begin Eq 47 from BPM Airfoil Self-noise and Prediction paper
13761378 elseif (RC .LE. 8.0E+05 ) then
13771379 K1 = - 9.0 * LOG10 (RC) + 181.6
13781380 else
13791381 K1 = 128.5
13801382 end if
13811383
13821384 IF (RDSTRP .LE. 5000 .) then
1383- RDSTRP = MAX (AA_EPSILON,RDSTRP)
1384- DELK1 = - ALPSTAR* (5.29-1.43 * LOG10 (RDSTRP)) ! Begin Eq 48 from BPM Airfoil Self-noise and Prediction paper
1385+ DELK1 = - ALPSTAR* (5.29-1.43 * LOG10AA(RDSTRP)) ! Begin Eq 48 from BPM Airfoil Self-noise and Prediction paper
13851386 else
13861387 DELK1 = 0.0
13871388 end if
@@ -1409,50 +1410,40 @@ SUBROUTINE TBLTE(ALPSTAR,C,U,THETA,PHI,L,R,p,d99Var2,dstarVar1,dstarVar2,StallVa
14091410 IF ((ALPSTAR .GE. XCHECK).OR. (ALPSTAR .GT. StallVal))SWITCH= .TRUE.
14101411 DO I= 1 ,size (p% FreqList)
14111412 STP= p% FreqList(I) * DSTRP / U ! Eq 31 from BPM Airfoil Self-noise and Prediction paper
1412- LogVal = MAX (AA_EPSILON,STP / STPEAK)
1413- A = LOG10 ( LogVal ) ! Eq 37 from BPM Airfoil Self-noise and Prediction paper
1413+ A = LOG10AA( STP / STPEAK ) ! Eq 37 from BPM Airfoil Self-noise and Prediction paper
14141414 AMINA = AMIN(A)
14151415 AMAXA = AMAX(A)
14161416 AA = AMINA + ARA0 * (AMAXA - AMINA) ! Eq 40 from BPM Airfoil Self-noise and Prediction paper
14171417
1418- LogVal = MAX (AA_EPSILON,DSTRP* M** 5 * DBARH* L/ R** 2 )
1419- SPLP(I)= AA+ K1-3 .+ 10 .* LOG10 (LogVal)+ DELK1 ! Eq 25 from BPM Airfoil Self-noise and Prediction paper
1418+ SPLP(I)= AA+ K1-3 .+ 10 .* LOG10AA(DSTRP* M** 5 * DBARH* L/ R** 2 )+ DELK1 ! Eq 25 from BPM Airfoil Self-noise and Prediction paper
14201419 STS = p% FreqList(I) * DSTRS / U ! Eq 31 from BPM Airfoil Self-noise and Prediction paper
14211420
14221421 IF (.NOT. SWITCH) THEN
1423- LogVal = MAX (AA_EPSILON,STS / ST1PRIM)
1424- A = LOG10 ( LogVal )
1422+ A = LOG10AA( STS / ST1PRIM )
14251423 AMINA = AMIN(A)
14261424 AMAXA = AMAX(A)
14271425 AA = AMINA + ARA0 * (AMAXA - AMINA)
1428- LogVal = MAX (AA_EPSILON,DSTRS* M** 5 * DBARH* L/ R** 2 )
1429- SPLS(I) = AA+ K1-3 .+ 10 .* LOG10 (LogVal) ! Eq 26 from BPM Airfoil Self-noise and Prediction paper
1426+ SPLS(I) = AA+ K1-3 .+ 10 .* LOG10AA(DSTRS* M** 5 * DBARH* L/ R** 2 ) ! Eq 26 from BPM Airfoil Self-noise and Prediction paper
14301427 ! 'B' CURVE COMPUTATION
14311428 ! B = ABS(LOG10(STS / ST2))
1432- LogVal = MAX (AA_EPSILON,STS / ST2)
1433- B = LOG10 (LogVal) ! abs not needed absolute taken in the BMAX,BMIN ! Eq 43 from BPM Airfoil Self-noise and Prediction paper
1429+ B = LOG10AA(STS / ST2) ! abs not needed absolute taken in the BMAX,BMIN ! Eq 43 from BPM Airfoil Self-noise and Prediction paper
14341430 BMINB = BMIN(B)
14351431 BMAXB = BMAX(B)
14361432 BB = BMINB + BRB0 * (BMAXB- BMINB) ! Eq 46 from BPM Airfoil Self-noise and Prediction paper
1437- LogVal = MAX (AA_EPSILON,DSTRS* M** 5 * DBARH* L/ R** 2 )
1438- SPLALPH(I)= BB+ K2+10 .* LOG10 (LogVal) ! Eq 27 from BPM Airfoil Self-noise and Prediction paper
1433+ SPLALPH(I)= BB+ K2+10 .* LOG10AA(DSTRS* M** 5 * DBARH* L/ R** 2 ) ! Eq 27 from BPM Airfoil Self-noise and Prediction paper
14391434 ELSE
14401435 ! The 'a' computation is dropped if 'switch' is true
1441- LogVal = MAX (AA_EPSILON,DSTRS* M** 5 * DBARL* L/ R** 2 )
1442- SPLS(I) = 10 .* LOG10 (LogVal)
1436+ SPLS(I) = 10 .* LOG10AA(DSTRS* M** 5 * DBARL* L/ R** 2 )
14431437
14441438 ! SPLP(I) = 0.0 + 10.*LOG10(DSTRS*M**5*DBARL*L/R**2) ! changed the line below because the SPLP should be calculatd with DSTRP not with DSTRS
1445- LogVal = MAX (AA_EPSILON,DSTRP* M** 5 * DBARL* L/ R** 2 )
1446- SPLP(I) = 10 .* LOG10 (LogVal) ! this is correct
1439+ SPLP(I) = 10 .* LOG10AA(DSTRP* M** 5 * DBARL* L/ R** 2 ) ! this is correct
14471440
14481441 ! B = ABS(LOG10(STS / ST2))
1449- LogVal = MAX (AA_EPSILON,STS / ST2)
1450- B = LOG10 (LogVal) ! abs not needed absolute taken in the AMAX,AMIN
1442+ B = LOG10AA(STS / ST2) ! abs not needed absolute taken in the AMAX,AMIN
14511443 AMINB = AMIN(B)
14521444 AMAXB = AMAX(B)
14531445 BB = AMINB + ARA02 * (AMAXB- AMINB)
1454- LogVal = MAX (AA_EPSILON,DSTRS* M** 5 * DBARL* L/ R** 2 )
1455- SPLALPH(I)= BB+ K2+10 .* LOG10 (LogVal)
1446+ SPLALPH(I)= BB+ K2+10 .* LOG10AA(DSTRS* M** 5 * DBARL* L/ R** 2 )
14561447 ENDIF
14571448 ! Sum all contributions from 'a' and 'b' on both pressure and suction side on a mean-square pressure basis
14581449 IF (SPLP(I) .LT. - 100 .) SPLP(I) = - 100 . ! Similar to Eq 28 of BPM Airfoil Self-noise and Prediction paper
@@ -1462,8 +1453,7 @@ SUBROUTINE TBLTE(ALPSTAR,C,U,THETA,PHI,L,R,p,d99Var2,dstarVar1,dstarVar2,StallVa
14621453 ! P1 = 10.**(SPLP(I) / 10.) ! SPL_Pressure
14631454 ! P2 = 10.**(SPLS(I) / 10.) ! SPL_Suction
14641455 ! P4 = 10.**(SPLALPH(I) / 10.) ! SPL_AoA
1465- ! LogVal = MAX(AA_EPSILON,P1 + P2 + P4)
1466- ! SPLTBL(I) = 10. * LOG10(LogVal) ! Eq 24 from BPM Airfoil Self-noise and Prediction paper
1456+ ! SPLTBL(I) = 10. * LOG10AA(P1 + P2 + P4) ! Eq 24 from BPM Airfoil Self-noise and Prediction paper
14671457
14681458
14691459
@@ -1517,16 +1507,16 @@ SUBROUTINE TIPNOIS(ALPHTIP,ALPRAT2,C,U ,THETA,PHI, R,p,SPLTIP)
15171507 ENDIF
15181508 MM = (1 . + .036 * ALPTIPP) * M ! Eq 64 from BPM Airfoil Self-noise and Prediction paper
15191509 UM = MM * p% SpdSound ! Eq 65 from BPM Airfoil Self-noise and Prediction paper
1520- TERM = M* M* MM** 3 * L** 2 * DBARH/ R** 2 ! TERM = M^2 * M_max^5 *l^2 *D / r^2 according to Semi-Empirical Aeroacoustic Noise Prediction Code for Wind Turbines paper
1510+ TERM = M* M* MM** 3 * L** 2 * DBARH/ R** 2 ! TERM = M^2 * M_max^5 *l^2 *D / r^2 according to Semi-Empirical Aeroacoustic Noise Prediction Code for Wind Turbines paper
15211511 ! Term is correct according to Eq 61 from BPM Airfoil self-noise and Prediction paper
15221512 IF (TERM .NE. 0.0 ) THEN
15231513 SCALE = 10 .* LOG10 (TERM)
15241514 ELSE
15251515 SCALE = 0.0
15261516 ENDIF
15271517 DO I= 1 ,size (p% FreqList)
1528- STPP = MAX (AA_EPSILON, p% FreqList(I) * L / UM ) ! Eq 62 from BPM Airfoil Self-noise and Prediction paper
1529- SPLTIP(I) = 126 .- 30.5 * (LOG10 (STPP)+ .3 )** 2 + SCALE ! Eq 61 from BPM Airfoil Self-noise and Prediction paper
1518+ STPP = p% FreqList(I) * L / UM ! Eq 62 from BPM Airfoil Self-noise and Prediction paper
1519+ SPLTIP(I) = 126 .- 30.5 * (LOG10AA (STPP)+ .3 )** 2 + SCALE ! Eq 61 from BPM Airfoil Self-noise and Prediction paper
15301520 ENDDO
15311521END SUBROUTINE TipNois
15321522! ==================================================================================================================================!
@@ -1561,7 +1551,6 @@ SUBROUTINE InflowNoise(AlphaNoise,Chord,U,THETA,PHI,d,RObs,TINoise,p,SPLti)
15611551 REAL (ReKi) :: khat ! nafnoise
15621552 REAL (ReKi) :: ke ! nafnoise
15631553 REAL (ReKi) :: tinooisess ! nafnoise
1564- REAL (ReKi) :: LogInverse ! temp variable to ensure we avoid taking the log of 0
15651554
15661555 INTEGER (intKi) :: I ! I A generic index for DO loops.
15671556
@@ -1610,8 +1599,8 @@ SUBROUTINE InflowNoise(AlphaNoise,Chord,U,THETA,PHI,d,RObs,TINoise,p,SPLti)
16101599
16111600 ! Note: when we set RObs in CalcObserve(), we make sure it is >= AA_EPSILON ! avoid divide-by-zero
16121601 ! tinooisess could be 0, especially on the first step, so we need to check that we don't get a
1613- LogInverse = max (AA_EPSILON, p% AirDens** 2 * p% SpdSound** 4 * p% Lturb * (d/ 2 .) / (RObs** 2 ) * (Mach** 5 ) * tinooisess ** 2 * (Khat ** 3 ) * ( 1 + Khat ** 2 ) ** ( - 7 . / 3 .) * Directivity)
1614- SPLhigh = 10 . * LOG10 (LogInverse ) + 78.4 ! ref a; [2] )
1602+ SPLhigh = 10 . * LOG10AA( p% AirDens** 2 * p% SpdSound** 4 * p% Lturb * (d/ 2 .) / (RObs** 2 ) * (Mach** 5 ) * &
1603+ tinooisess ** 2 * (Khat ** 3 ) * ( 1 + Khat ** 2 ) ** ( - 7 . / 3 .) * Directivity ) + 78.4 ! ref a; [2] )
16151604
16161605 ! !! SPLhigh = 10.*LOG10(p%Lturb*(d/2.)/ &
16171606 ! !! (RObs*RObs)*(Mach**5)*tinooisess*tinooisess*(WaveNumber**3) &
@@ -1631,7 +1620,7 @@ SUBROUTINE InflowNoise(AlphaNoise,Chord,U,THETA,PHI,d,RObs,TINoise,p,SPLti)
16311620 ! !! ELSE ! ref b [3])
16321621 ! !! SPLti(I) = SPLhigh ! ref b [3])
16331622 ! !!ENDIF
1634- SPLti(I) = SPLhigh + 10 .* LOG10 (LFC/ (1 + LFC))
1623+ SPLti(I) = SPLhigh + 10 .* LOG10AA (LFC/ (1 + LFC))
16351624
16361625 ENDDO
16371626
@@ -1837,20 +1826,17 @@ SUBROUTINE BLUNT(ALPSTAR,C,U ,THETA,PHI,L,R,H,PSI,p,d99Var2,dstarVar1,dstarVar2,
18371826
18381827 ! Compute scaled spectrum level eq 74 of BPM Airfoil Self-noise and Prediction paper
18391828 if (HDSTAR .LE. 5 .) then
1840- HDSTAR = MAX (AA_Epsilon,HDSTAR)
1841- G4= 17.5 * LOG10 (HDSTAR)+ 157.5-1.114 * PSI
1829+ G4= 17.5 * LOG10AA(HDSTAR)+ 157.5-1.114 * PSI
18421830 else
18431831 G4= 169.7 - 1.114 * PSI
18441832 end if
18451833
18461834 ! For each frequency, compute spectrum shape referenced to 0 db
1847- LogVal = MAX (AA_EPSILON,M** 5.5 * H* DBARH* L/ R** 2 )
1848- SCALE = 10 . * LOG10 (LogVal)
1835+ SCALE = 10 . * LOG10AA(M** 5.5 * H * DBARH * L / R** 2 )
18491836 G5Sum= 0.0_Reki
18501837 DO I= 1 ,SIZE (p% FreqList)
18511838 STPPP = p% FreqList(I) * H / U
1852- LogVal = MAX (AA_EPSILON,STPPP/ STPEAK)
1853- ETA = LOG10 (LogVal)
1839+ ETA = LOG10AA(STPPP/ STPEAK)
18541840 G514 = G5COMP(HDSTAR,ETA) ! compute G5 for Phi=14deg
18551841
18561842 HDSTARP = 6.724 * HDSTAR ** 2-4.019 * HDSTAR+1.107 ! eq 82 from BPM Airfoil Self-noise and Prediction paper
@@ -2028,9 +2014,9 @@ SUBROUTINE THICK(C,RC,ALPSTAR,p,DELTAP,DSTRS,DSTRP,StallVal)
20282014 character (* ), parameter :: RoutineName = ' Thick'
20292015 real (ReKi) :: DELTA0 ! BOUNDARY LAYER THICKNESS AT ZERO ANGLE OF ATTACK METERS
20302016 real (ReKi) :: DSTR0 ! DISPLACEMENT THICKNESS AT ZERO ANGLE OF ATTACK METERS
2031- real (ReKi) :: LogRC ! LOG (RC)
2017+ real (ReKi) :: LogRC ! LOG10 (RC)
20322018
2033- LogRC = LOG10 ( MAX (AA_EPSILON, RC) )
2019+ LogRC = LOG10AA( RC )
20342020
20352021 ! Boundary layer thickness
20362022 DELTA0 = 10 .** (1.6569-0.9045 * LogRC+0.0596 * LogRC** 2 )* C ! (untripped) Eq. (5) of [1]
0 commit comments