Simple Flow Examples#

simple_flows#

class SimpleShear(grid, dimensions, velcomp, amplitudes)[source]#
prescribe velocity for a simple shear flow on a general grid

roughly: product(amplitudes [i] * x[i] for i in dimensions) where x[i] is the coordinate in the i’th direction

Variables:
  • grid – grid which provices coordinates

  • dimensions – labels of shearing directions

  • velcomp – 0-indexed component of velocity vector that is sheared (all others are set to 0)

  • amplitudes – amplification factor of gradient along dimensions

velocity(shape)[source]#

produce a velocity field with a given shape

Parameters:

shape (list[int]) – shape of velocity field

Return type:

DataArray

class ScalarGradient(grid, dimension, gdt, offset=0.0)[source]#

prescribe a scalar field with a constant gradient on a cartesian mesh

Variables:
  • grid – grid which provices coordinates

  • dimension – label of direcion of coordinate

  • gdt – value of gradient

  • offset – reference value at coordinate origin

field(shape)[source]#

produce a scalar field with a given shape

Parameters:

shape (list[int]) – shape of scalar field

Return type:

DataArray