mpcd.stream

Overview

bulk Streaming method for bulk geometry.

Details

MPCD streaming methods

An MPCD streaming method is required to update the particle positions over time. It is meant to be used in conjunction with an integrator and collision method (see collide). Particle positions are propagated ballistically according to Newton’s equations (without any acceleration) for a time \(\Delta t\):

\[\mathbf{r}(t+\Delta t) = \mathbf{r}(t) + \mathbf{v}(t) \Delta t\]

where r and v are the particle position and velocity, respectively.

class hoomd.mpcd.stream.bulk(period)

Streaming method for bulk geometry.

Parameters:period (int) – Number of integration steps between collisions.

bulk performs the streaming step for MPCD particles in a fully periodic geometry (2D or 3D). This geometry is appropriate for modeling bulk fluids. The streaming time \(\Delta t\) is equal to period steps of the integrator. For a pure MPCD fluid, typically period should be 1. When particles are embedded in the MPCD fluid through the collision step, period should be equal to the MPCD collision period for best performance. The MPCD particle positions will be updated every time the simulation timestep is a multiple of period. This is equivalent to setting a phase of 0 using the terminology of other periodic update methods.

Example for pure MPCD fluid:

mpcd.integrator(dt=0.1)
mpcd.collide.srd(seed=42, period=1, angle=130.)
mpcd.stream.bulk(period=1)

Example for embedded particles:

mpcd.integrator(dt=0.01)
mpcd.collide.srd(seed=42, period=10, angle=130., group=hoomd.group.all())
mpcd.stream.bulk(period=10)
disable()

Disable the streaming method

Examples:

method.disable()

Disabling the streaming method removes it from the current MPCD system definition. Only one streaming method can be attached to the system at any time, so use this method to remove the current streaming method before adding another.

enable()

Enable the streaming method

Examples:

method.enable()

Enabling the streaming method adds it to the current MPCD system definition. Only one streaming method can be attached to the system at any time. If another method is already set, disable() must be called first before switching. Streaming will occur when the timestep is the next multiple of period.

set_period(period)

Set the streaming period.

Parameters:period (int) – New streaming period.

The MPCD streaming period can only be changed to a new value on a simulation timestep that is a multiple of both the previous period and the new period. An error will be raised if it is not.

Examples:

# The initial period is 5.
# The period can be updated to 2 on step 10.
hoomd.run_upto(10)
method.set_period(period=2)

# The period can be updated to 4 on step 12.
hoomd.run_upto(12)
hoomd.set_period(period=4)