ReverseNonequilibriumShearFlow

class hoomd.mpcd.update.ReverseNonequilibriumShearFlow(trigger, num_swaps, slab_width, target_momentum=inf)

Bases: Updater

Reverse nonequilibrium shear flow.

Parameters:
  • trigger (hoomd.trigger.trigger_like) – Select the time steps on which to to swap momentum.

  • num_swaps (int) – Maximum number of pairs to swap per update.

  • slab_width (float) – Width of momentum-exchange slabs.

  • target_momentum (float) – Target magnitude of momentum for swapped particles (must be positive).

ReverseNonequilibriumShearFlow generates a bidirectional shear flow in x by imposing a momentum flux on MPCD particles in y. Particles are selected from two momentum-exchange slabs with normal to y, width w, and separated by \(L_y/2\). The lower slab accordingly has particles with \(-L_y/2 \le y < L_y/2 + w\), while the upper slab has particles with \(0 \le y < w\).

MPCD particles are sorted into these slabs, and the particles whose x momenta are closest to the target_momentum \(p_0\) in the lower slab and \(-p_0\) in the upper slab are selected for a momentum swap. Up to num_swaps swaps are executed each time.

The amount of momentum transferred from the lower slab to the upper slab is accumulated into summed_exchanged_momentum. This quantity can be used to calculate the momentum flux and, in conjunction with the shear velocity field that is generated, determine the shear viscosity.

Examples:

To implement the method as originally proposed by Müller-Plathe, only the fastest particle and the slowest particle in the momentum-exchange slabs are swapped. Set num_swaps to 1 and target_momentum at its default value of infinity.

flow = hoomd.mpcd.update.ReverseNonequilibriumShearFlow(
    trigger=1, num_swaps=1, slab_width=1
)
simulation.operations.updaters.append(flow)

An alternative approach proposed by Tenney and Maginn swaps particles that are instead closest to the target_momentum, typically requiring more swaps per update.

flow = hoomd.mpcd.update.ReverseNonequilibriumShearFlow(
    trigger=1, num_swaps=10, slab_width=1, target_momentum=5
)
simulation.operations.updaters.append(flow)

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 TriggeredOperation:

trigger

The trigger to activate this operation. Read more...


Members defined in ReverseNonequilibriumShearFlow:

num_swaps

Maximum number of times to swap momentum per update.

Example:

flow.num_swaps = 10
Type:

int

slab_width

Width of momentum-exchange slabs.

Example:

flow.slab_width = 1
Type:

float

target_momentum

Target momentum for swapped particles.

Example:

flow.target_momentum = 5
Type:

float

property summed_exchanged_momentum

Total momentum exchanged.

This quantity is the total momentum exchanged from the lower slab to the upper slab.

(Loggable: category=”scalar”)

Type:

float