Day 11 Mesoscale: LBE Tutorial Exercise 2: Multi-Component LBE simulations

We are now extending our single-component LBE calculations from the first exercise to look at systems with additional fluid components, using an approach for multi-component lattice Boltzmann (MCLB) to model how different fluids interact and affect their flows.

The principal learning objectives for this tutorial are:

  1. to familiarise you with the structure of the multiple component, bulk MCLB algorithm, and

  2. to underscore the ‘kinetic length scale’ of the description,

  3. to illustrate the fundamental simplicity and versatility of MCLB, and

  4. to apply and compare algorithmic variations.

The first code with which you will be working - a custom code for this course - has two key algorithmic extensions beyond the single component code: (i) a phase field to distinguish immiscible fluid components, and (ii) a fluid force fluid, or immersed boundary force, used to impress interfacial forces. It models a 2D bulk with two component lattice Boltzmann fluids and fully periodic boundary conditions, although you could impose some approximate Dirichlet boundary conditions (see the first LBE exercise). The basic simulation is of a red fluid drop [1] at rest in the centre of a square lattice; the periodic boundary conditions make this into an array of identical drops, of course.

Note that certain parameters in the program, such as the number of time steps, have been set to allow students to obtain results within the necessary time frame. The values suggested in the exercises below for other algorithmic variants have also been worked around this requirement. Consequently, the results and observations in the following exercises are at times only qualitatively correct.

Later on in this exercise, we will switch to DL_MESO_LBE, DL_MESO’s LBE code, to carry out calculations of suspended drops when subjected to hydrodynamic flow fields. This code is more complex than the custom one but includes the same MCLB method, as well as others which we will not go into today.

To get started, access the working directory for this exercise (and the next):

~/WORKSHOP/Day_11Meso

and then open the notebook Day11LBETutorial2Ex1-3.ipynb, and follow the instructions within it for the first part of this exercise.

For historical reasons, we have also provided some (deprecated) plotting scripts for this custom code:

  • lbe2plots.m to use in MATLAB or Octave with comma-separated value (CSV) files

  • lbe2plots.py to use Python (with Matplotlib) with comma-separated value (CSV) files

  • lbe2plots.gp to use in Gnuplot with fixed-width delimited files ending with .dat

but the scripts provided in the notebook are more extensive, flexible and easier to use. (Note that the MATLAB/Octave and Gnuplot scripts would require modification if the simulation grid size is changed, while the Python script can be used as-is for any grid size.)

The second part using DL_MESO_LBE will follow with the notebook Day11LBETutorial2Ex4-5.ipynb. Note that to access the copy of DL_MESO we have provided, you will need to have access to the working directory for the DPD exercises: ~/WORKSHOP/Day_9Meso. You can use Paraview to visualise the results, although our Python scripts in the notebook can visualise most of what is needed for these exercises.