Example 6: rising bubble in an imposed flow (advection + AMR)¶
Files¶
- 2D test file: main.cpp
- 3D test file: main.cpp
- Velocity field:
coefficient.jsonin each test directory
Statement of the problem¶
This test is adapted from a rising bubble problem of C. Introïni's PhD thesis1.
It validates the advection integrators (SplitAdvection, AdvectionBoundaryCH) coupled with the Cahn-Hilliard equations, with adaptive mesh refinement.
A bubble is transported by an imposed velocity field (no Navier-Stokes equations are solved):
where is the phase indicator ( in the bubble, in the surrounding matrix), the generalized chemical potential and the double-well potential:
The 2D domain is the rectangle with and , where is the bubble radius. The imposed velocity is a Poiseuille-like profile, vanishing on the lateral walls and divergence-free:
In 3D, the domain is ( is the vertical direction) and the profile is parabolic in both transverse directions:
Initial condition¶
The bubble is centred at in 2D ( in 3D):
where is the distance to the bubble centre. corresponds to the equilibrium of the planar tanh profile ( since ).
Parameters used for the test¶
The physical data are those of the rising bubble problem with and , the radius being deduced from the Bond number: .
| Name | Description | Symbol | Value |
|---|---|---|---|
sigma |
interfacial energy | J.m | |
rho1, rho2 |
gas and liquid densities | , kg.m | |
bond |
Bond number | ||
rb |
bubble radius | m | |
epsilon |
interface thickness | ||
mob |
mobility coefficient | ||
vmax |
maximum velocity | m.s |
Boundary conditions¶
Two configurations are computed successively:
- periodic: periodic boundary conditions on all boundaries. The bubble leaving the domain at the top re-enters at the bottom.
- open: periodic boundary conditions on the lateral boundaries, inflow/outflow boundary conditions on the bottom and top boundaries (homogeneous Neumann conditions for and completed by the advective flux):
The inflow/outflow term is activated by an Inflow coefficient attached to the open boundaries (see Boundary conditions).
The velocity components are Velocity_X, Velocity_Y (and Velocity_Z in 3D) coefficients carried by (block 0):
Coefficient velocity_x(Glossary::Velocity_X, 0.);
Coefficient velocity_y(Glossary::Velocity_Y, Scheme::Explicit, PoiseuilleVelocity());
Coefficient inflow(Glossary::Inflow, 1.);
inflow.set_bdr_index_coef(std::vector<int>{0, 2});
Coefficients coef_phi(double_well, capillary, mobility, grad_energy, velocity_x, velocity_y, inflow);
Coefficients coef_mu(double_well, capillary, mobility, grad_energy);
SPAS spatials{&spatial_phi, &spatial_mu};
TransientOPE oper(spatials, {"CahnHilliard", "SplitAdvection"}, params, TimeScheme::EulerImplicit,
"SplitTimeDerivative");
Numerical scheme¶
- Time integration: Euler Implicit over the interval s with a time-step s
- Spatial discretization: finite elements, coarse mesh ( in 3D, )
- AMR:
SingleVariableAMRdriven by with a Kelly error estimator, 3 levels of refinement (, i.e. about 3.4 elements in ), 3 cycles of pre-refinement of the initial condition - AMR thresholds:
max_elem_errorin 2D ( in 3D),scale_down_factor - Load balancing (2D test): the mesh is rebalanced between MPI processes after each AMR pass (
rebalanceAMR parameter), and anMPI_Problemsaves the MPI rank of each degree of freedom (Saves_<config>/ProblemMPI) to visualize the partition (see Load balancing) - Newton solver: relative tolerance , absolute tolerance
- Iterative solver: HYPRE_GMRES
- Preconditioner: HYPRE_ILU
Results¶
The bubble is stretched by the Poiseuille flow (faster in the centre of the domain) and takes an ogive shape, while the refined region follows the interface and the wake is derefined (Figure 1).
In the periodic configuration, the integral of is conserved. In the open configuration, it increases once the bubble leaves the domain through the top boundary, the bubble () being replaced by the matrix () entering at the bottom.
-
Clément Introïni. Interaction entre un fluide à haute température et un béton: contribution à la modélisation des échanges de masse et de chaleur. PhD thesis, Institut National Polytechnique de Toulouse-INPT, 2010. ↩