Skip to content

Commit 94b3188

Browse files
committed
additional clean up and added Carreau-Yasuda model integration
1 parent 9c66426 commit 94b3188

File tree

5 files changed

+40
-9
lines changed

5 files changed

+40
-9
lines changed
File renamed without changes.
File renamed without changes.

sample_run.m

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/forward_solver/f_viscosity.m

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,27 @@
4343
% carreau_yasuda
4444
elseif nu_model == 2
4545
f = sf_carreau_yasuda(nc,lambda,gammadot_R);
46+
% calculating the Leibniz integration rule limit, see Appendix
47+
% of the manuscript
48+
h = f*gammadot_R*(Rdot/R);
49+
% calculating the stress integral for a non-Newtonian model,
50+
% goes directly into the E term in the Keller-Miksis equation
51+
I1 = integral(@(r) sf_carreau_yasuda_d(r,a,nc,lambda,gammadot_num),...
52+
R,Inf,'RelTol',reltol,'AbsTol',abstol);
53+
% calculating the time derivative of the stress integral for
54+
% a non-Newtonian model, this integral has to two coefficients.
55+
% one of the terms is in the E_primber term in m_cavitation,
56+
% the other goes in the denominator of the Rdot_dot solution to
57+
% account for the Rddot term
58+
I2 = integral(@(r) sf_carreau_yasuda_dd(r,a,nc,lambda,gammadot_num),R,Inf,...
59+
'RelTol',reltol,'AbsTol',abstol);
60+
intf = gammadot_num*I1;
61+
% note the additional h term is to account for the Leibniz
62+
% integration rule correction
63+
dintf = dgammadot*I2 - h;
64+
% second term that is used for the denominator of the Rdot_dot
65+
% calculation
66+
ddintf = ddgammadot*I2;
4667
% powell_eyring
4768
elseif nu_model == 3
4869
f = sf_powell_eyring(nc,lambda,gammadot_R);
@@ -88,6 +109,25 @@
88109
f = (1+(lambda).^a.*(gammadot_R).^a).^((nc-1)./a);
89110
end
90111

112+
function intf = sf_carreau_yasuda_d(r,a,nc,lambda,gammadot_num)
113+
gammadot = gammadot_num./r.^3;
114+
% additional r in the denominator is from the stress integral
115+
intf = (gammadot./r).*(1+(lambda).^a.*(gammadot).^a).^((nc-1)./a);
116+
end
117+
118+
function dintf = sf_carreau_yasuda_dd(r,a,nc,lambda,gammadot_num)
119+
% numerator is multiplied later
120+
gammadot = gammadot_num./r.^3;
121+
% term inside the power, reduces computation
122+
pre_f = (1+(lambda).^a.*(gammadot).^a);
123+
% regular f calculation
124+
f = pre_f.^((nc-1)./a);
125+
% derivative of f with respect to gammadot only
126+
dfdgamma = ((nc-1)./a)*pre_f.^((nc-3)./a)*a*lambda^a.*gammadot;
127+
% collecting terms for integration
128+
dintf = (1./r.^4).*(f+gammadot.*dfdgamma);
129+
end
130+
91131
function f = sf_cross(a,lambda,gammadot_R)
92132
f = 1/(1+(lambda*gammadot_R).^a);
93133
end

0 commit comments

Comments
 (0)