BlockForce

class hoomd.mpcd.force.BlockForce(force, separation=None, width=None)

Bases: BodyForce

Block force.

Parameters:
  • force (float) – Magnitude of the force in x per particle.

  • separation (float) – Distance between the centers of the blocks.

  • width (float) – Width of each block.

The force magnitude F is applied in the x direction on the MPCD particles in blocks defined along the y direction by the separation \(2H\) and the width \(2w\). The force in x is \(+F\) in the upper block, \(-F\) in the lower block, and zero otherwise.

\begin{equation} \mathbf{F} = \begin{cases} +F \mathbf{e}_x & |r_y - H| < w \\ -F \mathbf{e}_x & |r_y + H| < w \\ \mathbf{0} & \mathrm{otherwise} \end{cases} \end{equation}

The BlockForce can be used to implement the double-parabola method for measuring viscosity using separation \(L_y/2\) and width \(L_y/2\), where \(L_y\) is the size of the simulation box in y.

Warning

You should define the blocks to lie fully within the simulation box and to not overlap each other.

Example:

Block force for double-parabola method.

Ly = simulation.state.box.Ly
force = hoomd.mpcd.force.BlockForce(
    force=1.0, separation=Ly/2, width=Ly/2)
stream = hoomd.mpcd.stream.Bulk(period=1, mpcd_particle_force=force)
simulation.operations.integrator.streaming_method = stream
force

Magnitude of the force in x per particle.

Example:

force.force = 1.0
Type:

float

separation

Distance between the centers of the blocks.

Example:

Ly = simulation.state.box.Ly
force.separation = Ly / 2
Type:

float

width

Width of each block.

Example:

Ly = simulation.state.box.Ly
force.width = Ly / 2
Type:

float