Skip to content

Commit

Permalink
Merge pull request #5 from ptrbortolotti/directivity
Browse files Browse the repository at this point in the history
atan2 instead of atan
  • Loading branch information
ptrbortolotti authored Jul 24, 2020
2 parents 22a10e7 + 34136cb commit ee11e41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions modules/aerodyn/src/AeroAcoustics/AeroAcoustics.f90
Original file line number Diff line number Diff line change
Expand Up @@ -876,19 +876,19 @@ SUBROUTINE CalcObserve(t,p,m,u,xd,errStat,errMsg)
! z ---> y_e

! Compute spanwise directivity angle phi for the trailing edge
phi_e = ATAN (RTEObserve(1)/RTEObserve(3))
phi_e = ATAN2 (RTEObserve(1) , RTEObserve(3))
m%SpanAngleTE(K,J,I) = phi_e * R2D

! Compute chordwise directivity angle theta for the trailing edge
theta_e = ATAN ((RTEObserve(3) * COS (phi_e) + RTEObserve(1) * SIN (phi_e) ) / RTEObserve(2))
theta_e = ATAN2 ((RTEObserve(3) * COS (phi_e) + RTEObserve(1) * SIN (phi_e) ) , RTEObserve(2))
m%ChordAngleTE(K,J,I) = theta_e * R2D

! Compute spanwise directivity angle phi for the leading edge (it's the same angle for the trailing edge)
phi_e = ATAN (RLEObserve(1)/RLEObserve(3))
phi_e = ATAN2 (RLEObserve(1) , RLEObserve(3))
m%SpanAngleLE(K,J,I) = phi_e * R2D

! Compute chordwise directivity angle theta for the leading edge
theta_e = ATAN ((RLEObserve(3) * COS (phi_e) + RLEObserve(1) * SIN (phi_e) ) / RLEObserve(2))
theta_e = ATAN2 ((RLEObserve(3) * COS (phi_e) + RLEObserve(1) * SIN (phi_e) ) , RLEObserve(2))
m%ChordAngleLE(K,J,I) = theta_e * R2D

ENDDO !K, observers
Expand Down
2 changes: 1 addition & 1 deletion modules/aerodyn/src/AeroAcoustics/AeroAcoustics_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ SUBROUTINE ReadPrimaryFile( InputFile, InputFileData, AABlFile, Default_DT, Out
READ( Line, *, IOSTAT=IOS) InputFileData%DT_AA
CALL CheckIOS ( IOS, InputFile, 'DT_AA', NumType, ErrStat2, ErrMsg2 ); call check

IF (mod(InputFileData%DT_AA, Default_DT) .gt. 1E-10) THEN
IF (abs(InputFileData%DT_AA / Default_DT - NINT(InputFileData%DT_AA / Default_DT)) .gt. 1E-10) THEN
CALL SetErrStat(ErrID_Fatal,"The Aeroacoustics input DT_AA must be a multiple of DTAero.", ErrStat, ErrMsg, RoutineName)
return
END IF
Expand Down

0 comments on commit ee11e41

Please sign in to comment.