sandbox/ggennari/phase_change/test_cases/constant_axi.c
Axisymmetric bubble with constant mass transfer rate
We model an axisymmetric dissolving bubble with constant mass transfer rate. A similar test can be found in Section 4.2 of Gennari et al.,2022.
The analytical solution for the radius reads: \displaystyle R(t) = R(0) + \frac{\dot{m}}{\rho_d}
#define F_ERR 1e-10
#define MASS_TRANSFER_RATE (-1e-3)
#include "grid/quadtree.h"
#include "axi.h"
#define PHASE_CHANGE 1
#include "../navier-stokes/centered.h"
#include "../two-phase.h"
#include "tension.h"
#include "../diffusion.h"
#include "../phase_change_pure_species.h"
#include "../../adapt_wavelet_leave_interface.h"
#include "view.h"
#define RHOR 1000.
#define MUR 100.
#define WIDTH 5
#define TEND 1.
int LEVEL = 9;
We add the transport of a soluble tracer. But this is not relevant in this case, since the mass transfer rate is fixed.
scalar a_c[];
scalar * species = {a_c};
scalar m_a[];
scalar * m_list = {m_a};
int main()
{
size (WIDTH);
init_grid (64);
rho1 = 1.;
rho2 = rho1/RHOR;
mu1 = 1.;
mu2 = mu1/MUR;
f.tracers = species;
f.sigma = 1.;
a_c.inverse = false;
a_c.mol_mass = 1./RHOR;
a_c.diff = false;
tt = 0.;
TOLERANCE = 1e-4;
DT = 1e-3;
run();
}
We need outflow boundary conditions to let the liquid enter the domain as the bubble dissolves.
//Bcs
u.n[right] = neumann(0.);
p[right] = dirichlet(0.);
pf[right] = dirichlet(0.);
u.n[top] = neumann(0.);
p[top] = dirichlet(0.);
pf[top] = dirichlet(0.);
event init (t = 0) {
refine (sq(x) + sq(y) < sq(4) && level < LEVEL);
fraction (f, sq(x) + sq(y) - sq(1.));
}
We log the volume of the bubble
event log_simulation (i++) {
double vol = 0.;
foreach(reduction(+:vol))
vol += (1. - f[])*dv();
fprintf (stderr, "%g %g\n", t, vol*2.*pi);
fflush (stderr);
}
event adapt (i++)
{
double uemax = 1e-2;
adapt_wavelet_leave_interface ({u.x,u.y}, {f}, (double[]){uemax,uemax,1e-3}, LEVEL, 5, 1);
}
event movie (t += 0.01) {
view (quat = {0.002, 0.005, 0.000, 1.000},
fov = 30, near = 0.01, far = 1000,
tx = -0.1, ty = -0.1, tz = -1.,
width = 600, height = 600);
clear();
box();
draw_vof ("f");
squares("u.x", min=-1.5, max=1.5, linear=true);
save ("movie.mp4");
}
event stop_simulation (t = TEND) {
return 1;
}
References
[gennari2022] |
Gabriele Gennari, Richard Jefferson-Loveday, and Stephen J. Pickering. A phase-change model for diffusion-driven mass transfer problems in incompressible two-phase flows. Chemical Engineering Science, 259:117791, 2022. [ DOI | http ] |