Newer
Older
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
!------------------------------------------------------------------------------|
!------------------------------------------------------------------------------|
! |
! ||===\\ |
! || \\ |
! || || //==\\ || || //==|| ||/==\\ |
! || || || || || || || || || || |
! || // || || || || || || || |
! ||===// \\==// \\==\\ \\==\\ || |
! |
!------------------------------------------------------------------------------|
!------------------------------------------------------------------------------|
! |
! DEFINE_BC_3Dpunch Apr. 2007 |
! |
!------------------------------------------------------------------------------|
!------------------------------------------------------------------------------|
subroutine define_bc_3Dpunch (nnode,kfix,kfixt,x,y,z,u,v,w,temp,vo)
!------------------------------------------------------------------------------|
!(((((((((((((((( Purpose of the routine ))))))))))))))))))))))))))))))))))))))
!------------------------------------------------------------------------------|
! this routine assigns the boundary condition in the case of a square,
! rectangular, or circular punch
!------------------------------------------------------------------------------|
!(((((((((((((((( declaration of the subroutine arguments ))))))))))))))))))))
!------------------------------------------------------------------------------|
use definitions
implicit none
integer nnode
integer kfix(nnode*3)
integer kfixt(nnode)
double precision x(nnode),y(nnode),z(nnode)
double precision u(nnode),v(nnode),w(nnode)
double precision temp(nnode)
type (void) vo
!------------------------------------------------------------------------------|
!(((((((((((((((( declaration of the subroutine internal variables )))))))))))))
!------------------------------------------------------------------------------|
integer i
double precision eps,square_size,rect_x_size,rect_y_size,circle_radius
double precision imposed_velocity
logical circle_punch
logical square_punch
logical rect_punch
logical rough
!------------------------------------------------------------------------------|
!------------------------------------------------------------------------------|
rough=.true.
square_punch = .true.
square_size = 0.15d0
rect_punch=.false.
rect_x_size = 0.06d0
rect_y_size = 0.08d0
circle_punch=.false.
circle_radius = 0.05d0
imposed_velocity=1.05d0
eps=1.d-10
do i=1,nnode
if (x(i).lt.eps) then
kfix((i-1)*3+1)=1 ; u(i)=0.d0
kfix((i-1)*3+2)=1 ; v(i)=0.d0
kfix((i-1)*3+3)=1 ; w(i)=0.d0
endif
if (x(i).gt.1.d0-eps) then
kfix((i-1)*3+1)=1 ; u(i)=0.d0
kfix((i-1)*3+2)=1 ; v(i)=0.d0
kfix((i-1)*3+3)=1 ; w(i)=0.d0
endif
if (y(i).lt.eps) then
kfix((i-1)*3+1)=1 ; u(i)=0.d0
kfix((i-1)*3+2)=1 ; v(i)=0.d0
kfix((i-1)*3+3)=1 ; w(i)=0.d0
endif
if (y(i).gt.1.d0-eps) then
kfix((i-1)*3+1)=1 ; u(i)=0.d0
kfix((i-1)*3+2)=1 ; v(i)=0.d0
kfix((i-1)*3+3)=1 ; w(i)=0.d0
endif
if (z(i).lt.eps) then
if (square_punch) then
if ((x(i)-(.5d0-.5d0*square_size))*(x(i)-(.5d0+.5d0*square_size)).le.0.d0 .and. &
(y(i)-(.5d0-.5d0*square_size))*(y(i)-(.5d0+.5d0*square_size)).le.0.d0 ) then
if (rough) then
kfix((i-1)*3+1)=1 ; u(i)=0.d0
kfix((i-1)*3+2)=1 ; v(i)=0.d0
end if
kfix((i-1)*3+3)=1 ; w(i)=imposed_velocity
endif
endif
if (rect_punch) then
if ((x(i)-(.5d0-.5d0*rect_x_size))*(x(i)-(.5d0+.5d0*rect_x_size)).le.0.d0 .and. &
(y(i)-(.5d0-.5d0*rect_y_size))*(y(i)-(.5d0+.5d0*rect_y_size)).le.0.d0 ) then
if (rough) then
kfix((i-1)*3+1)=1 ; u(i)=0.d0
kfix((i-1)*3+2)=1 ; v(i)=0.d0
end if
kfix((i-1)*3+3)=1 ; w(i)=imposed_velocity
endif
endif
if (circle_punch) then
if (sqrt((x(i)-.5d0)**2+(y(i)-.5d0)**2).le.circle_radius) then
if (rough) then
kfix((i-1)*3+1)=1 ; u(i)=0.d0
kfix((i-1)*3+2)=1 ; v(i)=0.d0
end if
kfix((i-1)*3+3)=1 ; w(i)=imposed_velocity
endif
endif
kfixt(i)=1
temp(i)=1.d0
endif
if (z(i).gt.1.d0-eps) then
kfix((i-1)*3+1)=1 ; u(i)=0.d0
kfix((i-1)*3+2)=1 ; v(i)=0.d0
kfix((i-1)*3+3)=1 ; w(i)=0.d0
kfixt(i)=1
temp(i)=0.d0
endif
if (.not.vo%influid(i)) then
kfixt(i)=1
temp(i)=0.d0
endif
enddo
return
end
!-------------------------------------------------------------------------------
!-------------------------------------------------------------------------------