-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathboundary_conditions.f90
77 lines (61 loc) · 1.22 KB
/
boundary_conditions.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
subroutine boundary_conditions()
use variables
implicit none
!---------------------------------------------------!
! Boundary conditions calculation !
!---------------------------------------------------!
!!!!!!!!Velocity boundary conditions!!!!!!!!
!Left vertical wall
do j=0,ny+1
u(0,j) = 0
v(0,j) = -v(1,j)
u1(0,j) = 0
v1(0,j) = -v1(1,j)
u_star(0,j) = 0
v_star(0,j) = -v_star(1,j)
end do
!Right vertical wall
do j=0,ny+1
u(nx,j) = 0
v(nx+1,j) = -v(nx,j)
u1(nx,j) = 0
v1(nx+1,j) = -v1(nx,j)
u_star(nx,j) = 0
v_star(nx+1,j) = -v_star(nx,j)
end do
!Bottom horizontal wall
do i=0,nx+1
u(i,0) = -u(i,1)
v(i,0) = 0
u1(i,0) = -u1(i,1)
v1(i,0) = 0
u_star(i,0) = -u_star(i,1)
v_star(i,0) = 0
end do
!Top horizontal wall
do i=0,nx+1
u(i,ny+1) = 2-u(i,ny)
v(i,ny) = 0
u1(i,ny+1) = 2-u1(i,ny)
v1(i,ny) = 0
u_star(i,ny+1) = 2-u_star(i,ny)
v_star(i,ny) = 0
end do
!!!!!!!Pressure boundary conditions!!!!!!!
!Left vertical wall
do j=0,ny+1
p(0,j)=p(1,j)
end do
!Right vertical wall
do j=0,ny+1
p(nx+1,j)=p(nx,j)
end do
!Bottom horizontal wall
do i=0,nx+1
p(i,0)=p(i,1)
end do
!Top horizontal wall
do i=0,nx+1
p(i,ny+1)=p(i,ny)
end do
end subroutine boundary_conditions