Tutorial04_stokes_sink - apusok/FD-PDE GitHub Wiki

Tutorial 4. 2-D Stokes equation: Sinking sphere test

The problem we want to solve in this tutorial is the following: a sphere of radius $a$, density $\rho_1$ and viscosity $\eta_1$ sinks in a fluid of density $\rho_0$ and viscosity $\eta_0$. The problem is illustrated in the Figure below.

The equations for conservation of mass and momentum for fluid flow (Stokes equations), assuming incompressibility and neglecting thermal diffusion, are given by

$$-\nabla P + \nabla \cdot \eta\left(\nabla \textbf{v}+\nabla\textbf{v}^T\right)+\rho \textbf{g} = 0\tag{1}$$

$$\nabla \cdot \textbf{v} = 0\tag{2}$$

where $P$ is pressure, $\textbf{v}$ is velocity, $\eta$ is viscosity, $\rho$ is density, and $\textbf{g}$ is the gravitational acceleration.

We can assume free-slip boundary conditions on all boundaries. That is 1) normal velocity is zero (Dirichlet), 2) shear stress is zero (Neumann).

Setting up the problem

Ex 1.1: Non-dimensionalize Eqs. (1) and (2) using the following scales: $[x] = H, [\rho]=\rho_0, [P] = \rho_0 g H$, where $H$ is domain height. What would be a good choice for the velocity scale and time scale? Hint: Stokes velocity.

Ex 1.2: What are the FD-PDE Coefficients for this problem and where are they located on the staggared grid? Check wiki for FDPDE_STOKES.

In this tutorial, we will

  • couple the Stokes equations (FDPDE_STOKES) with advection of the compositional field (sphere vs surrounding fluid),
  • track the sphere and material properties using the marker-in-cell method provided by DMSwarm functionality.

Hint: Use the test_stokes_rt_compare_pic_phasefield.c as an example how to implement the marker-in-cell method using DMSwarm.

Exercises

We will split the problem into simpler parts: 1) build a Stokes solver without markers and advection, 2) add the marker interface with Stokes, 3) advect markers in time.

Ex 2.1: Create an FD-PDE model that solves for the static Stokes problem above with uniform density and viscosity.

  • Set-up the input parameters using a bag object. Use the function InputParameters() in tests as a template.
  • Modify FormCoefficient(), BCList().
  • Set-up output of solution vectors and coefficients.
  • Get the code to compile, run and visualize the problem.

Ex 2.2: Set-up the DMSwarm object with fields eta and density. Correct the problem geometry in the initial conditions. Solve Stokes with these initial conditions.

Ex 2.3: Implement a time loop and marker advection. Compute the sinking velocity of the sphere over time.


Back to Tutorials
Back to HOME