-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBodyCondition.f90
29 lines (26 loc) · 1.06 KB
/
BodyCondition.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
MODULE MBodyCondition
USE MMesh, ONLY: TMesh
USE MConstants, ONLY: czero, ComputeWave
IMPLICIT NONE
public :: DiffractionCondition
CONTAINS
SUBROUTINE DiffractionCondition(w, beta, Mesh, pressure, velocity)
REAL, INTENT(IN) :: w, beta
TYPE(TMesh), INTENT(IN) :: Mesh
COMPLEX, DIMENSION(Mesh%nPanels), INTENT(OUT) :: pressure
COMPLEX, DIMENSION(Mesh%nPanels), INTENT(oUT) :: velocity
! local variables
INTEGER :: i
COMPLEX :: phi
COMPLEX, DIMENSION(3) :: vector
DO i = 1, Mesh%nPanels
IF (Mesh%center(3, i) .lt. 0.) THEN
CALL ComputeWave(w, beta, Mesh%center(:, i), phi, pressure(i), vector)
ELSE
pressure(i) = czero
vector = (/czero, czero, czero/)
END IF
velocity(i) = dot_product(vector, Mesh%normalVector(:, i))
END DO
END SUBROUTINE DiffractionCondition
END MODULE MBodyCondition