-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettling_velocity_fixM_Natalie_Mass_Weight.m
204 lines (172 loc) · 7.67 KB
/
settling_velocity_fixM_Natalie_Mass_Weight.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
clear;
clc;
nu = 1.5* 10^(-5);mu = 1.8* 10^(-5);eulerc = 0.5772156649;dissip = 0.0001;
rho = 1000.0;g = 9.8;
geodata1=load('/Users/shuolinxiao/Downloads/PostDoc/Cornell_Qi/projects/MPF/code/Beaver_Mountain_Fiber.dat');
geodata2=load('/Users/shuolinxiao/Downloads/PostDoc/Cornell_Qi/projects/MPF/code/CO98_Fiber.dat');
geodata3=load('/Users/shuolinxiao/Downloads/PostDoc/Cornell_Qi/projects/MPF/code/UT95_Fiber.dat');
geodata4=[geodata1;geodata2;geodata3];
% geodata4=load('/Users/shuolinxiao/Downloads/PostDoc/Cornell_Qi/projects/MPF/code/sample.dat');
geodata1=10^(-6)*geodata1;
geodata2=10^(-6)*geodata2;
geodata3=10^(-6)*geodata3;
geodata4=10^(-6)*geodata4;
width=geodata4(:,2);height = 0.2* 10^(-5);
radius=(0.25*width.^2+height^2)/(2.0*height);
De = sqrt(asin(0.5*width./radius)*4.0.*radius.^2/pi-2.0*width.*(radius-height)/pi);
betafl = geodata4(:,1)./De;
betacy = geodata4(:,1)./width;
Dfl = De;
Dcy = width;
Dim = size(width);
syms x
f = exp(-x)/x;
Rel = 0.0*width;Relf = 0.0*width;
wslRe = 0.0*width;wslRemin = 0.0*width;
wslRecfl = 0.0*width;wslReccy = 0.0*width;
Fv = 0.0*width;Fh = 0.0*width;Mv = 0.0*width;Mh = 0.0*width;
Fic = 0.0*width;
SF = 0.0*width;costheta = 0.0*width+0.5;theta = 0.0*width;thetaf = 0.0*width;
i=1;
while (i<=Dim(:,1))
Rel(i) = betafl(i)*(log(2.0*betafl(i))+log(4)-0.5)*Dfl(i)^3*rho*g/(32*mu*nu);
Relf(i) = 0.0;
while (abs(Rel(i)-Relf(i))/Rel(i)>0.01)
Relf(i) = Rel(i);
Fv(i) = int(f,x,Rel(i),inf) + log(Rel(i))-(exp(-Rel(i))-1)/Rel(i) + eulerc -0.5 -log(4);
Fh(i) = 0.5*((int(f,x,2*Rel(i),inf)+log(2*Rel(i))-exp(-2*Rel(i))+eulerc+1)/(2.0*Rel(i))+int(f,x,2*Rel(i),inf)+log(Rel(i))+eulerc-3*log(2)+1);
Mv(i) = log(2.0*betafl(i))-Fv(i);
Mh(i) = 2.0*log(2.0*betafl(i))-2.0*Fh(i);
wslRemin(i) = rho*g*Dfl(i)^2/(16*mu)*Mv(i); %incomning flow velocity as U in COX
Rel(i) = wslRemin(i)*betafl(i)*Dfl(i)/(2.0*nu);
end
i=i+1;
end
i=1;
while (i<=Dim(:,1))
theta(i) = pi/4.0;
Fic(i)=-12.0*sin(2.0*theta(i))/(5.0*Rel(i)^2)*(0.5/(1-cos(theta(i)))*(2+(2.0*exp(-Rel(i)*(1-cos(theta(i))))-2)/((1-cos(theta(i)))*Rel(i))-int(f,x,Rel(i)*(1-cos(theta(i))),inf)-log((Rel(i)*(1-cos(theta(i)))))-eulerc)+0.5/(1+cos(theta(i)))*(2+(2.0*exp(-Rel(i)*(1+cos(theta(i))))-2)/((1+cos(theta(i)))*Rel(i))-int(f,x,Rel(i)*(1+cos(theta(i))),inf)-log((Rel(i)*(1+cos(theta(i)))))-eulerc)-1.0/cos(theta(i))/(1-cos(theta(i)))*(1-(1-exp(-Rel(i)*(1-cos(theta(i)))))/(Rel(i)*(1-cos(theta(i)))))+1.0/cos(theta(i))/(1+cos(theta(i)))*(1-(1-exp(-Rel(i)*(1+cos(theta(i)))))/(Rel(i)*(1+cos(theta(i))))));
if betafl(i)*Dfl(i)<=(nu^3/dissip)^0.25
SF(i) = 5.0*wslRemin(i)^2*Fic(i)/(8.0*nu^0.5*dissip^0.5*log(2.0*betafl(i)));
else
SF(i) = 5.0*wslRemin(i)^2*(betafl(i)*Dfl(i))^(2.0/3.0)*Fic(i)/(8.0*nu*dissip^(1.0/3.0)*log(2.0*betafl(i)));
end
if SF(i)<=0.1
costheta(i) = 1.0/3.0;
elseif SF(i)>=5.0
costheta(i) = 2.0/(15.0*SF(i)^2);
else
costheta(i) = 0.0753*SF(i)^(-0.6692)-0.0188;
end
wslRecfl(i) = rho*g*Dfl(i)^2/(16*mu)*(Mv(i)+costheta(i)*(Mh(i)-Mv(i)));
if (wslRecfl(i)<=0.0)
wslRecfl(i) = 0.0;
end
i=i+1;
end
i=1;
while (i<=Dim(:,1))
Rel(i) = betacy(i)*(log(2.0*betacy(i))+log(4)-0.5)*Dcy(i)^3*rho*g/(32*mu*nu);
Relf(i) = 0.0;
while (abs(Rel(i)-Relf(i))/Rel(i)>0.01)
Relf(i) = Rel(i);
Fv(i) = int(f,x,Rel(i),inf) + log(Rel(i))-(exp(-Rel(i))-1)/Rel(i) + eulerc -0.5 -log(4);
Fh(i) = 0.5*((int(f,x,2*Rel(i),inf)+log(2*Rel(i))-exp(-2*Rel(i))+eulerc+1)/(2.0*Rel(i))+int(f,x,2*Rel(i),inf)+log(Rel(i))+eulerc-3*log(2)+1);
Mv(i) = log(2.0*betacy(i))-Fv(i);
Mh(i) = 2.0*log(2.0*betacy(i))-2.0*Fh(i);
wslRemin(i) = rho*g*Dcy(i)^2/(16*mu)*Mv(i); %incomning flow velocity as U in COX
Rel(i) = wslRemin(i)*betacy(i)*Dcy(i)/(2.0*nu);
end
i=i+1;
end
i=1;
while (i<=Dim(:,1))
theta(i) = pi/4.0;
Fic(i)=-12.0*sin(2.0*theta(i))/(5.0*Rel(i)^2)*(0.5/(1-cos(theta(i)))*(2+(2.0*exp(-Rel(i)*(1-cos(theta(i))))-2)/((1-cos(theta(i)))*Rel(i))-int(f,x,Rel(i)*(1-cos(theta(i))),inf)-log((Rel(i)*(1-cos(theta(i)))))-eulerc)+0.5/(1+cos(theta(i)))*(2+(2.0*exp(-Rel(i)*(1+cos(theta(i))))-2)/((1+cos(theta(i)))*Rel(i))-int(f,x,Rel(i)*(1+cos(theta(i))),inf)-log((Rel(i)*(1+cos(theta(i)))))-eulerc)-1.0/cos(theta(i))/(1-cos(theta(i)))*(1-(1-exp(-Rel(i)*(1-cos(theta(i)))))/(Rel(i)*(1-cos(theta(i)))))+1.0/cos(theta(i))/(1+cos(theta(i)))*(1-(1-exp(-Rel(i)*(1+cos(theta(i)))))/(Rel(i)*(1+cos(theta(i))))));
if betacy(i)*Dcy(i)<=(nu^3/dissip)^0.25
SF(i) = 5.0*wslRemin(i)^2*Fic(i)/(8.0*nu^0.5*dissip^0.5*log(2.0*betacy(i)));
else
SF(i) = 5.0*wslRemin(i)^2*(betacy(i)*Dcy(i))^(2.0/3.0)*Fic(i)/(8.0*nu*dissip^(1.0/3.0)*log(2.0*betacy(i)));
end
if SF(i)<=0.1
costheta(i) = 1.0/3.0;
elseif SF(i)>=5.0
costheta(i) = 2.0/(15.0*SF(i)^2);
else
costheta(i) = 0.0753*SF(i)^(-0.6692)-0.0188;
end
wslReccy(i) = rho*g*Dcy(i)^2/(16*mu)*(Mv(i)+costheta(i)*(Mh(i)-Mv(i)));
if (wslReccy(i)<=0.0)
wslReccy(i) = 0.0;
end
i=i+1;
end
Dzenderfl=sqrt(wslRecfl*18*nu/rho/g)*10^6;
Dzendercy=sqrt(wslReccy*18*nu/rho/g)*10^6;
Dzender=[Dzenderfl';Dzendercy']';
% edges = [0 0.3:2.5:7:15:35:70 175];
edges = [0 0.3 2.5 7 15 35 70];
figure (1)
hfl=histogram(Dzenderfl,edges,'FaceColor','g');
ylim([0 1000])
set(gca,'FontSize',24);
title(' Histogram of Fiber Equivalent Spherical Diameter','fontsize',18)
xlabel('${D_e (\mu m)}$','fontsize',36,'Interpreter','latex')
ylabel('count','fontsize',36,'Interpreter','latex')
legend({'flat fiber'},'Location','northeast','fontsize',18)
figure (2)
hcy=histogram(Dzendercy,edges);
ylim([0 1000])
set(gca,'FontSize',24);
title(' Histogram of Fiber Equivalent Spherical Diameter','fontsize',18)
xlabel('${D_e (\mu m)}$','fontsize',36,'Interpreter','latex')
ylabel('count','fontsize',36,'Interpreter','latex')
legend('off')
legend({'cylindrical fiber'},'Location','northeast','fontsize',18)
% hist(Dzender,edges);
% h1 = histfit(wslRecfl*100,10,'kernel');
% delete(h1(1))
% set(h1(2),'color','m')
% set(h1(2),'LineStyle','--')
% hold on
% h2 = histfit(wslReccy*100,100,'kernel');
% delete(h2(1))
% set(h2(2),'color','r')
% xlim([0 15])
% set(gca,'FontSize',24);
% title(' PDF of Fiber Settling Velocity','fontsize',18)
% xlabel('${w_s (cm/s)}$','fontsize',36,'Interpreter','latex')
% ylabel('$PDF$','fontsize',36,'Interpreter','latex')
% legend({'flat fiber','cylindrical fiber'},'Location','northeast','fontsize',18)
% figure(1)
% h1 = histfit(wslRecfl*100,10,'kernel');
% delete(h1(1))
% set(h1(2),'color','m')
% set(h1(2),'LineStyle','--')
% xlim([0 1.5])
% set(gca,'FontSize',24);
% title(' Curved Histograms of Flat Fiber Settling Velocity','fontsize',18)
% xlabel('${w_s (cm/s)}$','fontsize',36,'Interpreter','latex')
% ylabel('$count$','fontsize',36,'Interpreter','latex')
%
% figure(2)
% h2 = histfit(wslReccy*100,10,'kernel');
% delete(h2(1))
% set(h2(2),'color','r')
% hold on
%
% xlim([0 15])
% set(gca,'FontSize',24);
% title(' Curved Histograms of Cylindrical Fiber Settling Velocity','fontsize',18)
% xlabel('${w_s (cm/s)}$','fontsize',36,'Interpreter','latex')
% ylabel('$count$','fontsize',36,'Interpreter','latex')
% plot(D,wslRe,'--green','linewidth',3)
% hold on
% scatter(Resultfl(:,1)*10^6,Resultfl(:,2),'o','LineWidth',14)
% hold on
% scatter(Resultcy(:,1)*10^6,Resultcy(:,2),'+','LineWidth',14)
% set(gca,'FontSize',24);
% title(' Fiber Settling Velocity','fontsize',18)
% xlabel('${w (\mu m)}$','fontsize',36,'Interpreter','latex')
% ylabel('${w_s (m/s)}$','fontsize',36,'Interpreter','latex')
% legend({'high dissipation rate','low dissipation rate'},'Location','northwest','fontsize',18)