Stokes flow on a grid

Stokes flow on a grid in two- and three-dimensions

class pygl.solvers.Stokes

Numerical solution of Stokes equation on 2D or 3D grid.

Parameters:
  • eta (float) – Viscosity of the fluid (eta)
  • grid (dict) – Grid and its properties as a dict

Example

>>> import pygl
>>> eta    = .1
>>> grid   = {"dim":2, "Nx":32, "Ny":32}
>>> stokes = pygl.solvers.Stokes(eta, grid)
solve

Compute flow given force per unit area

self.vx, self.vy and self.vz contains the flow computed

Parameters:fk (np.array) – Fourier transform of the force per unit area on the grid

Example

>>> import pygl
>>> eta    = .1
>>> grid   = {"dim":2, "Nx":32, "Ny":32}
>>> stokes = pygl.solvers.Stokes(eta, grid)
>>> fkx    = np.random.random((32, 32))
>>> fky    = np.random.random((32, 32))
>>> stokes.solve( (fkx, fky) )