-
Notifications
You must be signed in to change notification settings - Fork 3
/
get_ice_viscosity.m
141 lines (123 loc) · 11.9 KB
/
get_ice_viscosity.m
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
function [visc_s, visc, strain_heat] = get_ice_viscosity(u_s, u, AGlen_s)
global Ms N dzeta dx de0 n dzetadx_s H_s W W_s isFlowband
de2_s=zeros(N,Ms);
visc_s=zeros(N,Ms);
for i = 1:Ms
for j = 2:N-1
if i == 1
de2_s(j,i) = ((u_s(j+1,i)-u_s(j-1,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((-8*u_s(j,i)+9*u_s(j,i+1)-u_s(j,i+2))/(3*dx) + dzetadx_s(j,i)*(u_s(j+1,i)-u_s(j-1,i))/(2*dzeta))^2 + ...
(u_s(j,i)/W_s(j,i)*((-8*W_s(j,i)+9*W_s(j,i+1)-W_s(j,i+2))/(3*dx) + dzetadx_s(j,i)*(W_s(j+1,i)-W_s(j-1,i))/(2*dzeta)))^2 + ...
u_s(j,i)/W_s(j,i)*((-8*u_s(j,i)+9*u_s(j,i+1)-u_s(j,i+2))/(3*dx) + dzetadx_s(j,i)*(u_s(j+1,i)-u_s(j-1,i))/(2*dzeta)) * ...
((-8*W_s(j,i)+9*W_s(j,i+1)-W_s(j,i+2))/(3*dx)+dzetadx_s(j,i)*(W_s(j+1,i)-W_s(j-1,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(j,i)/W_s(j,i))^2;
visc_s(j,i) = 1/2*AGlen_s(j,i)^(-1/n)*(de2_s(j,i) + de0)^((1-n)/(2*n));
de2_s(N,i) = ((3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((-8*u_s(N,i)+9*u_s(N,i+1)-u_s(N,i+2))/(3*dx) + dzetadx_s(N,i)*(3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta))^2 + ...
(u_s(N,i)/W_s(N,i)*((-8*W_s(N,i)+9*W_s(N,i+1)-W_s(N,i+2))/(3*dx) + dzetadx_s(N,i)*(3*W_s(N,i)-4*W_s(N-1,i)+W_s(N-2,i))/(2*dzeta)))^2 + ...
u_s(N,i)/W_s(N,i)*((-8*u_s(N,i)+9*u_s(N,i+1)-u_s(N,i+2))/(3*dx) + dzetadx_s(N,i)*(3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta)) * ...
((-8*W_s(N,i)+9*W_s(N,i+1)-W_s(N,i+2))/(3*dx)+dzetadx_s(N,i)*(3*W_s(N,i)-4*W_s(N-1,i)+W_s(N-2,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(N,i)/W_s(N,i))^2;
visc_s(N,i) = 1/2*AGlen_s(N,i)^(-1/n)*(de2_s(N,i) + de0)^((1-n)/(2*n));
de2_s(1,i) = ((-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((-8*u_s(1,i)+9*u_s(1,i+1)-u_s(1,i+2))/(3*dx) + dzetadx_s(1,i)*(-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta))^2 + ...
(u_s(1,i)/W_s(1,i)*((-8*W_s(1,i)+9*W_s(1,i+1)-W_s(1,i+2))/(3*dx) + dzetadx_s(1,i)*(-3*W_s(1,i)+4*W_s(2,i)-W_s(3,i))/(2*dzeta)))^2 + ...
u_s(1,i)/W_s(1,i)*((-8*u_s(1,i)+9*u_s(1,i+1)-u_s(1,i+2))/(3*dx) + dzetadx_s(1,i)*(-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta)) * ...
((-8*W_s(1,i)+9*W_s(1,i+1)-W_s(1,i+2))/(3*dx)+dzetadx_s(1,i)*(-3*W_s(1,i)+4*W_s(2,i)-W_s(3,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(1,i)/W_s(1,i))^2;
visc_s(1,i) = 1/2*AGlen_s(1,i)^(-1/n)*(de2_s(1,i) + de0)^((1-n)/(2*n));
elseif i == Ms
de2_s(j,i) = ((u_s(j+1,i)-u_s(j-1,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((8*u_s(j,i)-9*u_s(j,i-1)+u_s(j,i-2))/(3*dx) + dzetadx_s(j,i)*(u_s(j+1,i)-u_s(j-1,i))/(2*dzeta))^2 + ...
(u_s(j,i)/W_s(j,i)*((8*W_s(j,i)-9*W_s(j,i-1)+W_s(j,i-2))/(3*dx) + dzetadx_s(j,i)*(W_s(j+1,i)-W_s(j-1,i))/(2*dzeta)))^2 + ...
u_s(j,i)/W_s(j,i)*((8*u_s(j,i)-9*u_s(j,i-1)+u_s(j,i-2))/(3*dx) + dzetadx_s(j,i)*(u_s(j+1,i)-u_s(j-1,i))/(2*dzeta)) * ...
((8*W_s(j,i)-9*W_s(j,i-1)+W_s(j,i-2))/(3*dx)+dzetadx_s(j,i)*(W_s(j+1,i)-W_s(j-1,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(j,i)/W_s(j,i))^2;
visc_s(j,i) = 1/2*AGlen_s(j,i)^(-1/n)*(de2_s(j,i) + de0)^((1-n)/(2*n));
de2_s(N,i) = ((3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((8*u_s(N,i)-9*u_s(N,i-1)+u_s(N,i-2))/(3*dx) + dzetadx_s(N,i)*(3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta))^2 + ...
(u_s(N,i)/W_s(N,i)*((8*W_s(N,i)-9*W_s(N,i-1)+W_s(N,i-2))/(3*dx) + dzetadx_s(N,i)*(3*W_s(N,i)-4*W_s(N-1,i)+W_s(N-2,i))/(2*dzeta)))^2 + ...
u_s(N,i)/W_s(N,i)*((8*u_s(N,i)-9*u_s(N,i-1)+u_s(N,i-2))/(3*dx) + dzetadx_s(N,i)*(3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta)) * ...
((8*W_s(N,i)-9*W_s(N,i-1)+W_s(N,i-2))/(3*dx)+dzetadx_s(N,i)*(3*W_s(N,i)-4*W_s(N-1,i)+W_s(N-2,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(N,i)/W_s(N,i))^2;
visc_s(N,i) = 1/2*AGlen_s(N,i)^(-1/n)*(de2_s(N,i) + de0)^((1-n)/(2*n));
de2_s(1,i) = ((-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((8*u_s(1,i)-9*u_s(1,i-1)+u_s(1,i-2))/(3*dx) + dzetadx_s(1,i)*(-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta))^2 + ...
(u_s(1,i)/W_s(1,i)*((8*W_s(1,i)-9*W_s(1,i-1)+W_s(1,i-2))/(3*dx) + dzetadx_s(1,i)*(-3*W_s(1,i)+4*W_s(2,i)-W_s(3,i))/(2*dzeta)))^2 + ...
u_s(1,i)/W_s(1,i)*((8*u_s(1,i)-9*u_s(1,i-1)+u_s(1,i-2))/(3*dx) + dzetadx_s(1,i)*(-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta)) * ...
((8*W_s(1,i)-9*W_s(1,i-1)+W_s(1,i-2))/(3*dx)+dzetadx_s(1,i)*(-3*W_s(1,i)+4*W_s(2,i)-W_s(3,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(1,i)/W_s(1,i))^2;
visc_s(1,i) = 1/2*AGlen_s(1,i)^(-1/n)*(de2_s(1,i) + de0)^((1-n)/(2*n));
elseif i == 2
de2_s(j,i) = ((u_s(j+1,i)-u_s(j-1,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((-4*u_s(j,i-1)+3*u_s(j,i)+u_s(j,i+1))/(3*dx) + dzetadx_s(j,i)*(u_s(j+1,i)-u_s(j-1,i))/(2*dzeta))^2 + ...
(u_s(j,i)/W_s(j,i)*((-4*W_s(j,i-1)+3*W_s(j,i)+W_s(j,i+1))/(3*dx) + dzetadx_s(j,i)*(W_s(j+1,i)-W_s(j-1,i))/(2*dzeta)))^2 + ...
u_s(j,i)/W_s(j,i)*((-4*u_s(j,i-1)+3*u_s(j,i)+u_s(j,i+1))/(3*dx) + dzetadx_s(j,i)*(u_s(j+1,i)-u_s(j-1,i))/(2*dzeta)) * ...
((-4*W_s(j,i-1)+3*W_s(j,i)+W_s(j,i+1))/(3*dx)+dzetadx_s(j,i)*(W_s(j+1,i)-W_s(j-1,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(j,i)/W_s(j,i))^2;
visc_s(j,i) = 1/2*AGlen_s(j,i)^(-1/n)*(de2_s(j,i) + de0)^((1-n)/(2*n));
de2_s(N,i) = ((3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((-4*u_s(N,i-1)+3*u_s(N,i)+u_s(N,i+1))/(3*dx) + dzetadx_s(N,i)*(3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta))^2 + ...
(u_s(N,i)/W_s(N,i)*((-4*W_s(N,i-1)+3*W_s(N,i)+W_s(N,i+1))/(3*dx) + dzetadx_s(N,i)*(3*W_s(N,i)-4*W_s(N-1,i)+W_s(N-2,i))/(2*dzeta)))^2 + ...
u_s(N,i)/W_s(N,i)*((-4*u_s(N,i-1)+3*u_s(N,i)+u_s(N,i+1))/(3*dx) + dzetadx_s(N,i)*(3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta)) * ...
((-4*W_s(N,i-1)+3*W_s(N,i)+W_s(N,i+1))/(3*dx)+dzetadx_s(N,i)*(3*W_s(N,i)-4*W_s(N-1,i)+W_s(N-2,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(N,i)/W_s(N,i))^2;
visc_s(N,i) = 1/2*AGlen_s(N,i)^(-1/n)*(de2_s(N,i) + de0)^((1-n)/(2*n));
de2_s(1,i) = ((-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((-4*u_s(1,i-1)+3*u_s(1,i)+u_s(1,i+1))/(3*dx) + dzetadx_s(1,i)*(-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta))^2 + ...
(u_s(1,i)/W_s(1,i)*((-4*W_s(1,i-1)+3*W_s(1,i)+W_s(1,i+1))/(3*dx) + dzetadx_s(1,i)*(-3*W_s(1,i)+4*W_s(2,i)-W_s(3,i))/(2*dzeta)))^2 + ...
u_s(1,i)/W_s(1,i)*((-4*u_s(1,i-1)+3*u_s(1,i)+u_s(1,i+1))/(3*dx) + dzetadx_s(1,i)*(-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta)) * ...
((-4*W_s(1,i-1)+3*W_s(1,i)+W_s(1,i+1))/(3*dx)+dzetadx_s(1,i)*(-3*W_s(1,i)+4*W_s(2,i)-W_s(3,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(1,i)/W_s(1,i))^2;
visc_s(1,i) = 1/2*AGlen_s(1,i)^(-1/n)*(de2_s(1,i) + de0)^((1-n)/(2*n));
elseif i == Ms-1
de2_s(j,i) = ((u_s(j+1,i)-u_s(j-1,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((-1*u_s(j,i-1)-3*u_s(j,i)+4*u_s(j,i+1))/(3*dx) + dzetadx_s(j,i)*(u_s(j+1,i)-u_s(j-1,i))/(2*dzeta))^2 + ...
(u_s(j,i)/W_s(j,i)*((-1*W_s(j,i-1)-3*W_s(j,i)+4*W_s(j,i+1))/(3*dx) + dzetadx_s(j,i)*(W_s(j+1,i)-W_s(j-1,i))/(2*dzeta)))^2 + ...
u_s(j,i)/W_s(j,i)*((-1*u_s(j,i-1)-3*u_s(j,i)+4*u_s(j,i+1))/(3*dx) + dzetadx_s(j,i)*(u_s(j+1,i)-u_s(j-1,i))/(2*dzeta)) * ...
((-1*W_s(j,i-1)-3*W_s(j,i)+4*W_s(j,i+1))/(3*dx)+dzetadx_s(j,i)*(W_s(j+1,i)-W_s(j-1,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(j,i)/W_s(j,i))^2;
visc_s(j,i) = 1/2*AGlen_s(j,i)^(-1/n)*(de2_s(j,i) + de0)^((1-n)/(2*n));
de2_s(N,i) = ((3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((-1*u_s(N,i-1)-3*u_s(N,i)+4*u_s(N,i+1))/(3*dx) + dzetadx_s(N,i)*(3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta))^2 + ...
(u_s(N,i)/W_s(N,i)*((-1*W_s(N,i-1)-3*W_s(N,i)+4*W_s(N,i+1))/(3*dx) + dzetadx_s(N,i)*(3*W_s(N,i)-4*W_s(N-1,i)+W_s(N-2,i))/(2*dzeta)))^2 + ...
u_s(N,i)/W_s(N,i)*((-1*u_s(N,i-1)-3*u_s(N,i)+4*u_s(N,i+1))/(3*dx) + dzetadx_s(N,i)*(3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta)) * ...
((-1*W_s(N,i-1)-3*W_s(N,i)+4*W_s(N,i+1))/(3*dx)+dzetadx_s(N,i)*(3*W_s(N,i)-4*W_s(N-1,i)+W_s(N-2,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(N,i)/W_s(N,i))^2;
visc_s(N,i) = 1/2*AGlen_s(N,i)^(-1/n)*(de2_s(N,i) + de0)^((1-n)/(2*n));
de2_s(1,i) = ((-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((-1*u_s(1,i-1)-3*u_s(1,i)+4*u_s(1,i+1))/(3*dx) + dzetadx_s(1,i)*(-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta))^2 + ...
(u_s(1,i)/W_s(1,i)*((-1*W_s(1,i-1)-3*W_s(1,i)+4*W_s(1,i+1))/(3*dx) + dzetadx_s(1,i)*(-3*W_s(1,i)+4*W_s(2,i)-W_s(3,i))/(2*dzeta)))^2 + ...
u_s(1,i)/W_s(1,i)*((-1*u_s(1,i-1)-3*u_s(1,i)+4*u_s(1,i+1))/(3*dx) + dzetadx_s(1,i)*(-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta)) * ...
((-1*W_s(1,i-1)-3*W_s(1,i)+4*W_s(1,i+1))/(3*dx)+dzetadx_s(1,i)*(-3*W_s(1,i)+4*W_s(2,i)-W_s(3,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(1,i)/W_s(1,i))^2;
visc_s(1,i) = 1/2*AGlen_s(1,i)^(-1/n)*(de2_s(1,i) + de0)^((1-n)/(2*n));
else
de2_s(j,i) = ((u_s(j+1,i)-u_s(j-1,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((u(j,i)-u(j,i-1))/(dx) + dzetadx_s(j,i)*(u_s(j+1,i)-u_s(j-1,i))/(2*dzeta))^2 + ...
(u_s(j,i)/W_s(j,i)*((W(j,i)-W(j,i-1))/(dx)+dzetadx_s(j,i)*(W_s(j+1,i)-W_s(j-1,i))/(2*dzeta)))^2 + ...
u_s(j,i)/W_s(j,i)*((u(j,i)-u(j,i-1))/(dx) + dzetadx_s(j,i)*(u_s(j+1,i)-u_s(j-1,i))/(2*dzeta))*...
((W(j,i)-W(j,i-1))/(dx)+dzetadx_s(j,i)*(W_s(j+1,i)-W_s(j-1,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(j,i)/W_s(j,i))^2;
visc_s(j,i) = 1/2*AGlen_s(j,i)^(-1/n)*(de2_s(j,i) + de0)^((1-n)/(2*n));
de2_s(N,i) = ((3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((u(N,i)-u(N,i-1))/(dx) + dzetadx_s(N,i)*(3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta))^2 + ...
(u_s(N,i)/W_s(N,i)*((W(N,i)-W(N,i-1))/(dx)+dzetadx_s(N,i)*(3*W_s(N,i)-4*W_s(N-1,i)+W_s(N-2,i))/(2*dzeta)))^2 + ...
u_s(N,i)/W_s(N,i)*((u(N,i)-u(N,i-1))/(dx) + dzetadx_s(N,i)*(3*u_s(N,i)-4*u_s(N-1,i)+u_s(N-2,i))/(2*dzeta))*...
((W(N,i)-W(N,i-1))/(dx)+dzetadx_s(N,i)*(3*W_s(N,i)-4*W_s(N-1,i)+W_s(N-2,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(N,i)/W_s(N,i))^2;
visc_s(N,i) = 1/2*AGlen_s(N,i)^(-1/n)*(de2_s(N,i) + de0)^((1-n)/(2*n));
de2_s(1,i) = ((-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta))^2/(4*H_s(i)^2) + ...
((u(1,i)-u(1,i-1))/(dx) + dzetadx_s(1,i)*(-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta))^2 + ...
(u_s(1,i)/W_s(1,i)*((W(1,i)-W(1,i-1))/(dx)+dzetadx_s(1,i)*(-3*W_s(1,i)+4*W_s(2,i)-W_s(3,i))/(2*dzeta)))^2 + ...
u_s(1,i)/W_s(1,i)*((u(1,i)-u(1,i-1))/(dx) + dzetadx_s(1,i)*(-3*u_s(1,i)+4*u_s(2,i)-u_s(3,i))/(2*dzeta))*...
((W(1,i)-W(1,i-1))/(dx)+dzetadx_s(1,i)*(-3*W_s(1,i)+4*W_s(2,i)-W_s(3,i))/(2*dzeta)) + ...
isFlowband/4*(u_s(1,i)/W_s(1,i))^2;
visc_s(1,i) = 1/2*AGlen_s(1,i)^(-1/n)*(de2_s(1,i) + de0)^((1-n)/(2*n));
end
end
end
visc = staggerX2main(visc_s);
strain_heat_s = 4*visc_s.*de2_s;
strain_heat = staggerX2main(strain_heat_s);
end