@NilsBerglund
  @NilsBerglund
Nils Berglund | Fatty polymers and water, with and without soap @NilsBerglund | Uploaded June 2024 | Updated October 2024, 25 seconds ago.
This is an attempt at simulating the effect of soap, by comparing a simulation including only "fat" and water molecules with another one, in which part of the molecules have a polar end, modeling soap. It is a very simplified model of the real process, and I don't claim the result to be particularly convincing, though it seems the molecules mix slightly better in the presence of soap. Feel free to propose improvements if you are knowledgeable about how soap works.
Water and fat do not easily mix. This is related to the fact that water molecules are polar, while fats are not. Soap molecules consist of a hydrophobic and lipophilic "tail", that tends to mix with fat molecules, and a hydrophilic and lipophobic "head", that tends to mix with water molecules. This helps mixing fat and water, and therefore cleaning objects, and people from fatty dirt particles.
This simulation shows a simple model for soap molecules, interacting with water molecules. The soap molecules consist in a tail made of ten neutral atoms, and a head consisting of two atoms of opposite charge. The soap molecules tend to latch on the oxygen atoms in water molecules. There are periodic boundary conditions, and the temperature is controlled by a thermostat with slowly decreasing temperature.
This simulation has two parts, showing the evolution with and without "soap" molecules:
Without soap: 0:00
With soap: 1:43
The particles' color depends on their type. The background indicates the local charge density, slightly averaged over space and time. In the second part, the particles' color hue depends on their kinetic energy.
To save on computation time, particles are placed into a "hash grid", each cell of which contains between 3 and 10 particles. Then only the influence of other particles in the same or neighboring cells is taken into account for each particle.
The temperature is controlled by a thermostat, implemented here with the "Nosé-Hoover-Langevin" algorithm introduced by Ben Leimkuhler, Emad Noorizadeh and Florian Theil, see reference below. The idea of the algorithm is to couple the momenta of the system to a single random process, which fluctuates around a temperature-dependent mean value. Lower temperatures lead to lower mean values.
The Lennard-Jones potential is strongly repulsive at short distance, and mildly attracting at long distance. It is widely used as a simple yet realistic model for the motion of electrically neutral molecules. The force results from the repulsion between electrons due to Pauli's exclusion principle, while the attractive part is a more subtle effect appearing in a multipole expansion. For more details, see en.wikipedia.org/wiki/Lennard-Jones_potential

Render time: Part 1 - 15 minutes 54 seconds
Part 2 - 16 minutes 11 seconds
Compression: crf 23
Color scheme: Turbo, by Anton Mikhailov
gist.github.com/mikhailov-work/6a308c20e494d9e0ccc29036b28faa7a

Music: Finding the Balance by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 licence. creativecommons.org/licenses/by/4.0
Source: incompetech.com/music/royalty-free/index.html?isrc=USUAN1100708
Artist: incompetech.com

Reference: Leimkuhler, B., Noorizadeh, E. & Theil, F. A Gentle Stochastic Thermostat for Molecular Dynamics. J Stat Phys 135, 261–277 (2009). doi.org/10.1007/s10955-009-9734-0
maths.warwick.ac.uk/~theil/HL12-3-2009.pdf

Current version of the C code used to make these animations:
github.com/nilsberglund-orleans/YouTube-simulations
https://www.idpoisson.fr/berglund/software.html
Some outreach articles on mathematics:
https://images.math.cnrs.fr/_Berglund-Nils-1343_.html
(in French, some with a Spanish translation)

#molecular_dynamics #ions #soap
Fatty polymers and water, with and without soapAn asteroid impact in the North Atlantic, modeled with a shallow water equationClassics revisited: Parabolic reflectors in high resolutionThe Rock-Paper-Scissors equation on the sphere, with improved behavior at the polesEnhance 57-19: DNA replication (long version)[Flash warning] A planar wave crossing a gradient index lens at an angleAn asteroid impact in the South Atlantic, modeled with a shallow water equationCreating rotating waves in a circle with fifteen angled secondary cavitiesPentagonal foam with gravityAn equatorial asteroid impact in the Pacific OceanUnzipping DNA with enzymes (a simple model)Hexagons make nice sand piles

Fatty polymers and water, with and without soap @NilsBerglund

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER