-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRotor_functions.f90
72 lines (48 loc) · 1.35 KB
/
Rotor_functions.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
function rho0(x,y)
implicit none
real(kind = 8) x,y,f,r,r0,r1
real(kind = 8) rho0
r = ((x - 0.5d0)**2d0 + (y - 0.5d0)**2d0)**0.5d0
r0 = 0.1d0
r1 = 0.115d0
f = (r1 - r)/(r1 - r0)
if (r < r0) then
rho0 = 10d0
else if ((r >= r0) .and. (r < r1)) then
rho0 = 1d0 + 9d0*f
else if (r >= r1) then
rho0 = 1d0
end if
end
function ux0(x,y)
implicit none
real(kind = 8) x,y,f,r,r0,r1
real(kind = 8) ux0
r = ((x - 0.5d0)**2d0 + (y - 0.5d0)**2d0)**0.5d0
r0 = 0.1d0
r1 = 0.115d0
f = (r1 - r)/(r1 - r0)
if (r < r0) then
ux0 = -(y - 0.5d0)/r0
else if ((r >= r0) .and. (r < r1)) then
ux0 = -f*(y - 0.5d0)/r
else if (r >= r1) then
ux0 = 0d0
end if
end
function uy0(x,y)
implicit none
real(kind = 8) x,y,f,r,r0,r1
real(kind = 8) uy0
r = ((x - 0.5d0)**2d0 + (y - 0.5d0)**2d0)**0.5d0
r0 = 0.1d0
r1 = 0.115d0
f = (r1 - r)/(r1 - r0)
if (r < r0) then
uy0 = (x - 0.5d0)/r0
else if ((r >= r0) .and. (r < r1)) then
uy0 = f*(x - 0.5d0)/r
else if (r >= r1) then
uy0 = 0d0
end if
end