.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples_gallery/droplets_coalescence.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_gallery_droplets_coalescence.py: Brownian droplet coarsening =========================== Simple examples of droplets subjected to Brownian motion and coalescence. .. GENERATED FROM PYTHON SOURCE LINES 8-33 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples_gallery/images/sphx_glr_droplets_coalescence_001.png :alt: droplets coalescence :srcset: /examples_gallery/images/sphx_glr_droplets_coalescence_001.png :class: sphx-glr-multi-img * .. image-sg:: /examples_gallery/images/sphx_glr_droplets_coalescence_002.png :alt: droplets coalescence :srcset: /examples_gallery/images/sphx_glr_droplets_coalescence_002.png :class: sphx-glr-multi-img .. code-block:: Python import numpy as np import pde from droplets import SphericalDroplet import emulsim # set up state droplets = [SphericalDroplet(50 * np.random.randn(2), 5) for i in range(100)] state = emulsim.State( {"droplets": emulsim.SphericalDropletsElement.from_droplets(droplets)} ) # set up simulation simulation = emulsim.Simulation(state) simulation.add_actor( "droplets", emulsim.BrownianMotionActor({"diffusivity": "1/radius"}) ) simulation.add_actor("droplets", emulsim.CoalescenceDropletActor()) # run simulation result = simulation.run(t_range=1e3, dt=1, tracker=pde.PlotTracker(10, show=True)) result.plot() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 7.333 seconds) .. _sphx_glr_download_examples_gallery_droplets_coalescence.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: droplets_coalescence.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: droplets_coalescence.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: droplets_coalescence.zip `