mpcd.geometry

Overview

Geometry

Geometry.

CosineChannel

Serpentine (sinusoidal) channel.

CosineExpansionContraction

Channel with sinusoidal expansion and contraction.

ParallelPlates

Parallel-plate channel.

PlanarPore

Pore with parallel plate opening.

Sphere

Spherical confinement.

Details

MPCD geometries.

A geometry defines solid boundaries that cannot be penetrated. These geometries are used for various operations in the MPCD algorithm including:

Each geometry may put constraints on the size of the simulation and where particles are allowed. These constraints will be documented by each object.

class hoomd.mpcd.geometry.CosineChannel(amplitude, repeat_length, separation, no_slip=True)

Bases: Geometry

Serpentine (sinusoidal) channel.

Parameters:
  • amplitude (float) – Amplitude of cosine.

  • repeat_length (float) – Repeat length (period) of cosine.

  • separation (float) – Distance between channel walls.

  • no_slip (bool) – If True, surfaces have no-slip boundary condition. Otherwise, they have the slip boundary condition.

CosineChannel models a fluid confined in \(y\) between two walls described by a sinusoidal profile with equations

\[y(x) = A \cos\left(\frac{2 \pi x}{L}\right) \pm H\]

where \(A\) is the amplitude, \(L\) is the repeat_length, and \(2H\) is the separation.

Example:

channel = hoomd.mpcd.geometry.CosineChannel(
    amplitude=2.0,
    separation=4.0,
    repeat_length=10.0)
stream = hoomd.mpcd.stream.BounceBack(period=1, geometry=channel)
simulation.operations.integrator.streaming_method = stream
amplitude

Amplitude of cosine (read only).

Type:

float

repeat_length

Repeat length (period) of cosine. (read only).

Type:

float

separation

Distance between walls (read only).

Type:

float

class hoomd.mpcd.geometry.CosineExpansionContraction(expansion_separation, contraction_separation, repeat_length, no_slip=True)

Bases: Geometry

Channel with sinusoidal expansion and contraction.

Parameters:
  • expansion_separation (float) – Maximum distance between channel walls.

  • contraction_separation (float) – Minimum distance between channel walls.

  • repeat_length (float) – Repeat length (period) of cosine.

  • no_slip (bool) – If True, surfaces have no-slip boundary condition. Otherwise, they have the slip boundary condition.

CosineExpansionContraction models a fluid confined in \(y\) between two walls described by a sinusoidal profile with equations

\[y(x) = \pm\left( \frac{H_{\rm e}-H_{\rm c}}{2} \left[1+\cos\left(\frac{2 \pi x}{L}\right)\right] + H_{\rm c} \right)\]

where \(2 H_{\rm e}\) is the expansion_separation, \(2 H_{\rm c}\) is the contraction_separation, and \(L\) is the repeat_length.

Example:

channel = hoomd.mpcd.geometry.CosineExpansionContraction(
    expansion_separation=6.0,
    contraction_separation=3.0,
    repeat_length=10.0)
stream = hoomd.mpcd.stream.BounceBack(period=1, geometry=channel)
simulation.operations.integrator.streaming_method = stream
contraction_separation

Distance between channel walls at the minimum contraction (read only).

Type:

float

expansion_separation

Distance between channel walls at the maximum expansion (read only).

Type:

float

repeat_length

Repeat length (period) of cosine. (read only).

Type:

float

class hoomd.mpcd.geometry.Geometry(no_slip)

Bases:

Geometry.

Parameters:

no_slip (bool) – If True, surfaces have a no-slip boundary condition. Otherwise, they have a slip boundary condition.

no_slip

If True, plates have a no-slip boundary condition. Otherwise, they have a slip boundary condition (read only).

A no-slip boundary condition means that the average velocity is zero at the surface. A slip boundary condition means that the average normal velocity is zero at the surface, but there is no friction against the tangential velocity.

Type:

bool

class hoomd.mpcd.geometry.ParallelPlates(separation, speed=0.0, no_slip=True)

Bases: Geometry

Parallel-plate channel.

Parameters:
  • separation (float) – Distance between plates.

  • speed (float) – Wall speed.

  • no_slip (bool) – If True, surfaces have no-slip boundary condition. Otherwise, they have the slip boundary condition.

ParallelPlates confines particles between two infinite parallel plates centered around the origin. The plates are placed at \(y=-H\) and \(y=+H\), where the total separation is \(2H\). The plates may be put into motion with speed V, having velocity \(-V\) and \(+V\) in the x direction, respectively. If combined with a no-slip boundary condition, this motion can be used to generate simple shear flow.

Examples:

Stationary parallel plates with no-slip boundary condition.

plates = hoomd.mpcd.geometry.ParallelPlates(separation=6.0)
stream = hoomd.mpcd.stream.BounceBack(period=1, geometry=plates)
simulation.operations.integrator.streaming_method = stream

Stationary parallel plates with slip boundary condition.

plates = hoomd.mpcd.geometry.ParallelPlates(
    separation=6.0, no_slip=False)
stream = hoomd.mpcd.stream.BounceBack(period=1, geometry=plates)
simulation.operations.integrator.streaming_method = stream

Moving parallel plates.

plates = hoomd.mpcd.geometry.ParallelPlates(
    separation=6.0, speed=1.0, no_slip=True)
stream = hoomd.mpcd.stream.BounceBack(period=1, geometry=plates)
simulation.operations.integrator.streaming_method = stream
separation

Distance between plates (read only).

Type:

float

speed

Wall speed (read only).

speed will have no effect if no_slip is False because the slip surface cannot generate shear stress.

Type:

float

class hoomd.mpcd.geometry.PlanarPore(separation, length, no_slip=True)

Bases: Geometry

Pore with parallel plate opening.

Parameters:
  • separation (float) – Distance between pore walls.

  • length (float) – Pore length.

  • no_slip (bool) – If True, surfaces have no-slip boundary condition. Otherwise, they have the slip boundary condition.

PlanarPore is a finite-length version of ParallelPlates. The geometry is similar, except that the plates extend from \(x=-L\) to \(x=+L\) (total length 2L). Additional solid walls with normals in x prevent penetration into the regions above / below the plates. The plates are infinite in z. Outside the pore, the simulation box has full periodic boundaries; it is not confined by any walls. This model hence mimics a narrow pore in, e.g., a membrane.

Example:

pore = hoomd.mpcd.geometry.PlanarPore(separation=6.0, length=4.0)
stream = hoomd.mpcd.stream.BounceBack(period=1, geometry=pore)
simulation.operations.integrator.streaming_method = stream
separation

Distance between pore walls (read only).

Type:

float

length

Pore length (read only).

Type:

float

class hoomd.mpcd.geometry.Sphere(radius, no_slip=True)

Bases: Geometry

Spherical confinement.

Parameters:
  • radius (float) – Radius of sphere.

  • no_slip (bool) – If True, surfaces have no-slip boundary condition. Otherwise, they have the slip boundary condition.

Sphere confines particles inside a sphere of radius \(R\) centered at the origin.

Examples:

Sphere with no-slip boundary condition.

sphere = hoomd.mpcd.geometry.Sphere(radius=5.0)
stream = hoomd.mpcd.stream.BounceBack(period=1, geometry=sphere)
simulation.operations.integrator.streaming_method = stream

Sphere with slip boundary condition.

sphere = hoomd.mpcd.geometry.Sphere(radius=5.0, no_slip=False)
stream = hoomd.mpcd.stream.BounceBack(period=1, geometry=sphere)
simulation.operations.integrator.streaming_method = stream
radius

Radius of sphere (read only).

Type:

float