BounceBack

class hoomd.mpcd.stream.BounceBack(period, geometry, mpcd_particle_force=None)

Bases: StreamingMethod

Streaming with bounce-back rule for surfaces.

Parameters:
  • period (int) – Number of integration steps covered by streaming step.

  • geometry (hoomd.mpcd.geometry.Geometry) – Surface to bounce back from.

  • mpcd_particle_force (BodyForce) – Body force on MPCD particles.

One of the main strengths of the MPCD algorithm is that it can be coupled to complex boundaries, defined by a geometry. This StreamingMethod reflects the MPCD particles from boundary surfaces using specular reflections (bounce-back) rules consistent with either “slip” or “no-slip” hydrodynamic boundary conditions. The external force is only applied to the particles at the beginning and the end of this process.

Although a streaming geometry is enforced on the MPCD particles, there are a few important caveats:

  1. Embedded particles are not coupled to the boundary walls. They must be confined by an appropriate method, e.g., an external potential, an explicit particle wall, or a bounce-back method (hoomd.mpcd.methods.BounceBack).

  2. The geometry exists inside a fully periodic simulation box. Hence, the box must be padded large enough that the MPCD cells do not interact through the periodic boundary. Usually, this means adding at least one extra layer of cells in the confined dimensions. Your periodic simulation box will be validated by the geometry.

  3. It is an error for MPCD particles to lie “outside” the geometry. You must initialize your system carefully to ensure all particles are “inside” the geometry.

Examples:

Shear flow between moving parallel plates.

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

Pressure driven flow between parallel plates.

stream = hoomd.mpcd.stream.BounceBack(
    period=1,
    geometry=hoomd.mpcd.geometry.ParallelPlates(
        separation=6.0, no_slip=True
    ),
    mpcd_particle_force=hoomd.mpcd.force.ConstantForce((1, 0, 0)),
)
simulation.operations.integrator.streaming_method = stream

Members inherited from AutotunedObject:

property kernel_parameters

Kernel parameters. Read more...

property is_tuning_complete

Check if kernel parameter tuning is complete. Read more...

tune_kernel_parameters()

Start tuning kernel parameters. Read more...


Members inherited from StreamingMethod:

period

Number of integration steps covered by streaming step. Read more...

mpcd_particle_force

Body force on MPCD particles. Read more...


Members defined in BounceBack:

geometry

Surface to bounce back from (read only).

Type:

hoomd.mpcd.geometry.Geometry

check_mpcd_particles()

Check if MPCD particles are inside geometry.

This method can only be called after this object is attached to a simulation.

Returns:

True if all MPCD particles are inside geometry.

Examples:

assert stream.check_mpcd_particles()