Stokes flow near interfaces¶
Hydrodynamic interactions of active particles in the half-space bounded by a plane no-shear surface
RBM (Rigid Body Motion: Velocity and Angular Velocity)¶
-
class
pystokes.interface.
Rbm
¶ Rigid body motion (RBM)
…
Parameters: - radius (float) – Radius of the particles (a)
- particles (int) – Number of particles (Np)
- viscosity (float) – Viscosity of the fluid (eta)
-
mobilityTR
()¶ Compute velocity due to body forces using \(v=\mu^{TR}\cdot T\) …
Parameters: - v (np.array) – An array of velocities An array of size 3*Np,
- r (np.array) – An array of positions An array of size 3*Np,
- T (np.array) – An array of forces An array of size 3*Np,
- ll (float) – viscosity ratio of the two fluids Default is zero
-
mobilityTT
()¶ Compute velocity due to body forces using \(v=\mu^{TT}\cdot F\) …
Parameters: - v (np.array) – An array of velocities An array of size 3*Np,
- r (np.array) – An array of positions An array of size 3*Np,
- F (np.array) – An array of forces An array of size 3*Np,
- ll (float) – viscosity ratio of the two fluids Default is zero
Examples
An example of the RBM
>>> import pystokes, numpy as np, matplotlib.pyplot as plt >>> # particle radius, self-propulsion speed, number and fluid viscosity >>> b, vs, Np, eta = 1.0, 1.0, 128, 0.1 >>> #initialise >>> r = pystokes.utils.initialCondition(Np) # initial random distribution of positions >>> p = np.zeros(3*Np); p[2*Np:3*Np] = -1 # initial orientation of the colloids >>> >>> rbm = pystokes.interface.Rbm(radius=b, particles=Np, viscosity=eta) >>> force = pystokes.forceFields.Forces(particles=Np) >>> >>> def rhs(rp): >>> # assign fresh values at each time step >>> r = rp[0:3*Np]; p = rp[3*Np:6*Np] >>> F, v, o = np.zeros(3*Np), np.zeros(3*Np), np.zeros(3*Np) >>> >>> force.lennardJonesWall(F, r, lje=0.01, ljr=5, wlje=1.2, wljr=3.4) >>> rbm.mobilityTT(v, r, F) >>> return np.concatenate( (v,o) ) >>> >>> # simulate the resulting system >>> Tf, Npts = 150, 200 >>> pystokes.utils.simulate(np.concatenate((r,p)), >>> Tf,Npts,rhs,integrator='odeint', filename='crystallization')
-
noiseRR
()¶ Compute rotational Brownian motion …
Parameters: - o (np.array) – An array of angular velocities An array of size 3*Np,
- r (np.array) – An array of positions An array of size 3*Np,
-
noiseTT
()¶ Compute translation Brownian motion …
Parameters: - v (np.array) – An array of velocities An array of size 3*Np,
- r (np.array) – An array of positions An array of size 3*Np,
-
propulsionT2s
()¶ Compute velocity due to 2s mode of the slip \(v=\pi^{T,2s}\cdot S\) …
Parameters: - v (np.array) – An array of velocities An array of size 3*Np,
- r (np.array) – An array of positions An array of size 3*Np,
- S (np.array) – An array of 2s mode of the slip An array of size 5*Np,
-
propulsionT3t
()¶ Compute velocity due to 3t mode of the slip \(v=\pi^{T,3t}\cdot D\) …
Parameters: - v (np.array) – An array of velocities An array of size 3*Np,
- r (np.array) – An array of positions An array of size 3*Np,
- D (np.array) – An array of 3t mode of the slip An array of size 3*Np,
Flow¶
-
class
pystokes.interface.
Flow
¶ Flow at given points
…
Parameters: - radius (float) – Radius of the particles.
- particles (int) – Number of particles
- viscosity (viscosity of the fluid) –
- gridpoints (int) – Number of grid points
Examples
An example of the RBM
-
flowField1s
()¶ Compute flow field at field points due body forces …
Parameters: - vv (np.array) – An array of flow at field points An array of size 3*Nt,
- rt (np.array) – An array of field points An array of size 3*Nt,
- r (np.array) – An array of positions An array of size 3*Np,
- F (np.array) – An array of body force An array of size 3*Np,
Examples
An example of the Flow field due to $1s$ mode of force per unit area
>>> 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]) >>> F1s = pystokes.utils.irreducibleTensors(1, p) >>> >>> # space dimension , extent , discretization >>> dim, L, Ng = 3, 10, 64; >>> >>> # instantiate the Flow class >>> flow = pystokes.interface.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.flowField1s(vv, rr, r, F1s) >>> pystokes.utils.plotStreamlinesYZsurf(vv, rr, r, offset=6-1, density=1.4, title='1s')