RMPCDMD
mpcd Module Reference

Routines to perform MPCD dynamics. More...

## Functions/Subroutines

double precision function, dimension(3), public rand_sphere (state)
Return random point on the surface of a sphere. More...

subroutine, public simple_mpcd_step (particles, cells, state, alpha, thermostat, T, hydro)
Perform a collision. More...

subroutine, public wall_mpcd_step (particles, cells, state, wall_temperature, wall_v, wall_n, thermostat, bulk_temperature, alpha, keep_cell_v)
Collisions in partially filled cells at the walls use the rule of Lamura et al (2001) [2]. More...

double precision function, public compute_temperature (particles, cells, tz)
Compute the temperature of a mpcd solvent. More...

subroutine, public compute_rho (particles, rhoz)
Compute density profile along z. More...

subroutine, public compute_vx (particles, vx)
Compute x-velocity profile along z. More...

subroutine, public mpcd_stream_periodic (particles, cells, dt)
Stream MPCD particles in a periodic system. More...

subroutine, public mpcd_stream_xforce_yzwall (particles, cells, dt, g)
Stream MPCD particles with a force in the x-direction and specular or bounce-back conditions in y. More...

subroutine yzwall_collision (x0, v0, x, v, im, L, t, bc, g)
Collide a particle in y and z with constant acceleration in x. More...

pure integer function change_23 (i)
Return 2 for 3 and 3 for 2. More...

subroutine, public bulk_reaction (p, c, from, to, rate, tau, state)
Apply a bulk unimolecular RMPCD reaction. More...

subroutine, public bulk_reaction_endothermic (p, c, from, to, rate, tau, state, delta_u)
Apply a endothermic bulk unimolecular RMPCD reaction. More...

subroutine, public mpcd_stream_nogravity_zwall (particles, cells, dt)

subroutine, public rescale_cells (particles, cells, state, T)
Rescale the kinetic energy of all cells. More...

## Detailed Description

Routines to perform MPCD dynamics.

User manual: algorithms

MPCD collisions are implemented in simple_mpcd_step and wall_mpcd_step, that takes into account a wall in the z-direction.

Streaming is achieved by the mpcd_stream_periodic, mpcd_stream_xforce_yzwall and mpcd_stream_nogravity_zwall routines. Only a single stream routine should be used, depending on the simulation setup. A further call to md_vel is needed in the presence of forces.

## ◆ bulk_reaction()

 subroutine, public mpcd::bulk_reaction ( type(particle_system_t), intent(inout) p, type(cell_system_t), intent(inout) c, integer, intent(in) from, integer, intent(in) to, double precision, intent(in) rate, double precision, intent(in) tau, type(threefry_rng_t), dimension(:), intent(inout) state )

Apply a bulk unimolecular RMPCD reaction.

Definition at line 606 of file mpcd.f90.

## ◆ bulk_reaction_endothermic()

 subroutine, public mpcd::bulk_reaction_endothermic ( type(particle_system_t), intent(inout) p, type(cell_system_t), intent(inout) c, integer, intent(in) from, integer, intent(in) to, double precision, intent(in) rate, double precision, intent(in) tau, type(threefry_rng_t), dimension(:), intent(inout) state, double precision, intent(in) delta_u )

Apply a endothermic bulk unimolecular RMPCD reaction.

Definition at line 647 of file mpcd.f90.

## ◆ change_23()

 pure integer function mpcd::change_23 ( integer, intent(in) i )
private

Return 2 for 3 and 3 for 2.

This routine is used for computing alternate dimensions y and z in collision detection.

Definition at line 595 of file mpcd.f90.

## ◆ compute_rho()

 subroutine, public mpcd::compute_rho ( type(particle_system_t), intent(in) particles, type(histogram_t), intent(inout) rhoz )

Compute density profile along z.

Definition at line 411 of file mpcd.f90.

## ◆ compute_temperature()

 double precision function, public mpcd::compute_temperature ( type(particle_system_t), intent(inout) particles, type(cell_system_t), intent(in) cells, type(profile_t), intent(inout), optional tz )

Compute the temperature of a mpcd solvent.

User manual: algorithms - temperature-computation

Definition at line 343 of file mpcd.f90.

## ◆ compute_vx()

 subroutine, public mpcd::compute_vx ( type(particle_system_t), intent(in) particles, type(profile_t), intent(inout) vx )

Compute x-velocity profile along z.

Definition at line 426 of file mpcd.f90.

## ◆ mpcd_stream_nogravity_zwall()

 subroutine, public mpcd::mpcd_stream_nogravity_zwall ( type(particle_system_t), intent(inout) particles, type(cell_system_t), intent(in) cells, double precision, intent(in) dt )

Definition at line 703 of file mpcd.f90.

## ◆ mpcd_stream_periodic()

 subroutine, public mpcd::mpcd_stream_periodic ( type(particle_system_t), intent(inout) particles, type(cell_system_t), intent(in) cells, double precision, intent(in) dt )

Stream MPCD particles in a periodic system.

Definition at line 441 of file mpcd.f90.

## ◆ mpcd_stream_xforce_yzwall()

 subroutine, public mpcd::mpcd_stream_xforce_yzwall ( type(particle_system_t), intent(inout) particles, type(cell_system_t), intent(in) cells, double precision, intent(in) dt, double precision, intent(in) g )

Stream MPCD particles with a force in the x-direction and specular or bounce-back conditions in y.

MPCD particles near the walls must not be in the interaction range of a colloid, this is not verified programmatically.

Definition at line 465 of file mpcd.f90.

## ◆ rand_sphere()

 double precision function, dimension(3), public mpcd::rand_sphere ( type(threefry_rng_t), intent(inout) state )

Return random point on the surface of a sphere.

Ref. [4]

Definition at line 44 of file mpcd.f90.

## ◆ rescale_cells()

 subroutine, public mpcd::rescale_cells ( class(particle_system_t), intent(inout) particles, class(cell_system_t), intent(in) cells, type(threefry_rng_t), dimension(:), intent(inout) state, double precision, intent(in) T )

Rescale the kinetic energy of all cells.

Definition at line 749 of file mpcd.f90.

## ◆ simple_mpcd_step()

 subroutine, public mpcd::simple_mpcd_step ( class(particle_system_t), intent(inout) particles, class(cell_system_t), intent(in) cells, type(threefry_rng_t), dimension(:), intent(inout) state, double precision, intent(in), optional alpha, logical, intent(in), optional thermostat, double precision, intent(in), optional T, logical, intent(in), optional hydro )

Perform a collision.

Use the rule defined in Ref. [3] to collide the particles cell-wise.

User manual: algorithms - mpcd

Optionally use MPC-AT thermostat, with the possibility of switching off the conservation of momentum and energy.

Definition at line 72 of file mpcd.f90.

## ◆ wall_mpcd_step()

 subroutine, public mpcd::wall_mpcd_step ( class(particle_system_t), intent(inout) particles, class(cell_system_t), intent(in) cells, type(threefry_rng_t), dimension(:), intent(inout) state, double precision, dimension(2), intent(in), optional wall_temperature, double precision, dimension(3,2), intent(in), optional wall_v, integer, dimension(2), intent(in), optional wall_n, logical, intent(in), optional thermostat, double precision, intent(in), optional bulk_temperature, double precision, intent(in), optional alpha, logical, intent(in), optional keep_cell_v )

Collisions in partially filled cells at the walls use the rule of Lamura et al (2001) [2].

If thermostatting is enabled, MPCD-AT is used.

If keep_cell_v is disabled (the default is enabled), the center of mass velocity of the cells is set to zero.

Definition at line 195 of file mpcd.f90.

## ◆ yzwall_collision()

 subroutine mpcd::yzwall_collision ( double precision, dimension(3), intent(inout) x0, double precision, dimension(3), intent(inout) v0, double precision, dimension(3), intent(inout) x, double precision, dimension(3), intent(inout) v, integer, dimension(3), intent(inout) im, double precision, dimension(3), intent(in) L, double precision, intent(in) t, integer, dimension(3), intent(in) bc, double precision, intent(in), optional g )
private

Collide a particle in y and z with constant acceleration in x.

Periodic boundary conditions are applied in x

Definition at line 512 of file mpcd.f90.