Skip to content

Commit 4eff82b

Browse files
committed
radial test cases done, debugging the bubble thermal cases for FD
1 parent 1abd85c commit 4eff82b

File tree

10 files changed

+34
-24
lines changed

10 files changed

+34
-24
lines changed

src/default_case.m

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,30 @@
33
bubtherm = 0; % 0 : polytropic assumption, 1: thermal PDE in bubble
44
medtherm = 0; % 0 : cold fluid, 1: warm fluid assumption
55
stress = 0; % 1 : NHKV, qKV, 2: linear Maxwell, Jeffreys, Zener, 3: UCM or OldB, 4: PTT, 5: Giesekus
6-
eps3 = -1; % this value must be (0, 0.5]
6+
eps3 = 0; % this value must be (0, 0.5]
77
vapor = 0; % 0 : ignore vapor pressure, 1 : vapor pressure
88
masstrans = 0; % mass transfer, default is no mass transfer
99

1010
% solver options
11-
TFin = 100e-6; % final time (s)
11+
TFin = 20e-6; % final time (s)
1212
TVector = [0 TFin];
1313
method = 45; % ode45 setting for the time stepper
1414
spectral = 0; % force spectral collocation solution
1515
divisions = 0; % minimum number of timesteps
16-
Nt = 12; % number of points in bubble, thermal PDE
17-
Mt = 12; % number of points outside of bubble, thermal PDE
16+
Nt = 10; % number of points in bubble, thermal PDE
17+
Mt = 10; % number of points outside of bubble, thermal PDE
1818
Nv = 150; % number of points outside of bubble, viscoelastic stress PDE
1919
Lv = 3; % characteristic length for grid stretching, leave at 3
2020
Lt = 3; % characteristic length for grid stretching, leave at 3
2121

2222
% initial conditions
23-
R0 = 2.447495043190468e-04; % initial bubble radius
23+
R0 = 100E-6; % initial bubble radius
2424
U0 = 0; % initial velocity (m/s)
25-
Req = 3.008409399929516e-05;%27E-6; % Equilibrium radius for pre-stress bubble, see Estrada JMPS 2017
25+
Req = 50E-6; % Equilibrium radius for pre-stress bubble, see Estrada JMPS 2017
2626

2727
% output options
2828
dimensionalout = 0; % output result in dimensional variables
2929
progdisplay = 0; % display progress while code running
30-
plotresult = 0; % generate figure containing results
3130

3231
% acoustic options
3332
rho8 = 1064;%997; % far-field density (kg/m^3)

src/f_call_params.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@
151151
C8 = sqrt(nstate*(P8 + GAM)/rho8);
152152
end
153153

154+
if ~medtherm && Mt >= 0
155+
Mt = -1;
156+
disp('RESETTING Mt = -1 for medtherm == 0');
157+
end
154158
check = 1-isnumeric(radial);
155159
if check || radial > 4 || radial <= 0
156160
error('INPUT ERROR: radial must be 1, 2, 3, or 4');

src/f_display.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
mass = 'no mass transfer in the bubble';
2929
end
3030

31-
if stress == 1
31+
32+
if stress == 0
33+
const = 'no stress applied';
34+
elseif stress == 1
3235
if Ca == Inf
3336
const = 'Newtonian fluid';
3437
else

src/m_imrv2_finitediff.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
p = X(:,3);
133133
if bubtherm
134134
Tau = X(:,4:(Nt+3));
135-
T = (A_star -1 + sqrt(1+2*Tau*A_star)) / A_star; % Temp in bubble
135+
T = (alpha -1 + sqrt(1+2*Tau*alpha)) / alpha; % Temp in bubble
136136
if medtherm
137137
Tm = X(:,(Nt+4):(2*Nt+3));
138138
end
@@ -203,7 +203,7 @@
203203
Tau(end) = prelim;
204204
T = TW(Tau);
205205

206-
K_star = A_star*T+B_star;
206+
K_star = alpha*T+beta;
207207
pVap = (f_pvsat(T(1)*T8)/P8);
208208
else
209209
pVap = p0star;
@@ -238,9 +238,9 @@
238238
/( T(end)*R*Rmix(end)*(1-C(end)) ) );
239239

240240
% temperature inside the bubble
241-
U_vel = (chi/R*(kappa-1)*DTau-yk*R*pdot/3)/(kappa*p);
241+
U_vel = (chi/R*(kappa-1)*DTau-y*R*pdot/3)/(kappa*p);
242242
first_term = (DDTau*chi/R^2+pdot)*( K_star*T/p*kapover);
243-
second_term = -DTau*((1/R)*(U_vel-yk*U));
243+
second_term = -DTau*((1/R)*(U_vel-y*U));
244244

245245
Taudot= first_term+second_term;
246246
Taudot(end) = 0;
@@ -262,16 +262,16 @@
262262
% internal pressure equation
263263
pdot = 3/R*(chi*(kappa-1)*DTau(end)/R-kappa*p*U);
264264
% temperature inside the bubble
265-
U_vel = (chi/R*(kappa-1).*DTau-yk*R*pdot/3)/(kappa*p);
265+
U_vel = (chi/R*(kappa-1).*DTau-y*R*pdot/3)/(kappa*p);
266266
first_term = (DDTau.*chi./R^2+pdot).*( K_star.*T/p*kapover );
267-
second_term = -DTau.*(1/(R).*(U_vel-yk*U));
267+
second_term = -DTau.*(1/(R).*(U_vel-y*U));
268268

269269
Taudot= first_term+second_term;
270270
Taudot(end) = 0;
271271

272272
else
273273
% polytropic gas
274-
p = p0star*(1/R)^(3*kappa);
274+
p = (p0star-Pv_star)*R^(-3*kappa);
275275
pdot= -3*kappa*U/R*p;
276276
pVap = Pv_star;
277277
end
@@ -338,7 +338,7 @@
338338

339339
function Tw= TW(Tauw)
340340
%calculates the temperature at the bubble wall as a fuction of \tau
341-
Tw = (A_star -1 + sqrt(1+2*Tauw*A_star)) / A_star;
341+
Tw = (alpha -1 + sqrt(1+2*Tauw*alpha)) / alpha;
342342
end
343343

344344
function Cw= CW(Tw,P)

toolchain/f_generate_test.m

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
clc; clear all; close all;
22

33
addpath('../src');
4-
addpath('../src/spectral/');
5-
addpath('toolchain/');
64
addpath('../unit_tests/');
75
load('file_ids.mat');
86

@@ -13,26 +11,32 @@
1311
for id = testb:teste
1412
filename = strcat('../unit_tests/',ids{id},'.dat');
1513
[ts,Rs,Us] = m_imrv2_spectral('radial',id);
16-
[tf,Rf,Uf] = m_imrv2_spectral('radial',id);
14+
[tf,Rf,Uf] = m_imrv2_finitediff('radial',id);
1715
display(filename)
1816
if (norm(Rs-Rf,2) < 1E-15)
19-
disp('success')
17+
disp('----> SUCCESS! <------')
2018
save(filename,"ts","Rs","Us")
2119
else
2220
disp('error radial not working')
2321
end
2422
end
25-
%%
23+
2624
testb = testb + 1;
2725
teste = teste + 1;
2826
% bubtherm tests
2927
for id = testb:teste
3028
filename = strcat('../unit_tests/',ids{id},'.dat');
31-
[t,R,U] = m_imrv2_spectral('bubtherm',1);
29+
[ts,Rs,Us] = m_imrv2_spectral('bubtherm',1);
30+
[t,R,U] = m_imrv2_finitediff('bubtherm',1);
3231
display(filename)
33-
save(filename,"t","R","U")
32+
if (norm(Rs-Rf,2) < 1E-15)
33+
disp('----> SUCCESS! <------')
34+
save(filename,"ts","Rs","Us")
35+
else
36+
disp('error radial not working')
37+
end
3438
end
35-
39+
%%
3640
testb = testb + 1;
3741
teste = teste + 1;
3842
% medtherm tests

unit_tests/E2hDNpN.dat

-105 KB
Binary file not shown.

unit_tests/N7g6bFO.dat

143 KB
Binary file not shown.

unit_tests/Y7GT9pZ.dat

-106 KB
Binary file not shown.

unit_tests/eLkviKx.dat

-79.6 KB
Binary file not shown.

unit_tests/oHG2T88.dat

-106 KB
Binary file not shown.

0 commit comments

Comments
 (0)