mpcd.force¶
Overview
Body force. |
|
Block force. |
|
Constant force. |
|
Sine force. |
Details
MPCD particle body forces.
MPCD can apply a body force to each MPCD particle as a function of position.
The external force should be compatible with the chosen
Geometry. Global momentum conservation can be
broken by adding a body force, so care should be chosen that the entire model
is designed so that the system does not have net acceleration. For example,
solid boundaries can be used to dissipate momentum, or a balancing force can be
applied to particles that are embedded in the MPCD particles through the
collision step. Additionally, a thermostat will likely be required to maintain
temperature control in the driven system.
- class hoomd.mpcd.force.BlockForce(force, separation=None, width=None)¶
Bases:
BodyForceBlock force.
- Parameters:
The
forcemagnitude F is applied in the x direction on the MPCD particles in blocks defined along the y direction by theseparation\(2H\) and thewidth\(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
BlockForcecan 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
- separation¶
Distance between the centers of the blocks.
Example:
Ly = simulation.state.box.Ly force.separation = Ly / 2
- Type:
- class hoomd.mpcd.force.BodyForce¶
Bases:
Body force.
The
BodyForceis a body force applied to each MPCD particle. This class should not be instantiated directly. It exists for type checking.
- class hoomd.mpcd.force.ConstantForce(force)¶
Bases:
BodyForceConstant force.
The same constant force is applied to all MPCD particles, independently of time and position. This force is useful for simulating pressure-driven flow in conjunction with a confined geometry having no-slip boundary conditions. It is also useful for measuring diffusion coefficients with nonequilibrium methods.
Example:
force = hoomd.mpcd.force.ConstantForce((1.0, 0, 0)) stream = hoomd.mpcd.stream.Bulk(period=1, mpcd_particle_force=force) simulation.operations.integrator.streaming_method = stream
- class hoomd.mpcd.force.SineForce(amplitude, wavenumber)¶
Bases:
BodyForceSine force.
- Parameters:
SineForceapplies a force with amplitude F in x that is sinusoidally varying in y with wavenumber k to all MPCD particles:\[\mathbf{F}(\mathbf{r}) = F \sin (k r_y) \mathbf{e}_x\]Typically, the wavenumber should be something that is commensurate with the simulation box. For example, \(k = 2\pi/L_y\) will generate one period of the sine.
Example:
Sine force with one period.
Ly = simulation.state.box.Ly force = hoomd.mpcd.force.SineForce( amplitude=1.0, wavenumber=2 * numpy.pi / Ly) stream = hoomd.mpcd.stream.Bulk(period=1, mpcd_particle_force=force) simulation.operations.integrator.streaming_method = stream