Swalbe.jl

Simple Julia Lattice Boltzmann Solver for Thin Liquid Films and Droplets, approximating the thin film equation.
Author Zitzeronion
Popularity
15 Stars
Updated Last
4 Months Ago
Started In
November 2020

Swalbe.jl

Dev CI codecov status DOI Downloads

Dewetting_logo

Thin film simulations using lattice Boltzmann 🌈 🌊

Why is a thin film solver called Swalbe.jl you may ask?

The idea is to use the lattice Boltzmann method (LBM) and all its benefits (easy to code, vast amount of literature and scalability) to simulate thin liquid film flows. Instead of reinventing the wheel we make use of a class of lattice Boltzmann models that were build to simulate shallow water problems, see Salmon (not the fish 🐟), Dellar and van Thang et al. (all free to read). Thus the name of the package Shallow WAter Lattice Boltzmann slovEr or Swalbe.

Of course using a plain shallow water model will not work to simulate thin film dynamics, that is the reason we build our own model :neckbeard:. Now the main difference is that we throw away most of the shallow water parts by assuming they are small as compared to thin film relevant things, e.g. the substrate fluid interaction. The full explanation of the model with some benchmarks can be found in our paper Zitz et al. (the C/C++ OpenACC codebase has not been further developed since the project moved to Julia)

How to get

Requirements

First of all you need a Julia (>= 1.6) installation. Julia is a high level open source programming language and it is as easy to use as python 🐍 (my opinion).

Julia can be downloaded at the projects homepage julialang.org.

Install using the Julia package manager

Swalbe.jl is a registered package of the Julia package manager. The only thing you have to do is to add the package to your Julia environment with:

julia> ] add Swalbe

Install from source

Of course you can also clone or fork the repo and activate the package inside the julia REPL (Read Evaluate Print Loop). First you need to go the Swalbe directory and open a REPL

git clone <swalbe git url>
cd swalbe.jl
julia

now you can activate the package with

julia> ] activate .

To check if the package works you can run the test suite with

julia> ] test Swalbe

All tests can be found in test folder, but do not expect too many comments. Still especially the simulate.jl file is worth a look.

How to use

The idea of Swalbe.jl is to script your thin film simulation, based on a lattice Boltzmann iteration.
That is why most core functions can be easily extended, or used out of the box. Find some examples in the scripts folder.

Some initial conditions are handily pre-programmed. E.g. simulating the Rayleigh-Taylor instability:

using Swalbe

# set the constants of the system
sys = Swalbe.SysConst(Lx=100, Ly=100, g=-0.001, γ=0.0005, Tmax=1000)

# run with given parameters for Tmax timesteps ...
# return Lx×Ly array with the final configuration
h = Swalbe.run_rayleightaylor(sys, "CPU"; h₀=1.0, ϵ=0.01, verbos=true)

Further examples can be found in the tutorials section of the documentation: Tutorials

Some development for this solver was performed under the priority program SPP2171-Dynamic Wetting of Flexible, Adaptive, and Switchable Surfaces. On the homepage of the SPP in the resources' section we supply a simple tutorial for the coalescence of droplets using a Pluto notebook.

How to support and contribute

Leave a star if you like the idea of the project and/or the content of the package. You can support the project by actively using it and raising issues. Help is always very welcome, if you want to contribute open a PR or raise an issue with a feature request (and if possible with a way how to include it). Feel free to DM me on Mastodon if you have questions, I will try to answer them all timely.

Publications

Peer reviewed:

In this Phys. Rev. E publication we introduce the core concepts of Swalbe. We therefore discuss the lattice Boltzmann method for shallow water flows and derive a matching condition with the thin film equation. Based on the derived model we present benchmark simulations and show that numerical results agree well with theoretical predictions, e.g., Cox-Voinov law.

In the second Phys. Rev. E publication we discusses the addition of a stochastic force term as an effective model for the stochastic thin film equation, see Grün et al.. This approach works surprisingly well and was validated against theory. Beyond the validation we showed how a film reacts to both a chemical pattern and thermal fluctuations. Again we were able to justify multiple findings with simple theoretical derivations.

After the first two publications we cleaned up the repository and added documentations as well as test cases. During this process we became aware about the Journal of Open Source Software which we wholeheartly support. Scientific software is of value, however, it is often seen as byproduct and meeting the actual rigor requirement for a publication only discussing software is far from trivial. A JOSS publication was therefore a good place to show that Swalbe.jl is an open source tool and that it has a well definded scientific goal, namely thin liquid film solutions or the approximation of the thin film equation.

For this letter in Phys. Rev. Fluids we investigate a dewetting thin film on a "switchable" substrate. The idea is that based on external stimuli, such as light, local surface chemistry can be altered. We build a toy model that effects the local wettability both in time and space. We found non-dimensional number that explained the morphology changes that we observe and were able to motivate further results with theoretical considerations. We also fed numerical data into blender to render simulations.

Preprints:

Credit

If you use this package please cite it as

@article{Zitz2022,
  doi = {10.21105/joss.04312},
  url = {https://doi.org/10.21105/joss.04312},
  year = {2022},
  publisher = {The Open Journal},
  volume = {7},
  number = {77},
  pages = {4312},
  author = {Stefan Zitz and Manuel Zellhöfer and Andrea Scagliarini and Jens Harting},
  title = {Swalbe.jl: A lattice Boltzmann solver for thin film hydrodynamics},
  journal = {Journal of Open Source Software}
} 

Used By Packages

No packages found.