Phoresis and Stokesian hydrodynamics in Python
Project description
PyStokes: Phoresis and Stokesian hydrodynamics in Python
About | News | Installation | Documentation | Examples | Publications | Gallery | Support | License
About
PyStokes is a numerical library for phoresis and Stokesian hydrodynamics in Python. It uses a grid-free method, combining the integral representation of Laplace and Stokes equations, spectral expansion, and Galerkin discretization, to compute phoretic and hydrodynamic interactions between spheres with slip boundary conditions on their surfaces. The library also computes suspension scale quantities, such as rheological response, energy dissipation and fluid flow. The computational cost is quadratic in the number of particles and upto 1e5 particles have been accommodated on multicore computers. The library has been used to model suspensions of microorganisms, synthetic autophoretic particles and self-propelling droplets.
News
26th July 2019 -- PyStokes can compute hydrodynamic and phoretic interactions in autophoretic suspensions.
Installation
You can take PyStokes for a spin without installation: . Please be patient while Binder loads.
Via Anaconda
Install PyStokes and its dependencies in an environment named pystokes:
>> git clone https://github.com/rajeshrinet/pystokes.git
>> cd pystokes
>> make env
>> conda activate pystokes
>> make
Via pip
Install the latest PyPI version
>> pip install pystokes
From a checkout of this repo
Install PyStokes and required dependencies using
>> git clone https://github.com/rajeshrinet/pystokes.git
>> cd pystokes
>> pip install -r requirements.txt
>> python setup.py install
Testing
Short test of installation and running
>> cd tests
>> python shortTests.py
Long test of example notebooks
>> cd tests
>> python notebookTests.py
Examples
# Example 1: Flow field due to $2s$ mode of active slip
import pystokes, numpy as np, matplotlib.pyplot as plt
# particle radius, self-propulsion speed, number and fluid viscosity
b, eta, Np = 1.0, 1.0/6.0, 1
# initialize
r, p = np.array([0.0, 0.0, 3.4]), np.array([0.0, 1.0, 0])
V2s = pystokes.utils.irreducibleTensors(2, p)
# space dimension , extent , discretization
dim, L, Ng = 3, 10, 64;
# instantiate the Flow class
flow = pystokes.wallBounded.Flow(radius=b, particles=Np, viscosity=eta, gridpoints=Ng*Ng)
# create grid, evaluate flow and plot
rr, vv = pystokes.utils.gridYZ(dim, L, Ng)
flow.flowField2s(vv, rr, r, V2s)
pystokes.utils.plotStreamlinesYZsurf(vv, rr, r, offset=6-1, density=1.4, title='2s')
#Example 2: Phoretic field due to active surface flux of l=0 mode
import pystokes, numpy as np, matplotlib.pyplot as plt
# particle radius, fluid viscosity, and number of particles
b, eta, Np = 1.0, 1.0/6.0, 1
#initialise
r, p = np.array([0.0, 0.0, 5]), np.array([0.0, 0.0, 1])
J0 = np.ones(Np) # strength of chemical monopolar flux
# space dimension , extent , discretization
dim, L, Ng = 3, 10, 64;
# instantiate the Flow class
phoreticField = pystokes.phoreticUnbounded.Field(radius=b, particles=Np, phoreticConstant=eta, gridpoints=Ng*Ng)
# create grid, evaluate phoretic field and plot
rr, vv = pystokes.utils.gridYZ(dim, L, Ng)
phoreticField.phoreticField0(vv, rr, r, J0)
pystokes.utils.plotContoursYZ(vv, rr, r, density=.8, offset=1e-16, title='l=0')
Other examples include
- Irreducible Active flows
- Effect of plane boundaries on active flows
- Active Brownian Hydrodynamics near a plane wall
- Flow-induced phase separation at a plane surface
- Irreducible autophoretic fields
- Autophoretic arrest of flow-induced phase separation
Publications
-
Hydrodynamic and phoretic interactions of active particles in Python, Rajesh Singh and R. Adhikari, arXiv:1910.00909, 2019. (Please cite this paper if you use PyStokes in your research).
-
Competing phoretic and hydrodynamic interactions in autophoretic colloidal suspensions, Rajesh Singh, R. Adhikari, and M. E. Cates, The Journal of Chemical Physics 151, 044901 (2019)
-
Generalized Stokes laws for active colloids and their applications, Rajesh Singh and R. Adhikari, Journal of Physics Communications, 2, 025025 (2018)
-
Flow-induced phase separation of active particles is controlled by boundary conditions, Shashi Thutupalli, Delphine Geyer, Rajesh Singh, R. Adhikari, and Howard A. Stone, Proceedings of the National Academy of Sciences, 115, 5403 (2018)
-
Universal hydrodynamic mechanisms for crystallization in active colloidal suspensions, Rajesh Singh and R. Adhikari, Physical Review Letters, 117, 228002 (2016)
Support
- For help with and questions about PyStokes, please post to the pystokes-users group.
- For bug reports and feature requests, please use the issue tracker on GitHub.
License
We believe that openness and sharing improves the practice of science and increases the reach of its benefits. This code is released under the MIT license. Our choice is guided by the excellent article on Licensing for the scientist-programmer.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pystokes-2.1.10-py3.7-macosx-10.9-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ca5854752c869d422aab5e9ef0d1a57ddee5973838a4dcbfbfa4b89701ca8d6 |
|
MD5 | bb9daa97d985335c71d39a15e08f39f2 |
|
BLAKE2b-256 | 67431b8bc7b5a93a1f139829e471925bd64a282392e6450a00649fe833bc4b87 |
Hashes for pystokes-2.1.10-py3.7-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50eb2d18a4130dd4aa0529c57e763e5055f60acd80bce5fbd04d8b26cf829600 |
|
MD5 | cc493b9c518e1ee5addff577400a5aa8 |
|
BLAKE2b-256 | 0bf55d05cfb480f5337a8ed5ffc1b36c9092b1a5d44c42bfe03fa4fee067646f |
Hashes for pystokes-2.1.10-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 216cee8106a33131ed9a9804d169ca49348efb472164638814ce884902dc6b5a |
|
MD5 | 958b5d4e1e4518d3efee5f6e20e77564 |
|
BLAKE2b-256 | af58d70444230152a161ba2b8db712d3fe2308db93221759edfb1b681a695c69 |