Skip to content

navlalli/modelling-magnetic-soap-films

Repository files navigation

CC BY 4.0

Thin film modelling of magnetic soap films

The packages required and their version numbers can be found in conda-env.yml. The python files and bash scripts in this project can be run with an active conda environment created from conda-env.yml:

conda env create -f conda-env.yml

Mesh generation

Mesh generation with gmsh. The mesh files and scripts used are in the mesh directory. Each mesh can be created using the shell script mesh_generation.sh.

Magnetic field intensity

The magnetic field produced by the neodymium magnet used in the experiments was computed using Magpylib, with code provided in the Hfield directory. Run neo_field.py to create the magnetic fields used in the simulations.

Simulation files

The system of partial differential equations governing the film thickness field was solved using the Galerkin finite element method with FEniCSx. The following files were used to solve the film thickness field over time:

  • soap_unit.py - a circular soap film with dimensionless dimensions of unit size

  • soap_exp.py - a circular soap film with dimensions aligning with the experiments

  • mag_unit.py - a circular magnetic soap film with dimensionless dimensions of unit size under the forcing of an inhomogeneous magnetic field

  • mag_exp.py - a circular magnetic soap film with dimensions aligning with the experiments under the forcing of an inhomogeneous magnetic field

  • soap_vertical.py - a vertical soap film bounded by a rectangular frame

  • mag_oned.py - a vertical magnetic soap film in one dimension aligning with Moulton and Pelesko 2010

All simulation files can be run using the shell script run_sim.sh, assuming the mesh (see mesh) and applied magnetic field (see Hfield) have first been created.

Example simulations

A circular, horizontal magnetic soap film in an inhomogeneous magnetic field

mag_exp.mp4

A vertical soap film bounded by a square frame

soap_vertical.mp4

License

This work is licensed under a Creative Commons Attribution 4.0 International License.

CC BY 4.0

About

Solver for equations governing magnetic soap films

Resources

License

Stars

Watchers

Forks

Packages

No packages published