Skip to content

Commit f006f08

Browse files
committed
debugged, in part, the bubtherm, need the Rayleigh solution to work
1 parent 4eff82b commit f006f08

File tree

11 files changed

+24
-31
lines changed

11 files changed

+24
-31
lines changed

src/f_call_params.m

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
% remaining parameters
3434

3535
% viscosity variables
36-
[mu8,Dmu,v_a,v_nc,v_lambda] = f_nonNewtonian_Re(vmaterial); % non-Newtonian viscosity
36+
[mu8,Dmu,v_a,v_nc,v_lambda] = ...
37+
f_nonNewtonian_Re(vmaterial);
3738

3839
% pressure variables
3940
Pv = f_pvsat(T8);
@@ -61,7 +62,6 @@
6162
case 'eps3', eps3 = varargin{n+1};
6263
case 'vapor', vapor = varargin{n+1};
6364
case 'masstrans', masstrans = varargin{n+1};
64-
case 'perturbed', perturbed = varargin{n+1};
6565

6666
% solver options
6767
case 'method', method = varargin{n+1};
@@ -81,14 +81,10 @@
8181
case 'u0', U0 = varargin{n+1};
8282
case 'req', Req = varargin{n+1};
8383
P0 = (P8 + 2*S/Req - Pv*vapor)*((Req/R0)^(3));
84-
case 'a0', a0 = varargin{n+1};
85-
case 'adot0', adot0 = varargin{n+1};
86-
case 's0', S0 = varargin{n+1};
8784

8885
% output options
8986
case 'dimout', dimensionalout = varargin{n+1};
9087
case 'pdisp', progdisplay = varargin{n+1};
91-
case 'plot', plotresult = varargin{n+1};
9288

9389
% acoustic options
9490
case 'rho8', rho8 = varargin{n+1};
@@ -111,7 +107,7 @@
111107
case 'g', G = varargin{n+1};
112108
case 'lambda1', lambda1 = varargin{n+1};
113109
case 'lambda2', lambda2 = varargin{n+1};
114-
case 'alphax', alphax = varargin{n+1};
110+
case 'alphax', alphax = varargin{n+1};
115111
case 'surft', S = varargin{n+1};
116112
P0 = (P8 + 2*S/Req - Pv*vapor)*((Req/R0)^(3));
117113
case 'vmaterial', vmaterial = varargin{n+1};
@@ -151,10 +147,6 @@
151147
C8 = sqrt(nstate*(P8 + GAM)/rho8);
152148
end
153149

154-
if ~medtherm && Mt >= 0
155-
Mt = -1;
156-
disp('RESETTING Mt = -1 for medtherm == 0');
157-
end
158150
check = 1-isnumeric(radial);
159151
if check || radial > 4 || radial <= 0
160152
error('INPUT ERROR: radial must be 1, 2, 3, or 4');
@@ -366,7 +358,7 @@
366358
% solver options
367359
solve_opts = [method spectral divisions Nv Nt Mt Lv Lt];
368360
% dimensionless initial conditions
369-
init_opts = [Rzero Uzero pzero P8 T8 Pv_star Req_zero S0 alphax];
361+
init_opts = [Rzero Uzero pzero P8 T8 Pv_star Req_zero alphax];
370362
% time span options
371363
tspan_opts = tvector;
372364
% output options

src/f_odesolve.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
if divisions == 0
1212
options = odeset();
1313
else
14-
options = odeset('MaxStep',tfin/divisions,'RelTol',1e-8,'AbsTol',1e-8);
14+
options = odeset('MaxStep',tfin/divisions);%'RelTol',1e-8,'AbsTol',1e-8);
1515
end
1616
[t,X] = ode23tb(bubble,tspan,init,options);
1717
elseif method == 45
1818
if divisions == 0
1919
options = odeset('NonNegative',1,'AbsTol',1e-8,'RelTol',1e-8);
2020
else
21-
options = odeset('NonNegative',1,'MaxStep',tfin/divisions,'RelTol',1e-8);
21+
options = odeset('NonNegative',1,'MaxStep',tfin/divisions);%'RelTol',1e-8);
2222
end
2323
[t,X] = ode45(bubble,tspan,init,options);
2424
else

src/m_imrv2_finitediff.m

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
Rzero = init_opts(1); Uzero = init_opts(2);
2929
p0star = init_opts(3); P8 = init_opts(4);
3030
T8 = init_opts(5); Pv_star = init_opts(6);
31-
Req = init_opts(7); S0 = init_opts(8);
32-
alphax = init_opts(9);
31+
Req = init_opts(7); alphax = init_opts(8);
3332

3433
% time span options
3534
tspan = tspan_opts;
@@ -104,9 +103,12 @@
104103
T = zeros(-1,1);
105104
if bubtherm
106105
Tau0 = zeros(Nt,1);
107-
Tm0 = ones(Mt ~= -1);
108106
else
109107
Tau0 = zeros(-1,1);
108+
end
109+
if medtherm
110+
Tm0 = ones(Mt ~= -1);
111+
else
110112
Tm0 = zeros(-1,1);
111113
end
112114
if masstrans
@@ -239,8 +241,8 @@
239241

240242
% temperature inside the bubble
241243
U_vel = (chi/R*(kappa-1)*DTau-y*R*pdot/3)/(kappa*p);
242-
first_term = (DDTau*chi/R^2+pdot)*( K_star*T/p*kapover);
243-
second_term = -DTau*((1/R)*(U_vel-y*U));
244+
first_term = (DDTau*chi./R^2+pdot)*(K_star*T./p*kapover);
245+
second_term = -DTau.*((1./R).*(U_vel-y.*U));
244246

245247
Taudot= first_term+second_term;
246248
Taudot(end) = 0;
@@ -262,9 +264,9 @@
262264
% internal pressure equation
263265
pdot = 3/R*(chi*(kappa-1)*DTau(end)/R-kappa*p*U);
264266
% temperature inside the bubble
265-
U_vel = (chi/R*(kappa-1).*DTau-y*R*pdot/3)/(kappa*p);
266-
first_term = (DDTau.*chi./R^2+pdot).*( K_star.*T/p*kapover );
267-
second_term = -DTau.*(1/(R).*(U_vel-y*U));
267+
U_vel = (chi/R*(kappa-1)*DTau-y*R*pdot/3)/(kappa*p);
268+
first_term = (DDTau.*chi./R^2+pdot).*(K_star.*T./p*kapover);
269+
second_term = -DTau.*((1/R).*(U_vel-y*U));
268270

269271
Taudot= first_term+second_term;
270272
Taudot(end) = 0;

src/m_imrv2_spectral.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
Rzero = init_opts(1); Uzero = init_opts(2);
2929
p0star = init_opts(3); P8 = init_opts(4);
3030
T8 = init_opts(5); Pv_star = init_opts(6);
31-
Req = init_opts(7); S0 = init_opts(8);
32-
alphax = init_opts(9);
31+
Req = init_opts(7); alphax = init_opts(8);
3332

3433
% time span options
3534
tspan = tspan_opts;

toolchain/f_generate_test.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@
2121
end
2222
end
2323

24-
testb = testb + 1;
25-
teste = teste + 1;
2624
% bubtherm tests
27-
for id = testb:teste
28-
filename = strcat('../unit_tests/',ids{id},'.dat');
29-
[ts,Rs,Us] = m_imrv2_spectral('bubtherm',1);
30-
[t,R,U] = m_imrv2_finitediff('bubtherm',1);
25+
tvector = linspace(0,20E-6,100);
26+
for id = testb+3
27+
filename = strcat('../unit_tests/',ids{id+4},'.dat');
28+
[ts,Rs,Us] = m_imrv2_spectral('radial',id,'bubtherm',1,'tvector',tvector);
29+
[tf,Rf,Uf] = m_imrv2_finitediff('radial',id,'bubtherm',1,'Nt',140,'tvector',tvector);
3130
display(filename)
32-
if (norm(Rs-Rf,2) < 1E-15)
31+
if (norm(Rs-Rf,2) < 1E-2)
3332
disp('----> SUCCESS! <------')
3433
save(filename,"ts","Rs","Us")
3534
else
3635
disp('error radial not working')
3736
end
37+
plot(tf,Rf,'--r'); hold on; plot(ts,Rs,'ks');
3838
end
3939
%%
4040
testb = testb + 1;

unit_tests/E2hDNpN.dat

0 Bytes
Binary file not shown.

unit_tests/Y7GT9pZ.dat

0 Bytes
Binary file not shown.

unit_tests/eLkviKx.dat

0 Bytes
Binary file not shown.

unit_tests/oHG2T88.dat

0 Bytes
Binary file not shown.

unit_tests/rk1VwLg.dat

-11.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)