PyStokes

PyStokes: phoresis and Stokesian hydrodynamics in Python - Published in JOSS (2020)

https://github.com/rajeshrinet/pystokes

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 17 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: aps.org, iop.org, joss.theoj.org
  • Committers with academic emails
    3 of 9 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

active-colloids active-particles autophoretic-suspensions colloids crystallization cython force-fields hydrodynamic-interactions phase-separation phoretic-interactions pystokes python stokes-flow stokesian-hydrodynamics traction

Scientific Fields

Mathematics Computer Science - 37% confidence
Last synced: 4 months ago · JSON representation

Repository

PyStokes: phoresis and Stokesian hydrodynamics in Python. github.com/rajeshrinet/pystokes

Basic Info
Statistics
  • Stars: 47
  • Watchers: 7
  • Forks: 19
  • Open Issues: 1
  • Releases: 3
Topics
active-colloids active-particles autophoretic-suspensions colloids crystallization cython force-fields hydrodynamic-interactions phase-separation phoretic-interactions pystokes python stokes-flow stokesian-hydrodynamics traction
Created about 11 years ago · Last pushed 9 months ago
Metadata Files
Readme Contributing License

README.md

Imagel

PyStokes: phoresis and Stokesian hydrodynamics in Python

Installation Notebooks Documentation Status DOI PyPI PyPI Downloads Stars Forks

About | 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.

You can take PyStokes for a spin online using Google Colab: Open In Colab


Please read the PyStokes paper and Wiki before you use PyStokes for your research. Included below are some examples from PyStokes Gallery:

Periodic orbits of active particles

Image

Our work shows that the oscillatory dynamics of a pair of active particles near a boundary, best exemplified by the fascinating dance of the green algae Volvox, can be understood in terms of Hamiltonian mechanics, even though the system does not conserve energy. Read more in the PyStokes Gallery.

Crystallization at a plane no-slip surface

It 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 this work, 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 the PyStokes Gallery.

Crystallization of active colloids

News

26th July 2019 -- PyStokes can compute hydrodynamic and phoretic interactions in autophoretic suspensions.

Installation

From a checkout of this repo

Install PyStokes and an extended list of dependencies using

```bash

git clone https://github.com/rajeshrinet/pystokes.git cd pystokes pip install -r requirements.txt python setup.py install ```

Via a conda environment

Install PyStokes and its dependencies in an environment named "pystokes" via Anaconda

```bash

git clone https://github.com/rajeshrinet/pystokes.git cd pystokes make env conda activate pystokes make ```

Via pip

Install the latest PyPI version

```bash

pip install pystokes ```

Testing

Test installation and running

```bash

cd tests python test_short.py ```

Long test of example notebooks

```bash

cd tests python test_notebooks.py ```

Examples

```Python

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, N = 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=N, 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') ```

```Python

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, N = 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(N) # strength of chemical monopolar flux

space dimension , extent , discretization

dim, L, Ng = 3, 10, 64;

instantiate the Flow class

phoreticField = pystokes.phoretic.unbounded.Field(radius=b, particles=N, 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

A selected list of publications is given below. See full publication list here.

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.

Owner

  • Name: Rajesh Singh
  • Login: rajeshrinet
  • Kind: user
  • Location: Chennai
  • Company: IIT Madras

JOSS Publication

PyStokes: phoresis and Stokesian hydrodynamics in Python
Published
June 30, 2020
Volume 5, Issue 50, Page 2318
Authors
Rajesh Singh ORCID
DAMTP, Centre for Mathematical Sciences, University of Cambridge, Wilberforce Road, Cambridge CB3 0WA, UK
Ronojoy Adhikari
DAMTP, Centre for Mathematical Sciences, University of Cambridge, Wilberforce Road, Cambridge CB3 0WA, UK
Editor
Alice Harpole ORCID
Tags
Cython Active particles Stokes flow Hydrodynamic interactions Phoretic interactions

GitHub Events

Total
  • Issues event: 2
  • Watch event: 3
  • Delete event: 1
  • Issue comment event: 1
  • Push event: 14
  • Pull request review event: 1
  • Pull request event: 1
  • Fork event: 2
  • Create event: 1
Last Year
  • Issues event: 2
  • Watch event: 3
  • Delete event: 1
  • Issue comment event: 1
  • Push event: 14
  • Pull request review event: 1
  • Pull request event: 1
  • Fork event: 2
  • Create event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 476
  • Total Committers: 9
  • Avg Commits per committer: 52.889
  • Development Distribution Score (DDS): 0.246
Past Year
  • Commits: 17
  • Committers: 1
  • Avg Commits per committer: 17.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Rajesh Singh r****t@g****m 359
phi6GTurk g****9@c****k 90
Ronojoy Adhikari r****y 9
Austen a****5@c****k 9
Konrad Hinsen k****n@f****t 4
Takuya k****i@c****p 2
Alice Harpole h****a 1
Rajesh Singh r****h@R****l 1
Rajesh Singh r****t@r****n 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 10
  • Total pull requests: 15
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 2 hours
  • Total issue authors: 5
  • Total pull request authors: 6
  • Average comments per issue: 2.2
  • Average comments per pull request: 0.67
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 5
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: 25 days
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • fcooper8472 (4)
  • khinsen (3)
  • zcgan (1)
  • gpavanb1 (1)
  • pasancrom (1)
Pull Request Authors
  • dependabot[bot] (9)
  • khinsen (4)
  • ajinkya-kulkarni (2)
  • Takuya-Kobayash (2)
  • harpolea (1)
  • phi6GTurk (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (9)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 64 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 21
  • Total maintainers: 1
pypi.org: pystokes

Phoresis and Stokesian hydrodynamics in Python

  • Versions: 21
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 64 Last month
Rankings
Dependent packages count: 7.4%
Forks count: 9.2%
Stargazers count: 10.5%
Average: 25.6%
Downloads: 31.9%
Dependent repos count: 69.0%
Maintainers (1)
Last synced: 4 months ago

Dependencies

environment.yml conda
  • cython
  • ipython
  • jupyter
  • matplotlib
  • nbconvert
  • numpy
  • pytest
  • pytest-cov
  • python
  • scipy
requirements.txt pypi
  • cython *
  • matplotlib *
  • numpy *
  • scipy *
  • wheel *
setup.py pypi
  • cython *
  • matplotlib *
  • numpy *
  • scipy *
.github/workflows/ci.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/run_notebooks.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
binder/environment.yml conda
  • pip
  • python