src/test/collapse.c
Rayleigh collapse of a compressible gas bubble
A gas bubble at lower pressure collapses in a viscous fluid in the absence of surface tension forces.
The fluids are either viscous or inviscid and we compare the evolution of the radius with the Rayleigh-Plesset and Keller-Miksis models.
See also section 4.2.4 of Fuster & Popinet, 2018.
Results for an inviscid fluid
set xlabel 't/tR'
set ylabel 'R/R_0'
set key bottom
pg0 = 100.
pinf = 5.*pg0
tR = 0.915*sqrt(1./(pinf - pg0))
plot "../collapse-inviscid/log" u ($1/tR):($2*3.)**(1./3.) every 4 w p pt 6 t "Basilisk", \
"RPinviscid.dat" u ($1/tR):2 w l lw 2 t 'Rayleigh-Plesset', \
"" u ($1/tR):3 w l lw 2 t 'Keller-Miksis'
Bubble radius as a function of time (script)
For adiabatic gas transformations P_b V_b^{\gamma} should remain constant inside the bubble.
set ylabel 'p V^{/Symbol g}'
plot "../collapse-inviscid/log" u ($1/tR):(($2*3.)**(1.4)*$4) not w l
Entropy errors (script)
The bubble does not remain spherical.
set xlabel 'x'
set ylabel 'y'
set size ratio -1
plot "../collapse-inviscid/out" u 1:2 not w l
Interfaces (script)
Results for a viscous fluid
reset
set xlabel 't/tR'
set ylabel 'R/R_0'
set key bottom
plot "log" u ($1/tR):($2*3.)**(1./3.) every 3 w p pt 6 t "Basilisk", \
"../collapse-spherical/log" u ($1/tR):($2*3.)**(1./3.) every 3 w p pt 8 t "Basilisk (1D)", \
"RP.dat" u ($1/tR):2 w l lw 2 t 'Rayleigh-Plesset', \
"" u ($1/tR):3 w l lw 2 t 'Keller-Miksis', \
"RPinviscid.dat" u ($1/tR):3 w l lw 2 t "Keller-Miksis (inviscid)"
Bubble radius as a function of time (script)
For adiabatic gas transformations P_b V_b^{\gamma} should remain constant inside the bubble.
set ylabel 'p V^{/Symbol g}'
plot "log" u ($1/tR):(($2*3.)**(1.4)*$4) not w l
Entropy errors (script)
The bubble remains more spherical than in the inviscid case.
set xlabel 'x'
set ylabel 'y'
set size ratio -1
plot "out" u 1:2 not w l
Interfaces (script)
References
[brennen2014] |
Christopher E Brennen. Cavitation and bubble dynamics. Cambridge university press, 2014. |
[keller1980] |
Joseph B Keller and Michael Miksis. Bubble oscillations of large amplitude. The Journal of the Acoustical Society of America, 68(2):628–633, 1980. |
We run both the (1D) spherically-symmetric and the (2D) axisymmetric versions.
#if SPHERICAL
# include "spherisym.h"
#else
# include "axi.h"
#endif
#include "bubble.h"
int main()
{
pinf = 5.*pg0;
tend = 2.50001*0.915*sqrt (1./(pinf - pg0)); // fixme: stops too early with 2.5
#if INVISCID
MAXLEVEL = 12;
#else // !INVISCID
MAXLEVEL = 11;
double Reynolds = 10.;
mu1 = sqrt(pinf - pg0)/Reynolds;
Rayleigh-Plesset like models neglect the gas viscosity. Here we put a small value.
mu2 = mu1*0.0001;
#endif // !INVISCID
CFLac = 10.;
gamma2 = 1.4;
gamma1 = 7.14;
PI1 = 300*pg0;
L0 = 50;
#if TREE
N = 1 << MINLEVEL;
#else
N = 1 << MAXLEVEL;
#endif
run();
}