Package: pystokes
PyStokes: phoresis and Stokesian hydrodynamics in PythonAbout|Blog|News|Installation|Documentation|Examples|Publications|Gallery|Support|LicenseAboutPyStokesis 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 ofmicroorganisms,synthetic autophoretic particlesandself-propelling droplets.Please read the PyStokespaperandWikibefore you use PyStokes for your research. Included below are some examples fromPyStokes Gallery:Periodic orbits of active particlesOurworkshows that the oscillatory dynamics of a pair of active particles near
a boundary, best exemplified by the fascinating dance of the green algaeVolvox, can be understood in terms of Hamiltonian mechanics, even though the
system does not conserve energy. Read more in thePyStokes Gallery.Crystallization at a plane no-slip surfaceIt is well-known that crystallization of colloids approximating hard spheres
is due, paradoxically, to the higher entropy of the ordered crystalline state
compared to that of  the disordered liquid state. Out of equilibrium, no such general
principle is available to rationalize crystallization. In thiswork, we identify a new non-equilibrium mechanism, associated with entropy production rather than entropy gain, which drives crystallization of active colloids near plane walls. Read more in thePyStokes Gallery.News26th July 2019-- PyStokes can compute hydrodynamicandphoretic interactions in autophoretic suspensions.InstallationYou can take PyStokes for a spinwithout installation:. Please be patient whileBinderloads.From a checkout of this repoInstall PyStokes and an extended list of dependencies using>>gitclonehttps://github.com/rajeshrinet/pystokes.git
>>cdpystokes
>>pipinstall-rrequirements.txt
>>pythonsetup.pyinstallInstall PyStokes and its dependencies in anenvironmentnamed "pystokes" viaAnaconda>>gitclonehttps://github.com/rajeshrinet/pystokes.git
>>cdpystokes
>>makeenv
>>condaactivatepystokes
>>makeVia pipInstall the latestPyPIversion>>pipinstallpystokesTestingTest installation and running>>cdtests
>>pythonshortTests.pyLong test of example notebooks>>cdtests
>>pythonnotebookTests.pyExamples# Example 1: Flow field due to $2s$ mode of active slipimportpystokes,numpyasnp,matplotlib.pyplotasplt# particle radius, self-propulsion speed, number and fluid viscosityb,eta,Np=1.0,1.0/6.0,1# initializer,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 , discretizationdim,L,Ng=3,10,64;# instantiate the Flow classflow=pystokes.wallBounded.Flow(radius=b,particles=Np,viscosity=eta,gridpoints=Ng*Ng)# create grid, evaluate flow and plotrr,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 modeimportpystokes,numpyasnp,matplotlib.pyplotasplt# particle radius, fluid viscosity, and number of particlesb,eta,Np=1.0,1.0/6.0,1#initialiser,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 , discretizationdim,L,Ng=3,10,64;# instantiate the Flow classphoreticField=pystokes.phoretic.unbounded.Field(radius=b,particles=Np,phoreticConstant=eta,gridpoints=Ng*Ng)# create grid, evaluate phoretic field and plotrr,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 includeIrreducible Active flowsEffect of plane boundaries on active flowsActive Brownian Hydrodynamics near a plane wallFlow-induced phase separation at a plane surfaceIrreducible autophoretic fieldsAutophoretic arrest of flow-induced phase separationSelected publicationsPyStokes: phoresis and Stokesian hydrodynamics in Python, R Singh and R Adhikari,Journal of Open Source Software, 5(50), 2318, (2020).(Please cite this paper if you use PyStokes in your research).Controlled optofluidic crystallization of colloids tethered at interfaces, A Caciagli, R Singh, D Joshi, R Adhikari, and E Eiser,Physical Review Letters125 (6), 068001 (2020)Periodic Orbits of Active Particles Induced by Hydrodynamic Monopoles, A Bolitho, R Singh, R Adhikari,Physical Review Letters124 (8), 088003 (2020)Competing phoretic and hydrodynamic interactions in autophoretic colloidal suspensions, R Singh, R Adhikari, and ME Cates,The Journal of Chemical Physics151, 044901 (2019)Generalized Stokes laws for active colloids and their applications, R Singh and R Adhikari,Journal of Physics Communications, 2, 025025 (2018)Flow-induced phase separation of active particles is controlled by boundary conditions, S Thutupalli, D Geyer, R Singh, R Adhikari, and HA Stone,Proceedings of the National Academy of Sciences, 115, 5403 (2018)Universal hydrodynamic mechanisms for crystallization in active colloidal suspensions, R Singh and R Adhikari,Physical Review Letters, 117, 228002 (2016)See full publication listhere.SupportFor help with and questions about PyStokes, please post to thepystokes-usersgroup.For bug reports and feature requests, please use theissue trackeron GitHub.LicenseWe believe that openness and sharing improves the practice of science and increases the reach of its benefits. This code is released under theMIT license. Our choice is guided by the excellent article onLicensing for the scientist-programmer.