Home
        DL MESO USER MANUAL - Scientific Computing Department
         Contents
1.         4   al  3 PISAS  Ko   O NIN  IN      I  ol jo  SHI IN  elOl mim     al   M  TFT  a ha  re             Speed vector       Ci z       Ci y       Cia                                                 12  13  14  15  16  17  18  19  20  21                                  22  23  24  25  26                      36 CHAPTER 4  DL  MESO _LBE BASIC DEFINITION    Table 4 1  Boundary condition category          value meaning   0 liquid   10 domain boundary   11 inside solid   12 on grid bounce back boundary  13 mid link bounce back boundary    100 199   constant speed  composition and temperature boundary   200 299   constant speed  Neumann composition and temperature boundary  300 399   constant speed and composition  Neumann temperature boundary  400 499   constant speed and temperature  Neumann composition boundary  500 599   constant pressure  composition and temperature boundary   600 699   constant pressure  Neumann composition and temperature boundary  700 799   constant pressure and composition  Neumann temperature boundary  800 899   constant pressure and temperature  Neumann composition boundary          4 2 Data structure    4 2 1 Storage of particle distribution functions    For a system with a square lattice  the total number of grid points   lbsy nx x lbsy ny x lbsy nz  where  lbsy nx  lbsy ny and lbsy nz are the numbers of grid points along the x   y  and z axes respectively  The    grid points are arranged in a serial order of    9000  9001        900 1bsy nz gt  
2.       lur  1  1   Car  ii  lt rotr  U  rig    id SR de  11 64   00 Tij 2 To T Tmax       11 6  BOND INTERACTIONS BETWEEN PARTICLES 153    3  Marko Siggia Worm Like Chain  WLC  37               2  kgT 1 1 y ag    Tij Tij T ij  lt Tmaz  U  riz    lt  We  MA AE  haa  HST  11 65   oo Tij   Tmax  4  Morse potential bond 44    U  riz    De  1     exp  8  rij     ro      11 66     where Tij   Ti     T   ro is an equilibrium bond length  rmaz the maximum specified bond length or extension  k  is a spring force constant  A  the persistence length of a wormlike chain  De the potential well depth and p the  potential    width        The force on particle    due to a bond potential is obtained from the general formula   3 1 o  g     a Ca  Orij    U tr   rig  11 67     Tij    with the force acting on particle j equal to the negative of this  and the virial contribution from the stretching  bond given by    with only one contribution per bond      11 6 2 Bond angles    DL_MESO_DPD includes three methods for modelling potentials and forces between three bonded particles due  to the angle formed between them  0  x  The potentials are given as follows     1  Harmonic     K  U  ijk    5  Oije     00      11 69   2  Harmonic cosine   U  ijk    5  cos 65      COS bo      11 70   3  Cosine   U  Oijk    A  L   cos  m0j x           11 71     where A and    are angle force constants  m is the multiplicity     the angle at minimum potential and 0y an    equilibrium bond angle     The angle across par
3.     0 r2      1     exp    28rij   1  28ra  1   Bra    11 0   2  4nr   2  Wi ij 2  ij ij rij   x    152 CHAPTER 11  DL MESO DPD FEATURES    Even though the forces on frozen particles are ignored during integration  these do contribute to the system    potential energy  virial and stress tensor terms and should therefore be evaluated     The self energy correction term is constant for a given system for all time steps and is equal to    Ta  Us       3 oe  11 61   An  i    while the system charge correction is  2  cc T  Ui   aay 20 l  11 62     No additional forces are required for these terms     In DL_MESO_DPD  the module ewald_module contains the most important routines for calculating electrostatic  interactions using the algorithm described above  The real space  short range  component is calculated  in  routine ewald_real_slater  using a link cell algorithm with a cutoff radius of re  a larger boundary halo  than for standard pairwise interactions is therefore required  The reciprocal space  long range  component is  calculated using the scheme described by  58   parallelized by distribution over atomic sites  which requires  global summations but is more efficient in terms of memory usage than distribution of k vectors  The routine  ewald reciprocal also adds the self interaction and charged system corrections  which are calculated using  the routine elecgen in config module  The routine ewald_frozen_slater calculates the corrections to forces   potential energy  virial 
4.     The number of additional particles created during import of particle forces is greater than the current processor  can accommodate     Action  This error message suggests non constant particle densities across the system and poor load balancing   The user may wish to use the densvar directive in the CONTROL file to increase the value of maxdim and thus    accommodate larger numbers of particles     Message 72  import coordinate buffers exceeded for lees edwards shear    The number of additional particles created during import of particle forces with Lees Edwards shearing is greater  than the current processor can accommodate     Action  This error message suggests non constant particle densities across the system and poor load balancing   The user may wish to use the densvar directive in the CONTROL file to increase the value of maxdim and thus    accommodate larger numbers of particles     Message 81  export coordinate buffers exceeded    The number of additional particles created during export of particles into boundary halos is greater than the  current processor can accommodate     Action  This error message suggests non constant particle densities across the system and poor load balancing   The user may wish to use the densvar directive in the CONTROL file to increase the value of maxdim and thus    accommodate larger numbers of particles     236 APPENDIX C  DL MESO _DPD ERROR MESSAGES    Message 82  export coordinate buffers exceeded for lees edwards shear  The numb
5.     e Comments    The serial version of this function returns 1     timchk    e Header records  SUBROUTINE timchk ktim  time     e Function  Determines the time elapsed since the start of the calculation run and  if ktim  gt  0  prints the time to the  OUTPUT file     e Dependencies    None    e Arguments  ktim input integer  time output  real KIND dp     e Comments  The serial version of DL_MESO_DPD uses the generic SYSTEM_CLOCK call  while the parallel version uses  MPI_wtime     13 2 4 error_module    This module is used to print error messages and shut down DL_MESO_DPD in a controlled manner  It requires    the modules constants and comms_module to be loaded beforehand     178 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    error    e Header records  SUBROUTINE error  idnode  iode  value     e Function  Prints user friendly error message in OUTPUT file and closes down DL_MESO_DPD     e Dependencies    abortcomms    e Arguments  idnode input integer  iode input integer    value input integer    e Comments  The error code iode closes down DL _MESO_DPD when positive  negative values can be used to print    warning messages for non fatal problems     13 2 5 parse_utils  getword    e Header records  CHARACTER  LEN mxword  FUNCTION getword  txt  n     e Function  Obtains the nth word from a line of text txt separated by spaces or commas     e Dependencies    None    e Arguments  txt input  character LEN     n input integer    getword output  character LEN mxword     parseint    e 
6.     i   eia  a  fi   T7    s  Tf  M s   l    fSiteFluidIncomCollisionMRTSegregation    e Header records  int fSiteFluidIncomCollisionMRTSegregation double  startpos  double  sitespeed  double  bodyforce     double  phaseindex     e Function  Calculates collisions and phase segregation for the Lishchuk algorithm at a grid point using Multiple   Relaxation Time  MRT  models for incompressible fluids     e Dependencies  fGetAllMassSite  fGetTotMassSite  fReciprocal  fGetMomentEquilibriumFIncom  fGetMRTCollide    e Arguments  startpos input double pointer  sitespeed input array of doubles  bodyforce input double pointer    phaseindex input double pointer    e Comments  Collisions are carried out on a single    achromatic    fluid using multiple relaxation time  MRT  schemes 33   8   fluid segregation takes place using the D   Ortona algorithm  9         p   pop   A     fi a    gt  BP  z   i   Nab   P bla P    fSiteFluidCollisionMRT Guo    e Header records  int fSiteFluidCollisionMRTGuo double  startpos  double  sitespeed  double  bodyforce     e Function  Calculates collisions at a grid point using Multiple Relaxation Time  MRT  models coupled with Guo like  forcing terms for compressible fluids     e Dependencies  fGetOneMassSite  fGetMomentEquilibriumF  fGetMomentForce  fGetMRTCollide    108 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Arguments  startpos input double pointer  sitespeed input array of doubles    bodyforce input double pointer    e Comments  Collisions for eac
7.    11    12    13    14           15     Hans C  Andersen  Molecular dynamics simulations at constant pressure and or temperature  Journal of  Chemical Physics  72 4  2384 2393  1980     H  J  C  Berendsen  J  P  M  Postma  W  F  van Gunsteren  A  DiNola  and J  R  Haak  Molecular dynamics  with coupling to an external bath  Journal of Chemical Physics  81 8  3684 3690  1984     Gerhard Besold  Ilpo Vattulainen  Mikko Karttunen  and James M  Polson  Towards better integrators for  dissipative particle dynamics simulations  Physical Review E  62 6  R7611 R7614  December 2000     P  L  Bhatnagar  E  R  Gross  and M  Krook  A model for collision processes in gases  I  Small amplitude  processes in charged and neutral one component systems  Physical Review  94 3  511 525  May 1954     A  Chatterjee  Modification to Lees Edwards periodic boundary condition for dissipative particle dynamics  simulation with high dissipation rates  Molecular Simulation  33 15  1233 1236  2007     Shiyi Chen and Gary D  Doolen  Lattice Boltzmann method for fluid flows  Annual Review of Fluid  Mechanics  30 1  329 364  1998     Paul J  Dellar  Bulk and shear viscosities in lattice Boltzmann equations  Physical Review E  64 3  031203   August 2001     Dominique d   Humieres  Irina Ginzburg  Manfred Krafczyk  Pierre Lallemand  and Li Shi Luo  Multiple   relaxation time lattice Boltzmann models in three dimensions  Philosophical Transactions of the Royal  Society of London  Series A  Mathematical  Physic
8.    22    23    24    25    26          27    28    29          30          31    32    33    34          BIBLIOGRAPHY    Robert D  Groot and Patrick B  Warren  Dissipative particle dynamics  Bridging the gap between atomistic  and mesoscopic simulation  Journal of Chemical Physics  107 11  4423 4435  1997     Andrew J  Gunstensen  Daniel H  Rothman  St  phane Zaleski  and Gianluigi Zanetti  Lattice Boltzmann  model of immiscible fluids  Physical Review A  43 8  4320 4327  April 1991     Zhaoli Guo  Baochang Shi  and Chuguang Zheng  A coupled lattice BGK model for the Boussinesq  equations  International Journal for Numerical Methods in Fluids  39 4  325 342  2002     Zhaoli Guo  Chuguang Zheng  and Baochang Shi  Discrete lattice effects on the forcing term in the lattice  Boltzmann method  Physical Review E  Statistical  Nonlinear and Soft Matter Physics  65 4  046308  April  2002     I  Halliday  A  P  Hollis  and C  M  Care  Lattice Boltzmann algorithm for continuum multicomponent  flow  Physical Review E  Statistical  Nonlinear and Soft Matter Physics  76 2  026708  2007     I  Halliday  R  Law  C  M  Care  and A  Hollis  Improved simulation of drop dynamics in a shear flow at  low Reynolds and capillary number  Physical Review E  Statistical  Nonlinear and Soft Matter Physics   73 5  056708  2006     Cecil Hastings  Approximations for digital computers  Princeton University Press  Princeton  NJ  1955     Xiaoyi He  Shiyi Chen  and Gary D  Doolen  A novel thermal model for
9.    734   PCBCETR 743  PCBCETL 744   PCBCEDL 745   PCBCEDR 746  PCBCETF 747   PCBCELF 748   PCBCEDF 749  PCBCERF 750   PCBCETB 751   PCBCELB 752    PCBCEDB 753   PCBCERB 754   PBBPST 821  PBBPSD 822   PBBPSL 823   PBBPSR 824  PBBPSF 825   PBBPSB 826   PBBCCTRB   827    PBBCCTLB   828   PBBCCDLB   829   PBBCCDRB   830  PBBCCTRF   831   PBBCCTLF   832   PBBCCDLF   833  PBBCCDRF   834   PBBCETR 843   PBBCETL 844  PBBCEDL 845   PBBCEDR 846   PBBCETF 847  PBBCELF 848   PBBCEDF 849   PBBCERF 850  PBBCETB 851   PBBCELB 852   PBBCEDB 853  PPBCERB 854                      4 2 3 Storage of running information    The Lattice Boltzmann component of DL MESO defines three structures to store the system  information  The  parameters in these structures are listed in Tables 4 4  4 5  4 6 and 4 7     Table 4 4  System information             parameter   meaning   lbsy nd space dimension   lbsy nq number of discrete speeds   lbsy nf number of fluids   lbsy nc number of solutes   lbsy nt number of temperature scalars  0 or 1    lbsy pf phase field order parameter   lbsy  nx number of grid points in x direction   lbsy ny number of grid points in y direction   lbsy nz number of grid points in z direction  lbsy nz   1 when 1bsy nd   2        4 3 The Parameters and Their Functions    Table 4 8 lists all the parameters defined in DL_MESO_LBE  The whole range parameters are named with the  prefix 1b  Because DL_MESO is an ongoing project and new parameters might be added to the package in the  future 
10.    a ete os  Ore Fig x Fal    ar    F nF jr    005     Sei     Fig Fyre   005     Sen      215  mirada  Se      945    Calla  de     50     11 88   a ee Edd  are  Pin X Peal    Wh  IFjnTjml    Oa     Sex     Fa etl  025     den       215    FerTet  a   Sek     ej     Fin Fra    Sek     Fer   11 89           It can be shown both algebraically and thermodynamically that the dihedral makes no contribution to the  virial 59      Improper dihedrals     which limit the geometry of molecules     can be applied using the same procedure as  standard dihedrals and no distinction is made between them in DL_MESO_DPD     11 7 Surface interactions    The default boundaries for a simulation box are periodic  i e  particles leaving the system are replaced at  the opposite face with the same velocity  Certain systems may require alternative boundary conditions and  DL_MESO_DPD can include these at the system boundaries  The directive surface in the CONTROL file can  be used to specify the type of surface interaction  hard  frozen or shear  and which surface s  are to be  included  srfx  srfy  srfz  each set to 0 for periodic boundaries and 1 or greater for other types   Parameters  required for wall particle interactions can be specified using the same directive in the FIELD file  The module    surface module includes routines to set up and apply boundary conditions at those surfaces     Care should be taken to ensure that the initial configuration does not include bonds crossing any boundary
11.    bic particles     14 7 VesicleFormation    This simulation example consists of 37 440 unbonded water particles and 1008 molecules  each consisting of  one hydrophilic head particle and three hydrophobic tail particles bonded together with stiff harmonic bonds  of equilibrium length 1 0 between them 71   The molecules represent amphiphiles and during the course of  the simulation self assemble into a vesicle and encapsulate a number of water particles  Figure 14 7 shows the  self assembled vesicle  both in three dimensions and in a cross section to show the encapsulated water  An  AVI  video file of the simulation can be found in the Example Simulations page of the DL MESO website         a  Vesicle  water omitted for clarity   b  Cross section orthogonal to z axis    Figure 14 7  Visualizations of DPD VesicleFormation test case at t   50 000  red for hydrophile  green for  hydrophobe  blue for water     14 8  POISEUILLEFLOW 219    14 8 PoiseuilleFlow    This simulation example consists of 3000 unbonded particles in a box of 10 x 10 x 10 DPD length units with  walls of frozen particles added to the surfaces orthogonal to the x axis of thickness 1 DPD length unit and  particle density of 3  A constant body force in the direction of the y axis is added to each non frozen particle  which  in combination with the frozen particle walls approximating no slip boundaries  gives Poiseuille flow of  the DPD fluid  Figure 14 8 gives a snapshot of the system at the final time step  as 
12.    e Header records  SUBROUTINE importdensity_shear  nlimit  mdir  begin  final  shove  shovel  shove2  sidel   side2     e Function  Imports local densities from boundary halos for Lees Edwards shearing     e Dependencies  error  msg_receive_unblocked  msg_receive_sca_blocked  msg_send_blocked  msg_send_sca_blocked    msg_wait    13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 195    e Arguments  nlimit input output integer       mdir input integer   begin input real KIND dp   final input real KIND dp   shove input real KIND dp   shovel input real KIND dp   shove2 input real KIND dp   sidel input real KIND dp   side2 input real KIND dp        e Comments  Only exists in parallel version of DL_MESO_DPD  This routine requires information for the two dimensions  along the surface of the shearing boundary  the variables shove1 and shove2 represent the displacement    due to shear  while side1 and side2 are the domain dimensions     export    e Header records  SUBROUTINE export  nlimit  mdir  mp  begin  final  shove  skip   Parallel version   SUBROUTINE export  nlimit  mdir  begin  final  shove   Serial version     e Function    Exports particle data  positions  velocity  to neighbouring domain as boundary halo     e Dependencies  error  global_sca_and_all  Parallel version only   msg_receive_unblocked  Parallel version only   msg_receive_sca_blocked  Parallel version only   msg_send_blocked  Parallel version only   msg_send_sca_blocked  Parallel version only     msg_wait  Parallel v
13.    integer    integer    output double precision    7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 69    e Comments  Mass density is calculated according to the definition p   gt   fi  In the first case  startpos is the start  point for the summation of particle distribution functions and must be assigned correctly  The second  case carries out the same calculation for the fpos th fluid and tpos th grid point  while the third carries  it out for the fpos th fluid at the grid point indicated by the Cartesian coordinate  xpos  ypos  zpos      The latter two are more readable to the user but a bit slower to carry out     fGet AllMassSite    e Header records  three cases   int fGetAllMassSite double  rho  double  startpos   int fGetAllMassSite int fpos  long tpos   int fGetAllMassSite int fpos  int xpos  int ypos  int zpos     e Function    Calculates the individual mass densities of all fluids at a grid point     e Dependencies    None    e Arguments  startpos input double pointer    tpos input long integer   xpos input integer   ypos input integer   zpos input integer   rho output double precision array    e Comments  Mass density is calculated according to the definition p   gt   fi  In the first case  startpos is the start  point for the summation of particle distribution functions and must be assigned correctly  The second  case carries out the same calculation for the tpos th grid point  while the third carries it out at the grid  point indicated by the Cartesian coordinate  xp
14.   2 for z component    sets velocity at top boundary for all fluids   sets velocity at bottom boundary for all fluids   sets velocity at left boundary for all fluids   sets velocity at right boundary for all fluids   sets velocity at front boundary for all fluids   sets velocity at back boundary for all fluids   sets initial density for fluid f throughout system  f between 0 and 1bsy nf   1   sets constant density for incompressible fluid f   sets density for fluid f at top boundary   sets density for fluid f at bottom boundary   sets density for fluid f at left boundary   sets density for fluid f at right boundary   sets density for fluid f at front boundary       sets density for fluid f at back boundary  sets relaxation time  vy  for fluid f  sets relaxation frequency Ga  for fluid f       2Either the keyword or the number can be used to specify the types   3If set to an unrecognised word or to 0  interactions will be switched off     6 1  INPUT FILES    bulk_relaxation_fluid_f  bulk_relax_freq_fluid_f    solute_ini_s    solute_top_s  solute_bot_s  solute_lef_s  solute_rig_s  solute_fro_s  solute_bac_s  relax_solute_s  relax_freq_solute_s  temperature_ini  temperature_top  temperature_bottom  temperature_left  temperature_right  temperature_front  temperature_back    heating_rate_sys    heating_rate_top  heating_rate_bottom  heating_rate_left  heating_rate_right  heating_rate_front  heating rate back  relax thermal  relax_freq_thermal  body_force_n    body _force_x_f  body
15.   BGK  model with the Guo forcing term for compressible fluids     e Dependencies  fGetAllMassSite  fGetAllMassSite  fReciprocal  fGetEquilibriumF    e Arguments  startpos input double pointer  sitespeed input array of doubles  bodyforce input double pointer  phaseindex input double pointer    e Comments  Collisions are carried out on a single    achromatic    fluid using the BGK single relaxation time 4   with the  Guo forcing term 19  also acting on the achromatic fluid  fluid segregation takes place using the D   Ortona  algorithm  9    pa ae ae ab PEL  fi  z t        fi  Zt    58 Wi     z   i   Nab   P ba P    fSiteFluidIncomCollisionmBGKGuo    e Header records  int fSiteFluidIncomCollisionBGKGuo double  startpos  double  sitespeed  double  bodyforce     e Function  Calculates collisions at a grid point using the Bhatnagar Grook Krook  BGK  model with the Guo forcing    term for incompressible fluids     e Dependencies  fGetOneMassSite  fReciprocal    fGetEquilibriumFIncom    7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 105    e Arguments  startpos input double pointer  sitespeed input array of doubles    bodyforce input double pointer    e Comments  Collisions for each fluid species are carried out using the BGK single relaxation time 4   with the following  Guo forcing term 19  acting on each fluid   1        eia  a  fi    gt  f   1      wi  3  eia Va    9      0  Fa    fSiteFluidIncomCollisionBGKGuoSegregation    e Header records  int fSiteFluidIncomCollisionBGKGuoSegreg
16.   Premnath and John Abraham  Three dimensional multi relaxation time  MRT  lattice   Boltzmann models for multiphase flow  Journal of Computational Physics  224 2  539 559  2007     P  Prinsen  P  B  Warren  and M  A  J  Michels  Mesoscale simulations of surfactant dissolution and  mesophase formation  Physical Review Letters  89 14  148302  September 2002     M  Revenga  I  Zuniga  and P  Espanol  Boundary conditions in dissipative particle dynamics  Com   puter Physics Communications  121 122 309 311  1999  Proceedings of the Europhysics Conference on  Computational Physics CCP 1998     A  G  Schlijper  P  J  Hoogerbrugge  and C  W  Manke  Computer simulation of dilute polymer solutions  with the dissipative particle dynamics method  Journal of Rheology  39 3  567 579  1995     Xiaowen Shan  Analysis and reduction of the spurious current in a class of multiphase lattice Boltzmann  models  Physical Review E  73 4  047701  2006     250     54      55     56    57    58    59          60    61    62    63    64    65                66    67    68          69          70     71    BIBLIOGRAPHY    Xiaowen Shan  Pressure tensor calculation in a class of nonideal gas lattice Boltzmann models  Physical  Review E  77 6  066702  June 2008     Xiaowen Shan and Hudong Chen  Lattice Boltzmann model for simulating flows with multiple phases and  components  Physical Review E  Statistical Physics  Plasmas  Fluids  and related interdisciplinary topics   47 3  1815 1819  March 1993     Xiao
17.   Zpos input long integer    fGetFracSite output double precision    fGetOneSpeedSite    e Header records  three cases   int fGetOneSpeedSite double  speed  double  startpos   int fGetOneSpeedSite double  speed  int fpos  long tpos   int fGetOneSpeedSite double  speed  int fpos  int xpos  int ypos  int zpos     e Function    Calculates the macroscopic speed of  compressible  fluid fpos at the grid point     e Dependencies    fReciprocal    72 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Arguments  startpos input double pointer    fpos input integer   tpos input long integer   xpos input integer   ypos input integer   Zpos input integer   speed output double precision array    e Comments  The calculation is based on vg   an is The second and third cases are slightly slower than the first    but more readable     fGetOneSpeedIncomSite    e Header records  three cases   int fGetOneSpeedIncomSite double  speed  double  startpos  double rho0   int fGetOneSpeedIncomSite double  speed  int fpos  long tpos   int fGetOneSpeedIncomSite double  speed  int fpos  int xpos  int ypos  int zpos     e Function    Calculates the macroscopic speed of incompressible fluid fpos at the grid point     e Dependencies    fReciprocal    e Arguments  startpos input double pointer    rho0 input double precision   fpos input integer   tpos input long integer   xpos input integer   ypos input integer   Zpos input integer   speed output double precision array    e Comments    The calculation is based on 
18.   and its ability to model  complex system geometries and or fluid interactions with comparatively little additional computational cost     3 2 Basic Definitions    Triangular and rectangular lattices are two of the most popular grid forms used in Lattice Boltzmann simulations     Triangular lattices have sixth order rotation isotropy and have been widely applied in two dimensional systems     23    24 CHAPTER 3  THE LATTICE BOLTZMANN EQUATION  BASIC THEORY    e g  the D2Q7 and D2Q13 models  Rectangular lattices have only fourth order rotation isotropy but can  more easily handle the simulation of three dimensional systems with complex boundary conditions  The local  equilibria for D2Q9 and D3Q27 lattice models can be derived a priori from the Maxwell equilibrium distribution   D3Q15 and D3Q19 models appear to be more popular than D3Q27 because the latter is much more expensive    in terms of computing cost     It is required that the equilibrium state should be able to reproduce elementary macroscopic fluid variables     p  ih  3 1     q  Pa   y Si   ia  3 2   i 0    where p is the density  fi the   th particle distribution function      the ith lattice link vector and ua the    macroscopic velocity along the a axis     In the Lattice Boltzmann method  the lattice link vectors     do not represent the thermal velocities of a particle  and therefore    EASY nea   3 3     Equation  3 3  implies that the temperature cannot ordinarily be derived from the lattice particle distrib
19.   nlimit input output integer       mdir input integer   begin input real KIND dp   final input real KIND dp   shove input real KIND dp   shovel input real KIND dp   shove2 input real KIND dp   sidel input real KIND dp   side2 input real KIND dp        e Comments  Only exists in parallel version of DL_MESO_DPD  Setting first to  true  imports both sets of forces   constant and variable   while setting to  false  imports just the variable forces  This routine is suitable  for thermostats where two types of forces need to be kept separate and or recalculated  i e  the DPD  thermostat with DPD Velocity Verlet integration  DPD VV  and Stoyanov Groot thermostat  This rou     tine requires information for the two dimensions along the surface of the shearing boundary  the variables    194 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    shovel and shove2 represent the displacement due to shear  while side1 and side2 are the domain    dimensions     importdensity    e Header records  SUBROUTINE importdensity  nlimit  mdir  mp  begin  final     e Function  Imports local densities from boundary halo     e Dependencies  error  global_sca_and_all  msg_receive_unblocked  msg_receive_sca_blocked  msg_send_blocked  msg_send_sca_blocked    msg_wait    e Arguments  nlimit input output integer    mdir input integer  mp input integer  begin input real KIND dp   final input real KIND dp   shove input real KIND dp     e Comments  Only exists in parallel version of DL_MESO_DPD     importdensity_shear 
20.   that will be non periodic  DL_MESO_DPD will ensure this is the case for simulations starting from scratch but  cannot check for bonds crossing non periodic boundaries in CONFIG files     156 CHAPTER 11  DL MESO DPD FEATURES    11 7 1 Hard reflecting boundaries  hard     This boundary condition is applied by using a combination of specular  free slip  reflection at the system  boundaries and a soft short range wall repulsion to reduce density oscillations 50   The reflection is achieved  by moving any particle leaving the system at a particular boundary back into it and inverting the velocity  component normal to the wall  but maintaining the tangential momentum   which is achieved with the routine    surfacebounce  The soft short range wall repulsion is given by    2  z  Uwatt Z    5 Awall a e  1        A  z  lt  Zc   11 90    c  where Awall a is the repulsive force magnitude with species a  z is the distance between the particle and the wall  and z  the surface repulsion range  The repulsion is applied at the same time as all pairwise forces using the  routine hardreflect  Since the walls are assumed to be non porous  no interactions across them are included    and thus boundary halos adjacent to walls are not used     The repulsive force magnitudes between the boundary and each species are specified in the FIELD file using the  directive surface  while the same directive in the CONTROL file is used to determine the surface repulsion cutoff  and which boundary surfaces sho
21.   twister generator mtrnd   i e     Ci x V12  u   0 5       which produces statistically similar results 10  and is computationally more efficient than using the Gaus     sian random number subroutine gaussmp  although this or the duni random number generator may be    substituted if required  For systems involving Lees Edwards boundary conditions  thermostats are not    applied between particle pairs that cross shearing boundaries 5      dragforces_dpdvv    Header records  SUBROUTINE dragforces_dpdvv  nlimit     Function    Recalculates dissipative forces between particles within cut off radius     Dependencies    None     Arguments    nlimit input integer    idnode input integer    Comments    Only required for DPD Velocity Verlet  DPD VV  integration     shearing boundaries are omitted  5      plcfor_     e Header records    SUBROUTINE plcfor_     Function    Particle pairs that cross Lees Edwards    Sets up parallel link cells structure and calculates forces  including those involving particles in boundary    halo      Dependencies  exportdata  parlnk  local_density    13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 211    importdensitydata   exportdensitydata   forces_    importdata  importdata_dpdvv1  importdata_dpdvv2  importdata_stoyanov     freeze_beads    freeze_beads    e Header records  SUBROUTINE freeze_beads    e Function    Quenches forces and velocities of frozen particles by resetting them to zero     e Dependencies    None     13 2 14 integrate module    This m
22.  11 IbpSUB    fWeakMemory    e Header records    inline void fWeakMemory       e Function    Terminates calculation if system has insufficient memory     96 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Dependencies    None    e Comments  If called  will print error message     error  cannot allocate more memory     fMemory Allocation    e Header records    int fMemoryAllocation      e Function    Allocates memory for lattice Boltzmann calculations     e Dependencies    fWeakMemory    e Comments    If memory allocation is unsuccessful  will print error message and stop calculation     fFreeMemory    e Header records    int fFreeMemory       e Function    Frees allocated memory     e Dependencies  None    fSetSerialDomain    e Header records    int fSetSerialDomain      e Function    Sets domain parameters for serial running     e Dependencies    None    e Comments    Default routine  sets domain boundary width 1bdm bwid to zero     fSetSerialDomainBuffer    e Header records  int   SetSerialDomainBuffer       e Function    Sets domain parameters for serial running including additional boundary points     e Dependencies    None    7 2  DL MESO _LBE SUBROUTINES AND FUNCTIONS 97    e Comments  Similar to fSetSerialDomain but does not modify the domain boundary width from its user specified    value     fStartDLMESO    e Header records  int fStartDLMESO  O     e Function  Announces start of DL_MESO_LBE run     e Dependencies    None    e Comments    If preferred  the call to this
23.  19     146 CHAPTER 11  DL MESO DPD FEATURES    where Ny is the number of degrees of freedom  for a three dimensional box containing N moving  i e  non   frozen  particles  Ny   3  N     1   yp and op   4  3mWykgT are respectively the drag and random coefficients  for the piston and Cp a is a Gaussian random number for dimension a  this is set to the same value for all three  dimensions if operating isotropically   When both yp and a  are set to zero  the Langevin barostat reduces to  the extended system method     The subsequent simulation cell size La can be determined by  La   Psala   ug aLa  11 20   g  with the barostat mass W  chosen to be equal to N bel  where Tp is the characteristic barostat time and  should be set equal to between r and oa    The velocities and positions of the particles are calculated by integration of slightly modified differential equa           tions   dvi a Esa 1      a aVia   Ky Vio   QU 11 21  dE Ein E man  d 1 0  A   Via   Ug ali a  11 22     where the force on particle 7  E  includes any thermostatting forces  the time integral of these forces can be  determined for all thermostat types     The implementation of this barostat is carried out using the Velocity Verlet scheme to integrate the equations  of motion for both the particles and the barostat  The first Velocity Verlet stage integrates the forces on the    particles  At Fj   t  Vi a  t   At    Vio  t    a E Atug aUi a  11 23   Mii  which is followed by a similar integration for the ba
24.  239    Bibliography 247    Acknowledgements    DL_MESO was developed under the auspices of the Engineering and Physical Sciences Research Council  EP   SRC  for the EPSRC   s Collaborative Computational Project for the Computer Simulation of Condensed Phases   CCP5      The members of the CCP5 DL_MESO consortium were     David M  Heyes  University of Surrey  Chris M  Care  Sheffield Hallam University  Peter V  Coveney  University College London  David Emerson  STFC Daresbury Laboratory  Rob English  North East Wales Institute  Andrea Ferrante  Unilever Port Sunlight  lan Halliday  Sheffield Hallam University  John Harding  University of Sheffield  Sebastian Reich  Imperial College  Bill Smith  STFC Daresbury Laboratory  Patrick B  Warren  Unilever Port Sunlight  Julia Yeomans  Oxford University   Many other people have given advice and encouragement in the development of DL_MESO  We gratefully    acknowledge the support of the following people  Maurice Leslie  Richard Wain  Alexandre Dupuis  Jonathan  Chin  Michael Dupin  Weiming Liu and John Purton     Particular thanks go to Rongshan Qin at Imperial College as the original author of the Lattice Boltzmann  Equation source code  DL_MESO_LBE  and the DL_MESO graphical user interface  and Richard Anderson at  STFC Daresbury Laboratory and Ard van Bergen at Novidec for their contributions to the Dissipative Particle  Dynamics source code  DL_MESO_DPD      Chapter 1    DL MESO General Information    1 1 Description    DL_MESO is
25.  Closes Message Passing Interface  MPI      e Dependencies    None    7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS    fGlobalValue    e Header records  six cases   int fGlobalValue double  vqua  int nnum   int fGlobalValue int  vqua  int nnum  int  vtot   int fGlobalValue int  vqua  int nnum   int fGlobalValue long int  vqua  int nnum     int fGlobalValue long int  vqua  int nnum  long int  vtot     e Function    Sums values from all processes and distributes the sum     fGlobalProduct    e Header records  two cases   int fGlobalProduct double  vqua  int nnum     int fGlobalProduct int  vqua  int nnum     e Function    Multiplies together values from all processors and distributes the product     fArrangeProcessors    e Header records    int fArrangeProcessors      e Function    Arrange processors according to system dimensions     e Comments    Calculations are based on  lbdm xdim  1bdm ydim  J1bdm zdim    lbsy nx  lbsy ny  lbsy nz       lbdm xdim x 1bdm ydim x 1bdm zdim   1bdm size    fDefineDomain    e Header records    int fDefineDomain    e Function  Determines domain parameters for system calculation   fDefineMessage    e Header records    int fDefineMessage      e Function    115    Defines vector messages for system  distribution functions  boundary properties and interaction forces      116 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    fDefineNeighbours    e Header records    int fDefineNeighbours      e Function    Calculates the names of neighbouring processes and the
26.  DPD simulations that are bonded together  i e  molecules  A random flight generation system is used to  generate the coordinates of bonded beads     which can form branched molecule chains     a constant distance  apart within a cube of a size specified by the user  which will be used by DL_MESO_DPD to insert the molecule  into the system     This utility can be compiled to produce the executable molecule exe with the command  e c    o molecule exe molecule generate cpp    if c   is the command for the available C   compiler  This utility can be run from the command line or via  the GUI in Set DPD Molecules  which runs the utility in a new command line shell window      When running the utility  if a FIELD file exists in the same directory as the executable  the number of species    and their names will be read from it  otherwise the user will be asked to enter this information and this will be    228 APPENDIX B  DL_MESO UTILITIES    written to a new FIELD file  The user will then be asked for the number of molecules required  the numbers of  bond  angles and dihedrals and their types and parameters     For each molecule  the user is asked for its name  the number to be included in the system and whether or  not isomers of the molecule can be included  The side length for the cube inside which the molecule will fit is  then required  followed by the bond length  the number of molecule chains and the number of particles for each  chain  If the chain in question is not the fir
27.  Figure 14 5  Visualizations of DPD Polyelectrolyte test case  red for polyelectrolyte polymer  green for salt  cations  cyan for anions  orange for counterions  water omitted for clarity     14 6 AmphiphileMesophases    This example consists of four separate simulations  each with 12 000 particles consisting of dimers  molecules  consisting of two particles  one hydrophilic and the other hydrophobic  with harmonic bonds of equilibrium  length 0 5 between them  and unbonded monomers 31   Defining the composition    as the ratio of DPD  particles within dimers to the total number of particles in the system  the interaction data for simulations with    218 CHAPTER 14  DL MESO DPD EXAMPLES    dimer compositions of 30   55   75  and 90  are provided with filenames FIELD 30  FIELD 55  FIELD 75  and FIELD 90 respectively   Each of these files should be renamed to FIELD to run the simulation  while the  CONTROL defining the simulation properties can be used for all four simulations      These systems provide four points on a phase diagram corresponding to isotropic dimer  hexagonal  lamellar  and isotropic monomer phases respectively  The final configurations obtained for each phase can be seen in  Figure 14 6  shown as isosurfaces of the hydrophobic particles to highlight the distinctions between the phases        A        a       0 30  b       0 55  c  4 0 75  d    0 90    Figure 14 6  Visualizations of DPD AmphiphileMesophases test case at final time step  isosurfaces of hydropho
28.  KIND dp    z component of piston velocity upz real KIND dp    x component of piston velocity at previous timestep upx1 real KIND dp    y component of piston velocity at previous timestep upy1 real KIND dp    z component of piston velocity at previous timestep upzi real KIND dp    piston mass  Wg  psmass real KIND dp    x component of piston force fpx real KIND dp    y component of piston force fpy real KIND dp    z component of piston force fpz real KIND dp           2ykpT    1This incorporates the time step for Velocity Verlet integration and is thus equal to 4  HB     2The pair list arrays are not allocated for the DPD thermostat  MD VV or DPD VV      A    10 2  THE PARAMETERS AND THEIR FUNCTIONS    Table 10 4  DL_ MESO_DPD Parameters  continued     137                         function parameter data type notation  instantaneous virial ivrl real KIND dp  A 3   Langevin random force parameter  op  sigmalang real KIND dp    electrostatic algorithm type etype integer   electrostatic coupling parameter  T  gammaelec real KIND dp    total system charge   gt  gt   qi  qchg real KIND dp    Ewald real space convergence parameter  a  alphaew real KIND dp    reciprocal of real space convergence parameter ralphaew real KIND dp    maximum reciprocal vector size in x dimension  k7 9    kmax1 integer  gt 1   maximum reciprocal vector size in y dimension  k3    kmax2 integer  gt 1   maximum reciprocal vector size in z dimension  k3 o     kmax3 integer 21   Ewald self interaction correcti
29.  PCTCCTLF  PCTCETR  PCTCEDR  PCTCEDF  PCTCELB  PBTPST  PBTPSR  PBTCCTRB  PBTCCDRB  PBTCCDLF       122  125  128  131  134  145  148  151  154  223  226  229  232  243  246  249  252  321  324  327  330  333  344  347  350  353  422  425  428  431  434  445  448  451  454  523  526  529  532  543  546  549  552  621  624  627  630  633       VCTPSL  VCTPSB  VCTCCDLB  VCTCCTLF  VCTCETR  VCTCEDR  VCTCEDF  VCTCELB  VBBPST  VBBPSR  VBBCCTRB  VBBCCDRB  VBBCCDLF  VBBCETL  VBBCETF  VBBCERF  VBBCEDB  VCBPSD  VCBPSF  VCBCCTLB  VCBCCTRE  VCBCCDRF  VCBCEDL  VCBCELF  VCBCETB  VCBCERB  VBTPSL  VBTPSB  VBTCCDLB  VBTCCTLF  VBTCETR  VBTCEDR  VBTCEDF  VBTCELB  PCTPST  PCTPSR  PCTCCTRB  PCTCCDRB  PCTCCDLF  PCTCETL  PCTCETF  PCTCERF  PCTCEDB  PBTPSD  PBTPSF  PBTCCTLB  PBTCCTRF  PBTCCDRF       123  126  129  132  143  146  149  152  221  224  227  230  233  244  247  250  253  322  325  328  331  334  345  348  351  304  423  426  429  432  443  446  449  452  521  524  527  530  533  544  547  550  553  622  625  628  631  634       4 3  THE PARAMETERS AND THEIR FUNCTIONS 39    Table 4 3  Notation of boundary condition  continued        PBTCETR 643   PBTCETL 644   PBTCEDL 645  PBTCEDR 646   PBTCETF 647   PBTCELF 648  PBTCEDF 649   PBTCERF 650   PBTCETB 651  PBTCELB 652   PBTCEDB 653   PBTCERB 654  PCBPST 721   PCBPSD 722   PCBPSL 723  PCBPSR 724   PCBPSF 725   PCBPSB 726  PCBCCTRB   727   PCBCCTLB   728   PCBCCDLB   729  PCBCCDRB   730   PCBCCTRF   731   PCBCCTLF   732  PCBCCDLF   733   PCBCCDRF
30.  T     1 1 1 1 1 1  bulk  52 1  54 1  84 1  84  T  Tp TF Tf Tf  514     V    1    2     Ar    At    2  Tf bulk           9         33    1  I     2     2  1     2   2    1   11  4  4  1  1     11  4  4  1  2        11  4   4     4       8   1   36  Ci z    hiena     Wi        1   1   2   2   1   1   1       Weight factor       Ciy        1   1   1   1   2   2   1    Cia   1   1   1   1   1       1 3  10 12  4 9  13 18  Speed vector                12  13  14  15  16  17  18       4 1  LATTICE MODELS    D3Q19    11                                                                            11  4  1  1  1    11  4  1  1  2    ooo oo  ooo Oo       1   30  12  0  0  0  0  0  0  0    34    r     LTs    jne TF    9   bulk     5    CHAPTER 4  DL_MESO_LBE BASIC DEFINITION          p p  19         e amp 4    llp   po  is tiy   J   eea wept dy Pda   z de  qa     3Jx  dy jy  a   3ty  iz de  qsa ie 3Jz    A La 2j   j2 32  TT PO  ca  2  2 p  am    po  252     jy     Ja   Psw tte  med Wax 2    2  apap po   is  92   Pry daly  7 Po  Pye Jylz  ed Po  pe dada  mo   n  ma  0  m   0  0    38 07 Fo   Vy Fy   v2F       11  vs Fs   vyFy   004 E   Fx     2F    Fy   3Fy  Fz  S   2 2u  Fy      Uy Fy     v  F        207Fy     0yFy     vzF    2u  Ey     UzFs       vyFy     v  F    Uy Fy   vy Fo  Uy EF    uzFy  v2 Fy   UL Fs  0  0  0          T  1 1 1 1 1 1  bulk  52  1 54  1 54  1  54 77  4  Tf 1S4 Tp Tp Tp    16  516  516        a  aay     35    4 1  LATTICE MODELS    D3Q27          Weight factor        
31.  The HISTORY  files can be used with the utilities traject and trajectselected in the DPD utility directory  to produce plottable VMD files  with sets of bonded particles represented as residues  The utility local in  the same directory can calculate localized properties  e g  temperature  composition  from the same files and  produces VTK files with these properties as cell data  Appendix B gives instructions for their use     Statistical data file  CORREL    If the parameter 1corr is set to true  DL_MESO_DPD will generate an ANSI text file containing statistical data  every iscorr time steps  which can later be imported into a spreadsheet or used by graph plotting software  The  formatting of the data varies depending on which kinds of interactions  bonds  angles  dihedrals  electrostatics   were used and whether a barostat was applied  based on the overall format  in a single line      t Etot Ebpot tot Epot elec Enot bond Epot angle Ebpot dihed  P xx Cay Ozz Oye Coy Cyr Sze Ozy Ozz V T     bond  Toond max Tbond min  angle   ddihed     where t is the time  E energy  tot denoting total  pot potential   P pressure  o   stress tensor  V volume  T  temperature   Tpona  the mean bond length  rpond max aNd Trond min the maximum and minimum bond lengths    angle  the mean bond angle  in degrees  and  Odinea  the mean bond dihedral  in degrees   Any property  which does not vary or is not measured during the simulation  e g  volume for NVT ensembles  is omitted from    each line of
32.  The Stoyanov Groot thermostat is used for this  system to control both the fluid viscosity and system temperature  Figure 14 9 gives the time averaged emergent  velocity profile  yielding a shear rate of 0 1941  in DPD units  close to the applied shear rate of 0 2  against a  measured stress component  oyy       0 2063     220 CHAPTER 14  DL MESO DPD EXAMPLES       Time averaged horizontal velocity   lt v  gt                 IE 1 l   l 1 L 1 l 1 J  0 2 4 6 8 10  Vertical position  y       Figure 14 9  Plot of x component velocity from DPD ShearFlow test case  red line denotes best fit for deter   mining shear rate    14 10 VapourLiquid    This simulation example consists of 1000 unbonded water particles initially distributed uniformly in a box of  5 x 5 x 22 DPD length units  using the default many body DPD interactions with Aj       50 and By    25 to  apply vapour liquid interactions and surface tension 68  12   Figure 14 10 shows the system at the final timestep  after the water particles have coalesced into a single body surrounded by empty space           Figure 14 10  Visualization of system at final time step from DPD VapourLiquid test case    Appendix A    Manual compiliation and running of DL_MESO    A 1 DL MESO LBE    DL_MESO_LBE has been written in C   in a modular form and the main program codes     slbe cpp for  serial running  plbe cpp for parallel running     are designed to allow the user to change algorithms for collision   mesophases etc  by specifying them
33.  _force_y_f  body_force_z_f    boussinesq_force_n    boussinesq force_x_f  boussinesq_force_y_f  boussinesq_force_z_f  boussinesq_boussinesq_high  boussinesq_boussinesq_low  interaction_n   interaction_f _ fo  segregation   segregation_n    segregation_f_fo    Define space  lbin spa    57    sets bulk relaxation time  Tf buik  for fluid f   sets bulk relaxation frequncy  TF but    for fluid f   sets initial concentration for solute s throughout system  s between 0 and  lbsy nc     1    sets concentration for solute s at top boundary   sets concentration for solute s at bottom boundary   sets concentration for solute s at left boundary   sets concentration for solute s at right boundary    sets concentration for solute s at front boundary       sets concentration for solute s at back boundary   sets relaxation time  Ts  for solute s   sets relaxation frequency  T7    for solute s   sets initial temperature throughout system   sets temperature at top boundary   sets temperature at bottom boundary   sets temperature at left boundary   sets temperature at right boundary   sets temperature at front boundary   sets temperature at back boundary   sets rate of change in temperature  with time based on real life units  through   out system   sets rate of change in temperature at top boundary   sets rate of change in temperature at bottom boundary   sets rate of change in temperature at left boundary   sets rate of change in temperature at right boundary   sets rate of change in temper
34.  a general purpose mesoscopic simulation package developed at Daresbury Laboratory by Dr  Michael Seaton under the auspices of the Engineering and Physical Sciences Research Council  EPSRC  for  the EPSRC   s Collaborative Computational Project for the Computer Simulation of Condensed Phases  CCP5    The package is the property of the Science and Technology Facilities Council  STFC      DL_MESO is issued free under licence to academic institutions pursuing scientific research of a non commercial  nature  All recipients of the code must first agree to the terms and conditions of the licence and register with us  to be kept aware of new developments and discovered bugs  Commercial organisations interested in acquiring  the package should approach the Scientific Computing Department  STFC Daresbury Laboratory in the first  instance  Daresbury Laboratory is the sole centre for distribution of the package  Under no account is it to be  redistributed to third parties without consent of the owners     DL_MESO contains two mesoscale simulation methods     e Lattice Boltzmann Equation  included with version 1 0 and later     e Dissipative Particle Dynamics  included with version 2 0 and later     1 2 Functionality    The following is a list of the features that DL_MESO currently supports  Users are reminded that we are  interested in hearing what other features could be usefully incorporated  We obviously have ideas of our own    and CCP5 strongly influences developments  but other in
35.  ah eA a  Pee a bee oa ea ed 120  8 5 2D Lid avity rasas sia a sori 54 Foe ee Sk we A ee ee a 120  8 6  2D  RayleighBenardis aa tgs Sn ag eels oe ea AEB ee ee eo aed a  aS 121  80 2D Dropolear  tddi aes ee Bw Beak Savy Selah ee ete ae eA Rae Ee a 121  8 8   3D PhaseSeparation      4 2 2 face eee ele Ree Se ee ered a ee eee 122  8 9  SD Shear oid  tet ds de A he Ae do ah oe A dl ab tot bot Lal SA ee ae 122  8 10  3DRayleighBenard sce in apta ea ke A A eee PE ee ORE eae ee 123  II Dissipative Particle Dynamics  DPD  125  9 Dissipative Particle Dynamics  Basic Theory 127  91 JTiitroductiony  2s 4 dus ie SOAS a bate Geek SA eee RE RE AB ee Se 4 127  9 2  Outline of Method s 13 4  a a ae Se eee bo eG we Bh dd A 127  9 3 Equation of state and dynamic properties          ee 129  9 4 Derivation of Equilibrium    129  9 5 Summary of Dissipative Particle Dynamics          o    0    0000000000000  130  10 DL_MESO_DPD Basic Definition 131  10 2  Data  Structure ss  wart sow a  vay ee AAA A EE AA We whl Beat nee  at 131  10 2 The Parameters and Their Functions            134  11 DL_MESO_DPD Features 141  11 1 Domain decomposition and linked list cell calculations           0       0 000200  141  11 2 Thermostats and integration algorithms                     0000000000004 142  Td  Barostatss   22 ELA A ee Pe BE E nee eh ht BS dk oc  Ba 145  11 4 Particle particle interactions    147  11 5 Long ranged Electrostatic  Coulombic  Potentials    2    2 0 20    0 000000 0008  150  11 6 Bond inte
36.  all the specified time steps after equilibration containing the following  data for each cuboidal cell     e the mean velocity for all unfrozen beads   e the number of unfrozen beads   e overall temperature   e partial temperatures for each dimension  i e  for dimension a  Ta    gt   M40  a    e densities for each bead species   e volume fractions for bead species  starting from type 01    e volume fractions for molecule types  starting from type 00 for all unbonded beads   An additional file  averages  vtk  is also produced with time averaged values for the velocities  species densities   overall and partial temperatures in each cuboidal cell     The scalar properties  including compositions  may be considered to act across the entire volumes of the cells     while the velocities are representative for the cell centres     Appendix C    DL MESO DPD Error Messages    This appendix documents the error and warning messages currently available in the DPD code in DL_MESO   DL_MESO_DPD  and recommendations for users to try and overcome the errors  Users may contact the authors  of DL_MESO after attempting the recommended actions     Message 1  cutoff radius value not set    A valid cutoff radius  r   for all interactions cannot be found in the CONTROL file  this is a compulsory parameter  for DPD simulations     Action  Look in the CONTROL file and make sure the cutoff directive is included with a non zero value     Message 2  temperature not set    A valid system temperature  kg
37.  an ensemble of particles by a single distribution  function  This difference allows LBE to simulate both dilute fluids  i e  those in which the mean free path of  component particles is much larger than the lattice spacing  and condensed matter such as liquids     The Lattice Boltzmann method uses fully discretized space  time and velocity to describe the evolution of fluid   Space is represented by a regularly distributed grid  time flow is obtained by integrating over discrete time steps  and discrete velocity vectors  lattice links  are defined to ensure that a particle moves from one grid point to    another without falling between them     The Lattice Boltzmann algorithm can be summarized by the following     e Fluid properties are mapped onto a discrete lattice   e The physical state of the fluid at each lattice point is described by a set of particle distribution functions   e The system evolves towards an equilibrium  or steady state  by means of a two step process     1  Collision  relaxation  of the distribution function towards its local equilibrium form   2  Propagation of collided distribution functions along lattice links to neighbouring points   e Macroscopic fluid variables  e g  density  momenta  can be calculated from moments of the distribution    functions     Major benefits of the Lattice Boltzmann Equation method include the local nature of its most computationally  intensive process  collision   making the method inherently and massively parallelizable
38.  and Lees Edwards shearing periodic boundaries  The boundaries with the specified condition can    be selected by clicking on set surfaces     Switches to use global storage of bonds  global bonds   to ignore CONFIG files and to override  index numbers in a CONFIG file can be set using these tickboxes     Note that the DPD code uses reduced units in which the unit of length is the particle size  the unit of mass    is the particle mass and the unit of energy is the primary energy parameter of the potential energy function     From these the time unit may be derived  The temperature is defined to be 2 of the system kinetic energy     If a valid CONTROL file already exists in the  current  working directory  the OPEN button can be clicked  to load its information into the GUI  which can then be viewed and edited  The CONTROL file for input into  DL_MESO_DPD is created by clicking the SAVE button     14 CHAPTER 2  THE DL_MESO GUI                                           A  LBE DPD SPH Manual Help Exit  EAE r x job header  CONTROL file generated by DL MESO GUI 1l  Dissipative Particle Dynamics e EN    1250 0   T F 2  temperature  ko    f pressure  3  interaction cutoff   1 0   many body cutoff   1 0 4  electrostatic cutoff  1  surface cutoff  LO 5  boundary halo   0 0  time step  oo    6  total steps   000   equilibration steps   1000   Tj  stack interval    o  temp scale interval   10 8  save start   ooo   save interval  10 9  print interval    o  plot file interval  o  10  dum
39.  and functions into a module file called user_module   90 so future upgrades of DL_MESO will not interfere with    their contributions     13 2 DL_MESO_DPD Subroutines and Functions    13 2 1 Main program  dlmesodpd    Both the serial and parallel versions of the program operate in a similar way  Before DPD calculations start     the following tasks are carried out     For parallel running only  MPI is started up  initcomms  and the node properties are determined   e An I O channel for the general OUTPUT file is opened    e The system clock is consulted for a start time  timchk     e The starting banner for DL_MESO_DPD is printed    e System and bond data are read in and initialized  sysdef     e Initial values are set  zero      e The starting configuration is set up  start   either from scratch or specified by the user using a CONFIG  file     e The system clock is consulted again for the start of the DPD calculation cycle  timchk      13 2     DL_MESO_DPD SUBROUTINES AND FUNCTIONS 169    A loop for DPD calculations is then called from run_module depending on the integrator and barostat selected    by the user  Each step of DPD calculations involves the following     The step counter nstep is increased    The system clock is checked  timchk     The first stage of the required integrator is used to update the motion of the particles and their positions   Masses and particle molecule names are reassigned to the particles    The parallel link cell structure is set up and the p
40.  and or across  periodic boundary conditions for calculation of many body DPD interaction forces     e Dependencies    exportdensity    e Arguments    nlimit input output integer    e Comments  Non periodic boundaries do not require boundary halos  these are excluded from the export of particle  local densities     exportdensitydata_shear    e Header records  SUBROUTINE exportdensitydata_shear  nlimit     e Function  Applies export of local densities for particles to boundary halos of neighbouring domains and or across  periodic boundary conditions with Lees Edwards shearing for calculation of many body DPD interaction    forces     e Dependencies  exportdensity    exportdensity_shear  Parallel version only     e Arguments    nlimit input output integer    13 2 11 start module    This module requires the modules constants  variables  error_module  comms_module  numeric_container     parse_utils  ewald_module and surface_module to be loaded beforehand     13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 205    start    e Header records  SUBROUTINE start    e Function  Sets up starting configuration for DPD calculations  depending on availablity of CONFIG or restart files     e Dependencies  initialize  revive  read_config  initialvelocity    ewald_frozen_slater    initialize    e Header records  SUBROUTINE initialize    e Function    Sets up starting configuration for DPD calculations without given initial or restart configuration     e Dependencies  global_sca_and  error  duni  m
41.  be commented out to increase calculational efficiency     A 2 DL MESO DPD    The Fortran90 modules for DL MESO_DPD must be compiled in a particular order to satisfy dependencies of  shared variables and arrays     e constants   e variables   e numeric_container  e comms_module   e error_module   e parse_utils   e bond module   e surface_module   e ewald_ module   e manybody_module   e domain module   e start_module   e config_module   e field module   e integrate_module  e statistics module  e run module    e dimesodpd    If running DL_MESO_DPD in serial  the modules comms_module and domain_module should be replaced by    comms_module_ser and domain_module_ser respectively     To simplify the process  a makefile may be created either in the DPD directory or in the working directory to  automatically compile the modules and build the executable  Examples of these for running in the DPD directory  may be found in the DPD makefiles directory and modified by the user  The compiler  after FC   and flags   after FFLAGS   may need changing depending on the Fortran90 compiler available  if MPI is available  the    A 2  DL MESO DPD 223    Fortran90 compiler    wrapped    with MPI  most commonly mpif90  is required  If invoking from the working  directory  the modules for DL_MESO_DPD should either be preceded by the path  i e     DPD   in the list of  compile sources or the directive VPATH    DPD  can be used before the source list  the latter strategy is used  by the DL_MESO GUI when
42.  be loaded beforehand     surfacenodes    e Header records  SUBROUTINE surfacenodes    e Function    Identifies nodes containing surfaces or other boundary conditions     e Dependencies  None    e Comments    If using Lees Edwards boundary conditions  these are only applied after equilibration     hardreflect    e Header records  SUBROUTINE hardreflect  k     e Function  Applies boundary condition for hard reflecting walls  calculates short range forces on particles when k 1   applies bounce back condition when k 2 for particles about to pass through boundary     e Dependencies    surfacebounce    e Arguments    k input integer    e Comments    The boundary condition is given by  50   the applied wall potential on each particle is given as    1 Le  Uwatt i Z      Aval   Z         for z  lt  Ze     surfacebounce    e Header records  SUBROUTINE surfacebounce  ddd  vdd  sided     e Function  Applies boundary condition on a leaving particle by means of specular reflection  move particle back into    system and invert velocity component normal to wall     13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 181    Dependencies    None    e Arguments  ddd input output real KIND dp   vdd input output real KIND dp   sided input real KIND dp     e Comments  Momentum tangential to the boundary is preserved  i e  this applies a free slip boundary condition     frozenbead    e Header records  SUBROUTINE frozenbead    e Function  Determines number of frozen particles required for boundary walls  
43.  by module and routine names     Action  Increase the amount of memory available for running DL _MESO_DPD by closing any other running  applications  running the simulation on a larger number of processors  to reduce the memory required per  processor   underpopulating multicore processors  i e  using fewer cores per processor than the maximum    available  or upgrading your machine  Alternatively  try running a smaller simulation     Appendix D    DL MESO Licence Agreement  Academic    Purposes     1  DEFINITIONS AND INTERPRETATION    1 1 In this Licence Agreement the following expressions have the    meanings set opposite     Academic Purposes    a Derived Work    the DL_MESO Software    the DL_MESO Website    a Harmful Element    fundamental or basic research or academic  teaching  including any fundamental research  that is funded by any public or charitable  body  but not any purpose that generates  revenue  as opposed to grant income  for the  Licensee or any third party  Any research  that is wholly or partially sponsored by any  profit making organisation or that is carried  out for the benefit of any profit making    organisation is not an Academic Purpose     any modification of  or enhancement or  improvement to  any of the DL_MESO Software  and any software or other work developed or  derived from any of the DL_MESO Software     the release and version of the DL_MESO  Software downloaded by the Licensee from the  DL_MESO Website immediately after the Licensee  agr
44.  creating makefiles     DL_MESO_DPD can be compiled using the command make if the makefile is called Makefile  or if it has a    custom name  e g  Makefile custom  by the command  e make  f Makefile custom    The example makefiles will produce an executable with the name dpd exe  which can be copied to the working  directory  if necessary   The required input files  CONTROL and FIELD  will also need to be created in or copied  into the same directory  as well as an optional CONFIG file to specify an initial configuration for a new simulation   export  files from a previous run can be used for restarting a previous simulation  providing the number of  processing units remains the same  if the number of processing units changes  the utility exportconfig can be  used to convert the restart files into a CONFIG file     If running in serial  the executable can just be run using the command     e dpd exe if running in Windows  or    e  dpd exe if running in Unix like operating systems   while the parallel version requires a command to run N identical copies of the program on N processors  e g   e mpirun  np N   dpd exe    and may need to be launched via a batch job script  please consult your machine administrator or documentation  for further details     The maximum numbers of particles per process  maxdim   pairs of unbonded interactions  maxpair  and the  maximum sizes of transfer buffers maxbuf are automatically set according to the total number of particles in the  system and 
45.  data     Chapter 13    DL MESO DPD Package Reference    13 1 Overview    DL_MESO_DPD consists of seventeen Fortran90 modules  which should be compiled in the following order prior    to the main program itself     e constants  Contains the constants and parameters required by DL_MESO_DPD     e variables  Contains the globally available variables and arrays required by DL_MESO_DPD     e numeric_container  Contains random number generators and other general purpose functions  e g  scale sum  complementary    error function      e comms_module    Contains all subroutines necessary for parallel computation     e error module    Contains subroutines to print error messages and close down DL_MESO_DPD in a controlled manner     e parse_utils    Contains functions to read in text data from input files     e surface_module    Contains subroutines for applying boundary conditions at system planes  e g  solid walls     e ewald_ module  Contains subroutines for calculating forces due to electrostatic interactions using Ewald summation based  methods     e manybody_module  Contains subroutines for calculating density dependent forces between particles  including the calculation    of localized densities     e bond module    Contains book keeping and force calculation routines for bonds  angles and dihedrals     e domain_module  Contains subroutines to construct parallel link cells  import and deport particles in and export particle    data to domain boundary halos     167    168 CHAPTER 
46.  dt  K s   Ei   solute concentration  initial  o 1 top 0 o 8  relaxation time  1 FEMME E ts  7 a 5 o  bulk relaxation time  1 1 16 bottom  0 3  interaction parameters  fluid O fluid 1 left  o 4 an 2 A   fluid 0 o 11 right   o 5  o 4  fluid 1 trani  6 front 10  back  7  segregation parameter  lo  18 solute relaxation time  1 8 sic 11  SAVE F   CANCEL F SAVE C   CANCEL C SAVE T CANCEL T   a  Fluid parameters  b  Solute parameters  c  Thermal parameters    Figure 2 3  Fluid  solute and thermal parameter pop up windows    The fluid densities at the right boundary   The fluid densities at the front boundary   Greyed out for two dimensional systems    The fluid densities at the back boundary   Greyed out for two dimensional systems      The relaxation time  rp  for each fluid  these values should be greater than 0 5 to give non zero kinetic  viscosities     The bulk relaxation time  Tf buik  for each fluid  these values are only used in multiple relaxation time  schemes to define the bulk viscosity and again should be greater than 0 5     If more than one phase is being modelled  non zero interaction parameters between the fluid species  are required  gab   The Shan Chen algorithm can accept values of gap for both a   b and a    b  while the  Lishchuk algorithm only requires gap for a    b     If the Shan Chen pseudopotential algorithm with wetting is to be used  wall interaction parameters  between the fluid species and solid surfaces are required  ga wau   If the Lishchuk continu
47.  file     e Dependencies    revive    e Arguments  idnode input integer    nodes input integer    statis    e Header records  SUBROUTINE statis    e Function    Calculates statistical properties of system  including rolling averages and fluctuations     e Dependencies  sclsum  global_sum_dble  global_sca_max_dble  global_sca_min_dble    Chapter 14    DL MESO DPD Examples    Test cases for Dissipative Particle Dynamics simulations using DL_MESO   including the required input and  sample output files     can be found in the DEMO DPD subdirectory  All of the following examples can be run using  either the serial or parallel versions of DL_MESO_DPD  96 processing units were used to test them in parallel  although smaller and larger numbers should also work  The smaller problems  i e  with up to 20 000 particles   are best suited to running in serial or on a small number of processor cores  e g  16 or less  to limit the times  required for interprocess communication  while larger problems are better suited to running in parallel to reduce    the memory requirements per processor core     Images of all test cases and videos for some can be found in the Example Simulations page of the DL_MESO  website  a link to it can be found at www ccp5 ac uk DL_MESO    14 1 Mixture_Small    This simulation consists of 1000 particles with 3 species with populations of 333  333 and 334 respectively   All particle types have identical sizes and masses but different energy parameters  using the defa
48.  if adding a new bond angle type to  DL_MESO DPD  the scan_field and read_field routines in config_module need to be modified     Message 34  unrecognised bond dihedral type defined in FIELD file    A bond dihedral type not included in Table 12 5 has been found in the FIELD file     Action  Check the FIELD file to ensure all bond dihedral types are valid  if adding a new bond dihedral type to  DL_MESO_DPD  the scan_field and read_field routines in config_module need to be modified     233    Message 35  non existent species given in FIELD file for molecule i    An undefined species has been found in the definition for the    th molecule type in the FIELD file     Action  Check the FIELD file  particularly the i th molecule type and the species definitions  to ensure the    species in the molecule are defined     Message 36  unrecognised bond definition in FIELD file for molecule i    A bond definition has been found in the FIELD file for the    th molecule that was not detected during the initial  scan of the input file     Action  This error should never occur  If it does  please contact the authors of DL_MESO     Message 37  unrecognised bond angle definition in FIELD file for molecule i    A bond angle definition has been found in the FIELD file for the i th molecule that was not detected during the    initial scan of the input file     Action  This error should never occur  If it does  please contact the authors of DL_MESO     Message 38  unrecognised dihedral angle defin
49.  in both the expression above and as the velocity for calculating  equilibrium distribution functions  The former is used by default in   CollisionBGK  while the latter method  by Guo et al  can be invoked using   Co1lisionBGKGuo     5 1 1 2 Multiple Relaxation Time  MRT     The MRT collision operator operates on a similar principle to the quasilinear Lattice Boltzmann Equation 25    which expresses collisions in terms of a square matrix with dimensions equal to the number of lattice links per  grid point  m   1bsy nq   Unlike quasilinear LBE  however  MRT collision schemes are applied to the moments  for each lattice point rather than the distribution functions 33  8   which are related to each other by    M Tf  5 3     where f is a vector of all m distribution functions for the point  ie   fo  fi  seat M the vector of  moments  also of size m and dependent on the lattice system  and T the transformation matrix that renders  the moments in terms of the distribution functions  Equilibrium values for the moments  M    4  can be determined    by transforming the standard local equilibrium distribution function into moment space by  Met   T fe  5 4     where fea is the vector of local equilibrium distribution functions  the resulting equilibrium moments can  alternatively be expressed directly as functions of fluid density and velocity  Certain moments  such as density  and momentum  must be conserved and their equilibrium values are set so that no changes are made  The    post 
50.  in input files  Customised codes  slbecustom  cpp  and plbecustom  cpp   are also available to allow users to    hardwire    the algorithms for collisions  mesophases etc  into the code   which might improve computational efficiency   Using incompressible fluids would require setting the parameter  incompress equal to 1  this can either be hard wired into the customised codes or specified in the lbin sys  file      To compile the code and produce an executable in the working directory  at a command line type   e c      LBE slbe cpp  o lbe exe     assuming that c   is the name of the available C   compiler  s1be cpp is the version of the code being  compiled and lbe exe is the name of the executable required  If compiling the parallel version of the code   the command for the C   compiler    wrapped    with MPI is required  which is commonly mpiCC  Additional  compiler flags may be used between the compiler name and the reference to the code to improve computation    speed or assist in debugging     Before running the executable  the required input files  1bin sys  lbin spa and optionally lbin init  need  to be copied or moved into the working directory  If running in serial  the executable can just be run using the    command     e lbe exe if running in Windows  or    e  lbe exe if running in Unix like operating systems   while the parallel version requires a command to run N identical copies of the program on N processors  e g   e mpirun  np N   lbe exe    and may need to b
51.  integer  A nmoldef  mxbonds  dihedral table storage for molecule insertion dhdinp2 integer  A nmoldef  mxbonds  dihedral table storage for molecule insertion dhdinp3 integer  A nmoldef  mxbonds  dihedral table storage for molecule insertion dhdinp4 integer  A nmoldef  mxbonds  dihedral table storage for molecule insertion dhdinp5 integer  A nmoldef  mxbonds  localized densities rhomb real KIND dp   A maxdim  nspe  surface type sr  type integer   surface switch for boundary normal to x axis sr  x integer   surface switch for boundary normal to y axis srfy integer   surface switch for boundary normal to z axis sr  z integer   switches for surfaces in current node srflge logical A6   surface repulsion parameters Awall aasr   real KIND dp   A nspe   species of frozen beads for surface frzwspe integer   number of frozen beads in x dimension for wall normal to x axis npxfwx integer   number of frozen beads in y dimension for wall normal to   x axis npxfwy integer   number of frozen beads in z dimension for wall normal to x axis npxfwz integer   number of frozen beads in x dimension for wall normal to y axis npyfwx integer   number of frozen beads in y dimension for wall normal to y axis npyfwy integer   number of frozen beads in z dimension for wall normal to y axis npyfwz integer   number of frozen beads in x dimension for wall normal to z axis npzfwx integer   number of frozen beads in y dimension for wall normal to z axis npzfwy integer   number of frozen beads in z dimension f
52.  is  Mea   Tf    the exact form of which is dependent on the lattice scheme  given for D2Q9 by  33  and for D3Q15 and  D3Q19 by  8   Parameters for calculating the square of energy  e  and fourth order moments  Taa  can  be modified by the user in the 1bpMODEL module     fGetMomentForce    e Header records    int fGetMomentForce double  source  double  v  double  force     e Function    Calculates Guo like forcing terms in moment space     e Dependencies    None    e Arguments  meq output double pointer  v input double pointer  force input double pointer    7 2  DL MESO _LBE SUBROUTINES AND FUNCTIONS 101    e Comments    The forcing terms in moment space 49  calculated here are     gt          TT   3  6      T    9       0    i  F    the exact form of which is dependent on the lattice scheme  given for D2Q9  D3Q15 and D3Q19      fGetMRTCollide    e Header records    int fGetMRTCollide double  collide  double omegashear  double omegabulk     e Function    Calculates collision vector for Multiple Relaxation Time  MRT  scheme with specified fluid relaxation    frequencies     e Dependencies  None    e Arguments    collide output double pointer    omegashear input double precision    omegabulk input double precision    e Comments    The exact form of the collision vector   is dependent on the lattice scheme  given for D2Q9 by  33  and  for D3Q15 and D3Q19 by  8   Tuneable parameters for calculation stability can be modified by the user    in the LbpMODEL module     fInitializeSys
53.  is fundamental to Lattice Boltzmann calculations and should not be modified     fCollisionMRT    e Header records  int fCollisionMRTO    e Function  Collision steps for all compressible and incompressible fluids using MRT model     e Dependencies  fSiteFluidCollisionMRT  fSiteFluidIncomCollisionMRT  fSiteSoluteCollisionBGK  fSiteThermalCollisionBGK  fGetSpeedSite  fGetSpeedIncomSite    e Comments    This routine is fundamental to Lattice Boltzmann calculations and should not be modified     fCollisionMRTSegregation    e Header records    int fCollisionMRTSegregation      e Function  Collision and segregation steps for all compressible and incompressible fluids using MRT model with    Lishchuk mesophase interactions     e Dependencies  fSiteFluidCollisionMRTSegregation  fSiteFluidIncomCollisionMRTSegregation  fSiteSoluteCollisionBGK  fSiteThermalCollisionBGK  fGetOneMassSite  fGetTotMassSite  fGetSpeedSite  fGetSpeedIncomSite    e Comments    This routine is fundamental to Lattice Boltzmann calculations and should not be modified     fCollisionMRT Guo    e Header records  int   CollisionMRTGuo      e Function  Collision steps for all compressible and incompressible fluids using MRT model with Guo like forcing    terms     7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 113    e Dependencies  fSiteFluidCollisionMRTGuo  fSiteFluidIncomCollisionMRTGuo  fSiteSoluteCollisionBGK  fSiteThermalCollisionBGK  fGetSpeedSite  fGetSpeedIncomSite    e Comments    This routine is fundamental to 
54.  it is strongly suggested that users of DL_MESO would not name their own parameters with prefixes 1b   dp or sp        1Referring to the physical system being simulated rather than the computer system                                      40 CHAPTER 4  DL  MESO _LBE BASIC DEFINITION  Table 4 5  Domain information  parameter meaning  lbdm  rank name of the processor  lbdm size number of processors  lbdm bwid domain boundary width  set to zero for serial running   lbdm xcor x coordinate of the processor  lbdm ycor y coordinate of the processor  lbdm zcor z coordinate of the processor  1bdm zcor   0 when 1bsy nd   2   lbdm xdim number of processors along x axis  lbdm ydim number of processors along y axis  lbdm zdim number of processors along z axis  lbdm zdim   1 when lbsy nd   2   lbdm xs x coordinate of domain start position  lbdm xe xa coordinate of domain end position  lbdm xinner   number of grid points along z axis in the domain  lbdm xouter   number of grid points along x axis in the domain including the boundary  lbdm ys y coordinate of domain start position  lbdm ye y coordinate of domain end position  lbdm yinner   number of grid points along y axis in the domain  lbdm youter   number of grid points along y axis in the domain including the boundary  lbdm zs z coordinate of domain start position  lbdm ze z coordinate of domain end position  lbdm zinner   number of grid points along z axis in the domain  lbdm zouter   number of grid points along z axis in the domain incl
55.  mesophase interactions  are calculated   not required if only using constant body forces such as gravity     fCalcPotential_ShanChen    e Header records  int   CalcPotential_ShanChen       e Function    Calculates the interaction potential       pg  1     exp   5   as suggested by the Shan Chen model for  0    each species and lattice point     7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 93    e Dependencies  fGetOneMassSite    e Comments    The Shan Chen model is detailed in  55  56   Alternative mesoscale interaction potentials based on this  model can be introduced here     fCalcInteraction_ShanChen    e Header records    int fCalcInteraction ShanChen int xpos  int ypos  int zpos     e Function    Calculates particle interaction forces according to Shan Chen model     e Arguments  xpos input integer  ypos input integer  zpos input integer  e Comments    Further details can be found in  55  56   Similarly named routines to calculate interaction forces for  alternative mesoscale algorithms can be added by the user     fCalcInteraction_ShanChen Wetting    e Header records    int fCalcInteraction_ShanChenWetting int xpos  int ypos  int zpos     e Function    Calculates particle interaction forces according to Shan Chen model with additional fluid solid wetting  forces     e Arguments  xpos input integer  ypos input integer  zpos input integer  e Comments    Further details can be found in  55  56  and  41   Similarly named routines to calculate interaction forces    for altern
56.  pairwise interaction potentials  These potentials use an    effective mass    for each component  4     which is a  function of density and most frequently defined as    wa   05 i e          5 14     Po       where p   is the local density of component a and pg is the reference density for the same component  The  function in this form can be used to apply phase separation for a single component  and can be changed by the  user by modifying the subroutine fCalcPotential_ShanChen     Defining gap as the interaction coefficient between components a and b  the overall force on component a due    to interactions with other components is defined as  F   ap  2  Y gab D wiy   E        i  ory  b i    and any suitable forcing algorithm can be used to apply this force on a Lattice Boltzmann Equation simulation     For a particular interaction the resulting equation of state 53  is defined as    1  P   pes   Z Cs gab     p   5 16   and the interfacial tension between the components 54  is given as  4 Ag 2  t gt  2   x O   Ae  5 17   2 Z    dz    where ex is a lattice dependent constant and z distance along the normal from the phase interface     Optional fluid solid interaction forces can be added 41  for each fluid to control its wetting     Foo     Y   E  gawau X wis  Z     s    s  5 18    i  where s 2    0 for a pore  fluid site  at position 7 and s      1 for a solid site  The interaction coefficient  between component a and the wall  Ya wan  can be given a positive  negative  valu
57.  purpose     Define initial state  CONFIG    An optional CONFIG file can be included to define the initial state of the system  which can include the positions   velocities and forces for each particle     This file is read by the subroutine read_config in start_module and    scanned by the subroutine scan_config in config_module     At the beginning of the file  five lines of information  of which the first two are mandatory  have to be included     e The simulation name  80 characters     e The CONFIG file key levcfg  integer   the periodic boundary key imcon  integer   the number of particles  in the file  integer  optional  and the configuration energy  real  optional     e The x   y  and z components for the x axis vector  real  optional   e The x   y  and z components for the y axis vector  real  optional     e The z   y  and z components for the z axis vector  real  optional     The file key levcfg is set depending on the information available for each particle  0 for positions only  1 for  positions and velocities or 2 for positions  velocities and forces  If particle velocities are not specified  these  are generated at random to produce a distribution corresponding to the required system temperature  while  unknown forces are set to zero  The simulation name  number of particles in the file and configuration energy  are not read by DL_ MESO_DPD and can thus be ignored  although the line for the simulation name must  remain   If axes vectors are included in the CONFI
58.  rate of temperature change at the left boundary   The temperature and rate of temperature change at the right boundary     The temperature and rate of temperature change at the front boundary   This is greyed out for two   dimensional systems      The temperature and rate of temperature change at the back boundary   This is greyed out for two     dimensional systems      After filling in all the required values  clicking the relevant save button  SAVE F  SAVE C or SAVE T   will store the data in preparation for writing to the lbin sys input file  The cancel buttons  CANCEL F   CANCEL C and CANCEL T  will close the pop ups without saving any values     2 2 2 Defining the Space Properties    If this option is selected before saving the LBE system data  a warning message advising that the system should    be re defined will appear     Figure 2 4 shows the Set LBE Space panel with the rows for data entry labelled in red numbering  The following    data are required     1     The top boundary condition can be selected using the pull down list from     e periodic  e on grid bounce back    e mid grid bounce back    2 2  LATTICE BOLTZMANN AND THE DL_MESO GUI 11    g    LBE DPD SPH Manual Help       4    atticainaltemanin top periodic boundary condition       bottom periodic boundary condition    eft periodic boundary condition              right periodic boundary condition    front periodic boundary condition       o uh WN    back periodic boundary condition    ADD OBSTACLES    boun
59.  reappears on the opposite face with the same velocity  density etc     DL_MESO_LBE applies periodic boundary conditions in two different ways depending on the size of the bound   ary domain 1bdm bwid  If there is no boundary domain  the default for serial running   periodic boundary    5 2  BOUNDARY CONDITIONS 49    conditions are automatically applied during the propagation step by using the function fCppMod to adjust the  destination of distribution functions leaving the system so they are placed at the opposite side  No periodic  boundary using this implementation needs to be defined by the space property  which can be left equal to zero  as for the bulk fluid     For systems that include a non zero boundary domain size  the distribution functions at the edges of the actual  system are copied into the buffer at the opposing sides before collisions and propagation take place  This requires  the use of the space property  1bphi  i  10  to determine the location of the domain buffer     which can be  set up using the routine fMarkBoundArea     and either fsPeriodic and similar routines for serial running or  fNonBlockCommunication and similar routines for running in parallel to copy the distribution functions into  the buffers     5 2 2 On grid bounce back    The on grid bounce back condition applies a no slip condition  i e  zero fluid velocity  at a boundary that lies  halfway between grid points  This is applied after the propagation stage by reversing the distribution fu
60.  routine can be commented out     fFinishDLMESO    e Header records  int fFinishDLMESO      e Function  Announces end of DL_MESO_LBE run  prints simulation time  efficiency measure  Millions of Lattice  Updates Per Second  and a message encouraging citations of DL_ MESO     e Dependencies    None    e Comments    If preferred  the call to this routine can be commented out     fGet Model    e Header records  int   GetModel       e Function    Initializes vectors 1bv  lbw and lbopv for lattice model     e Dependencies  D2Q9  D3Q15  D3Q19  D3Q27    e Comments  Parameters are specified according to requested space dimension and number of discrete velocities     fMarkBoundArea    e Header records  int fMarkBoundArea      98 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Function    Denotes where boundary areas for message passing and or periodic boundary conditions are located     e Dependencies  int fMarkBoundArea3D    int fMarkBoundArea2D       e Comments    Only used when boundary areas are used  primarily for parallel computing      fGetEquilibriumF    e Header records  int fGetEquilibriumF  double  feq  double  v  double rho     e Function    Calculates equilibrium distribution function for compressible fluid     e Dependencies    None    e Arguments  feq output double pointer  v input double pointer    rho input double precision    e Comments    The equilibrium distribution function calculated here is    3 8     9 G 8  3u   c2   2c  2c        f   wip  14    which is only sui
61.  s  Tf  M s      fSiteFluidCollisionMRTSegregation    e Header records  int fSiteFluidCollisionMRTSegregation double  startpos  double  sitespeed  double  bodyforce     double  phaseindex     e Function  Calculates collisions and phase segregation for the Lishchuk algorithm at a grid point using Multiple   Relaxation Time  MRT  models for compressible fluids     e Dependencies  fGetAllMassSite  fGetTotMassSite  fReciprocal  fGetMomentEquilibriumF  fGetMRTCollide    e Arguments  startpos input double pointer  sitespeed input array of doubles  bodyforce input double pointer    phaseindex input double pointer    e Comments  Collisions are carried out on a single    achromatic    fluid using multiple relaxation time  MRT  schemes 33     8   fluid segregation takes place using the D   Ortona algorithm  9         p   pep   E 7     ut     Bw  7        fab     ba    fSiteFluidIncomCollisionMRT    e Header records  int fSiteFluidIncomCollisionMRT doublex  startpos  double  sitespeed  double  bodyforce     e Function  Calculates collisions at a grid point using Multiple Relaxation Time  MRT  models for incompressible  fluids     e Dependencies  fGetOneMassSite  fGetMomentEquilibriumFIncom  fGetMRTCollide    7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 107    e Arguments  startpos input double pointer  sitespeed input array of doubles    bodyforce input double pointer    e Comments    Collisions for each fluid species are carried out using multiple relaxation time  MRT  schemes 33  8     
62.  schemes are available   The tickbox can be selected to specify that the fluids in the system  should be treated as incompressible     2  The collision forcing type for the system can be selected out of BGK  BGK with Guo forcing  MRT  and MRT with Guo like forcing     2 2     10     11     12     13     LATTICE BOLTZMANN AND THE DL_MESO GUI 7                                                                                                                           using temperature scalar   gt  gt  set thermal parametersl8     O   lt   5       L_MESO LBE DPD SPH Manual Help Exit   kamanaman LBE model  O incompressible i   collision forcing type  2   interactions  3   number of grid points x   40 y   30   z  4   total steps  10 equilibration steps  lo 5    Set LBE Space   save span  5 boundary width  a  6  output format  vik  vw  T     Change LBE Code sound speed  540 kinetic viscosity   0 001 gi  top boundary speed Vx   0 Vy   0 Vz  9   bottom boundary speed Vx   0 Vy   0 Vz  10     Compile LBE Code   left boundary speed Vx   0 Vy   0 Vz  11  right boundary speed Vx   0 Vy   0 Vz  12   front boundary speed Vx  Vy  V2  13   back boundary speed Vx  Vy  Vz  14   noise  0 1   0   phase field  Y  no phase field5     Gather LBE Data   number of fluids  phases  E  gt  gt  set fluid parameters 16     Piot LBE Results number of solutes  o   gt  gt  set solute parameters 17          Figure 2 2  Define LBE System      The required mesophase interactions can be selected from the pull down 
63.  sidel input real KIND dp   side2 input real KIND dp        e Comments  Only exists in parallel version of DL_MESO_DPD  This routine requires information for the two dimensions  along the surface of the shearing boundary  the variables shovel and shove2 represent the displacement  due to shear  sidel and side2 are the domain dimensions and vshovel and vshove2 are the velocity  corrections to particles passing through the shearing boundary     import    e Header records    SUBROUTINE import  nlimit  mdir  mp  begin  final  shove  skip     e Function  Imports particle forces from boundary halo for integration schemes and thermostats that only require one  set of forces to be calculated     e Dependencies  error  global_sca and all  msg receive unblocked  msg receive_sca blocked  msg send_ blocked  msg_send_sca_blocked    msg_wait    e Arguments  nlimit input output integer    mdir input integer  mp input integer  begin input real KIND dp   final input real KIND dp   shove input real KIND dp   skip input logical    e Comments  Only exists in parallel version of DL_ MESO_DPD  This routine is suitable for thermostats using the  standard Velocity Verlet algorithm for force integration and one set of forces  this includes the DPD  thermostat with MD integration  MD VV   the Lowe Andersen and Peters thermostats  The switch skip  prevents the importing of forces from the boundary halo of the current domain  this is useful for applying  non periodic boundary conditions  e g  hard surfa
64.  start points for sending and receiving messages     e Comments    This subroutine must not be changed     fNonBlockCommunication    e Header records    int fNonBlockCommunication      e Function    Passes distribution function information for either 2D or 3D system     fOutputInfo    e Header records  int fOutputInfo      e Function    Outputs number of processes and lengths of integers and floats     e Comments  This subroutine is necessary for gathering and rearranging the 1bout data  and produces the files lbout   info  and lbout ext     fBoundNonBlockCommunication    e Header records    int fBoundNonBlockCommunication      e Function    Passes boundary information for either 2D or 3D systems     fForceNonBlockCommunication    e Header records    int fForceNonBlockCommunication      e Function    Passes interaction force information for either 2D or 3D systems     fIndexNonBlockCommunication    e Header records    int fIndexNonBlockCommunication      e Function    Passes phase index information for either 2D or 3D systems     7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS    fCheckTimeMPI    e Header records  int fCheckTimeMPI  O    e Function    Outputs time in seconds since initial call     e Arguments  fCheckTimeMPI output double    e Comments  Obtains calculation time based on MPI wall clock     fPrintSystemMass    e Header records    int fPrintSystemMass      e Function    Calculates and prints total and individual fluid masses in entire system     e Dependencies  fGetTo
65.  system since the parallel VTK format links to these rather than creates    autonomous files for the entire system     Legacy VTK format  lbout  vtk    Legacy VTK files written by DL_MESO_LBE include the lattice dimensions  numbers of grid points in each  direction   the Cartesian coordinates of the grid points in real life units  and the following data     e A scalar property  fluid density  mass fraction  solute concentration or scalar temperature   e g   P0 0 0  Pnz   1 ny   1 nz   1    e Fluid velocity    Uo 0 0 Vo o 0 Wo o o       Una 1 ny    1 nz 1 Vne 1l ny   1 nz 1 Wha 1 ny    1 nz 1    e The space  boundary condition  property    0 0 0    na   1 ny   1 nz 1    If all properties are to be output  they are all included in the same file for each time step under unique names     Plot3D format  Output grid position  lbout  xyz    NT  NY  nz  L0 0 0      Tnx   1 ny 1 nz 1  Y0 0 0 gt      Ynx   1 ny   1 nz    1    20 0 0       Zng   1 ny   1 nz   1    where nx is the total number of grid points in x direction  ny is the total number of grid points in y direction   nz is the total number of grid points in z direction and    i  j k  Yi j k   Zi j k  is the Cartesian coordinate of grid    point  2  7  k      60 CHAPTER 6  DL MESO _LBE INPUT AND OUTPUT FILES    Output macroscopic quantities  1bout q    NL  NY  NZ   c  1 0  Re t   P0 0 0      Pna   1 ny   1 nz    1  Uo 0 0      Chest ai ne  Vo 0 05     Var tny  Laris Wo 0 0      Wrz 1 ny    1 nz 1    D0 0 0 gt  ves Ore  Tyne    
66.  system thermostat  the dissipative and random forces as defined for DPD with the standard  molec   ular dynamics  form of the Velocity Verlet integrator  DPD MD VV  is the default  but recalculation of  dissipative forces at the end of each step  DPD DPD VV  13   the Lowe Andersen 36   Peters 47  and  Stoyanov Groot 62  thermostats can also be selected  Values of y for the DPD and Peters thermostats  and I for the Lowe Andersen and Stoyanov Groot thermostats can be specified elsewhere for each pair of  species  but an additional parameter for the Stoyanov Groot thermostat should be set by clicking on set  thermostat     see below for more details     The system barostat  no barostat is used by default  but Langevin 29  and Berendsen 2  barostats are  available in combination with all five thermostats  If either barostat is selected  its parameters can be set  by clicking on set barostat and the target system pressure can be specified     The electrostatics scheme for the simulation  an Ewald sum method with Slater type  exponential   charge smearing 14  is available in DL_MESO_DPD  If selected  the short range electrostatic cutoff can  be edited and the parameters for the Ewald sum and charge smearing can be specified by clicking on set  electrostatics     The surfaces to be applied to the system  by default periodic boundary conditions are used  but alterna   tive boundary conditions include hard walls with soft repulsions and specular reflection 50   walls of frozen  beads
67.  the    terms and conditions of this Licence Agreement provided that     2 1 1 the Licensee may not distribute any of the DL_MESO Software  or any Derived Work to any third party  or share their use  with any third party  whether free of charge or otherwise    and the Licensee may not sub license the use of any of the  DL_MESO Software to any third party unless  in each case   that third party has complied with clause 2 3 below     2 1 2 the Licensee may not use the DL_MESO Software on behalf of   or for the benefit of  any third party  including  without  limitation  using it to provide bureau  outsourcing or  application services or facilities management services   party unless that third party has complied with clause 2 3    below  and    2 1 3 the DL_MESO Software and any Derived Work may be used by  the Licensee and its employees and registered students for    Academic Purposes only     2 2 If the Licensee wishes to use the DL_MESO Software or any Derived  Work in any way except for Academic Purposes  or wishes to    distribute or make the DL_MESO Software or any Derived Work    2 3    2 4    241    available to any third party for non Academic Purposes  it must  obtain a commercial licence from STFC  STFC may refuse to grant  the Licensee a commercial licence  If STFC agrees to grant a  commercial licence  that licence will be on such terms and    conditions as STFC sees fit     If the Licensee wishes to carry out any collaboration for  Academic Purposes with any third 
68.  the lattice Boltzmann method in  incompressible limit  Journal of Computational Physics  146 1  282 300  1998     Xiaoyi He and Li Shi Luo  Lattice Boltzmann model for the incompressible Navier Stokes equation  Journal  of Statistical Physics  88 3 4  927 944  1997     F  J  Higuera and J  Jim  nez  Boltzmann approach to lattice gas simulations  EPL  Europhysics Letters    9 7  663 668  1989     R  W  Hockney and J  W  Eastwood  Computer simulation using particles  McGraw Hill International   1981     Takaji Inamuro  Masato Yoshino  Hiroshi Inoue  Riki Mizuno  and Fumimaru Ogino  A lattice Boltzmann  method for a binary miscible fluid mixture and its application to a heat transfer problem  Journal of  Computational Physics  179 1  201 215  2002     Takaji Inamuro  Masato Yoshino  and Fumimaru Ogino  A non slip boundary condition for lattice Boltz   mann simulations  Physics of Fluids  7 12  2928 2930  1995     Ask F  Jakobsen  Constant pressure and constant surface tension simulations in dissipative particle dy   namics  Journal of Chemical Physics  122 12  124901  2005     J  E  Jones  On the determination of molecular fields  II  From the equation of state of a gas  Proceedings  of the Royal Society of London  Series A  106 738  463 477  October 1924     Simon Jury  Peter Bladon  Mike Cates  Sujata Krishna  Maarten Hagen  Noel Ruddock  and Patrick  Warren  Simulation of amphiphilic mesophases using dissipative particle dynamics  Physical Chemistry  Chemical Physics  1 9  2
69.  up input files  modifying and compiling the program code  running the simulation and gathering the results files    5    6 CHAPTER 2  THE DL_MESO GUI           a   x     2  DMIMESO  DL_MESO LBE DPD SPH Manual Help Exit       Welcome to DL MESO    R  S  Qin  W  Smith  amp  M  A  Seaton  Copyright    STFC 2012    Click one of the above buttons to start             Figure 2 1  DL MESO GUI on startup    for plotting and visualization  The SPH button is for Smoothed Particle Hydrodynamic simulations  which will  be included in future versions of DL_MESO  clicking on this button will currently produce a warning message   This user manual can be read in Adobe Acrobat Reader  if installed  by clicking the Manual button  while  Help will advise you to visit the DL MESO website at www ccp5 ac uk DL_MESO     2 2 Lattice Boltzmann and the DL_MESO GUI    To access the LBE facilities in the DL_MESO GUI  proceed as follows     e Click the LBE button to get the LBE panel     e Click the Define LBE System button and supply the required information  The file 1bin sys will be  created by the step     e Click the Set LBE Space button to define the simulation space  The file 1bin spa will be created by  this step     2 2 1 Defining the System    Figure 2 2 shows the Define LBE System panel with the rows for data entry labelled in red numbering  The  required data are as follows     1  The required LBE model can be selected from the pull down list  the D2Q9  D3Q15  D3Q19 and D3Q27  square lattice
70.  will be produced if either of the files lbout info and 1bout ext are missing  No  other error messages are produced  so care should be taken to ensure no solution files for the pieces are missing  before running the utility  Since the data is copied into the combined structure and solution files  the original  output files can be deleted after this utility is run     lbevtkgather  lbevtkgather is a utility written in C   to gather Structured Grid XML formatted VTK output files produced    by the parallel version of DL_MESO_LBE  lbout  vts  and produce a set of linking files  lbtout  pvts  for  visualization of the entire system     If c   is the command for the available C   compiler  the executable vtk exe can be produced by typing  e c    o vtk exe lbevtkgather cpp    and either run at the command line or via the GUI under Gather LBE Data     B 2  DL MESO_DPD 227    All lbout  vts files should be copied to the directory including the executable  if necessary  before running   as well as the 1bout info and lbout ext files to give information about the number of processors used for the    simulation and the extents of each piece     This utility can be run with a command line argument to give the scalar property required  e g  for Windows    and Unix Linux computers respectively    e vtk exe 1    e   vtk exe 1    where 0 is used for all properties  1 for fluid density  2 for mass fraction  3 for solute concentration and 4 for  temperature   If the GUI is used  this can be se
71.  will be required  for parallel running     and for postcollisional fluid segregation  The fCollision Segregation routines  used in  place of the standard collision routines  carry out the achromatic collision of all fluids and D   Ortona segregation   No solid fluid interactions  i e  wetting effects  are currently available in DL_MESO_LBE using this form of    mesoscopic interaction     5 4 Diffusion and heat transfer    In a similar fashion to multiple fluid systems  the Lattice Boltzmann Equation method can be applied to  problems involving diffusion and or heat transfers by using additional distribution functions for each solute  and or temperature 27  72      5 4  DIFFUSION AND HEAT TRANSFER 53    For a system consisting of a number of dilute solutes along with a bulk fluid  the governing equation for each    solute is given as  At       Ts  where g  is the distribution function for the solute and 7  the solute relaxation time  which is related to its    1 1   Any   D   x 5  At    and the Schmidt number can be determined by    diffusivity       v 277     1  ad ar    Taking the concentration of the solute as C    5    gi  the equilibrium distribution function for the solute is       given by a simpler form of Equation 3 11        i   u        gi   WCs i  3  5 29     where the velocity used is that of the bulk fluid     Heat transfers can be coupled to the system in a similar manner  using a thermal distribution function h  and  a thermal relaxation time 7  which gives th
72. 051 2056  1999     J  M  V  A  Koelman and P  J  Hoogerbrugge  Dynamic simulations of hard sphere suspensions under  steady shear  EPL  Europhysics Letters   21 3  363 368  1993     Pierre Lallemand and Li Shi Luo  Theory of the lattice Boltzmann method  Dispersion  dissipation   isotropy  Galilean invariance  and stability  Physical Review E  61 6  6546 6562  June 2000     A  W  Lees and S  F  Edwards  The computer study of transport processes under extreme conditions   Journal of Physics C  Solid State Physics  5 15  1921 1928  1972     BIBLIOGRAPHY 249     35     36    37    38    39          40    41    42           43    44    45    46    47    48          49    50          51     52      53     S  V  Lishchuk  C  M  Care  and I  Halliday  Lattice Boltzmann algorithm for surface tension with greatly  reduced microcurrents  Physical Review E  Statistical  Nonlinear and Soft Matter Physics  67 3  036701   March 2003     C  P  Lowe  An alternative approach to dissipative particle dynamics  EPL  Europhysics Letters    47 2  145 151  July 1999     John F  Marko and Eric D  Siggia  Stretching DNA  Macromolecules  28 26  8759 8770  1995     G  Marsaglia and T  A  Bray  A convenient method for generating normal variables  SIAM Review   6 3  260 264  July 1964     George Marsaglia  Arif Zaman  and Wai Wan Tsang  Toward a universal random number generator   Statistics and Probability Letters  9 1  35 39  January 1990     C  A  Marsh  G  Backx  and M  H  Ernst  Static and dynamic p
73. 13  DL MESO DPD PACKAGE REFERENCE    e start_module    Contains subroutines to initialize and restart DPD calculations     e config_module  Contains subroutines to read in input files with system and molecule bond data  to zero all parameters    and accumulators for statistical data and  for parallel version only  determine 3D domain decomposition     e field module    Contains subroutines to calculate pairwise forces between particles     e integrate module  Contains subroutines to integrate the equations of motion using the Velocity Verlet scheme and apply    various thermostats and barostats     e statistics module    Contains subroutines to calculate and write out statistical and trajectory data     e run module    Contains program loops for different integrators and barostats     Most of the above modules and the main program file dlmesodpd   90 are identical for both serial and parallel  versions of DL_MESO_DPD  The filenames for the serial versions of comms_module and domain_module end  with _ser  but are referred to in the code by their standard names     The module for many body DPD interactions  manybody_module  may be modified by users to incorporate  alternative schemes  Additional bond  angle and dihedral models can be added to bond module by the user   although modifications to config_module are also required to allow DL_MESO to recognise new types of bond  interaction  For anything else  however  we recommend that DL_MESO users put any self defined subroutines 
74. 4 3  Visualizations of DPD PhaseSeparation test case we for particle type blue for type 2     14 4 Aggregate    This simulation consists of 3000 unbonded particles and 30 molecules of 10 particles each with harmonic bonds  between them  The unbonded particles and molecules are made up of different species with a higher energy  parameter for unlike particle interactions  This causes the molecules to aggregate  which can be seen in Figure    14 4  a snapshot of the simulation     14 5  POLYELECTROLYTE 217       Figure 14 4  Visualization of system at t   2220 from DPD Aggregate test case    14 5 Polyelectrolyte    This simulation example consists of a slightly hydrophobic polyelectrolyte molecule of 50 particles  each with a  relative charge of  0 5  immersed in a salt solution of concentration 0 14M 14   The salt solution consists of 9900  neutral water particles  75 cationic salt particles  net charge  1   75 anions of charge    1 and 25 counterions of  charge    1 to keep the system neutral  A similar simulation is included with the polyelectrolyte replaced with a  neutral polymer of the same number of particles and the counterions replaced with water  FIELD neutral  this  should be renamed to FIELD to run the simulation and used with the same CONTROL file   Figure 14 5 gives a  comparison between the polyelectrolyte and neutral polymer at the final time step  which have measured radii  of gyration of 4 5 and 2 7 respectively         a  Polyelectrolyte  b  Neutral polymer   
75. 6    6 7    Headings  The headings in this Licence Agreement are for ease of  reference only  they do not affect its construction or    interpretation     Assignment etc  The Licensee may not assign or transfer this  Licence Agreement as a whole  or any of its rights or obligations    under it  without first obtaining the written consent of STFC     Illegal unenforceable provisions  If the whole or any part of any  provision of this Licence Agreement is void or unenforceable in  any jurisdiction  the other provisions of this Licence Agreement   and the rest of the void or unenforceable provision  will  continue in force in that jurisdiction  and the validity and  enforceability of that provision in any other jurisdiction will  not be affected     Waiver of rights  If STFC fails to enforce  or delays in  enforcing  an obligation of the Licensee  or fails to exercise   or delays in exercising  a right under this Licence Agreement   that failure or delay will not affect its right to enforce that  obligation or constitute a waiver of that right  Any waiver by  STFC of any provision of this Licence Agreement will not  unless  expressly stated to the contrary  constitute a waiver of that    provision on a future occasion     Entire agreement  This Licence Agreement constitutes the entire  agreement between the parties relating to its subject matter    The Licensee acknowledges that it has not entered into this  Licence Agreement on the basis of any warranty  representation   statem
76. 9    fCheckSteer    e Header records  int fCheckSteer       e Function    Checks for the existence of notsteer files  if found  then reads lbin sys and lbin spa files     e Dependencies  fInputParameters  lbin sys      fReadSpaceParameter   lbin spa      7 2 6 IbpIOPlot3D  fOutputGrid    e Header records  int fOutputGrid3D const char  filename  1bout      e Function    Outputs grid positions for system in Plot3D format     e Dependencies  fOutputGrid2D  fOutputGrid3D    e Arguments    filename input array of characters    e Comments    The default output file name is lbout  xyz for 3D systems and lbout  xy for 2D systems     fOutputQ    e Header records    int fOutputQ const char  filename  1bout      e Function  Outputs macroscopic mass densities and fractions for all fluids  concentrations for all solutes  temperature  and velocity  speeds along x   y  and z directions  at each lattice point for system in Plot3D format     e Dependencies  fOutputQ2D  fOutputQ3D    e Arguments    filename input array of characters    e Comments  The default output file name is 1bout prop  q  with prop substituted by dens  frac  conc or temp  for fluid densities  mass fractions  solute concentrations or temperature respectively and preceded by the  number of the fluid or solute  This can be changed by specifying an output file name when calling the    routine     80 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    fOutputQP    e Header records  int fOutputQP const char  filename  lbout   int ipro
77. 9010  9011        JO 1bsy ny lbsy nz  J100  9101        Jlbsy nx lbsy ny lbsy nz    At each grid point  DL_MESO_LBE arranges the particle distribution functions in order of  fluid functions   solute functions  temperature functions and phase field order parameter  For example  for a D2Q9 lattice with    two fluids  scalar temperature and phase field  the distribution functions are in the order of  ida tattoo tatoo Les Ji  f    To  Ti  To  To  Ta  To  To  Tr  Ts  pf    Therefore the number of particle distribution functions at each grid point is    lbsitelength    lbsy nf   lbsy nc   lbsy nt  x 1bsy nq   1bsy ph    where 1bsy nf  lbsy nc  1bsy nt  1bsy nq and 1bsy ph are respectively  number of fluids  number of solutes   number of temperature scalars  number of discrete speeds and number of the phase field order parameters   lbsy nt and lbsy ph can only take the values of 1 or 0  representing systems with or without temperature  scalar and phase field  Also if 1bsy nc 4 0  lbsy nf cannot be set larger than 1     4 2 2 Storage of space properties    The space property is represented by an integer value in DL MESO_LBE  For example  1bphi 100    0 represents  the 100th grid point as a liquid site and 1bphi 101    12 shows the 101st grid point as an on grid bounce back  boundary  Table 4 1 lists the categories of space properties     The orientation of a solid liquid boundary is also represented by the value of an integer  For example  a planar  surface with normal vector along t
78. CONFIG file ligindex ogical TorF  duplications of CONFIG file in x direction nfoldx integer   duplications of CONFIG file in y direction nfoldy integer   duplications of CONFIG file in z direction nfoldz integer   total number of duplications of CONFIG file nfold integer   data key for CONFIG file levcfg integer   periodic boundary key for CONFIG file imcon integer   printout selection for OUTPUT file outsel integer   maximum number of particles maxdim integer   maximum number of pairwise interactions maxpair integer   maximum message buffer size maxbuf integer   maximum number of particles per molecule mxmolsize integer   maximum number of bonds per molecule mxbond integer   maximum number of angles per molecule mxangles integer   maximum number of dihedrals per molecule mxdiheds integer   maximum number of interaction parameters mxprm integer   density variation for non uniform system distributions dvar real KIND dp    name of DL_MESO_DPD calculation text character 80    number of time steps for calculation nrun integer   interval for writing OUTPUT file nsbpo integer Sul  interval for writing CORREL file iscorr integer   starting time step for writing HISTORY  files straj integer   interval for writing HISTORY  files ntraj integer   restart file  export   creation interval ndump integer   temperature scaling interval nsbts integer   number of equilibration time steps nseql integer   calculation restart parameter kres integer   number of species nspe integer  gt 1  number o
79. Comments  The default output file name is 1bout  q and the concentration of solute 0 is output by default  These  can be changed by specifying an output file name and solute number  up to 1bsy ns   1  when calling the    routine     fOutputQT    e Header records  int fOutputQT const char  filename  lbout      e Function    Outputs macroscopic temperature and fluid velocity at each lattice point for system in Plot3D format     e Dependencies  fOutputQT2D  fOutputQT3D    e Arguments    filename input array of characters    e Comments  The default output file name is lbout  q  This can be changed by specifying an output file name when  calling the routine     7 2 7 lbplOLegacyVTK    fOutputLegacyVTK    e Header records    int fOutputLegacyVTK const char  filename  lbout      e Function  Outputs macroscopic mass densities and fractions for all fluids  concentrations for all solutes  temperature  and velocity  speeds along x   y  and z directions  at each lattice point for system in Structured Grid  Legacy VTK format     e Dependencies  fOutputLegacyVTK2D  fOutputLegacyVTK3D    e Arguments    filename input array of characters    e Comments  The default output file name is lbout  vtk  This can be changed by specifying an output file name when  calling the routine     fOutputLegacyVTKP    e Header records    int fOutputLegacyVTK const char  filename  lbout   int iprop 0     82    CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    Function  Outputs macroscopic mass density and velocity  s
80. D FUNCTIONS 63    D3Q19    e Header records  int D3Q19      e Function  Assign the weight factor lbw  speed vector 1bv  index for opposite speed vector lbopv  MRT transformation  matrices  1btr and 1btrinv  and tuneable parameters  1bmrts and 1bmrtw  for the D3Q19 lattice model     e Dependencies    None    D3Q27    e Header records  int D3Q27      e Function  Assign the weight factor lbw  speed vector 1bv and the index for opposite speed vector lbopv for the  D3Q27 lattice model     e Dependencies    None    e Comments  No Multiple Relaxation Time  MRT  scheme is currently available for this lattice     7 2 3 lbpBASIC    This package contains general purpose functions which are not directly related to the Lattice Boltzmann Equa   tion method  These may be replaced with any suitable functions in C   standard libraries     fCppAbs    e Header records  template  lt class T gt   T fCppAbs T a return  a lt 0   a a     e Function    Calculate absolute value of number a     e Dependencies    None    e Arguments  a input any datatype  fCppAbs output same datatype as a    fReciprocal    e Header records  template  lt class T gt   T fReciprocal T a return  a  0  1 a 0     64 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Function    Calculates reciprocal of a for all non zero values  returns zero for a   0     e Dependencies    None    e Arguments  a input any datatype  fReciprocal output same datatype as a    fEvapLimit    e Header records  template  lt class T gt   T fEvapLimit T a 
81. D particle density  For  sufficiently large densities  p  gt  2   g r  takes the same form and the equation of state can be well approximated  by    p   pkgT   aAp   9 13   4    ct       where the parameter a   0 101   0 001 has units equivalent to rf  This expression permits the use of fluid  compressibilities to obtain conservative force parameters for bulk fluids  e g  for water A   Se Alternative  equations of state may be obtained by modifying the functional form of conservative interactions to include    localized densities  i e  many body DPD   46  66      Transport coefficients for a DPD fluid can be derived using the expressions for the drag and stochastic forces 16   32  40   The kinematic viscosity can be found to be     MkgT 21 ypr           x   9 14  d 4nypr  1575  9 12   while the self diffusion coefficient is given as  45kpT  Dx   9 15  2nypr3      The ratio of these two properties  the Schmidt number  Sc       is therefore   1  2mypr      Sc x    c 9 16  e  5   70875keT vee     and for values of the drag coefficient and density frequently used in DPD simulations  this value is of the order  of unity  which is an appropriate magnitude for gases but three orders of magnitude too small for liquids     This property of standard DPD does not rule it out for simulations of liquid phases except when hydrodynamics  are important  It may also be argued that the self diffusion of DPD particles might not correspond to that  of individual molecules and thus a Schmidt numb
82. DL_MESO LBE provides the routine fConvectionForceBoussinesq to calculate this force  The product of  gravitational acceleration and volumetric expansion  g8   for each fluid  as well as the maximum and minimum  temperatures T  and T   can be included in the 1bin  sys file     54 CHAPTER 5  DL_MESO_LBE FEATURES    5 5 Compressible and incompressible fluids    The standard Lattice Boltzmann Equation scheme is capable of modelling compressible fluids  Incompressible  fluids can be modelled by making a simple modification to the local equilibrium distribution function 24      se e A ED  fet   wi ptm  262 26 3   5 33        2c4 2c     where po is the fixed density of the incompressible fluid and the density p becomes an analogue to pressure            p   While Equation 3 1 is still applicable to calculate p  the fluid velocity is now calculated by    q  poua   ys Silica  5 34   i 0    DL_MESO_LBE allows users to select incompressible fluids by means of the variable incompress  whose value  can be selected using the keyword incompressible_fluids in the lbin sys file  Additional collision and  equilibrium distribution function routines ending in Incom are included to allow the user to model incompressible  fluids  All of these routines use a specified constant density for each fluid in the system  1bincp  as the value  of po     Chapter 6    DL MESO LBE Input and Output Files    6 1 Input files    All user specified input files for DL MESO_LBE must be in ANSI text format  with keyw
83. DL_MESO USER MANUAL    M  A  Seaton and W  Smith    STFC Daresbury Laboratory  Daresbury  Warrington  Cheshire  WA4 4AD  United Kingdom    Version 2 5  April 2012    Contents    Contents    1 DL_MESO General Information    1 1  1 2  1 3  1 4  1 5  1 6  1 7  1 8    2 The  2 1  2 9  2 3  2 4  2 5    3 The  3 1  3 2  3 3  3 4  3 5  3 6    4 1  4 2  4 3    5 1  5 2  5 3  5 4  5 5    Description  e nse asaran A as   amp  ee e A A A a A ae ey EE REA  F  nctionality nd oh ein eee BA we Ae Geass od A ate Ll RA we oS BAA  Requirements  2 os a ad te a ee Dee egy er et ests kA  bs a oe CEA Bs he he ee ae  The DL_MESO Directory Structure     2    2    a  Disclaimer aa a see te BO Be She eon g ate Co ee BOP ae BL aS  Copyright  stages S MLD A A Et Be ha Gee A  Authors  Sa p At td Bae ha de eee tien Be SE die ey Se ee AA  Suggestions and Bug Reports    aaau aaa aaa a    DL_MESO GUI   Getting Started with the DL MESO GUI            0    00 0  000  00000000   Lattice Boltzmann and the DL MESO GUI                   e     Dissipative Particle Dynamics and the DL MESO GUl         o   o    ooo    o     Compiling and running DE MESO        200 2000  0000000000004  NOTES  gt  os  ee ae apni hy a BA Ae Gods a ate th eg ad Ske ee dd    Lattice Boltzmann Equation  LBE     Lattice Boltzmann Equation  Basic Theory   INTO UCM cri A E e e aai A A A A A a e AA EA a a  Basic  Detnitions  ono a e A dE PORE ee AR e i  Derivation of Equilibrium  ea AE A A RP ee ds a a ee A  Structural Relaxation and Macroscop
84. FC  STFC Daresbury Laboratory  Dares   bury  Warrington  Cheshire  WA4 4AD  United Kingdom  version 4 01 0 edition  October 2010     S  Y  Trofimov  E  L  F  Nies  and M  A  J  Michels  Thermodynamic consistency in dissipative parti   cle dynamics simulations of strongly nonideal liquids and liquid mixtures  Journal of Chemical Physics   117 20  9383 9394  2002     Loup Verlet  Computer    experiments    on classical fluids  I  Thermodynamical properties of Lennard Jones  molecules  Physical Review  159 1  98 103  July 1967     P  B  Warren  Vapor liquid coexistence in many body dissipative particle dynamics  Physical Review E   68 6  066702  December 2003     John D  Weeks  David Chandler  and Hans C  Andersen  Role of repulsive forces in determining the  equilibrium structure of simple liquids  Journal of Chemical Physics  54 12  5237 5247  1971     Dean R  Wheeler  Norman G  Fuller Rowley  and Richard L  Non equilibrium molecular dynamics simu   lation of the shear viscosity of liquid methanol  adaptation of the Ewald sum to Lees Edwards boundary  conditions  Molecular Physics  92 1  55 62  1997     Satoru Yamamoto  Yutaka Maruyama  and Shi aki Hyodo  Dissipative particle dynamics study of sponta   neous vesicle formation of amphiphilic molecules  Journal of Chemical Physics  116 13  5842 5849  2002     BIBLIOGRAPHY 251     72  M  Yoshino and T  Inamuro  Lattice Boltzmann simulations for flow and heat mass transfer problems in a  three  dimensional porous structure  Intern
85. G file and the value of imcon is greater than zero  these will  be read on the assumption that the simulation volume is orthorhombic  the only possible shape available in  DL_MESO_DPD      Each particle is represented by a block record  with at least two lines of information        1This file is formatted identically to CONFIG files used in DL_POLY 60  65   except that the origin is set as the back bottom left  corner of the simulation volume instead of the centre     164 CHAPTER 12  DL MESO DPD INPUT AND OUTPUT FILES    e The species name  8 characters  or number  integer  and the global particle number  integer  optional   e The z   y  and z coordinates for the particle  real   e The z   y  and z components of particle velocity  real  if levcfg gt  0     e The x   y  and z components of force on the particle  real  if levcfg gt  1     If global particle numbers are not included or the no index option is invoked in the CONTROL file  these are  generated automatically for the particles in the order specified by the CONFIG file  Care should be taken that any  particles belonging to molecules are numbered correctly  since the bond information is assigned in an identical  fashion to unspecified systems  i e  numbering after all loose particles in the relative order specified by the FIELD  file  If the nfold option is invoked in the CONTROL file  DL_MESO_DPD will duplicate the given configuration  in each Cartesian direction and assign global particle numbers to the enlarged syst
86. Header records  INTEGER  KIND 1i  FUNCTION parseint  word     e Function  Reads the integer contained in the string word     e Dependencies  None    e Arguments  word input  character LEN       parseint output  integer KIND li     13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 179    parsedble    e Header records  REAL KIND dp  FUNCTION parsedble  word     e Function    Reads the double precision number contained in the string word     e Dependencies    None    e Arguments  word input  character LEN     parsedble output  real KIND dp     getint    e Header records  INTEGER KIND 1i  FUNCTION getint  txt  n     e Function    Reads the nth    word    of the string txt to obtain an integer     e Dependencies    parseint    e Arguments  txt input  character LEN     n input integer  getint output integer KIND li     getdble    e Header records  REAL KIND dp  FUNCTION getdble  txt  n     e Function    Reads the nth    word    of the string txt to obtain a double precision number     e Dependencies    parsedble    e Arguments  txt input  character LEN     n input integer  getdble output  real KIND dp     lowercase    e Header records  SUBROUTINE lowercase  word     e Function    Changes all upper case letters in the string word to lower case     e Dependencies    None    180 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    e Arguments    word input output character LEN     n input integer  getdble output real KIND dp     13 2 6 surface_module    This module requires the variables module to
87. IELD 1    acceleration x component   0 0 2    acceleration y component   0 0          acceleration z component   0 0             SAVE E   CANCEL E                 c  External field parameters    Figure 2 8  Species  interactions and external field pop up windows    6  If a non periodic hard surface is defined  the wall repulsion parameter  Aa     for the species can be  specified     Figure 2 8 b  gives the layout for the interaction pop up window     1  The pair of species can be selected using these pull down boxes  the interaction parameters and type  currently set for the selected species pair will be displayed     2  The interaction type for the species pair  the standard DPD model by Groot and Warren 16  is the de   fault  but many body  density dependent  DPD 46  66   Lennard Jones 30  and Weeks Chandler Andersen     hard sphere  models can also be selected  Note that while the Lennard Jones and Weeks Chandler   Andersen  WCA  69  models are not DPD models  the DPD thermostat can be used with them to maintain  system temperature     3  The energy parameters for the species pair can be typed into these boxes and set using the button SET I   Only one energy parameter is required for standard DPD  4     Lennard Jones and WCA  eij   while  many body DPD can use up to five  the exact number required will depend upon the model selected by  the user  Note that values for these and other interaction parameters for all species pairs will be written to  the FIELD file  if many b
88. IND dp    system electrostatic energy at current step stpee real KIND dp    system mean bond length at current step stpbdl real KIND dp    system maximum bond length at current step stpbdmx real KIND dp    system minimum bond length at current step stpbdmn real KIND dp    system mean bond angle at current step stpang real KIND dp    system mean bond dihedral at current step stpdhd real KIND dp    rolling average system potential energy ravpe real KIND dp    rolling average system virial ravvir real KIND dp    rolling average system kinetic energy ravtke real KIND dp    rolling average system total energy ravte real KIND dp    rolling average system pressure ravprs real KIND dp    rolling average system volume ravvlm real KIND dp    rolling average system temperature ravttp real KIND dp    rolling average system bond potential energy ravbe real KIND dp    rolling average system angle potential energy ravae real KIND dp    rolling average system dihedral potential energy ravde real KIND dp    rolling average system electrostatic potential energy ravee real KIND dp    stage number for data stack nav integer   data stack for potential energy stkpe real KIND dp   A nstk  data stack for virial stkvir real KIND dp   A nstk  data stack for kinetic energy stktke real KIND dp   A nstk  data stack for volume stkvlm real KIND dp   A nstk  data stack for bond potential energy stkbe real KIND dp   A nstk  data stack for angle potential energy stkae real KIND dp   A nstk  data stack for dih
89. If bonds are dealt with  locally  only the bonds associated with the subdomain are calculated by each process  otherwise all processes  hold information on all bonds     The Cartesian coordinates  velocities and forces for the particles are each held in sets of three double precision  arrays for x   y  and z components  Particle positions relative to the volume modelled by the individual processor      thus not absolute positions unless the serial version of DL_MESO_DPD is used     are held in arrays xxx  i    yyy i  and zzz i   for particle i   Particle velocities are held in vxx i   vyy i  and vzz i   Three sets  of arrays for the net forces acting on the particles are available  fxx i   fyy i  and fzz i  for forces that  remain constant over each time step  fvx i   fvy i  and fvz i  for forces that may vary during the time step   e g  drag forces for DPD Velocity Verlet integration  thermostatting force for Stoyanov Groot thermostat    and fcfx i   fcfy i  and fcfz i  for corrections to forces between frozen particles  particularly long range    electrostatic forces      The particles modelled by a particular processor have both local and global identity numbers  the latter of which  are stored in the integer array lab i   DL MESO_DPD assigns the lowest local identity numbers  i e  between  1 and nfbeads  to the frozen particles in each processor   s subdomain to avoid having to search for and skip  over frozen particles during force integration steps  while the highest gl
90. Lattice Boltzmann calculations and should not be modified     fCollisionMRTGuoSegregation    e Header records    int fCollisionMRTGuoSegregation      e Function  Collision and segregation steps for all compressible and incompressible fluids using MRT model with  Guo like forcing terms and Lishchuk mesophase interactions     e Dependencies  fSiteFluidCollisionMRTGuoSegregation  fSiteFluidIncomCollisionMRTGuoSegregation  fSiteSoluteCollisionBGK  fSiteThermalCollisionBGK  fGetOneMassSite  fGetTotMassSite  fGetSpeedSite  fGetSpeedIncomSite    e Comments    This routine is fundamental to Lattice Boltzmann calculations and should not be modified     fPropagationTwoLattice    e Header records    int fPropagationTwoLattice      e Function    Moves lattice particles  distribution functions  to neighbouring grid points using the two lattice algorithm     e Dependencies    None    e Comments  This routine is fundamental to Lattice Boltzmann calculations and should not be modified  This is the    least efficient propagation routine available     fPropagationSwap    e Header records    int fPropagationSwap      e Function    Moves lattice particles  distribution functions  to neighbouring grid points using the swap algorithm     114 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Dependencies    fSwapPair    e Comments  This routine is fundamental to Lattice Boltzmann calculations and should not be modified  Propagation  is carried out by systematic swapping of post collisional values for 
91. OUTINE scan_config    e Function  Scans CONFIG file for dimensions of system unit cell     e Dependencies  CONFIG file  getint  getdble  global_sca_and    error    e Arguments  None    read_control    e Header records  SUBROUTINE read_control    e Function  Reads in system data from CONTROL file     208    CHAPTER 13     e Dependencies    CONTROL file  getdble  getint  getword  lowercase  error    global_sca_and    e Arguments    None    scan_field    e Header records    SUBROUTINE scan_field    e Function  Scans FIELD file for numbers of interactions  species etc      including bonds     e Dependencies    FIELD file  error  global_sca_and  getword  lowercase  getint  getdble    e Arguments    None    read_field    e Header records  SUBROUTINE read_field    e Function    DL_MESO_DPD PACKAGE REFERENCE    and sets up arrays for all interaction data    Reads in all species and interactions from FIELD file  including bonded interactions and molecule config     urations    e Dependencies  FIELD file  getdble  getint  getword  lowercase  error    global_sca_and    e Arguments    None    13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 209    e Comments  This routine will determine interaction parameters for species pairs not specified in FIELD file unless any    interactions are many body DPD  this requires all interaction species pairs to be specified      elecgen    e Header records  SUBROUTINE elecgen    e Function  Sets up electrostatic parameters for self interaction and charged s
92. S AND FUNCTIONS 111    e Function  Collision and segregation steps for all compressible and incompressible fluids using BGK model with    Lishchuk mesophase interactions     e Dependencies  fSiteFluidCollisionBGKSegregation  fSiteFluidIncomCollisionBGKSegregation  fSiteSoluteCollisionBGK  fSiteThermalCollisionBGK  fGetOneMassSite  fGetTotMassSite  fGetSpeedSite  fGetSpeedIncomSite    e Comments    This routine is fundamental to Lattice Boltzmann calculations and should not be modified     fCollisionBGKGuo    e Header records  int fCollisionBGKGuo      e Function    Collision steps for all compressible and incompressible fluids using BGK model with Guo forcing terms     e Dependencies  fSiteFluidCollisionBGKGuo  fSiteFluidIncomCollisionBGKGuo  fSiteSoluteCollisionBGK  fSiteThermalCollisionBGK  fGetSpeedSite  fGetSpeedIncomSite    e Comments    This routine is fundamental to Lattice Boltzmann calculations and should not be modified     fCollisionBGKGuoSegregation    e Header records    int fCollisionBGKGuoSegregation      e Function  Collision and segregation steps for all compressible and incompressible fluids using BGK model with Guo  forcing terms and Lishchuk mesophase interactions     e Dependencies  fSiteFluidCollisionBGKGuoSegregation  fSiteFluidIncomCollisionBGKGuoSegregation fSiteSoluteCollisionBGK  fSiteThermalCollisionBGK  fGetOneMassSite  fGetTotMassSite  fGetSpeedSite  fGetSpeedIncomSite    112 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Comments    This routine
93. SerialDomainBuffer   e Addition of fsBoundPeriodic and fMarkBoundArea immediately before fInitializeSystem     e Addition of fsPeriodic inside main loop before calculating interaction forces  it does not matter whether    this is placed before or immediately after the call for creating output files      e Addition of fsIndexPeriodic inside main loop before calculating interaction forces for the Lishchuk  algorithm  if these are not to be calculated  this call can be omitted      e Addition of fsForcePeriodic inside main loop after calculating interaction forces  if these are not to be  calculated  this call can be omitted      5 2 Boundary conditions    To apply boundary conditions to a Lattice Boltzmann Equation simulation  the distribution functions f  at  boundary lattice points have to be modified or replaced during each time step to give the required fluid velocity  or pressure concentration temperature  This may take place either between the collision and propagation stages  or at the end of each time step  the subroutines fPostCollBoundary and fPostPropBoundary respectively are  used to invoke the boundary conditions  The space property lbphi is used to define the boundary conditions  for each lattice node in the system     5 2 1 Periodic    Periodic boundaries are used to simulate bulk fluids sufficiently far away from the actual boundaries of a real  physical system so that surface effects can be neglected  As the fluid moves out of one face of the system volume   it
94. T  cannot be found in the CONTROL file  this is a compulsory parameter for    DPD simulations     Action  Look in the CONTROL file and make sure the temperature directive is included with a non zero value     Message 3  time step size not set    A valid simulation timestep  At  cannot be found in the CONTROL file  this is a compulsory parameter for DPD    simulations     Action  Look in the CONTROL file and make sure the timestep directive is included with a non zero value     Message 4  boundary halo size larger than half subdomain size    The size of the boundary halo  either specified by the user or determined from required interaction and bond  lengths  exceeds half the length of at least one dimension of the subdomain volume assigned to each processor     The DPD simulation may therefore run less efficiently     Action  None required to ensure the simulation runs as this is a warning message  but the user may wish to    reduce the specified boundary halo size or use global bond calculations for future calculations     Message 5  too many beads per node    The number of particles likely to be assigned to each processor is greater than the calculated maximum value    maxdim     231    232 APPENDIX C  DL MESO_DPD ERROR MESSAGES    Action  This error is unlikely to happen as maxdim is calculated according to the numbers of particles and  processors available  but the user may wish to use the densvar directive in the CONTROL file to increase this    value     Message 10  cann
95. TER 7  DL MESO _LBE PACKAGE REFERENCE    Function  Outputs macroscopic mass density of fluid iprop and velocity  speeds along x   y  and z directions  at  each lattice point for system in Structured Grid XML VTK format     Dependencies  fOutputVTKP2D  fOutputVTKP3D    Arguments  filename input array of characters    iprop input integer    Comments  The default output file name is lbout  vts and the density of fluid 0 is output by default  This can be  changed by specifying an output file name and fluid number  up to 1bsy nf   1  when calling the routine     fOutputVTKCA    e Header records    int fOutputVTKCA const char  filename  1bout   int iprop 0     Function  Outputs mass fraction of fluid iprop and speeds along x   y  and z directions at each lattice point for  system in Structured Grid XML VTK format     Dependencies  fOutputVTKCA2D  fOutputVTKCA3D    Arguments  filename input array of characters    iprop input integer    Comments  The default output file name is 1bout  vts and the mass fraction of fluid 0 is output by default  These  can be changed by specifying an output file name and fluid number  up to 1bsy nf   1  when calling the    routine     fOutputVTKCB    e Header records    int fOutputVTKCB const char  filename  1bout   int iprop 0     e Function    Outputs concentration of solute iprop and fluid velocity at each lattice point for system in Structured  Grid XML VTK format     e Dependencies    fOutputVTKCB2D  fOutputVTKCB3D    e Arguments    filename input 
96. TK  Contains subroutines to write calculation output files in Legacy VTK  structured grid  format         1bpIOVTK  Contains subroutines to write calculation output files in XML VTK  structured grid  format     e 1bpBOUND  Contains subroutines for boundary conditions  e g  calculating the particle distribution function in a shear    boundary     e lbpFORCE  Contains subroutines to calculate non constant forces  e g  immiscible fluid fluid interactions     e 1bpSUB  Contains the most important subroutines for Lattice Boltzmann calculations  e g  particle propagation    and site collision     e 1bpRUNx  Contain the major program loops to carry out Lattice Boltzmann calculations  1bpRUNSER for serial  running  1bpRUNPAR for parallel      61    62 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e 1bpMPI  Contains all subroutines necessary for parallel computation  This package can be left out if the user uses    only a single processor workstation or a Windows PC     It is recommended that DL_MESO users put self defined subroutines into a package called 1bpUSER so upgrades  of DL_MESO will not interfere with their contributions     7 2 DL MESO LBE Subroutines and Functions    7 2 1 main    There are two primary versions of the main DL_MESO_LBE program  serial  slbe cpp  and parallel  plbe  cpp    These provide calls to the main loops for Lattice Boltzmann calculations in 1bpRUN  and allow the use of input  files to select collision  forcing and mesophase interaction algorithms  as w
97. a utility written in C   to gather Plot3D output files produced by the parallel version  of DL_MESO_LBE and produce a single structure file  lbtout  xyz or 1btout xy  and a single set of solution  files  Ibtout  q  for visualization of the entire system     If c   is the command for the available C   compiler  the executable plot3d exe can be produced by typing  e c    o plot3d exe lbeplot3dgather cpp    and either run at the command line or via the GUI under Gather LBE Data     All lbout  xyz and lbout  q files should be copied to the directory including the executable  if necessary   before running  as well as the lbout info file to give information on the sizes of integers and floating point  numbers  No user input is required  although the utility will stop with an error message if no 1bout   info file is    available  No other error messages are produced  so care should be taken to ensure no solution files are missing     This utility can be run with a command line argument to give the scalar property required  e g  for Windows    and Unix Linux computers respectively    e plot3d exe 1    e   plot3d exe 1    where 0 is used for all properties  1 for fluid density  2 for mass fraction  3 for solute concentration and 4 for  temperature   If the GUI is used  this can be selected using the pulldown list in the Gather LBE Data panel    If the argument is omitted  the utility will ask the user to enter the required property  No other user input is  required  but error messages
98. action types in this sub   routine as additional cases  this would also require changes to read_control in config_module     bondforceslocal    e Header records  SUBROUTINE bondforceslocal    e Function  Calculates all bond  stretching  angle  dihedral  forces between particles in system using locally defined  bond lists     188 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    e Dependencies  shellsort_list  search_list  duplicate  error  global_sca_and  bond_force  angle force    dihedral_force    e Comments  Assumes that bond lists contain only those bonds in the current node  This is the most efficient method  for parallel running but runs the risk of losing track of bonded pairs if bond lengths get longer than the    subdomain halo size rhalo     bondforcesglobal    e Header records  SUBROUTINE bondforcesglobal    e Function  Calculates all bond  stretching  angle  dihedral  forces between particles in system using globally defined  bond lists     e Dependencies  shellsort_list  search_list  images  error  global_sum_dble  global_sca_and  bond_force  angle_force    dihedral_force    e Comments  Assumes that bond lists contain all bonds in the entire system  This is less efficient for parallel running  than only calculating the bonds in each node but ensures longer bond lengths can be accommodated     13 2 10 domain module    This module requires the modules constants  variables  error_module  comms_module  if running parallel    version  and bond_module  if running parallel v
99. ader records  two cases  3D and 2D   inline long fGetNodePosi  int xpos  int ypos  int zpos     inline long fGetNodePosi  int xpos  int ypos     68    e Function    CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    Calculates the position of the grid point in a one dimensional array from its Cartesian coordinate     e Dependencies    None    e Arguments    xpos input  ypos input  zpos input    fGetNodePosi output    e Comments    integer  integer  integer  long integer    The calculation follows the standard C   data structure  row major      fGetCoord    e Header records  two cases  3D and 2D     int fGetCoord long tpos  int amp  xpos  int amp  ypos  int amp  zpos     int fGetCoord long tpos  int amp  xpos  int amp  ypos     e Function    Calculates the Cartesian coordinate of a grid point from its position in a one dimensional array     e Dependencies    None    e Arguments    xpos output integer reference    ypos output integer reference    zpos output integer reference    tpos input long integer    fGetOneMassSite    e Header records  three cases   double fGetOneMassSite doublex  startpos   double fGetOneMassSite int fpos  long tpos     double fGetOneMassSite int fpos  int xpos  int ypos  int zpos     e Function    Calculates the mass density of one of the fluids at a grid point     e Dependencies    None    e Arguments   startpos   fpos   tpos   xpos   ypos   zpos  fGetOneMassSite    input  input  input  input  input    input    double pointer  integer   long integer  integer
100. airs that are to be subjected to the Nos   Hoover thermostat   an additional thermostatting force is included     Y kpT   Fi   ow   rij   1   a   vig  gt  ij  ei  11 16     with a as a system wide thermostat coupling parameter and w   rij  as a switching function  which by default is  equivalent to w   rij    1    Tii for standard DPD  All other particle pairs are thermostatted using the standard  Lowe Andersen method  A virial correction of  FF  Tij is also made for each particle pair     This thermostat can produce a wide range of system viscosities and diffusivities with good temperature control  and hydrodynamics  using the collision frequency I to obtain the required Schmidt number  The replicated  data strategy is again used for the Lowe Andersen part  which requires memory in each processing unit to store  the velocities of all particles and the data for particle pair modification using the Lowe Andersen scheme  the  Nos   Hoover scheme calculates the thermostatting forces locally     11 3 Barostats    In addition to a thermostat  a barostat may be included in simulations to obtain a desired average pressure   Po  by adjusting the size  and shape  of the simulation cell  DL_MESO_DPD includes two such algorithms  a  Langevin type barostat 29  and the Berendsen barostat 2   both of which have been coupled to all five available  thermostats     The isotropic pressure in a system is calculated using the virial theorem        P t    70 2 mito   DAO 0  11 17     while for an
101. airwise forces calculated  plcfor_      The time taken to calculate the forces is determined  timchk      The second stage of the integrator is applied to calculate the velocities at the end of the time step  This    may include e g  recalculation of dissipative forces or resizing of the system for a barostat     Statistical properties for the system are calculated and  during equilibration  the particle velocities are  rescaled for the specified temperature  statis      After every nsbpo time steps  the system clock is consulted  timchk  and statistical data is printed to the  OUTPUT file  printout   If equilibration has come to an end  i e  nstep   nseql  this is also reported   equilout      If requested by the user  after every iscorr time steps statistical data is written to the CORREL file  corout   and after every ntraj time steps trajectory data is saved to the HISTORY or HISTORY  file s      The step time is calculated  timchk  and if the allocated time has expired  the job is closed down  otherwise  restart data is saved  revive      After all the time steps have been calculated or the allocated time has elapsed     The final calculation summary is printed to the OUTPUT file  result    The duration of the calculation run is determined and printed  timchk    All remaining output channels  for OUTPUT  HISTORY  files  are closed     For parallel running only  MPI communications are closed down  exitcomms      13 2 2 numeric_container    This package contains general pu
102. ajectory file  export vtf  from  DL_MESO_DPD restart files  export   that can be visualized to give a snapshot of the last simulation timestep     B 2  DL MESO DPD 229    Since a limited amount of data is included in restart files  the FIELD file for the simulation is needed to provide    some additional information     The source code for this utility  exportimage f90  can be used for export or export  files created by both the  serial and parallel versions of DL_MESO_DPD  their endianness is automatically detected  so the utility can be  run on a different machine to the one used for DPD calculations  If the available Fortran90 compiler is invoked  by the command   90  the executable export  exe can be produced by typing    e   90  o export exe exportimage f90    and either run at the command line or by using the GUI in Process DPD Data     This utility can be run with a command line argument indicating the number of processes used to generate the    restart data  e g  if 16 processes were used  either of the following commands can be used     e export exe 16    e   export exe 16    If no command line argument is given  the utility will ask the user to type in the number of processes   The  number of processes can be specified in the GUI before running the utility      traject    The Fortran90 utility traject reads in HISTORY  output data files generated by DL_MESO_DPD and produces  a VTF format trajectory file  traject vtf  that can visualize the simulation after equilibra
103. al and Engineering Sciences  360 1792  437 451  2002     U  D   Ortona  D  Salin  Marek Cieplak  Renata B  Rybka  and Jayanth R  Banavar  Two color nonlinear  Boltzmann cellular automata  Surface tension and wetting  Physical Review E  Statistical Physics  Plasmas   Fluids  and related interdisciplinary topics  51 4  3718 3728  April 1995     Burkhard Diinweg and Wolfgang Paul  Brownian dynamics simulations without Gaussian random numbers   International Journal of Modern Physics C  2 3  817 827  1991     U  Frisch  B  Hasslacher  and Y  Pomeau  Lattice gas automata for the Navier Stokes equation  Physical  Review Letters  56 14  1505 1508  April 1986     A  Ghoufi and P  Malfreyt  Mesoscale modeling of the water liquid vapor interface  A surface tension  calculation  Physical Review E  83 051601  May 2011     J  B  Gibson  K  Chen  and S  Chynoweth  The equilibrium of a velocity Verlet type algorithm for DPD  with finite time steps  International Journal of Modern Physics C  10 1  241 261  February 1999     Minerva Gonz  lez Melchor  Estela Mayoral  Maria Eugenia Vel  zquez  and Jos   Alejandre  Electro   static interactions in dissipative particle dynamics using the Ewald sums  Journal of Chemical Physics   125 22  224107  2006     R  D  Groot  Electrostatic interactions in dissipative particle dynamics   simulation of polyelectrolytes and  anionic surfactants  Journal of Chemical Physics  118 24  11265 11277  2003     247    248    16    17    18          19     20     21 
104. ameter data type notation  many body DPD cutoff radius  rg  rmbcut real KIND dp    square of many body DPD cutoff radius rmbct2 real KIND dp    short range electrostatic cutoff  re  relec real KIND dp    square of electrostatic cutoff rel2 real KIND dp    surface cutoff length  ze  srfzcut real KIND dp    square of surface cutoff length sr  zct2 real KIND dp    maximum calculation time timjob real KIND dp    calculation close time tclose real KIND dp    system volume volm real KIND dp    size of system in x dimension dimx real KIND dp    size of system in y dimension dimy real KIND dp    size of system in z dimension dimz real KIND dp    size of unit cell in z dimension dimxcell real KIND dp    size of unit cell in y dimension dimycell real KIND dp    size of unit cell in z dimension dimzcell real KIND dp    number of domain cells in x npx integer  gt 1  number of domain cells in y npy integer  gt 1  number of domain cells in z npz integer  gt 1  list of neighbouring processes map integer A6   x position of domain cell idx integer   y position of domain cell idy integer   z position of domain cell idz integer   position of domain cell origin in system volume  x dimension  delx real KIND dp    position of domain cell origin in system volume  y dimension  dely real KIND dp    position of domain cell origin in system volume  z dimension  delz real KIND dp    domain cell length in   x direction sidex real KIND dp    domain cell length in y direction sidey real KIND dp    domain c
105. an and unit variance  The constant o   is related to    the temperature  as is understood from the role of the stochastic force in representing a heat bath     Finally the particles are subject to a drag force  which depends on the relative velocity between interacting  pairs of particles   2 Pere  FR      qijw   riz   Fig Ui  T  9 7   ij  where w   r j  is once again a switching function and vj    vj     vj  The constant 7   is the drag coefficient  It  follows from the fluctuation dissipation theorem that for thermodynamic equilibrium to result from this method    the following relations must hold     oj   2yijkBT  9 8     2  w   rij     w   ri5    9 9   In practice the switching functions are defined through    w   rig     1   a  rij  lt  re   9 10     9 3  EQUATION OF STATE AND DYNAMIC PROPERTIES 129    which ensures that all interactions are switched off at the range rij   re  In many DPD simulations  the  stochastic and drag coefficients are often constant for all interactions  i e  oij   0 and yi    y  although this  assumption does not have to apply     9 3 Equation of state and dynamic properties    The form of the conservative force determines the equation of state for a DPD fluid  which can be derived using    the virial theorem to express system pressure as follows        1 Li  p   pkaT 35  Es    Fy   is   9 11   j gt i    pkgT   se f   rA  1        g r r  dr  9 12   0 Te    where g r  is a radial distribution function for the soft sphere model 16  and p is the DP
106. and  standard Plot3D data format  in binary format for parallel calculations and ANSI for serial  These may be  modified by the user as required  The utility lbeplot3dgather in the LBE utility directory can combine  Plot3D files generated in parallel  while Parallel Structured Grid XML VTK files  lbtout  pvts  that refer to  the files from each processor can be created using the utility lbevtkgather  further details can be found in  Appendix B or the README file in the same directory  By default all properties for a simulation     fluid densities   mass fractions  solute concentrations and temperatures     are written to each output file  or to individual output  files for Plot3D for each property   The customizable version of DL MESO_LBE allows users to select which  properties should be written to output files     6 2  OUTPUT FILES 59    Structured Grid XML VTK format  lbout  vts    Structured Grid VTK files written by DL MESO_LBE include the lattice dimensions  numbers of grid points  in each direction   the Cartesian coordinates of the grid points in real life units  and the same data as in Legacy  VTK files  Output files produced in serial include the data between XML tags  e g   lt DataArray gt   while those  produced in parallel use the  lt DataArray gt  tags to refer to the starting point for the data in a stream of binary  numbers inside an  lt AppendedData gt  tag  The latter files represent the data in each subdomain and should  be retained when plotting the entire
107. and edited afterwards using the text  editor option described above     2 3 2 1 Species  interactions and external field parameters    Examples of the pop up windows for species  non bonded interactions and external field parameters can be seen  in Figure 2 8 with the rows labelled in red numbering     The species pop up window is formatted as in Figure 2 8 a   with individual columns for each species     1  The name of each species  which can be up to 8 characters long    2  The mass of a particle for the species  m      3  The charge of a particle for the species  q      4  The number of unbonded particles of the species  population  unbonded   in the system     5  The tickbox indicates whether or not the particles for the species should be frozen     2 3  DISSIPATIVE PARTICLE DYNAMICS AND THE DL_MESO GUI 17                                                                                                                         species i      1 Aij   250 3  species j  SPEC   v Bij   interaction type   DPD 7   Cij   Dij   TE bpp species properties      abe Eli   species 1  interaction length   1 0 4  name  SPECl 1  1 dissipative collision parameter   4 5 5  mass  1 0 2   E 0 0 rane  paare oo 3 wall species    6  population  unbonded   0 4  wall density  Tf  frozen   wall thickness   wall repulsion parameter  6 A E 8  SAVE SP   CANCEL SP   SELL   SAVE I CANCEL     a  Species parameters  b  Non bonded interaction parameters  EJ DPD external field properties SAIA  GRAVITATIONAL F
108. and stress tensors that are required to exclude interactions between charged frozen  particles  these corrections only need to be calculated once if the volume is held constant  and thus the frozen  particles do not move  but have to be recalculated at each time step if a barostat is applied     This method can be invoked by using the directives ewald  permittivity and smear in the CONTROL file  the  first is used to set the real space convergence parameter  a    and k space vector range  the second to set the  permittivity coupling constant  T  and the third with the keyword slater used to set the smearing coefficient    B     11 6 Bond interactions between particles    Molecules of particles bonded together can be included in calculations using a FIELD file to define the properties  and topologies of the bonds  angles and dihedrals between them  These data are used in the start subroutine  to add the specified numbers of molecules into the system before DPD calculations commence and to create  tables listing the particles that are included in bonds  angles and dihedrals     11 6 1 Stretching bonds    DL_MESO_DPD can model four forms of bond potential  and corresponding force  between specified particles   all of which are functions of the distance between them  The available bond forms between particles    and j are  as follows     1  Harmonic  Hookean Fraenkel  bond     U  rij    5  rij     ro      11 63     2   Shifted  Finitely Extendible Non linear Elastic  FENE  bond  
109. ange repulsion between species and wall    while if frozen bead surfaces are in use  the surface directive should be followed by a single line specifying the  properties for the walls to be constructed     12 1  INPUT FILES 163    name a8 name of frozen bead species  Pwall real density of frozen beads in wall regions  Lwall real thickness of wall region    External fields are flagged by the directive external  followed by a line with a keyword indicating the type of  field to be applied and the field parameters  A gravitational field can be specified using the keyword grav and    three real values representing the x   y  and z components of gravitational acceleration  i e     grav Gr Gy Gz    If using the Lees Edwards shearing boundary condition  the velocity of the walls in dimension a can be specified  using the keyword shear and three real values representing the x   y  and z components for the velocity at  Za   La  i e    shear Via Voy Vw z  Note that the velocity at   a   0 will be equal in magnitude but opposite in direction  and that the velocity    component for dimension a will be ignored   The FIELD file must be closed with the directive close     If molecules are to be included in the system  the supplied C   program molecule generate in the directory  DPD utility can be used to either create a new FIELD file with the required data or append it to a pre existing  file  see Appendix B for more details  Example files in the DEMO DPD directory can be examined for this
110. any other way out of the subject matter of this  Licence Agreement or the use of the DL_MESO Software will not  exceed in total 5000     Nothing in this Licence Agreement limits or excludes STFC   s  liability for death or personal injury caused by its negligence  or for any fraud  or for any sort of liability that  by law     cannot be limited or excluded     The express undertakings and given by STFC in this Licence  Agreement and the terms of this Licence Agreement are in lieu of  all warranties  conditions  terms  undertakings and obligations    on the part of STFC  whether express or implied by statute     243    common law  custom  trade usage  course of dealing or in any  other way  All of these are excluded to the fullest extent  permitted by law     4  INTELLECTUAL PROPERTY RIGHTS AND ACKNOWLEDGEMENTS    4 1    4 2    5 2    5 3    5 4    Nothing in this Licence Agreement assigns or transfers any  Intellectual Property Rights in any of the DL_MESO Software     Those rights are reserved to STFC     The Licensee will ensure that  if any of its employees or  students publishes any article or other material resulting from   or relating to  a project or work undertaken with the assistance  of any part of the DL_MESO Software  that publication will    contain the following acknowledgement      DL_MESO is a mesoscale simulation package written by R  Qin   W  Smith and M  A  Seaton and has been obtained from STFC   s  Daresbury Laboratory via the website  http   www ccp5 ac 
111. array of characters    iprop input integer    7 2  DL MESO _LBE SUBROUTINES AND FUNCTIONS 85    e Comments  The default output file name is 1bout  vts and the concentration of solute 0 is output by default  These  can be changed by specifying an output file name and solute number  up to 1bsy ns   1  when calling the    routine     fOutputVTKT    e Header records  int fOutputVTKT const char  filename  lbout      e Function  Outputs macroscopic temperature and fluid velocity at each lattice point for system in Structured Grid  XML VTK format     e Dependencies  fOutputVTKT2D  fOutputVTKT3D    e Arguments    filename input array of characters    e Comments  The default output file name is lbout  vts  This can be changed by specifying an output file name when  calling the routine     Other output routines    Subroutines with names fsOutput  are suitable for serial running and produce output files for entire systems     Unlike the routines listed above  these omit any domain boundary lattice points used in calculations     Notes regarding  q   vtk and  vts files    e lboutzx   is the  q   vtk or  vts file at the   th saved step during serial running     e lboutyatxz   is the  q   vtk or  vts file at the xth saved step written by processor y during parallel    running     e lbout files produced using multiple processors will require gathering or simultaneous plotting  see Ap   pendix B for more details     7 2 9 IbpBOUND  fNextStep    e Header records  three cases  3D  2D and coord
112. art file s   export     Each processing unit produces a restart file with a name beginning with export every ndump time steps  This  binary file contains the following information for the time step     e Name of DPD calculation   e Numbers of particles  bonds  angles and dihedrals in the processing unit     e Specified temperature  number of time steps  system volume     12 2  OUTPUT FILES 165    e Current state of random number generators    e Particle global identity numbers  species and molecule numbers  e Bond  angle and dihedral tables    e Particle Cartesian coordinates  velocities  forces and virials     e Current time step and statistical properties  current values  cumulative sums and fluctuations  rolling    averages and stacks      In combination  the export  files can restore a stopped DPD calculation  They can also be used to generate  a plot at the given time step or a CONFIG file for subsequent simulations using the utilities exportimage and  exportconfig respectively in the DPD utility directory  Appendix B gives instructions for their use     Trajectory file s   HISTORY     If the trajectory option is specified in the CONTROL file  each processing unit will generate a trajectory file with  a name beginning with HISTORY every ntraj time steps starting from timestep straj  Each binary file contains  some of the system properties     including an identity number for each molecule     followed by the positions    and velocities for each particle in the domain    
113. ation double  startpos  double  sitespeed  double   bodyforce  double  phaseindex     e Function  Calculates collisions and phase segregation for the Lishchuk algorithm at a grid point using the Bhatnagar   Grook Krook  BGK  model with the Guo forcing term for incompressible fluids     e Dependencies  fGetAllMassSite  fGetTotMassSite  fReciprocal    fGetEquilibriumFIncom    e Arguments  startpos input double pointer  sitespeed input array of doubles  bodyforce input double pointer  phaseindex input double pointer    e Comments  Collisions are carried out on a single    achromatic    fluid using the BGK single relaxation time 4   with the  Guo forcing term 19  also acting on the achromatic fluid  fluid segregation takes place using the D   Ortona  algorithm  9    pa ae ae ab PEL  fi  z t        fi  Zt    58 Wi     z   i   Nab   P ba P    fSiteFluidCollisionMRT    e Header records  int fSiteFluidCollisionMRT double  startpos  double  sitespeed  double  bodyforce     e Function    Calculates collisions at a grid point using Multiple Relaxation Time  MRT  models for compressible fluids     e Dependencies  fGetOneMassSite  fGetSpeedSite  fGetMomentEquilibriumF  fGetMRTCollide    106 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Arguments  startpos input double pointer  sitespeed input array of doubles    bodyforce input double pointer    e Comments    Collisions for each fluid species are carried out using multiple relaxation time  MRT  schemes 33  8       Os   eia  a  fi   T7   
114. ational Journal for Numerical Methods in Fluids  43 2  183 198   2003      73  Qisu Zou and Xiaoyi He  On pressure and velocity boundary conditions for the lattice Boltzmann BGK  model  Physics of Fluids  9 6  1591 1598  June 1997     
115. ative mesoscale algorithms can be added by the user     fInteractionForceShanChen    e Header records    int fInteractionForceShanChen       e Function    Calculates interaction forces for all fluids based on the Shan Chen model 55  56      e Dependencies    fCalcInteraction_ShanChen    e Comments  The interaction potentials need to be calculated prior to calling this routine  Alternative mesoscale    interactions can be applied using similar routines     94 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    fInteractionForceShanChen Wetting    e Header records    int fInteractionForceShanChenWetting      e Function  Calculates interaction forces for all fluids based on the Shan Chen model 55  56  with additional wetting  forces 41      e Dependencies    fCalcInteraction_ShanChenWetting    e Comments  The interaction potentials need to be calculated prior to calling this routine  Alternative mesoscale    interactions can be applied using similar routines     fCalcPhaseIndex_Lishchuk    e Header records  int   CalcPhaseIndex_Lishchuk       e Function  a b  Calculates phase indices pn    ae and first order spatial derivatives  Vp  for all unlike fluid pairs   storing the latter for future use   e Dependencies  fGetOneMassSite    e Comments  The Lishchuk model is detailed in  35  20      fCalcInteraction_Lishchuk    e Header records    int fCalcInteraction Lishchuk int xpos  int ypos  int zpos     e Function    Calculates particle interaction forces according to Lishchuk model     e A
116. ature at front boundary   sets rate of change in temperature at back boundary   sets thermal relaxation time  7     sets thermal relaxation frequency  7       sets constant external body force on fluid f  n   3f for c component  n   3f 1  for y component  n   3f   2 for z component   sets x component of constant external body force on fluid f   sets y component of constant external body force on fluid f   sets z component of constant external body force on fluid f   sets Boussinesq force constant  g8  for fluid f  n   3f for z component  n    3f  1 for y component  n   3f  2 for z component   sets z component of Boussinesq force constant  7 8  for fluid f   sets y component of Boussinesq force constant  g8  for fluid f   sets z component of Boussinesq force constant  gf  for fluid f   sets high reference temperature for Boussinesq convection  Th    sets low reference temperature for Boussinesq convection  T     sets interaction parameter between fluids f   and fo  n  1bsy nf x f     f2  sets interaction parameter between fluids f   and fa   sets fluid segregation parameter between all fluids species   sets fluid segregation parameter between fluids f   and fo  n   lbsy nf x fi   fo  sets fluid segregation parameter between fluids f   and fa    The GUI is recommended for creating the 1bin spa file  which stores the data in the following format     58 CHAPTER 6  DL_MESO_LBE INPUT AND OUTPUT FILES    X y Z grid property    An empty lbin spa file represents all boundaries as peri
117. be used to specify other information  such as fluid densities  velocities  relaxation    times or frequencies etc  Superfluous parameters can be omitted  while new ones would require additions to    the parameter recognition loop in the fInputParameters subroutine in 1bpIO  Note that if there are duplicate    entries for any keyword  the value associated with the last one in the 1lbin  sys file will be used     keyword     total_step    equilibration_step    save_span  noise_intensity    evaporation_limit    sound_speed  kinetic_viscosity  total_step    speed_ini_n    speed_top_n  speed_bot_n  speed_lef_n  speed_rig_n  speed_fro_n  speed_bac_n  density _ini_f  density_inc_f  density_top_f  density_bot_f  density _lef_f  density_rig_f  density_fro_f  density_bac_f  relaxation fluid_f    relax _freq_fluid_f    meaning     sets total number of timesteps for the simulation   sets number of timesteps for equilibration of the simulation  without solid  boundary conditions or external forcing    sets interval for writing output files   gives maximum variation in initial fluid densities for multiple fluid systems  gives minimum fluid density for non continuous fluids when dealing with edge  or corner boundaries   sets speed of sound for fluid 0 in real life  i e  non lattice based  units   sets kinematic viscosity for fluid 0 in real life units   sets total number of timesteps for the simulation   sets initial velocity for all fluids  n   0 for x component  n   1 for y component   n 
118. ble  A lbsy nf   bulk fluid inverse relaxation time  77  hulk    Lbtfbulk double  A lbsy nf   solute inverse relaxation time  1     lbtc double  A lbsy nc   temperature inverse relaxation time  7       1btt double  A lbsy nt   fluid fluid interaction parameter  gas  lbg double  A lbsy  nf lbsy nf   fluid wall interaction parameter  ga wail  lbgwall double  A lbsy nf   fluid segregation parameter  8   lbseg double  A lbsy nf 1bsy nf   body force lbbdforce double  A 3 lbsy nf   Boussinesq force  78  lbbousforce double  A 3 lbsy nf   interaction force lbinterforce   double  A 3x 1bsy nf 1bdm touter   distribution function 1bf double  A lbsitelength lbdm touter   temporary function 1bft double  A 1bdm touter  lbsy nf lbsy nc    equilibrium distribution lbfeq double  A lbsy nq   space property lbphi int  A lbdm touter   neighbouring point property lbneigh int  A 6 1bdm touter   speed vector for the model lbv int  A 3 lbsy nq   index for opposing speed lbopv int  A lbsy nq   weight factor of speed vector lbw double  A lbsy nq   MRT transformation matrix lbtr double  A lbsy nq lbsy nq   MRT inverse transformation matrix lbtrinv double  A lbsy nq lbsy nq   MRT tuneable collision parameters lbmrts double A3   MRT tuneable equilibrium parameters 1bmrtw double A3   number of parameters per grid point lbsitelength   int   number of grid points in yz plane lbyz int   grid spacing 1bdx double   time step 1bdt double   speed of sound lbsoundv double   Reynolds number lbreynolds double   pro
119. ble pointer  v input double pointer    tem input double precision    e Comments    The equilibrium distribution function calculated here is  het   wT f ds mm  c    using the velocity of the bulk fluid 27   This subroutine can be changed for other Lattice Boltzmann  models  e g   23      fGetMomentEquilibriumF    e Header records    int fGetMomentEquilibriumF double  meq  double  p  double rho     e Function    Calculates equilibrium distribution function in moment space for compressible fluid     100 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Dependencies    None    e Arguments  meq output double pointer  p input double pointer    rho input double precision    e Comments    The equilibrium distribution function in moment space calculated here is  Mea   T       the exact form of which is dependent on the lattice scheme  given for D2Q9 by  33  and for D3Q15 and  D3Q19 by  8   Parameters for calculating the square of energy  e  and fourth order moments  Taa  can  be modified by the user in the 1bpMODEL module     fGetMomentEquilibriumF Incom    e Header records    int fGetMomentEquilibriumFIncom double  meq  double  p  double rho  double rho0     e Function    Calculates equilibrium distribution function in moment space for incompressible fluid     e Dependencies    None    e Arguments  meq output double pointer  p input double pointer  rho input double precision    rho0 input double precision  e Comments  The equilibrium distribution function in moment space calculated here
120. briumFIncom  fGetMomentForce  fGetMRTCollide    7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 109    e Arguments  startpos input double pointer  sitespeed input array of doubles    bodyforce input double pointer    e Comments  Collisions are carried out using multiple relaxation time  MRT  schemes coupled with Guo like forcing  terms  49     81   eia  a  fi   T7   3  TF   Met     1  413        fSiteFluidIncomCollisionMRTGuoSegregation    e Header records  int fSiteFluidIncomCollisionMRTGuoSegregation double  startpos  double  sitespeed  double   bodyforce  double  phaseindex     e Function  Calculates collisions and phase segregation for the Lishchuk algorithm at a grid point using Multiple   Relaxation Time  MRT  models coupled with Guo like forcing terms for incompressible fluids     e Dependencies  fGetAllMassSite  fGetTotMassSite  fReciprocal  fGetMomentEquilibriumFIncom  fGetMomentForce  fGetMRTCollide    e Arguments  startpos input double pointer  sitespeed input array of doubles  bodyforce input double pointer  phaseindex input double pointer    e Comments  Collisions are carried out on a single    achromatic    fluid using multiple relaxation time  MRT  schemes  coupled with Guo like forcing terms 49   fluid segregation takes place using the D   Ortona algorithm  9      p   pep   Pat A    Bw    s   fab   P Za P    fSiteSoluteCollisionBGK    e Header records  int fSiteSoluteCollisionBGK double  startpos  double  sitespeed     e Function  Calculates solute collisions at a 
121. ce back type  x0   obstacle type  yo     z0     add obstacle    SET AS POROUS MEDIA  bounce back type  pore fraction      0 8                Figure 2 4  Set LBE Space    e fixed V  velocity   C  concentration  and T  temperature   e fixed V and C  Neumann  T   e fixed V and T  Neumann C   e fixed V  Neumann C and T   e fixed P  pressure or density   C and T   e fixed P and T  Neumann C   e fixed P and C  Neumann T   e fixed P  Neumann C and T    2  The bottom boundary condition can be selected using the pull down list   3  The left boundary condition can be selected using the pull down list   4  The right boundary condition can be selected using the pull down list     5  The front boundary condition can be selected using the pull down list  This pull down list will be  greyed out for two dimensional systems     6  The back boundary condition can be selected using the pull down list  This pull down list will be  greyed out for two dimensional systems     7  Solid obstacles can be added to the calculation space by selecting the bounce back  on grid or mid grid   and obstacle types in the pull down lists  entering its location on the grid and  if necessary  entering its  size  and clicking add obstacle    e A single point will be located at  x0  y0  z0    e A sphere is centred at  x0  yO  z0  and has radius r     e A two dimensional circle is centred at  x0  y0  and has radius r        lFor a property     DL MESO currently only calculates V     0 by using on grid bounce back on 
122. ce code   e JAVA   containing the GUI source code   e MAN   containing the DL_MESO user manual   e DEMO   containing test cases for DL_MESO    e WORK   an example    working directory       1 5 Disclaimer    Neither STFC  CCP5 nor any of the authors of the DL_MESO package guarantee that the package is free from  error  Neither do they accept responsibility for any loss or damage that results from its use     1 6 Copyright       STFC Daresbury Laboratory 2012    1 7 Authors    Dr Michael Seaton and Prof  William Smith  Scientific Computing Department   STFC Daresbury Laboratory   Warrington   WA4 4AD   United Kingdom    1 8 Suggestions and Bug Reports    We encourage users to send suggestions for improvements and new features for DL_MESO  including bug reports  and subroutines  as well as any additional test cases that demonstrate its features  All of these should be sent    to michael seaton stfc ac uk    Chapter 2    The DL MESO GUI    2 1 Getting Started with the DL MESO GUI    The DL_MESO GUI offers a convenient way of using the DL_MESO package  although it is not an essential  tool for those who prefer command line operation  Appendix A provides details on compiling the DL_MESO  program codes manually  Working with the GUI requires the availability of Java tools  particularly the javac  compiler and the java runner for Java 2 version 1 4 or later  These may be obtained from the java sun com    website     To build the GUI  proceed as follows     e Enter the DL_MESO JAVA d
123. ce links are organised so that the conjugate link j to link     i e    j           is equal to  a  mt fori   1    m  Looping i between 1 and m the post collisional distribution functions for each  lattice point f   Z  are initially swapped with their conjugate values f   7   then at each point the value f   1     is then swapped with f   1      At      These sets of swaps can be carried out either in two separate steps or in one go  The use of separate swap steps  requires two sweeps through the domain  but the order in which the distribution functions are swapped does not  matter and no boundary domain is necessary for serial calculations  Simultaneous swapping cannot make use  of automatic periodic boundary conditions  thus a non zero domain boundary is required  and requires lattice  links to be additionally ordered so that the first half are all directed to lattice points that have previously gone  through at least the first swap stage  but only a single sweep through the domain is required     By default the serial version of DL MESO LBE uses the propagation routine that carries out two separate  swap steps     fPropagationSwap     while the parallel version uses the combined swap propagation routine  fPropagationCombinedSwap  If the user wishes to use the combined swap propagation routine in serial   an alternative program slbecombine cpp is available which includes the following notable modifications to    slbecustom  cpp     e Replacement of fSetSerialDomain with fSet
124. ceives data in the form of a double precision array buf        176 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    e Dependencies    None    e Arguments    buf output array of real KIND dp   msgtag input integer  length input integer    msg_receive_unblocked output integer    e Comments    Since no scalars are received in non blocking calls  no scalar version of this function exists     msg_send_blocked    e Header records  SUBROUTINE msg_send_blocked  msgtag  buf  length  pe     e Function    In a blocking call  send data from a double precision array buf        e Dependencies    None    e Arguments  buf input array of real KIND dp   msgtag input integer  length input integer    pe input integer    e Comments  For a double precision scalar  the alternative SUBROUTINE msg_send_sca_blocked  msgtag  buf  length     pe  is available     msg_wait    e Header records  SUBROUTINE msg_wait  request     e Function    Causes process to wait for an unblocked message     e Dependencies    None  e Arguments  request input integer  mynode    e Header records  INTEGER FUNCTION mynode       e Function    Returns name of process     13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 177    Dependencies    None    e Arguments    mynode output integer    e Comments    The serial version of this function returns 0     numnodes    e Header records  INTEGER FUNCTION numnodes       e Function    Returns total number of processes available     e Dependencies    None    e Arguments    numnodes output integer
125. ces  Lees Edwards shearing      192 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    import_shear    e Header records    SUBROUTINE import_shear  nlimit  mdir  begin  final  shove  shovel  shove2  sidel  side2     e Function  Imports particle forces from boundary halos for integration schemes and thermostats that only require  one set of forces to be calculated and Lees Edwards shearing     e Dependencies  error  msg_receive_unblocked  msg_receive_sca_blocked  msg_send_blocked  msg_send_sca_blocked    msg_wait    e Arguments  nlimit input output integer       mdir input integer   begin input real KIND dp   final input real KIND dp   shove input real KIND dp   shovel input real KIND dp   shove2 input real KIND dp   sidel input real KIND dp   side2 input real KIND dp        e Comments  Only exists in parallel version of DL_MESO_DPD  This routine is suitable for thermostats using the  standard Velocity Verlet algorithm for force integration and one set of forces  this includes the DPD  thermostat with MD integration  MD VV   the Lowe Andersen and Peters thermostats  This routine  requires information for the two dimensions along the surface of the shearing boundary  the variables  shovel and shove2 represent the displacement due to shear  while side1 and side2 are the domain    dimensions     importvariable    e Header records    SUBROUTINE importvariable  nlimit  mdir  mp  begin  final  shove  first  skip     e Function  Imports particle forces from boundary halo for integration sc
126. cessor name lbdm rank int   total number of processors lbdm size int   x coordinate for domain 1bdm xcor int   y coordinate for domain 1bdm ycor int   z coordinate for domain 1lbdm zcor int   number of processors along x axis 1bdm xdim int   number of processors along y axis 1bdm ydim int   number of processors along z axis 1bdm zdim int   x coordinate of domain start position 1bdm xs int   x coordinate of domain end position 1bdm xe int   y coordinate of domain start position lbdm  ys int   y coordinate of domain end position lbdm ye int   z coordinate of domain start position lbdm zs int   z coordinate of domain end position lbdm  ze int   inner  grid points along x 1bdm xinner int                   2Excluding boundary points    4 3  THE PARAMETERS AND THEIR FUNCTIONS    Table 4 8  DL_MESO_LBE Parameters  continued     43                function parameter data type notation  outer  grid points along x 1bdm xouter int   inner grid points along y 1bdm yinner int   outer grid points along y 1bdm youter int   inner grid points along z 1bdm zinner int   outer grid points along z 1bdm zouter int   total grid points 1bdm touter int   name of neighbouring processor 1bnb     rank int   position for sending distribution message 1bnb     spos unsigned long  position for receiving distribution message   lbnb    rpos unsigned long  position for sending boundary message lbnb    bspos   unsigned long  position for receiving boundary message lbnb    brpos   unsigned long  position for send
127. collisional moments are determined by relaxation of the non equilibrium part  i e   M   t      M d t      A M E t      M  4 z t    5 5     where A is the collision matrix  which takes the form of a diagonal matrix of m collision parameters  represented    by 5    A   diag s   5 6     Some of the collision parameters can be specified by the user to set both kinematic and bulk viscosities  a few  others can be tuned to improve simulation stability and the remainder  i e  those for density and momentum   are fixed to conserve macroscopic hydrodynamics  If all values of s  are set to a the scheme reduces to BGK  single relaxation time collisions  Since the collisional matrix is diagonal  equation 5 5 can be rewritten in terms  of each moment  i e    Mi  amp  t     M  E  t      s   M   E  t      ME   E  0   5 7     2  Multiplying M  Z t   by the inverse of the transformation matrix  T    gives the post collisional distribution    functions     Interfacial and external forces can be applied either by the addition of rF to the fluid momentum 41  or by    the use of a moment transformed source term  S  whose terms are defined by 49            s  u    EAF  5 8   and applied by the following to correct the post collisional moments   AM    I A  SAt  5 9   where I as an identity matrix  The above equation can be re expressed as  AM     1     tsi  S  At  5 10     The above equations after inverse transformation reduce to equation 5 2 when the collision parameters are set    to a All colli
128. coupling parameter a  and Langevin barostat with relaxation time f   and viscosity parameter fa  select NPT ensemble  thermostat type Q with Berendsen barostat  setting ratio  of compressibility to relaxation time  to f   select NPT ensemble  Stoyanov Groot thermostat with coupling parameter o  and Berendsen barostat with compressibility  relaxation time ratio f  equilibrate system for the first n timesteps  default n   0    calculate electrostatic forces using Ewald sum with real space convergence pa   rameter   and reciprocal space  k vector  range  k1  ka  k3    close the CONTROL file  last data record    calculate bonded interactions globally by storing bond data on all processors  and sharing bonded particle positions  default  calculate bonded interactions  locally    set maximum job time to f seconds   set required many body DPD interaction radius  rg  to f length units  default  f  e    write restart data to export files every n timesteps  default n   1000    option to create volumetrically expanded version of current system  described  by CONFIG and FIELD files  by replicating CONFIG file   s contents  i  j  k  times  while preserving topology of FIELD file   ignore contents of CONFIG file and create initial configuration based purely on  FIELD file   ignore electrostatics in simulation   ignore particles    indices as read from CONFIG file and set their indexing accord   ing to order of reading   switch off isotropy for barostat  i e  allow uneven contractions and e
129. cubic or orthogonal  or  whether replication of a CONFIG file is required  nfold   If specifying a cubic volume  the total volume  should be specified  while orthogonal volumes require the sizes for all three dimensions and the nfold    setting requires integer values specifying the number of replications in each dimension       The target temperature  kgT  and pressure  Pp  for the system   The latter is greyed out if no barostat    is to be used        The maximum interaction cutoff  re  for pairwise particle interactions and the many body cutoff     ra  for determining localized particle densities as used for many body DPD       If required  the electrostatic cutoff  re  for short range electrostatic interactions and the surface cutoff     zc  for interactions between particles and solid walls   These are greyed out if not required        The size of the boundary halo for copying particle data from neighbouring subdomains or across periodic    boundaries and the size of each time step  At  for integrating the equations of motion       The total steps required for the DPD simulation and the number of time steps required to equilibrate    the system  equilibration steps      2 3     10     11     12     13     14     15     16     17     18     DISSIPATIVE PARTICLE DYNAMICS AND THE DL_MESO GUI 13      The numbers of time steps to store system variables for rolling averages  stack interval  and between    rescaling of particle velocities to the desired system temperature duri
130. domain along y axis  nlz number of link cells in domain along z axis  wdthx link cell size in x dimension  wdthy link cell size in y dimension  wdthz link cell size in z dimension  nlewx number of electrostatic link cells in domain along x axis  nlewy number of electrostatic link cells in domain along y axis  nlewz number of electrostatic link cells in domain along z axis  wdthewx electrostatic link cell size in x dimension  wdthewy electrostatic link cell size in y dimension  wdthewz electrostatic link cell size in z dimension  Table 10 3  Neighbour information  parameter   meaning  map  k  processor name of neighbour k  k 1 left neighbour  k 2 right neighbour  k 3 lower neighbour  k 4 upper neighbour  k 5 back neighbour  k 6 front neighbour          Bond angles and bond dihedrals are stored in similar tables  angtb1  i j   particles j from 1 to 3  angle type    at j 4  and dhdtb1  i j   particles j from 1 to 4  dihedral type at j 5  respectively  using the second particle    in each triple or quadruple as the reference particle     Prior to force calculations  a list of bonded particles in each process domain and     if calculating bond forces  locally     the surrounding boundary halo is constructed  lblclst  i j   to allow DL_MESO_DPD to find the    local number for a particle  j 2  from its global number  j 1  using a binary search  This list may include    duplicates for the same global particle number  the local numbers giving the shortest distance between pairs of    
131. ds   i too many  few    The total number of particles assigned to all processors for a new simulation does not match up with the  numbers specified in the FIELD file  taking nfold duplication into account if a CONFIG file is used      Action  For simulations without CONFIG files  this error should never occur and the authors of DL_MESO should  be contacted if it does  If using a CONFIG file  check the FIELD file to ensure that the number of particles for  each species and numbers of molecules match up with those in the CONFIG file     Message 52  cube for molecule i bigger than domain    The maximum extent of molecule i  which is represented as a cube  is larger than the defined size of the system   This is particularly important for systems with hard surfaces or frozen walls as molecules cannot cross these    boundaries     Action  If running a simulation with hard surfaces or frozen walls  either the system size must be increased to  accomodate the defined molecule or the molecule needs to be made smaller  If running a simulation without  hard surfaces or frozen walls  this is only a warning message  no action is thus required but the user may wish    to consider modifying either the system or molecule sizes in future     Message 53  insufficient number of beads per node allocated for required CONFIG file    The value of maxdim is not large enough to include the particles assigned to each processor for a new simulation  with a CONFIG file     Action  This error is unlikely 
132. e boundary     The fluid velocity at the lattice point  given by the array uwall  is required for this boundary condition     fFixed Temperature    e Header records    int fFixedTemperature long tpos  int prop  double  uwall     e Function    Calculates the particle distribution function at a fixed temperature boundary     e Dependencies    Many for different lattice schemes    e Arguments  tpos input long integer  prop input long integer  uwall input array of doubles  e Comments  Planar surface calculations are based on  28   concave edges and corners assume zero speed at the boundary     The fluid velocity at the lattice point  given by the array uwal1  is required for this boundary condition     fPostCollBoundary    e Header records  int fPostCollBoundary       e Function  Calculates the particle distribution function at different boundaries after the collision step  prior to prop     agation     e Dependencies    Many for different lattice schemes    e Comments  Algorithms for other boundary conditions can be added by the user  although care should be taken as  to when they are applied in each time step  the conditions invoked in this routine are applied to post     collisional distribution functions before propagation takes place     fPostPropBoundary    e Header records    int fPostPropBoundary       e Function  Calculates the particle distribution function at different boundaries after propagation  prior to the next    collision step     e Dependencies    Many for diff
133. e drag force does  however  depend upon  particle velocities and is therefore only approximated using the mid step values  this frequently produces a  system temperature higher than that specified by the user and requires a small time step At to reduce the offset  to tolerable levels     11 2 2 DPD thermostat with DPD Velocity Verlet integration  DPD VV   dpdvv     As with the MD VV scheme  this algorithm uses the drag and random forces as the system thermostat  which  are combined with all other forces before being integrated using the Velocity Verlet scheme  The drag force is  subsequently recalculated after the second stage using the velocities at the end of the time step 13      The recalculation of drag forces after force integration helps to alleviate the temperature offset produced by the  MD VV  and hence larger time steps may be used for reasonable temperature control  It does require the re use  of the linked list cells and inter processor communications to recalculate the drag forces  which can significantly  increase the time required per time step compared to the MD VV scheme     11 2 3 Lowe Andersen thermostat  lowe     The Lowe Andersen thermostat  36  is an alternative to the use of drag and random forces in the DPD thermostat   which uses a variant of the Andersen thermostat 1   After all other forces  conservative  bonding etc   are  integrated using the Velocity Verlet scheme  a random sample of particle pairs have their relative velocity  replaced by a val
134. e expressed in terms of pairwise interactions  taking a form similar to the standard DPD  conservative force  Equation 9 5      A Op  pi    OW  ps  Tij  O     J Gh VI  Fj     Ta  H F w Cri   11 42        The local density approximation can be defined as a weighted average of instantaneous densities     En I AA     pi   S w  rij   11 43     with we r  as the weight function vanishing beyond a cutoff rq  which can be equal to re or smaller  and  normalized so that dor Arr w  r dr   1  The most frequently used form for the weight function is    15 Tij f  wP  riz    2nr3  1   s   rij  lt  ra   11 44   which reduces to standard DPD when the excess free energy per particle is set to y  5    45 Ap     Multiple component many body DPD is also possible by defining partial local densities  e g  for component a  p  Y lr   11 45   jEa j i  and generalizing Equation 11 42     FC  ee es  a       e i y    m 11 46  a Be  OPe i       Tij    with c i  as the component to which particle    belongs  e g  if i     a  c i    a  and  p    as the set of local  densities of different components at the position of particle 7     The manybody_module includes a routine  local_density  to calculate local densities for each species using  Equation 11 45  the overall density for each particle can be obtained by a simple sum over all species  The user  can modify the routines manybody_force and manybody_potential to apply their own choices for many body  forces and potentials respectively  Up to five many b
135. e governing equation  At  hi  Z       At t   At      hi  Zt            hi     t      hj    5 30   Tt  The temperature at each lattice point  relative to a mean value  can be determined as the sum of the distribution  functions  T        hi  which can be used to determine the equilibrium distribution function    e   i u  he    wT     a  5 31     again using the bulk fluid velocity  The thermal relaxation time is related to the thermal diffusivity    1 1   Az     z T  Mt       with the Prandtl number for the system determined by a ratio of relaxation times  i e     277     1    V  PS  a         It should be noted that if multiple relaxation time  MRT  schemes are to be used  these only apply to fluids   all diffusion and heat transfer processes are calculated using the single relaxation time schemes described in this    section     5 4 1 Boussinesq approximation    The coupling of fluid flows to heat transfer described above only produces heat conduction effects  To model  convective heat transfer processes  an additional force on the fluid is required to link flow to thermal trans   port  The most common form is the Boussinesq approximation 18   which applies a buoyancy force on fluid a  proportional to the temperature difference        Fog   7   5 32   where g is gravitational acceleration  6  is the volumetric expansion coefficient for fluid a  T  and T  are  respectively the maximum and minimum temperatures of the system and To   5 T    T    is a reference  temperature     
136. e launched via a batch job script  please consult your machine administrator or documentation  for further details     Modifications may be made to the customised versions of the code to select routines for e g  specific collision   propagation and mesophase interaction algorithms  For example  the Guo forcing scheme can be applied by       lif preferred  an alternative version that uses a boundary layer  slbecombine cpp  is available   2  may need to be replaced by   on computers running Windows     221    222 APPENDIX A  MANUAL COMPILIATION AND RUNNING OF DL_MESO    selecting collision routines with Guo  e g  fCollisionBGKGuo  while multiple relaxation time  MRT  schemes  can be used with calls to f CollisionMRT   Other possible modifications include modifying tuneable parameters  for MRT schemes  which are given in lbpMODEL  cpp for the required lattice model  D2Q9  D3Q15 or D3Q19    Additional boundary conditions should be added to the fPostCollBoundary  or fPostPropBoundary  routines   depending on whether they are applied after collisions  and before propagation  or after propagation respectively   Calls to alternative and or additional output routines can be included in the main loops of the customisable  codes  provided they are called before the output file number  qVersion  is increased  If no fluid fluid interaction  forces are required  the calls to routines to zero interaction forces  fInteractionForceZero  and calculate them   e g  fInteractionForceShanChen  can
137. e left hand side of Equation  3 12  can be expanded as    X NE  m     fi        At  t  At      fi      t       m 1     0    liada     fi  z  t   3 15     Expanding the instantaneous particle distribution function around its equilibrium and retaining only the first  order gives  fi  z  t    i  z  t  7 Tf        liada  ie  z  t  Te O  0    3 16   Substituting Equations  3 15  and  3 16  into the left hand side of Equation  3 12  gives the second order  differential equation for the equilibrium distribution  Fa    fi   eq 2 peq 3         0    liada          WF  0    liada  f    O  0    3 17     Tf x    At    where wf   Tf     E    26 CHAPTER 3  THE LATTICE BOLTZMANN EQUATION  BASIC THEORY  Summing Equation  3 17  over i and ignoring the second order deriviative we obtain   0   Op   Ogpta     Wf0g  ons     a De feas   0  0     3 18   Summing Equation  3 18  times e  over i we obtain    0   pua   Og No fi eiaeig     wf Oy  a 5 fi  CiaCiy   08 5 ieee  0  6     3 19     Equation  3 19  shows that the second term in Equation  3 18  is of the third order in the derivative  Therefore  we have the continuity equation to the second order of the derivative    Defining the third and fourth order moments  5 Free   Pag   puaug  3 21   DE FP eiatigeiy   Paguy   Payus   PgqUa   PUAUGUur  3 22     a    With these definitions  Equation  3 19  leads to the weakly compressible Navier Stokes equation          wD as     30  Pa   pua    Os puaug       Og Pag 4 5 ay   B  gt  20   pun    dalpus    Os 0
138. e step    without requiring recalculation of particle forces or rescaling of particle coordinates     11 3 2 Berendsen barostat  berendsen     The governing equation for the Berendsen barostat 2  is a simple differential equation for the pressure     dP  P P   Zao aae  11 30   dt Tp  which can be solved to give a scaling factor for the simulation volume  7 t    BAt  Ma t   1  7  Po     Palt    11 31   P    where   is the isothermal compressibility of the system  The exact value of this property is not critical to the  algorithm  since it relies on the ratio     P    The barostat is implemented using a variant of the Velocity Verlet algorithm  after the midstep velocities are    determined  the scaling factor for time t is used to modify the particle positions and resize the simulation volume  Tia  t  At    nalt rija  t    Atvia  t  4At   11 32   La t  At    nalt La t   11 33        The remainder of the Velocity Verlet algorithm is unchanged  although the scaling factor for the beginning  of the next time step can be calculated at this point using Equation 11 31  No iteration is required for this  barostat     11 4 Particle particle interactions    Pairwise particle interaction parameters in DL_MESO_DPD are specified in the FIELD file for each species  pair using the directive interactions  Interaction parameter values and lengthscales are stored in the array  vvv 1 npot  1 mxprm  in preparation for DPD calculations  the maximum number of parameters mxprm de   pendent on the u
139. e to reduce  increase  its    wetting     5 3 2 Lishchuk continuum based model    The Lishchuk model 35  20  is a modified form of the    chromodynamic    model devised by Gunstensen and  Rothman  17   which models interactions between multiple components by applying forces based on the exis   tence of those components  This continuum based model is primarily suited for systems where hydrodynamic    interactions dominate and no further fluid separation takes place     A phase field is defined between components a and b as    NPOP            5 19  Pab pe   p       noting that A      pN  First order spatial differentials of this quantity can be determined by means of fourth     order accurate isotropic schemes 21   e g  for lattice points without neighbouring walls     1 A de  V pa   AL Ds wi  ipap  Z   At   5 20     52 CHAPTER 5  DL MESO_LBE FEATURES    and these can be used to determine the interfacial normal between the phases        5 21   which can subsequently be used to obtain the local curvature from the interface normal in the phase field   Ka      V 5    ab   5 22   The force acting between the components to give interfacial tension is given by     gt a 1  F      3900 Kab V Pat   5 23     Rather than colliding each fluid separately  a single    achromatic    distribution function is defined as the sum of  distribution functions for all fluids    k  f  52a     the sum of which is equal to the density of all fluids  p  This distribution function is collided using any va
140. each dimension    and the shape of the system will change over time   The parameters for electrostatics can be given in the pop up window shown in Figure 2 6 c      1  The type of electrostatics to be used in the simulation     2  Electrostatic parameters  for the Ewald sum with Slater type smearing  the system coupling constant   T   Ewald real space convergence  a  and charge smearing  8  coefficients need to be specified     3  The Ewald sum method also requires a reciprocal space  k vector  range     2 3  DISSIPATIVE PARTICLE DYNAMICS AND THE DL_MESO GUI 15       FI DPD thermostat properties mm a oone properties E  LANGEVIN de  STOYANOV GROOT 1  barostat relaxation time   0 0 2  global coupling parameter  0 0  2 piston drag coefficient  0 0                   y  isotropic system 3                   SAVET   CANCEL T             SAVE B   CANCEL B                       a  Thermostat parameters  b  Barostat parameters                                                                            system coupling constant  0 0 2  Ewald real space convergence   0 0  charge smearing  0 0    g g El  DPD surface properties SIERS  ER be componant  o 3  HARD SURFACES WITH SOFT REPULSION  iL  k vector  y component   0  wall directions  xyz 2  k vector  z component    0   SAVE E CANCEL E SAVE SF   CANCEL SF   c  Electrostatic parameters  d  Surface parameters    Figure 2 6  Thermostat  barostat  electrostatic and surface pop up windows    If non periodic boundaries are to be used  the param
141. ecules       Potentials  standard Groot Warren DPD 16   density dependent  many body  DPD 46  66   Lennard   Jones 30   Weeks Chandler Andersen 69     Electrostatic potentials between charged beads using a modified Ewald summation  14     Boundaries  Periodic  hard reflecting walls with optional short range repulsions 50   frozen particle walls     Lees Edwards periodic shearing boundaries 34     Initial conditions can either be determined by DL MESO_DPD or specified by the user    Requirements    1 3 1 Software requirements    Standard C   Compiler for LBE source code  DL_MESO_LBE  Standard Fortran90 Compiler for DPD source code  DL_MESO_DPD  Message Passing Interface  if parallel execution required    JAVA 2 Version 1 4 or higher  if GUI is to be used     GNU Make  included in standard Unix Linux distributions  can be installed for Windows     1 3 2 System requirements    DL_MESO is designed to work in both serial and parallel running  it can be run on standalone machines  clusters  and supercomputers  The code has been tested on Solaris  Windows XP  IBM p690  HPCx  PowerPC 450 Blue  Gene P and Cray XT4 XT6 HECTOR machines     1 4  THE DL MESO DIRECTORY STRUCTURE 3  1 4 The DL_MESO Directory Structure    The supplied version of DL_MESO is a gzipped tar file  which unpacks as directory dl_meso_2 x  where x is a  generation number  Beneath the top level of this directory are a number of subdirectories    e LBE   containing the LBE source code   e DPD   containing the DPD sour
142. edral potential energy stkde real KIND dp   A nstk  data stack for electrostatic potential energy stkee real KIND dp   A nstk  duni random number generator state uni integer A 102  mtrnd random number generator state mt integer A 0 624       Chapter 11    DL MESO DPD Features    11 1 Domain decomposition and linked list cell calculations    The Domain Decomposition  DD  strategy is one of several ways to parallelize particle based simulations 57    Its basis is the division of the simulated system into equal sized spatial blocks or domains  each of which is  allocated to a specific processing unit of a parallel computer  The arrays defining the coordinates  velocities  and forces for all N particles in the system are divided into sub arrays of size   x on each of the P processing  units  with the particles allocated geometrically among them  In order for the strategy to work efficiently  the  simulated system should possess a reasonably uniform density so that each processing unit is allocated as equal  a portion of particle data as possible  The computation of forces and integration of the equations of motion are  shared  more or less  equally between the processing units and to a large extent can be computed independently  on each unit  While tricky to program  this method is conceptually simple and particularly suited to large scale    simulations     The DD strategy which underpins DL_ MESO_DPD is based on the link cell algorithm 26   which requires a  relatively short ra
143. ees to the terms and conditions of this    Licence Agreement     the website with the URL  http   www ccp5 ac uk DL_MESO   and any website that from time to time    replaces that website     any virus  worm  time bomb  time lock  drop  dead device  trap and access code or anything    else that might disrupt  disable  harm or    239    240 APPENDIX D  DL_MESO LICENCE AGREEMENT  ACADEMIC PURPOSES     impede the operation of any information  system  or that might corrupt  damage  destroy  or render inaccessible any software  data or  file on  or that may allow any unauthorised  person to gain access to  any information    system or any software  data or file on it     Intellectual Property patents  trade marks  service marks   registered designs  copyrights  database  rights  design rights  know how  confidential  information  applications for any of the  above  and any similar right recognised from  time to time in any jurisdiction  together  with all rights of action in relation to the    infringement of any of the above     the Licence Period the period beginning when the Licensee  agrees to the terms and conditions of this  Licence Agreement and downloads the DL_MESO  Software from the DL_MESO Website and ending  on the termination of this Licence Agreement    under clause 5 2     2  LICENCE    2 1 STFC grants the Licensee an indefinite  non exclusive   non transferable  royalty free licence to use  copy  modify  and  enhance the DL_MESO Software during the Licence Period on
144. elease or version of the  DL_MESO Software that would have remedied or mitigated the  effects of any error  defect  bug or deficiency in the DL_MESO    Software     The Licensee acknowledges that proper use of the DL_MESO Software  and any Derived Work is dependent on the Licensee  its employees  and students exercising proper skill and care in inputting data  and interpreting the output provided by the DL_MESO Software or  that Derived Work  STFC will not be liable for the consequences  of decisions taken by the Licensee or any other person on the  basis of that output  STFC does not accept any responsibility  for any use which may be made by the Licensee of that output  nor  for any reliance which may be placed on that output  nor for    advice or information given in connection with that output     Subject to clause 3 7  STFC   s liability or any breach of this  Licence Agreement  any negligence or arising in any other way out  of the subject matter of this Licence Agreement or the use of the  DL_MESO Software  will not extend to any incidental or  consequential damages or losses  or any loss of profits  loss of  revenue  loss of data  loss of contracts or opportunity  whether  direct or indirect  even if the Licensee has advised STFC of the  possibility of those losses arising or if they were or are within    STFC   s contemplation     Subject to clause 3 7  the aggregate liability of STFC for any  and all breaches of this Licence Agreement  any negligence or  arising in 
145. ell as output file formats and whether  fluids are compressible or incompressible  These programs do not need to be modified by the user if the provided  code features are to be used     Alternative versions of the program  slbecustom cpp and plbecustom cpp for serial and parallel running  respectively  are also provided  The user may wish to modify these listings to use user defined routines and  functions  as well as different outputs and formats  alternative collision routines  boundary conditions that move  through the system etc  These versions reduce the number of logic statements required to run and thus may  be used if greater computational efficiency is required  An additional version of the serial program is available  which uses a boundary layer of lattice points  slbecombine cpp   Appendix A gives more details on using  these versions of the program     7 2 2 IbpMODEL  D2Q9    e Header records  int D2Q9      e Function  Assign the weight factor lbw  speed vector 1bv  index for opposite speed vector lbopv  MRT transformation  matrices  1btr and 1btrinv  and tuneable parameters  1lbmrts and 1bmrtw  for the D2Q9 lattice model     e Dependencies  None  D3Q15    e Header records  int D3Q150    e Function  Assign the weight factor 1bw  speed vector 1bv  index for opposite speed vector 1bopv  MRT transformation  matrices  1btr and 1btrinv  and tuneable parameters  1bmrts and 1bmrtw  for the D3Q15 lattice model     e Dependencies    None    7 2  DL MESO_LBE SUBROUTINES AN
146. ell length in z direction sidez real KIND dp    number of particles in domain cell nbeads integer   number of frozen particles in domain cell nfbeads integer   number of link cells in domain cell  x dimension  nlx integer   number of link cells in domain cell  y dimension  nly integer   number of link cells in domain cell  z dimension  nlz integer   number of link cells in domain cell and boundary halo  x dimension  n1x2 integer   number of link cells in domain cell and boundary halo  y dimension  nly2 integer   number of link cells in domain cell and boundary halo  z dimension  nlz2 integer   link cell length in   x direction wdthx real KIND dp    link cell length in y direction wdthy real KIND dp    link cell length in z direction wdthz real KIND dp    number of link cells for electrostatics in domain cell  x dimension  nlewx integer   number of link cells for electrostatics in domain cell  y dimension  nlewy integer   number of link cells for electrostatics in domain cell  z dimension  nlewz integer   number of link cells for electrostatics in domain cell and boundary halo  x dimension  nlewx2 integer   number of link cells for electrostatics in domain cell and boundary halo  y dimension  nlewy2 integer   number of link cells for electrostatics in domain cell and boundary halo  z dimension  nlewz2 integer   electrostatic link cell length in x direction wdthewx real KIND dp    electrostatic link cell length in y direction wdthewy real KIND dp    electrostatic link cell leng
147. em in a similar fashion  i e   unbonded particles precede bonded ones and molecules are ordered according to the FIELD file     CONFIG files can be created from restart files of previous simulations using the supplied Fortran90 program  exportconf ig in the directory DPD utility  see Appendix B for more details  Frozen particle walls  if specified  in the CONTROL file  can be added to systems with CONFIG files  with or without duplication  but users have  to ensure that any molecules do not cross boundaries where frozen particle walls will be placed  no checks are  available to prevent this from happening but CONFIG files could be created from previous simulations involving  hard adsorbing surfaces     12 2 Output files    General output file  OUTPUT    This ANSI text file is generated by all DPD calculations and contains     e The system and bond  angle dihedral properties used for calculations   e Domain decomposition details  Parallel version only    e The starting positions and velocities of a particle sample     e The calculation time  current values and rolling averages for the total energy  potential energy  total  elec   trostatic  and from bond stretching  angles and dihedrals   virial  kinetic energy  pressure and temperature  every nsbpo time steps     e Final averages and fluctuations  standard deviations  over all time steps after equilibration   e The final positions and velocities of a particle sample     e Elapsed and average times for the calculation     Rest
148. ensional system  is modelled  this will be reset to 1    domain boundary width sets the size of the boundary region  if running DL_MESO in serial  this is    usually reset to 0     Additional keywords can be used to specify the algorithms for collisions  forcing and mesophase interac   tions  the format for output files and whether fluids are compressible or incompressible  If these are omit   ted  DL_MESO_LBE will assume that the fluids are compressible and subjected to BGK  single relaxation        1No multiple fluid phase scheme included in DL MESO currently requires this lattice     55    56    CHAPTER 6  DL MESO _LBE INPUT AND OUTPUT FILES    time  collisions using standard forcing without mesophase interactions   If using the customizable versions of    DL_MESO_LBE  all of these keywords may be omitted except for incompressible_fluids  which is required    to correctly calculate fluid velocities in initialization and output files and apply boundary conditions      keyword     collision_type    interaction type    output_format    incompressible_fluids    meaning     sets the type of collisions and forcing  BGK  0   BGKGuo  1   MRT  2  or MRTGuo   3    sets the type of mesophase interactions   ShanChen  1   ShanChenWetting  2   or Lishchuk  3     sets the format for output files  VTK  0   LegacyVTK  1   Plot3D  2    determines whether or not the fluids should be incompressible  set to 0 for  compressible fluids  1 for incompressible fluids     The following keywords can 
149. ensure molecules do not cross non periodic boundaries     initialvelocity    e Header records    SUBROUTINE initialvelocity    e Function    Initializes particle velocities randomly in system to give required system temperature     e Dependencies    duni  global_sum_dble    sort_beads    e Header records    SUBROUTINE sort_beads    e Function    Re orders local identity numbers of beads in current processor to place frozen beads at beginning of list     e Comments    Frozen beads are moved to local bead numbers between 1 and nfbeads  while non frozen beads are moved    to local bead numbers between nfbeads 1 and nbeads     13 2 12 config_module    This module requires the modules constants  variables  comms_module  numeric_container  parse_utils     domain_module and surface_module to be loaded beforehand     13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 207    sysdef    e Header records  SUBROUTINE sysdef    e Function  Reads in system data  determines simulation properties  prints to OUTPUT file and allocates main arrays    for calculations     e Dependencies  scan_config  read_control  scan_field  read_field  frozenbead  domain_decompose  domain_dimensions  surfacenodes  elecgen    error    e Arguments    None    e Comments  The routine calculates a maximum size for the main arrays  maxdim  and a maximum number of pairwise  interactions  maxpair  based on the total number of particles  the number of link cells and number of    nodes     scan_config    e Header records  SUBR
150. ent  agreement or undertaking except those expressly set  out in this Licence Agreement  The Licensee waives any claim for  breach of  or any right to rescind this Licence Agreement in  respect of  any representation which is not an express provision  of this Licence Agreement  However  this clause does not exclude  any liability which STFC may have to the Licensee  or any right  which the Licensee may have to rescind this Licence Agreement  in  respect of any fraudulent misrepresentation or fraudulent    concealment before the signing of this Licence Agreement     Amendments  No variation of  or amendment to  this Licence  Agreement will be effective unless it is made in writing and    Signed by each party   s representative     Third parties  No one who is not a party to this Licence  Agreement has any right to prevent the amendment of this Licence  Agreement or its termination  and no one except a party to this    Licence Agreement may enforce any benefit conferred by this    6 8    245    Licence Agreement  unless this Licence Agreement expressly    provides otherwise     Governing law  This Licence Agreement is governed by  and is to  be construed in accordance with  English law  The English Courts  will have exclusive jurisdiction to deal with any dispute which  has arisen or may arise out of or in connection with this Licence  Agreement  except that STFC may bring proceedings against the    Licensee or for an injunction in any jurisdiction     Bibliography          10 
151. ential energy fluctuation flcde real KIND dp    system electrostatic potential energy fluctuation flcee real KIND dp    system potential energy accumulator zumpe real KIND dp    system virial accumulator zumvir real KIND dp    system kinetic energy accumulator zumtke real KIND dp    system volume accumulator zumvlm real KIND dp    system bond potential energy accumulator zumbe real KIND dp    system angle potential energy accumulator zumae real KIND dp    system dihedral potential energy accumulator zumde real KIND dp    system electrostatic potential energy accumulator zumee real KIND dp    system potential energy at current step stppe real KIND dp    system virial at current step stpvir real KIND dp    system kinetic energy at current step stptke real KIND dp    system total energy at current step stptke real KIND dp                    3These are only allocated if variable forces are required for e g  DPD Velocity Verlet integration and Stoyanov Groot thermostat     10 2  THE PARAMETERS AND THEIR FUNCTIONS    Table 10 4  DL_ MESO_DPD Parameters  continued     139                            function parameter data type notation  system pressure at current step stpprs real KIND dp    system volume at current step stpvlm real KIND dp    system temperature at current step stpttp real KIND dp    system bond potential energy at current step stpbe real KIND dp    system angle potential energy at current step stpae real KIND dp    system dihedral energy at current step stpde real K
152. ents  nlimit input output integer  importdata_dpdvv2_shear    Header records  SUBROUTINE importdata_dpdvv2_shear  nlimit     e Function  Applies import of variable particle forces from boundary halos of neighbouring domains and or across  periodic boundary conditions for the DPD Velocity Verlet algorithm with Lees Edwards shearing     e Dependencies  importvariable  Parallel version only     importvariable_shear  Parallel version only   e Arguments    nlimit input output integer    importdata_stoyanov    e Header records  SUBROUTINE importdata_stoyanov  nlimit     e Function  Applies import of particle forces  constant and variable  from boundary halos of neighbouring domains    and or across periodic boundary conditions for the Stoyanov Groot thermostat     e Dependencies    importvariable  Parallel version only     e Arguments    nlimit input output integer    202 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    importdata_stoyanov_shear    e Header records  SUBROUTINE importdata_stoyanov_shear  nlimit     e Function  Applies import of particle forces  constant and variable  from boundary halos of neighbouring domains  and or across periodic boundary conditions for the Stoyanov Groot thermostat with Lees Edwards shear     ing     e Dependencies  importvariable  Parallel version only     importvariable_shear  Parallel version only     e Arguments    nlimit input output integer    importdensitydata    e Header records  SUBROUTINE importdensitydata  nlimit     e Function  Applies 
153. eometric property  planar surface  concave corner or concave edge       Boundary orientation  one letter for planar surface  two letters for concave corners or three letters for    concave edges     For example  a shearing planar surface facing down the y axis with constant composition and temperature  i e   isothermal  is represented as VCBPSD and translated as 322     38    CHAPTER 4  DL MESO _LBE BASIC DEFINITION    Table 4 3  Notation of boundary condition       VCTPST  VCTPSR  VCTCCTRB  VCTCCDRB  VCTCCDLF  VCTCETL  VCTCETF  VCTCERF  VCTCEDB  VBBPSD  VBBPSF  VBBCCTLB  VBBCCTRE  VBBCCDRF  VBBCEDL  VBBCELF  VBBCETB  VBBCERB  VCBPSL  VCBPSB  VCBCCDLB  VCBCCTLF  VCBCETR  VCBCEDR  VCBCEDF  VCBCELB  VBTPST  VBTPSR  VBTCCTRB  VBTCCDRB  VBTCCDLF  VBTCETL  VBTCETF  VBTCERF  VBTCEDB  PCTPSD  PCTPSF  PCTCCTLB  PCTCCTRF  PCTCCDRF  PCTCEDL  PCTCELF  PCTCETB  PCTCERB  PBTPSL  PBTPSB  PBTCCDLB  PBTCCTLF       121  124  127  130  133  144  147  150  153  222  225  228  231  234  245  248  251  254  323  326  329  332  343  346  349  352  421  424  427  430  433  444  447  450  453  522  525  528  531  534  545  548  551  554  623  626  629  632       VCTPSD  VCTPSF  VCTCCTLB  VCTCCTRF  VCTCCDRF  VCTCEDL  VCTCELF  VCTCETB  VCTCERB  VBBPSL  VBBPSB  VBBCCDLB  VBBCCTLF  VBBCETR  VBBCEDR  VBBCEDF  VBBCELB  VCBPST  VCBPSR  VCBCCTRB  VCBCCDRB  VCBCCDLF  VCBCETL  VCBCETF  VCBCERF  VCBCEDB  VBTPSD  VBTPSF  VBTCCTLB  VBTCCTRE  VBTCCDRF  VBTCEDL  VBTCELF  VBTCETB  VBTCERB  PCTPSL  PCTPSB  PCTCCDLB 
154. er of additional particles created during export of particles into boundary halos with Lees Edwards  shearing is greater than the current processor can accommodate     Action  This error message suggests non constant particle densities across the system and poor load balancing   The user may wish to use the densvar directive in the CONTROL file to increase the value of maxdim and thus    accommodate larger numbers of particles     Message 83  cannot correctly export velocities to boundary halos  Particle velocities  for DPD Velocity Verlet integration  cannot be exported correctly to particles already in the  boundary halos     Action  This error should never occur  If it does  please contact the authors of DL_MESO     Message 84  cannot correctly export densities to boundary halos    Particle densities  for many body DPD  cannot be exported correctly to particles already in the boundary halos     Action  This error should never occur  If it does  please contact the authors of DL_MESO     Message 100  wrong bead total after compression      too many few  The total number of particles after the first Velocity Verlet integration stage  including dealing with boundary  conditions etc   does not equal the specified total number of particles for the system     Action  This error should never occur  If it does  please contact the authors of DL_MESO     Message 200  bond too long or cannot be found    At least one bond between specified particles is too long  e g  longer than the ma
155. er of the order 10  is unnecessary for modelling liquids 47    Alternative thermostats are available which can model systems with higher Schmidt numbers 36  62      9 4 Derivation of Equilibrium    The derivation of the DPD algorithm is based on the Fokker Planck equation    Op       C 9 17   a   P  9 17   where p is the equilibrium distribution function and    is the evolution operator  which may be split into  conservative and dissipative parts     Estel   9 18     130 CHAPTER 9  DISSIPATIVE PARTICLE DYNAMICS  BASIC THEORY       with  INS  3 N  AS LA a  Lo   pee pas Oe  9 19   i 1 tj  A a af p op 2 o 0  Lo   Yeu ae  om    i  ig     gt   wh  ras  isle ae     9 20     e Tis  where   jj   2   ij    When a   y   0 then Equation  9 17  becomes       ane Lop  9 21   for which the equilibrium solution is evidently  N je ix  pt   E exp EBT 2 om    7 26  rs   9 22     which is  of course  the Boltzmann distribution function for an equilibrium system  Thus it is apparent that for  the simulation based on Equation  9 17  to maintain the same distribution function  the terms in the operator  LP of Equation  9 20  must sum to zero  It follows that the conditions given in Equations  9 8  and  9 9  must  apply     9 5 Summary of Dissipative Particle Dynamics    DPD is a simple method  All that is required is a system of spherical particles enclosed in a periodic box  undergoing time evolution as a result of the above forces  In implementation it differs very little from Molecular  Dynamic
156. erent lattice schemes    e Comments  Algorithms for other boundary conditions can be added by the user  although care should be taken as  to when they are applied in each time step  the conditions invoked in this routine apply to distribution    functions after propagation     7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 91    fNeighbourBoundary    e Header records    int fNeighbourBoundary      e Function    Determines the existence of solid boundaries in neighbouring lattice points     e Dependencies  None    e Comments  Stores results in the lbneigh array  currently only covers orthogonal directions  i e  no diagonals   Only    needs to be called once if boundary conditions do not change during calculations     fsPeriodic    e Header records    int fsPeriodic      e Function  Applies periodic boundary condition for serial calculations with non zero boundary domain widths by  copying distribution functions from edges of fluid points     e Dependencies  fsPeriodic2D  fsPeriodic3D    e Comments  Serial equivalent of    NonBlockCommunication  essential for using the combined swap propagation routine    fPropagationCombinedSwap in serial running     fsBoundPeriodic    e Header records    int fsBoundPeriodic      e Function  Applies periodic boundary condition for serial calculations with non zero boundary domain widths by    copying boundary information from edges of fluid points     e Dependencies  fsBoundPeriodic2D  fsBoundPeriodic3D    e Comments  Serial equivalent of fBoundNo
157. ers and boundary conditions for the solutes must be set by clicking the set solute parameters    button     see below for more details     The using temperature scalar box may be clicked yes if thermal systems are to be studied  If checked   the thermal parameters must be set by clicking the set thermal parameters button     see below for    more details     valid 1bin sys file already exists in the  current  working directory  the OPEN button can be clicked to    load its information into the GUI  which can then be viewed and edited  Once all the data in this window and    any    pop up windows for fluid  solute and thermal parameters are filled in  the SAVE button should be clicked    to write the lbin  sys file     2 2     1 1 Fluid  solute and thermal parameters    Examples of the pop up windows for fluid  solute and thermal parameters can be seen in Figure 2 3 with the    rows labelled in red numbering  multiple columns of dialogue boxes are made available for systems with multiple    fluids and or solutes     For    1    2     3     10     11     fluids  the required data are as follows       Body force x axis  the x component of body force on each fluid   Body force y axis  the y component of body force on each fluid     Body force z axis  the z component of body force on each fluid   Greyed out for two dimensional    systems     Boussinesq force x axis  the x component of the Boussinesq force parameter  7 5  on each fluid     Boussinesq force y axis  the y component o
158. ersion  to be loaded beforehand     domain_decompose    e Header records  SUBROUTINE domain_decompose    e Function  Determines 3D domain decomposition for system  number of nodes in each direction  location for each    node in system  nearest neighbouring nodes     13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 189    e Dependencies  parallel version only   msg_receive_blocked  msg_receive_sca_blocked  msg_send_blocked    msg_send_sca_blocked    e Comments  Essential for parallel version of DL _MESO_DPD  the serial version of this subroutine sets values for a    single processor     domain_dimensions    e Header records  SUBROUTINE domain dimensions    e Function    Determines dimensions of domain and link cells    e Dependencies    None    e Comments    This subroutine is called during setup and  if a barostat is used  when the volume of the system changes     parlnk    e Header records  SUBROUTINE parlnk  numi  num2     e Function    Constructs the parallel link cells for calculations of pairwise forces between particles     e Dependencies  None    e Arguments  numi input integer    num2 input integer    e Comments  Pairwise electrostatic forces typically act over longer lengthscales between charged particles only and are  not considered using this subroutine  a similar routine for the real space part of Ewald summation is    included in ewald_real     deport    e Header records  SUBROUTINE deport  nlimit  mdir  mp  begin  final  shove  skip     e Function    Deports particl
159. ersion only     e Arguments  nlimit input output integer    mdir input integer  mp input integer  begin input real KIND dp   final input real KIND dp   shove input real KIND dp   skip input logical    e Comments  The switch skip  in the parallel version only  prevents particles in the boundary halo of the current  domain from being transferred for non periodic boundary conditions  e g  hard surfaces  Lees Edwards  shearing      export_shear    e Header records    SUBROUTINE export_shear  nlimit  mdir  begin  final  shove  shovel  shove2  sidel  side2     196 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    e Function  Exports particle data  positions  velocity  to appropriate domains as boundary halos for Lees Edwards  shearing     e Dependencies  error  msg_receive_unblocked  Parallel version only   msg_receive_sca_blocked  Parallel version only   msg_send_blocked  Parallel version only   msg_send_sca_blocked  Parallel version only     msg wait  Parallel version only     e Arguments  nlimit input output integer       mdir input integer   begin input real KIND dp   final input real KIND dp   shove input real KIND dp   shovel input real KIND dp   shove2 input real KIND dp   sidel input real KIND dp   side2 input real KIND dp        e Comments  This routine requires information for the two dimensions along the surface of the shearing boundary  the  variables shovel and shove2 represent the displacement due to shear  while side1 and side2 are the    domain dimensions     exportveloc
160. es   double fGetFracSite int fpos  double  startpos   double fGetFracSite int fpos  long tpos   double fGetFracSite int fpos  int xpos  int ypos  int zpos     e Function    Calculates the mass fraction of fluid fpos in the site     e Dependencies    fReciprocal    e Arguments    startpos input double pointer  fpos input integer   tpos input long integer  xpos input integer   ypos input integer   Zpos input integer    fGetFracSite output double precision    7 2  DL MESO _LBE SUBROUTINES AND FUNCTIONS 71    e Comments    The calculation is based on z   se re This function operates in a similar way to fGetOneMassSite with       the second and third cases slightly slower than the first but more readable     fGetOneConcSite    e Header records  two cases   double fGetOneConcSite int cpos  long tpos     double fGetOneConcSite int cpos  int xpos  int ypos  int zpos     e Function    Calculates the concentration of solute cpos at the grid point     e Dependencies  fGetOneMassSite    e Arguments    tpos input long integer  cpos input integer  xpos input integer  ypos input integer  Zpos input integer    fGetFracSite output double precision    fGetTemperatureSite    e Header records  two cases   double fGetTemperatureSite long tpos   double fGetTemperatureSite long xpos  long ypos  long zpos     e Function    Calculates the scalar temperature at the grid point     e Dependencies  fGetOneMassSite    e Arguments    tpos input long integer  xpos input long integer  ypos input long integer
161. es from boundary halo to neighbouring domain     e Dependencies  contract_bndtbl    contract_angtbl    190 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    contract_dhdtbl   error  global_sca and all  msg receive_unblocked  msg receive_sca_ blocked  msg_send_blocked  msg_send_sca_blocked    msg_wait    e Arguments  nlimit input output integer    mdir input integer  mp input integer  begin input real KIND dp   final input real KIND dp   shove input real KIND dp   skip input logical    e Comments  Only exists in parallel version of DL_MESO_DPD  The switch skip prevents particles in the boundary  halo of the current domain from being transferred  this is useful for applying non periodic boundary    conditions  e g  hard surfaces  Lees Edwards shearing      deport_shear    e Header records  SUBROUTINE deport_shear  nlimit  mdir  begin  final  shove  shovel  shove2  vshovel  vshove2   sidel  side2     e Function  Deports particles from boundary halo to appropriate domains for Lees Edwards shearing     e Dependencies  contract_bndtbl  contract_angtbl  contract_dhdtbl  error  msg_receive_unblocked  msg_receive_sca_blocked  msg_send_blocked  msg_send_sca_blocked    msg_wait    e Arguments    13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 191    nlimit input output integer       mdir input integer   begin input real KIND dp   final input real KIND dp   shove input real KIND dp   shovel input real KIND dp   shove2 input real KIND dp   vshovel input real KIND dp   vshove2 input real KIND dp  
162. eters for surfaces can be entered in the appropriate pop up  window  Figure 2 6 d       1  The type of surface interactions or boundary conditions to be applied     2  Wall directions  if the checkbox for a particular dimension is ticked  the boundary condition will be  applied to the surfaces orthogonal to the specified axis     After filling in all the required values  clicking the relevant save button  SAVE T  SAVE B  SAVE E or  SAVE SF  will store the data in preparation for writing to the CONTROL file  The cancel buttons  CANCEL T   CANCEL B  CANCEL E and CANCEL SF  will close the pop ups without saving any values     2 3 2 Defining DPD Interactions    Figure 2 7 shows the Set DPD Interactions panel with the sections for data entry labelled in red numbering   The following data are required     1  The number of species is required to specify all interactions between particles in a DPD simulation   The spinner box allows the user to define up to 10 particle species  while the button set species opens a  pop up window for the user to enter the properties for each species and write them to a new FIELD file      see below for more details     2  After the particles species have been defined  the button set interactions opens a pop up window to  allow the user to define non bonded interactions between particle species and write them to the FIELD  file     3  The operating system is required before launching a command line terminal and running the molecule    generation utilit
163. f potentials npot integer  gt 1  number of defined molecule types nmoldef integer   number of defined bond types nbonddef integer  lt  mxbonddef  number of defined bond angle types nangdef integer  lt  mxbonddef  number of defined bond dihedral types ndhddef integer  lt  mxbonddef  size of statistical data stack nstk integer  gt 1  total number of particles in system nsyst integer   total number of unbonded particles in system nusyst integer   total number of frozen particles in system nfsyst integer   total number of particles per unit cell nsystcell integer   total number of unbonded particles per unit cell nusystcell integer   total number of frozen particles per unit cell nfsystcell integer   total number of molecules per unit cell nummol integer   total number of bonds per unit cell numbond integer   total number of bond angles per unit cell numang integer   total number of bond dihedrals per unit cell numdhd integer   time step number nstep integer   force calculation time accumulator timfrc real KIND dp    step time accumulator timstp real KIND dp    specified system temperature  kgT  temp real KIND dp    size of time step  At  tstep real KIND dp    halo boundary size rhalo real KIND dp    interaction cutoff radius  re  reut real KIND dp   gt 0  square of interaction cutoff radius rct2 real KIND dp   gt 0                136 CHAPTER 10  DL MESO DPD BASIC DEFINITION    Table 10 4  DL _ MESO_DPD Parameters  continued                                            function par
164. f the Boussinesq force parameter on each fluid     Boussinesq force z axis  the z component of the Boussinesq force parameter on each fluid   Greyed    out for two dimensional systems    The initial fluid densities are applied throughout the system and used to initialize LBE calculations     The constant fluid density  po  for incompressible systems  this property can also be used to define the  reference densities for Shan Chen pseudopotentials and for initialising systems with fluid drops     The fluid densities at the top boundary   The fluid densities at the bottom boundary     The fluid densities at the left boundary     2 2     LATTICE BOLTZMANN AND THE DL_MESO GUI 9    TBE Avid  properties                                                                                                                                                                                                                                                             12     13     14     15     16     17     18        fluid O fluid 1  body force x axis  0 o  1   body force y axis  o  e  2  body force z axis  3  boussinesq force x axis  0 O 4  boussinesq force y axis   e  0 5  boussinesq force z axis  6  fluid densities  initial   1 1 1 aire merma properties aE  constant   1 1 8 initial T K   o 1  top   0 0 9 initial dT dt  K s   0 2  bottom   0 o 10 boussinesq high T K   0 3  left   0 o 11 boussinesq low T K   0 4  lara  0 o 12 heat relaxation time 1 5  front  13 Ed  UBE solute properties ll T K  dT
165. fGetOneDirecSpeedSite int dire  long tpos   float fGetOneDirecSpeedSite int dire  int xpos  int ypos  int zpos     e Function    Calculates the grid speed for all  compressible  fluids along direction dire  O for x  1 for y and 2 for z     7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 75    e Dependencies    fReciprocal    e Arguments   startpos   tpos   xpos   YPos   Zpos   dire  fGetOneDirecSpeedSite    e Comments    input double pointer  input long integer  input integer   input integer   input integer   input double pointer  output floating point    Mainly used to output grid speed  The second and third cases are more readable than the first but also    slightly slower     fGetOneDirecSpeedIncomSite    e Header records  three cases     float fGetOneDirecSpeedIncomSite int dire  double  startpos     float fGetOneDirecSpeedIncomSite int dire  long tpos     float fGetOneDirecSpeedIncomSite int dire  int xpos  int ypos  int zpos     e Function    Calculates the grid speed for all incompressible fluids along direction dire  O for x  1 for y and 2 for z     e Dependencies    fReciprocal    e Arguments  startpos  tpos  xpos  ypos  Zpos    dire    fGetOneDirecSpeedIncomSite    e Comments    input  input  input  input  input  input    output    double pointer  long integer  integer   integer   integer   double pointer  floating point    Mainly used to output grid speed  The second and third cases are more readable than the first but also    slightly slower     7 2 5 IbpIO    fDefineS
166. ger reference  ioy input output integer reference    ioz input output integer reference    ix input integer   iy input integer   iz input integer  fBestGrouping    e Header records    int fBestGrouping int totalgrid  int totalgroup  int amp  indigrid  int amp  critigroup     e Function  Distribute grid points among the processes to give a maximum of one to the differences in the numbers    of grid points     e Dependencies  None    e Arguments  totalgrid input integer  totalgroup input integer  indigrid output integer reference  critigroup output integer reference  e Comments    The totalgrid grid points are distributed among totalgroup processes so that the first critigroup  processes have indigrid grid points and the others have indigrid 1     fCppMod    e Header records  two cases   int fCppMod int a  int b   long fCppMod  long a  long b     e Function  Ensure that a is in a range between 0 and b 1  so that the value beyond the maximum value equals the    minimum  and vice versa     66    e Dependencies    None    e Arguments    a input  integer long integer  b input  integer long integer  fCppMod output integer long integer    e Comments    CHAPTER 7  DL_MESO_LBE PACKAGE REFERENCE    fCppMod   a bwhena  gt   bor fCppMod   a bwhena  lt  0  This function is useful for periodic boundary    conditions     fPrintLine    e Header records  int fPrintLine      e Function    Prints a line of 76   characters     e Dependencies    None    fPrintDoubleLine    e Header records  int fP
167. given wall thickness and bead density     and adjusts system dimensions and particle counts to accommodate them     e Dependencies    None    e Comments    This routine is only called for new simulations  with or without a CONFIG file      shearslide    e Header records  SUBROUTINE shearslide    e Function    Determines displacement of shearing boundary for Lees Edwards boundary conditions     e Dependencies    None    e Comments  The boundary condition is given by  34   Displacement of boundaries only takes place after equilibration     13 2 7 ewald_module    This module requires the constant  variables  numeric_container and comms_module modules to be loaded    beforehand     ewald_real_slater    e Header records  SUBROUTINE ewald_real_slater  nlimit     e Function  Calculates real space terms for Ewald summation with Slater type  exponential decay  charge distribu     tions     182 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    e Dependencies    erfcdp    e Arguments    nlimit input integer    e Comments  Calculates short range Coulombic forces and potential energies for Ewald summation using the following    smeared  non point  charge distribution 14      ro      exp  8     mr  re       ewald_reciprocal    e Header records  SUBROUTINE ewald_reciprocal    e Function    Calculates reciprocal space terms for Ewald summation     e Dependencies    None    e Comments  Calculates long range Coulombic forces and potential energies using standard Ewald summation  including    self e
168. grid point using the Bhatnagar Grook Krook  BGK  model for compress   ible fluids     e Dependencies  fGetOneMassSite  fGetEquilibriumC    110 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Arguments  startpos input double pointer    sitespeed input array of doubles    e Comments    Collisions for each solute are carried out using the BGK single relaxation time 4      1 e   0    liada  gi     gi   g       Ts    fSite ThermalCollisionBGK    e Header records  int fSiteThermalCollisionBGK double  startpos  double  sitespeed     e Function  Calculates thermal collisions at a grid point using the Bhatnagar Grook Krook  BGK  model for com   pressible fluids     e Dependencies  fGetOneMassSite  fGetEquilibriumT    e Arguments  startpos input double pointer  sitespeed input array of doubles  bodyforce input double pointer    e Comments  Collisions for thermal currents are carried out using the BGK single relaxation time 4    1  Tt     Op   eiaa  hi    hi     hi      fCollisionBGK    e Header records  int fCollisionBGKO    e Function    Collision steps for all compressible and incompressible fluids using BGK model     e Dependencies  fSiteFluidCollisionBGK  fSiteFluidIncomCollisionBGK  fSiteSoluteCollisionBGK  fSiteThermalCollisionBGK  fGetSpeedSite  fGetSpeedIncomSite    e Comments    This routine is fundamental to Lattice Boltzmann calculations and should not be modified     fCollisionBGKSegregation    e Header records    int fCollisionBGKSegregation      7 2  DL MESO_LBE SUBROUTINE
169. guments  startpos input double pointer  sitespeed input array of doubles  bodyforce input double pointer    phaseindex input double pointer    e Comments  Collisions are carried out on a single    achromatic    fluid using the BGK single relaxation time 4   fluid    segregation takes place using the D   Ortona algorithm  9         p   pep   FAO        fi  z t     5 Bw  z   i   Nab   P bla P    fSiteFluidCollisionBGKGuo    e Header records  int fSiteFluidCollisionBGKGuo double  startpos  double  sitespeed  double  bodyforce     e Function  Calculates collisions at a grid point using the Bhatnagar Grook Krook  BGK  model with the Guo forcing    term for compressible fluids     e Dependencies  fGetOneMassSite  fReciprocal  fGetEquilibriumF    104 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Arguments  startpos input double pointer  sitespeed input array of doubles  bodyforce input double pointer    e Comments  Collisions for each fluid species  solute and the thermal lattice are carried out using the BGK single  relaxation time 4   with the following Guo forcing term 19  acting on each fluid         Cia0a  fi     gt   f   1      wi  3  Cia     Va    9        U   Fa    fSiteFluidCollisionBGKGuoSegregation    e Header records  int fSiteFluidCollisionBGKGuoSegregation doublex  startpos  double  sitespeed  double  bodyforce     double  phaseindex     e Function  Calculates collisions and phase segregation for the Lishchuk algorithm at a grid point using the Bhatnagar   Grook Krook
170. h  bead   name a8 name of species  x real relative x coordinate for bead  Y real relative y coordinate for bead    2 real relative z coordinate for bead    12 1  INPUT FILES 161    The relative coordinates are used to define the initial shape of the molecule when it is inserted into the    system  these are not used if an initial configuration is already available     4  no isomer  indicates that the molecule shape should not be reflected or otherwise modified when added to the system   This directive is optional and should be left out if no restrictions on molecule insertion are to apply     5  bonds n  where n gives the number of flexible bonds in the molecule  Each of the subsequent n records contains     bond key ad potential key  see Table 12 3   index 1  i  integer first bead index in bond   index 2  j  integer second bead index in bond  variable 1 real potential parameter  see Table 12 3  variable 2 real potential parameter  see Table 12 3  variable 3 real potential parameter  see Table 12 3  variable 4 real potential parameter  see Table 12 3    Note that the bead indices are those arising from numbering each bead in the molecule from 1 to the  number specified in the beads directive for this molecule  The same numbering scheme applies for all  descriptions of the molecule  DL MESO_DPD will itself construct the global numbers for all particles in  the system     6  angles n    where n gives the number of angle bonds in the molecule  Each of the n records following con
171. h fluid species are carried out using multiple relaxation time  MRT  schemes coupled  with Guo like forcing terms  49       91   eia  a  fi   T   3  TF   Mf      1  315  5     fSiteFluidCollisionMRT GuoSegregation    e Header records  int fSiteFluidCollisionMRTGuoSegregation doublex  startpos  double  sitespeed  double  bodyforce     double  phaseindex     e Function  Calculates collisions and phase segregation for the Lishchuk algorithm at a grid point using Multiple   Relaxation Time  MRT  models coupled with Guo like forcing terms for compressible fluids     e Dependencies  fGetAllMassSite  fGetTotMassSite  fReciprocal  fGetMomentEquilibriumF  fGetMomentForce  fGetMRTCollide    e Arguments  startpos input double pointer  sitespeed input array of doubles  bodyforce input double pointer    phaseindex input double pointer    e Comments  Collisions are carried out on a single    achromatic    fluid using multiple relaxation time  MRT  schemes    coupled with Guo like forcing terms 49   fluid segregation takes place using the D   Ortona algorithm  9      a   it  e z ab  PO     fi  z t    het    8 wi 7  ba              Nab     fSiteFluidIncomCollisionMRTGuo    e Header records    int fSiteFluidIncomCollisionMRTGuo double  startpos  double  sitespeed  double  bodyforce     e Function  Calculates collisions at a grid point using Multiple Relaxation Time  MRT  models coupled with Guo like  forcing terms for incompressible fluids     e Dependencies  fGetOneMassSite  fGetMomentEquili
172. he y axis is denoted by 21  while a concave corner face at the top right front  corner is denoted by 31  It must be pointed out that only those space positions located in the surface of a  face centered cube have been included and translated in DL_MESO_LBE  Points with random orientations  e g     47   plane  have not been included     The boundary condition number can be rather confusing and difficult to understand  The GUI in DL_MESO    therefore includes a translator which interprets a word as its corresponding integer number  The word is made    4 2  DATA STRUCTURE 37    Table 4 2  Boundary condition category                   letter   meaning   V Constant Velocity   P Constant Pressure  Density    C Constant Solute Composition   T Constant Temperature   B Neumann Boundary Condition  Solute Composition or Temperature   PS Planar Surface   CC Concave Corner   CE Concave Edge   T Normal Vector Pointing to Top   D Normal Vector Pointing Downwards  L Normal Vector Pointing to Left   R Normal Vector Pointing to Right   F Normal Vector Pointing to Front   B Normal Vector Pointing to Back       up of defined letters as listed in Table 4 2  The boundary conditions with combinations of type and orientation  are listed in Table 4 3  The letters are in the order of     1     2     3     Fluid property  constant speed or constant pressure   Solute property  constant composition or Neumann boundary     Temperature property  isothermal  constant  or heat bath  Neumann boundary        G
173. hemes and thermostats that require two  separate sets of forces to be calculated     e Dependencies  error  global_sca_and_all  msg_receive_unblocked  msg_receive_sca_blocked  msg_send_blocked  msg_send_sca_blocked    msg_wait    13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 193    e Arguments  nlimit input output integer    mdir input integer  mp input integer  begin input real KIND dp   final input real KIND dp   shove input real KIND dp   first input logical  skip input logical    e Comments  Only exists in parallel version of DL_MESO_DPD  Setting first to  true  imports both sets of forces   constant and variable   while setting to  false  imports just the variable forces  This routine is suitable  for thermostats where two types of forces need to be kept separate and or recalculated  i e  the DPD  thermostat with DPD Velocity Verlet integration  DPD VV  and Stoyanov Groot thermostat  The switch  skip ignores any particles in halos for non periodic boundary conditions  e g  hard surfaces  Lees Edwards  shearing      importvariable_shear    e Header records  SUBROUTINE importvariable_shear  nlimit  mdir  begin  final  shove  shovel  shove2  sidel   side2     e Function  Imports particle forces from boundary halos for integration schemes and thermostats that require two  separate sets of forces to be calculated and Lees Edwards shearing     e Dependencies  error  msg_receive_unblocked  msg_receive_sca_blocked  msg_send_blocked  msg_send_sca_blocked    msg_wait    e Arguments
174. his is a 2D simulation of an initially static drop on a 150 x 50 grid undergoing linear shear 21  using Lishchuk  continuum based mesophase interactions with Guo forcing  The drop and continuous fluid are contained between  two solid walls  after an equilibration period to allow the drop shape to settle  the wall at the top of the system  is set to move horizontally while the wall at the bottom is kept stationary  Figure 8 7 shows the fluid density   pressure  field and drop positions at time steps throughout the simulation  demonstrating traverse migration   lift  due to linear shear  for a system with droplet Reynolds number of 0 135 and capillary number  ratio of  inertial to interfacial stresses  of 0 147  An  AVI video file has been rendered from an example calculation   which can be found in the Example Simulations page of the DL_MESO website     122 CHAPTER 8  DL MESO LBE EXAMPLES    density   001    2 0008      DY 2 0004    a    2       1 9996   a  t   19 000    density   001    2 0008    2 0004       2    1 9996   b  t   87 500    density   001   2 0008  2 0004    2       1 9996   c  t   390 000    Figure 8 7  Plots of fluid density  pressure  and drop positions for LBE 2D_DropShear test case    8 8 3D_PhaseSeparation    This is a 3D simulation of two fluids on a 100 x 100 x 100 grid with periodic boundary conditions and Shan Chen  pseudopotential mesoscopic interactions that cause the fluids to separate  Figure 8 8 shows the phase separation  process in a number of 
175. his method  concave edges  in three   dimensions  and concave corners instead use the equilibrium distribution function for the given density  velocity  and either zero velocity or the density at the nearest fluid grid point  An    evaporation limit    is applied to the  density as a minimum limit for constant velocity edges and corners to prevent spurious production of non   continuous fluids in multiple fluid systems  a default value of 1078 is generally used but this can be overridden  by the user in the 1bin sys file     5 2 5 Constant solute concentration temperature    To specify constant solute concentrations or temperatures at planar boundaries  the Inamuro method 28  27  is  used in DL_MESO_LBE  This is based upon substituting the unknown distribution functions for a boundary  point with local equilibrium values  but using an adjusted solute concentration or temperature to produce the  correct value for the property at that point  This concentration temperature is obtained by substituting the  equilibrium distribution function for the unknown populations into the sum of distribution functions  equal to    the required concentration temperature      For example  for a top edge with a specified temperature Ty using the D2Q9 lattice scheme    TCEDF   the  adjustment temperature T    is given as    z 6  E 3Uw y          T   Tp     ho     h       h2     he     h7     hs     and the missing populations  i   3 4 5 in this case  are given by  n wr   36   c  where Vu is the k
176. ibriumF    e Arguments  startpos input double pointer  sitespeed input array of doubles  bodyforce input double pointer  phaseindex input double pointer    e Comments  Collisions are carried out on a single    achromatic    fluid using the BGK single relaxation time 4   fluid  segregation takes place using the D   Ortona algorithm 9         p   pep   fE  2 0      fi  2 04    X bw  z Ci   fab   P bla P    fSiteFluidIncomCollisionBGK    e Header records  int fSiteFluidIncomCollisionBGK doublex  startpos  double  sitespeed  double  bodyforce     e Function  Calculates collisions at a grid point using the Bhatnagar Grook Krook  BGK  model for incompressible  fluids     e Dependencies  fGetOneMassSite    7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 103    fReciprocal    fGetEquilibriumFIncom    e Arguments  startpos input double pointer  sitespeed input array of doubles    bodyforce input double pointer    e Comments    Collisions for each fluid species are carried out using the BGK single relaxation time 4       Op  00  fi   Ra  0    fSiteFluidIncomCollisionBGK Segregation    e Header records  int fSiteFluidIncomCollisionBGKSegregation doublex  startpos  double  sitespeed  double  bodyforce     double  phaseindex     e Function  Calculates collisions and phase segregation for the Lishchuk algorithm at a grid point using the Bhatnagar   Grook Krook  BGK  model for incompressible fluids     e Dependencies  fGetAllMassSite  fGetAllMassSite  fReciprocal    fGetEquilibriumFIncom    e Ar
177. ic Equations           0  0   000  ee ee eee  Mesoscale Interaction  et BPS Re Oe ne hee eee aa BOE eee ER ete AS    Summary of Lattice Boltzmann Equation               e       DL_MESO_LBE Basic Definition    Latticeimodels   ea GoM feck ean eee go a Boe Se ah a ek iS ik Gn ee Gee a e as  Data structure  24 A dee ce Sate ch Wn Sard ete Seth Ai ke ae RS es ee ee ed    The Parameters and Their Functions      2    a e ae a e e    DL_MESO_LBE Features    Collision and Propagation Algorithms sa sek psa te saa ee ee  Boutidary conditions  s eied ere 6 e ee ee ie od  Mesoscale interactions  ida a Qo eh oe Roe Dyeing GA eon Gee ee da  Diffusion and heat transfer       Compressible and incompressible fluids    2    a a ee    12  18  19    21    23  23  23  24  25  26  27    29  29  36  39    ii CONTENTS  6 DL_MESO_LBE Input and Output Files 55  OL  input files se eo be i en he eae Sle ae pe aie AS PL Oh Eaves wea ee 55  6225    Output Miles sas ag Ko y A AA AA A Soe oo gd 58  7 DL_MESO_LBE Package Reference 61  Tal    OVETVIEW  2 2 2 BEG  See eh ES be ae AS EROS ae Goh a ein be ee aed 61  7 2 DL_MESO_LBE Subroutines and Functions          0  0  0 000002 eee ee 62  8 DL_MESO LBE Examples 119  Srl  GZDEPRESSULC a he fe ade Paka Mate Gite ee ee Ge Ande Me At okt me ened esa of ae OR we EO we Fe Se 119  O22 2D  Shear A e see    by ds ele Aceh IS a fh la Nee oe oe 119  8 32 2D  Cylinder Flow es a a tie ae ae beh AE Boeck okt eee db duke ah ye eek Ge hd 120   3 4  2D Karman Vortex 1 oe a oe
178. id point     7 2  DL MESO LBE SUBROUTINES AND FUNCTIONS 87  e Dependencies  None    e Arguments    tpos input long integer    e Comments    This bounce back boundary condition is carried out using f  lbopv i        1bv i       fMidBounceBackF    e Header records    int fMidBounceBackF  long tpos     e Function    Performs a mid link bounce back for the fluid distribution function at the tpos th grid point     e Dependencies    None    e Arguments    tpos input long integer    e Comments  This bounce back boundary condition is carried out by exchanging post collisional populations with con     jugate values in neighbouring grid points     fMidBounceBackC    e Header records    int fMidBounceBackC  long tpos     e Function    Performs a mid link bounce back for the solute distribution function at the tpos th grid point     e Dependencies    None    e Arguments    tpos input long integer    e Comments  This bounce back boundary condition is carried out by exchanging post collisional populations with con     jugate values in neighbouring grid points     fMidBounceBackT    e Header records    int fMidBounceBackC  long tpos     e Function    Performs a mid link bounce back for the temperature distribution function at the tpos th grid point     e Dependencies    None    88 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Arguments    tpos input long integer    e Comments  This bounce back boundary condition is carried out by exchanging post collisional populations with con     jugate 
179. import of local densities for particles from boundary halos of neighbouring domains and or across  periodic boundary conditions     e Dependencies    importdensity  Parallel version only     e Arguments    nlimit input output integer    e Comments    This subroutine is essential for DPD calculations involving many body  density dependent  interactions     importdensitydata_shear    e Header records  SUBROUTINE importdensitydata shear  nlimit     e Function  Applies import of local densities for particles from boundary halos of neighbouring domains and or across  periodic boundary conditions with Lees Edwards shearing     e Dependencies  importdensity  Parallel version only     importdensity_shear  Parallel version only     e Arguments    nlimit input output integer    e Comments    This subroutine is essential for DPD calculations involving many body  density dependent  interactions     13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 203    exportdata    e Header records  SUBROUTINE exportdata  nlimit     e Function  Applies export of particle properties  positions  velocities  to boundary halos of neighbouring domains    and or across periodic boundary conditions     e Dependencies    export    e Arguments    nlimit input output integer    e Comments  Non periodic boundaries either do not require boundary halos or require them to be constructed differently   these are thus excluded from the export of particle properties     exportdata_shear    e Header records  SUBROUTINE expor
180. in all the required values  clicking the relevant save button  SAVE SP  SAVE I or SAVE E  will  write the data to the FIELD file  The cancel buttons  CANCEL SP  CANCEL I and CANCEL E  will    close the pop ups without saving any values     2 4 Compiling and running DL_ MESO    e Compiling the LBE DPD code may be accomplished through the compiler panel which is activated from  either of the Compile LBE Code or Compile DPD Code buttons     e The Compile LBE Code panel allows you to select the operating system  a C   compiler  compiler  flags and the version  serial or parallel  of the code you wish to build  If you require a C   compiler  that is not included in the pull down list  select other and type the command for the required compiler in  the neighbouring box  Clicking the COMPILE button will start the compilation and a message box will    signal its completion     e The Compile DPD Code panel allows you to select the operating system  a Fortran90 compiler  compiler  flags and the version  serial or parallel  of the code you wish to build  If you require a Fortran90 compiler  that is not included in the pull down list  select other and type the command for the required compiler in  the neighbouring box  The Create Makefile button needs to be clicked first to create a makefile in the  working directory  which automates compilation and may be edited by the user  Clicking the COMPILE    button will invoke the makefile to compile the code and a message box will signal its com
181. inate   long fNextStep int q  int xpos  int ypos  int zpos   long fNextStep int q  int xpos  int ypos   long fNextStep int dx  int dy  int dz  long tpos     e Function  Finds particle position at the next time step when currently at  xpos  ypos  zpos   or tpos  and moving    along direction q or  dx  dy  dz      86    CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Dependencies    fCppMod    e Arguments    q input integer  dx input integer  dy input integer  dz input integer  xpos input integer  ypos input integer  zpos input integer  tpos input long integer    fNextStep output long integer    fBounceBackF    Header records    int fBounceBackF  long tpos     Function    Performs an on grid bounce back for the fluid distribution function at the tpos th grid point     Dependencies    None  Arguments  tpos input long integer    Comments  This bounce back boundary condition is carried out using f lbopv i     f lbv i    i e  populations    are exchanged with conjugate values     fBounceBackC    Header records    int fBounceBackC  long tpos     Function    Performs an on grid bounce back for the solute distribution function at the tpos th grid point     Dependencies    None    Arguments    tpos input long integer    Comments    This bounce back boundary condition is carried out using f  lbopv i     f 1bv i       fBounceBackT    e Header records    int fBounceBackC  long tpos     e Function    Performs an on grid bounce back for the temperature distribution function at the tpos th gr
182. ing channel flow past an infinitely long cylinder that eventually produces a von  Karman vortex street between two solid walls  Figure 8 4 shows the flow field at the final time step  an  AVI  video file has been rendered from the calculation and can be found in the Example Simulations page of the  DL_MESO website        Figure 8 4  Velocity magnitude plot from LBE 2D KarmanVortex test case  scale  blue to red     8 5 2D_LidCavity    This is a 2D simulation of a single incompressible fluid on a 128 x 128 grid with a shear boundary condition at  the top and solid walls surrounding the other edges of the system  resulting in lid driven cavity flow  Figure 8 5    8 6  2D  RAYLEIGHBENARD 121    shows the fully developed velocity field for a Reynolds number of 100 at the final time step     velocity X  05  0 04    0 02     0 015       Figure 8 5  Magnitude plot of x component velocity and velocity vector plot from LBE 2D_Lidcavity test case    8 6 2D RayleighBenard    This is a 2D simulation of a single fluid undergoing natural  Rayleigh B  nard  convection on a 102 x 51 grid   The fluid is contained between two solid walls  the wall at the bottom of the system is maintained at a higher  temperature than that at the top  Figure 8 6 shows the fully developed temperature field at the final time step  for a Prandtl number of 1 and a Rayleigh number of   21250        Figure 8 6  Plot of fluid temperature for LBE 2D_RayleighBenard test case  scale  blue to red     8 7 2D_DropShear    T
183. ing force message lbnb   fspos   unsigned long  position for receiving force message lbnb   frpos   unsigned long  position for sending phase index message lbnb   ispos   unsigned long  position for receiving phase index message   lbnb   irpos   unsigned long  message type 1bmsg2x MPL Datatype  message type 1bmsg2y MPI Datatype  message type 1bmsg3x MPI Datatype  message type lbmsg3y MPI_Datatype  message type 1bmsg3z MPL Datatype  message type 1bbmsg2x MPL Datatype  message type 1bbmsg2y MPI Datatype  message type 1bbmsg3x MPI Datatype  message type 1bbmsg3y MPL Datatype  message type 1bbmsg3z MPL Datatype  message type lbfmsg2x MPL Datatype  message type lbfmsg2y MPI Datatype  message type 1lbfmsg3x MPI_Datatype  message type lbfmsg3y MPI_Datatype  message type 1b  msg3z MPL Datatype  message type lbimsg2x MPI_Datatype  message type lbimsg2y MPI Datatype  message type lbimsg3x MPI_Datatype  message type lbimsg3y MPI_Datatype  message type lbimsg3z MPI_Datatype  endianness of system bigend int   total calculation time totaltime double   output file number qVersion int   collision type parameter collide int   interaction type parameter interact int  incompressible fluid parameter incompress int 1 or O  output file type outformat int                   3Including boundary points    Chapter 5    DL MESO LBE Features    5 1 Collision and Propagation Algorithms    The collision and propagation routines are a fundamental part of Lattice Boltzmann Equation calculations   Implementat
184. input  input  input  input    input    13 2 3 comms_module          real KIND dp   real KIND dp   real KIND dp   real KIND dp   real KIND dp   real KIND dp     integer  integer  integer  real KIND dp   real KIND dp   real KIND dp     CHAPTER 13  DL MESO_DPD PACKAGE REFERENCE    This module is essential for parallel running and does not require detailed knowledge for its use  depending    on the version and implementation of MPI available  the user may wish to select between the lines USE MPI    and INCLUDE  mpif h  for loading the necessary routines  The serial version of the comms_module primarily    consists of dummy routines to satisfy the required calls in the rest of the code     initcomms    e Header records  SUBROUTINE initcomms       e Function    Starts Message Passing Interface  MPI      e Dependencies    None    exitcomms    e Header records  SUBROUTINE exitcomms       e Function    Closes Message Passing Interface  MPI  in a controlled manner     e Dependencies    None    abortcomms    e Header records  SUBROUTINE abortcomms       e Function    Terminates Message Passing Interface  MPI      e Dependencies    None    13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 173    gsync    e Header records  SUBROUTINE gsync       e Function  Pauses running until all processes are synchronized     e Dependencies    None    global_and    e Header records  SUBROUTINE global_and  iii  nnn  nod  idnode     e Function  Finds global logical AND from a Boolean array iii   of size nnn  
185. integer  begin input real KIND dp   final input real KIND dp   shove input real KIND dp   skip input logical    e Comments  In serial running  this routine can automatically deal with non periodic boundary conditions  The switch  skip  in the parallel version only  prevents particles in the boundary halo of the current domain from    being transferred for non periodic boundary conditions  e g  hard surfaces  Lees Edwards shearing      exportdensity_shear    e Header records  SUBROUTINE exportdensity_shear  nlimit  mdir  mp  begin  final  shove  skip   Parallel ver   sion   SUBROUTINE exportdensity  nlimit  mdir  begin  final   Serial version     e Function  Exports particle data  local densities  to neighbouring domain as boundary halo for calculation of many     body DPD interaction forces     e Dependencies  error  msg_receive_unblocked  msg_receive_sca_blocked  msg_send_blocked  msg_send_sca_blocked    msg_wait    e Arguments    13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 199    nlimit input output integer          mdir input integer   begin input real KIND dp   final input real KIND dp   shove input real KIND dp   shovel input real KIND dp   shove2 input real KIND dp   sidel input real KIND dp   side2 input real KIND dp     e Comments  Only exists in parallel version of DL_MESO_DPD  This routine requires information for the two dimensions  along the surface of the shearing boundary  the variables shove1 and shove2 represent the displacement    due to shear  while side1 a
186. inus concentration of anions  per unit volume   p 7  the local polarizability relative to a reference medium  e g  water  and I the coupling  constant for the reference medium  The latter is given by    e2    T       kBT eg  rre    with e as the electron charge  ey the dielectric constant of a vacuum and e  the relative permittivity of the  1  reference medium  For water at room temperature  298K  with Nm molecules per DPD particle  T   20 00Nim       Alternatively  the total electrostatic potential energy can be expressed as a sum of Coulombic energies  which    also include periodic images   i e        r 9 95         gt  11   U EZ pas iral  11 50    i gor    11 5 1 Standard Ewald sum with exponential charge smearing  ewald     The method currently used in DL_MESO_DPD to determine the electrostatic potential is an Ewald summation 14      U   a    ur y y  y pee y gee  11 51     where U     is a short range potential energy term that sums quickly in real space  U     is a long range term that  sums quickly in Fourier or reciprocal space  U    is a self energy correction term and U    is a correction for    systems with a net charge     While the original form of the short range electrostatic potential uses point charges  this cannot be used un   modified for DPD simulations  soft beads used in combination with unlike point charges would collapse on top  of each other  forming infinitely strong ion pairs  The charges are therefore spread out over a finite volume  using a smeari
187. ion involves the calculation of post collisional values for the distribution functions at each lattice  point  at time t    For the generalized form of the Lattice Boltzmann Equation with the collision operator C    normally in the form of a matrix     ABO    fi  Z t    Ci  and movement of these distribution functions to neighbouring lattice nodes     Ji  Z    iAt  t   At    fi  z t      which combine to give the governing equation for calculations     5 1 1 Collision algorithms    The forms of collision currently available in DL MESO LBE are the Bhatnagar Gross Krook  BGK  single  relaxation time 4  and Multiple Relaxation Time  MRT  schemes     5 1 1 1 BGK single relaxation time  The BGK collision operator is defined by    Ci    fi      t  F   5 1     E    where Ty is the relaxation time  related to the kinetic  shear  viscosity of fluid by    E 1   Az    A  173         with the kinematic bulk viscosity of the fluid  v     set equal to 3v 7   This reduces the equation for post collisional       distribution functions to    fi  zt   f Et   Fi  Z  t      F      At  Tf  the same as Equation 3 12     Interfacial and external forces are dealt with either by adding uE to the velocity of the fluid 41  when calculating  the equilibrium distribution function fj     or by adding a forcing term to the collisional distribution function 19      1 Bie coma  F           Wi   z2   A eij    F  5 2           46 CHAPTER 5  DL MESO_LBE FEATURES    where 7 is defined as equal to t   ap and used
188. iprop input integer    7 2  DL MESO _LBE SUBROUTINES AND FUNCTIONS 83    e Comments  The default output file name is 1bout  vtk and the concentration of solute 0 is output by default  These  can be changed by specifying an output file name and solute number  up to 1bsy ns   1  when calling the    routine     fOutputLegacy VTKT    e Header records    int fOutputLegacyVTKT const char  filename  1bout      e Function  Outputs macroscopic temperature and fluid velocity at each lattice point for system in Structured Grid  Legacy VTK format     e Dependencies  fOutputLegacyVTKT2D  fOutputLegacyVTKT3D    e Arguments    filename input array of characters    e Comments  The default output file name is lbout  vtk  This can be changed by specifying an output file name when  calling the routine     7 2 8 IbpIOVTK  fOutputVTK    e Header records  int fOutputVTK const char  filename  lbout      e Function  Outputs macroscopic macroscopic mass densities and fractions for all fluids  concentrations for all so   lutes  temperature and velocity  speeds along x   y  and z directions  at each lattice point for system in  Structured Grid XML VTK format     e Dependencies  fOutputVTK2D  fOutputVTK3D    e Arguments    filename input array of characters    e Comments  The default output file name is lbout  vts  This can be changed by specifying an output file name when  calling the routine     fOutputVTKP    e Header records    int fOutputVTKP const char  filename  1bout   int iprop 0     84    CHAP
189. irectory    e Type javac   java to compile the source code    e Type jar  cfm GUI jar manifest mf   class to create the GUI  jar executable JAR file   e Move to your working directory     e Launch the GUI     A Unix Linux script called makegui that performs the build of the GUI can be found in the JAVA subdirectory     Your working directory is the directory from which you wish to work when running DL_MESO  Working there  will keep any files you generate separate from the DL_MESO source files  Note in the current version of  DL_MESO the working directory should be at the same directory level as the JAVA direction  i e  within the  DL_MESO top directory  and contain the executables of any external utilities required to set up input files and  gather or process output files from simulations  An example of such a working directory  called WORK  is present  under the DL_MESO top directory  this includes a makefile to compile all of the external utilties which can be  invoked by the command make  f Makefile utils     In your working directory you can start the GUI with the command  e java  jar    JAVA GUI jar    You may consider saving this command in a script for simple execution  An example script for Unix Linux    called rungui is present in the WORK subdirectory     Figure 2 1 shows the DL_MESO GUI when it is started  Clicking the LBE and DPD buttons will produce the  Lattice Boltzmann and Dissipative Particle Dynamics panels respectively  which will guide you through setting 
190. isotropic orthorhombic systems the pressure in dimension a  related to the instantaneous stress    tensor component dqa t   is defined as       1 2  P t    Vi  2 MiV  q t  T 2 Falat    11 18   In both equations  the instantaneous values required for barostats include only the interaction forces  e g  soft  pairwise interactions  bonds  electrostatics   they do not include virial contributions from thermostatting  which    are included in reported values of system pressure     All barostat definitions are expressed for the more general anisotropic case  these can be applied for isotropic  systems by setting P  t   Py t  and P  t  all equal to P t   The barostat can be selected in the CONTROL  file using the directive ensemble npt  the barostat type should be specified after the coupled thermostat   The target system pressure can also be specified in the same file using the directive pressure  By default the  barostat is assumed to act isotropically  although the CONTROL file directive no isotropy can be used to apply  anisotropy  Frozen particles are moved when a barostat is applied but their positions relative to the dimensions    of the system remain constant during calculations     11 3 1 Langevin barostat  langevin     The governing equation for the Langevin barostat on an orthorhombic simulation cell 29  is the force exerted  by the piston  expressed as the time derivative of its momentum Py a   WgUg a        1 1  Paja   V  Pa     Po    N  2 MiV      YpPg a   Opp aAt   11
191. ist    e Function  Reorders the global local particle number list  in terms of global particle number  using a Shell sort     e Dependencies    None    search_list    e Header records  INTEGER FUNCTION search_list  aim     e Function  Determines the index for the global local particle number list for a specified global particle number aim    using a binary search     e Dependencies    None    e Arguments  aim input integer    search_list output integer    e Comments  This function returns a negative value if the global particle number cannot be found in the list  If it is  not the only entry for the global particle number  the function returns the index plus the value of nlist   number of list items  to flag up duplicate entries     13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 185    duplicate    e Header records  SUBROUTINE duplicate  global1  global2  indi  ind2     e Function  Determines the indices out of duplicate entries from the global local particle number list for a pair of  specified global particle numbers  global1 and global2  that produce the shortest distance between the    particles     e Dependencies    None    e Arguments    global1 input integer  global2 input integer  ind1 input output integer  ind2 input output integer    contract _bndtbl    e Header records  SUBROUTINE contract_bndtbl    e Function  Strips out all bond pairs from bond table that have been reassigned to neighbouring processors     e Dependencies    None    e Comments  Only called for paral
192. iting OUTPUT file nwrite integer   I O channel for reading export  files nrtin integer   I O channel for writing export  files nrtout integer   I O channel for writing CORREL file nsave integer   I O channel for writing HISTORY files nhist integer   number of bytes per real number lword1 integer   number of bytes per double precision number lword2 integer   value of 7 pi real KIND dp    value of yr rtpi real KIND dp    conversion factor from degrees to radians degrad real KIND dp    conversion factor from radians to degrees raddeg real KIND dp    conversion factor from energy to temperature fkt real KIND dp    square root of 12  for random force calculations  tti  real KIND dp    convergence error for Langevin barostat langeps real KIND dp    name of processing unit idnode integer   number of processing units nodes integer   filename for restart files exportname character 10    switch for temperature scaling ltemp ogical TorF  switch for reading CONFIG file lconfig ogical TorF  switch for writing CORREL file lcorr ogical TorF  switch for writing HISTORY  files ltraj ogical T or F  switch for modelling bonds lbond ogical TorF  switch for modelling bond angles langle ogical TorF  switch for modelling bond dihedrals ldihed ogical TorF  switch for global holding of bond information lgbnd ogical TorF  switch for defining variable force arrays lvarfc ogical TorF  switch for isotropic variations of volume with pressure lisoprs ogical TorF  switch for ignoring global bead numbers in 
193. ition in FIELD file for molecule i    A bond dihedral definition has been found in the FIELD file for the i th molecule that was not detected during  the initial scan of the input file     Action  This error should never occur  If it does  please contact the authors of DL_MESO     Message 40  non existent species given in FIELD file for unbonded interaction i    An undefined species has been found in the i th  unbonded  interaction definition in the FIELD file     Action  Check the FIELD file  particularly the    th interaction type and the species definitions  to ensure the    species in the interaction are defined     Message 41  non existent species given in FIELD file for surface interaction i    An undefined species has been found in the    th  hard  surface interaction definition in the FIELD file     Action  Check the FIELD file  particularly the i th surface interaction and species definitions  to ensure the    species in the interaction are defined     Message 42  non existent species given in FIELD file for frozen wall interaction    An undefined species has been found in the definition for frozen particle walls in the FIELD file     Action  Check the FIELD file  particularly the frozen particle wall and species definitions  to ensure the required    frozen particle species is defined     Message 43  incomplete many body DPD interaction data in FIELD file    Not all species pairs have defined interaction parameters in the FIELD file  this is vital for systems with a
194. ity    e Header records  SUBROUTINE exportvelocity  nlimit  mdir  mp  begin  final  shove  skip   Parallel version   SUBROUTINE exportvelocity  nlimit  mdir  begin  final   Serial version     e Function  Exports particle velocities to neighbouring domain as boundary halo for recalculation of dissipative forces   as required for DPD Velocity Verlet algorithm      e Dependencies  error  global_sca_and_all  Parallel version only   msg_receive_unblocked  Parallel version only   msg_receive_sca_blocked  Parallel version only   msg_send_blocked  Parallel version only   msg_send_sca_blocked  Parallel version only     msg_wait  Parallel version only     e Arguments    13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 197    nlimit input output integer    mdir input integer  mp input integer  begin input real KIND dp   final input real KIND dp   shove input real KIND dp   skip input logical    e Comments  In serial running  this routine can automatically deal with non periodic boundary conditions  The switch  skip  in the parallel version only  prevents particles in the boundary halo of the current domain from    being transferred for non periodic boundary conditions  e g  hard surfaces  Lees Edwards shearing      exportvelocity_shear    e Header records  SUBROUTINE exportvelocity_shear  nlimit  mdir  begin  final  shove  shovel  shove2  sidel   side2     e Function  Exports particle velocities to appropriate domains as boundary halo for recalculation of dissipative forces   as required fo
195. larger time steps than the standard DPD thermostat but with similarly  low system viscosities  As for the Lowe Andersen thermostat  its implementation in parallel running uses a  replicated data strategy to carry out the velocity corrections  which requires additional memory per processing  unit for storing the velocities of all particles in the system and the data required to modify them  The efficiency  of the Peters thermostat therefore depends upon the total number of particles in the system  since all particle  pairs are modified  calculation times for this thermostat may be comparable to those for the Lowe Andersen  thermostat when  At x 1     11 2 5 Stoyanov Groot thermostat  stoyanov     The Stoyanov Groot thermostat 62  is a combination of the Lowe Andersen thermostat and a Galilean invariant  Nos   Hoover thermostat which acts locally and on pairs of particles  During force calculations after the first  Velocity Verlet stage  the choice to use either the Lowe Andersen or Nos   Hoover thermostats for each particle  pair is made at random  the Lowe Andersen thermostat is selected with a probability of TAt  The system    temperature is also determined in terms of relative velocities for all particle pairs  i e     Ding WT  rij  ag      3 ae YT  rij        kpT     11 15     11 3  BAROSTATS 145    where 1 7  rij  is a smearing function for the temperature  chosen to reduce to zero when rj   gt  re  by default this  is set as  7  rij    1 for r  lt  re  For all particle p
196. lected using the pulldown list in the Gather LBE Data panel    If the argument is omitted  the utility will ask the user to enter the required property  No other user input is  required  but error messages will be produced if either of the files Lbout info and 1bout ext are missing  No  other error messages are produced  so care should be taken to ensure no VTK files for the pieces are missing   particularly since these files are required for plotting as the linking files do not include the data     B 2 DLMESO_DPD    convert input  convert input is a utility written in C   to read DPD input files created for earlier versions of DL_MESO   up to version 2 4  and create CONTROL and FIELD files formatted in the style for versions 2 5 and later     This utility can be compiled to produce the executable convert exe with the command  e c    o convert exe convert input cpp    if c   is the command for the available C   compiler     This utility can be run with up to three optional command line arguments specifying the names of the CONTROL   FIELD and MOLECULE files in that order if they have alternative names  If the standard names are used  the old  CONTROL and FIELD are renamed after being read to prevent them being overwritten with the new versions of  those files   The MOLECULE file is no longer required and therefore does not need to be renamed      molecule generate    molecule generate is a utility written in C   to generate the input files required for modelling particles  in
197. lel version of DL_MESO_DPD when bond tables include only local bonds in each    processor     contract _angtbl    e Header records  SUBROUTINE contract_angtbl    e Function  Strips out all bond angle triples from angle table that have been reassigned to neighbouring processors     e Dependencies    None    e Comments  Only called for parallel version of DL MESO_DPD when angle tables include only local angles in each    processor     contract _dhdtbl    e Header records  SUBROUTINE contract_dhdtbl    186 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    e Function  Strips out all bond dihedral quadruples from dihedral table that have been reassigned to neighbouring    processors     e Dependencies    None    e Comments  Only called for parallel version of DL_MESO_DPD when dihedral tables include only local dihedrals in    each processor     bond_force    Header records  SUBROUTINE bond force  bondtype  r  a  b  c  d  force  potential     e Function    Determines the stretching force and potential energy between a pair of bonded particles     Dependencies  None    e Arguments  bondtype input integer          r input  real KIND dp   a input  real KIND dp   b input  real KIND dp   c input real KIND dp   d input real KIND dp   force output real KIND dp   potential output real KIND dp     e Comments  If required  the user can add extra stretching bond interaction types in this subroutine as additional cases     this would also require changes to read_control in config_module     angle_f
198. lid    method with all interaction forces combined together and collision operators interpolated according to local  1 1     2  Y      5 25   TE PT    After the achromatic fluid is collided  the fluids are segregrated to produce post collisional distribution functions    mass fraction  e g     for each fluid  This is achieved using the D   Ortona algorithm 9   which gives a non zero boundary thickness  between the fluids and reduces non physical effects such as pinning of drops to the lattice  spatial anisotropy  in interfacial tension and spurious microcurrents  The equation for the post collisional segregated distribution  function for fluid a 61  is given as       p   pep   ft  3 00    Ef   2 00     8 w F    hab  5 26   P ba P  where 5  is a segregation parameter that controls the width of the diffuse boundary between phases and  pra   Ba   This method can directly simulate a specified interfacial tension  Gab   which is related to the lattice based  parameter gay by  Agavv       po  ct  277     1   Az    using the mean density  po   kinematic viscosity  v  and relaxation time  Tf  of a reference fluid  e g  the     5 27     Cab      continuous fluid for the system      The subroutine   CalcPhaseIndex_Lishchuk calculates and stores the first derivatives of the phase indices   which are subsequently used for force calculations     values from neighbouring lattice points are required for  calculations of interface curvature and the additional fIndexBlockCommunication routine
199. list  currently available options    include no interactions  Shan Chen pseudopotential interactions  Shan Chen interactions with surface  wetting and Lishchuk continuum based interactions       The number of grid points sets the size of the system  For 2D systems  the number of grid points in    the z direction must equal 1  selecting a two dimensional lattice model greys out this box       The total steps and the equilibration steps for the simulation       the save span  number of timesteps between system outputs  and the boundary width for running    the parallel version of DL_MESO_LBE are given in this row   The serial version by default automatically  resets the boundary width to zero        The output format for system snapshots is set using this pull down list  VTK  Legacy VTK and Plot3D       The sound speed  c  and kinetic viscosity  v  are real life quantities for the first  main  fluid  These    do not influence calculations at all but allow conversions between lattice and real units  the time step and      y     v _ v3v    lattice spacing are given by At   HD and Ag   5 respectively       The specified top boundary speed  in lattice units   i e  at the maximum y value for the grid  This    and similar properties only need to be specified if the boundary includes a fixed velocity  any specified  value will be ignored for periodic  bounce back and fixed density conditions  Note that the z component  will be greyed out for two dimensional systems     The specified b
200. local variation of   f   in the system density of particles  useful for  non homogeneous or non equilibrium simulations  default f   0   set required short range electrostatic cutoff radius  re  to f length units  default  f  e    select NVT ensemble  DPD thermostat with standard MD like Velocity Verlet  integration  default ensemble if otherwise not specified    select NVT ensemble  DPD thermostat with DPD Velocity Verlet integration  select NVT ensemble  Lowe Andersen thermostat   select NVT ensemble  Peters thermostat          select NVT ensemble  Stoyanov Groot thermostat with coupling parameter o    157    158    ensemble npt Q langevin f   fo    ensemble npt  langevin fi fo    ensemble npt Q berendsen f    stoyanov a    ensemble npt stoyanov a  berendsen f  equilibration  steps  n    ewald  sum  a ky ka kg    finish  global bonds    job time f  manybody cutoff f    ndump n  nfold i j k    no config    no electrostatics  no index    no isotropy    permittivity  constant  f    pressure f    print  every  n  rcut f  restart    restart noscale  restart scale    scale  temperature   every  n  smear slater f   stack  size  n   stats  every  n   steps n   surface cutoff f    surface hard 7    CHAPTER 12  DL MESO DPD INPUT AND OUTPUT FILES    select NPT ensemble  thermostat type Q  i e  mduv  dpdvv  lowe or peters   with Langevin barostat  setting relaxation time  7   and viscosity parameter   Yp  as f   and f2 respectively   select NPT ensemble  Stoyanov Groot thermostat with 
201. lue of a is equal to vee    The long range term for the Ewald sum requires the reciprocal vector k  which for an orthogonal periodic    simulation box of dimensions L    x Ly x Lz is given by    Qrky  Ly  21 ka  Ly  27k3  Lz    w  II    where k    ka and kg are integers  positive and negative  from zero to large values specified by the user as  KE  k3  and kz   respectively for x   y  and z dimensions  the maximum reciprocal vector Emaz using  the maximum k values can also be defined  Adjustments can be made to this vector to account for shearing  boundaries 70      The long range potential energy term for the entire system is given by       Emas ezp   ee A   y ieg exp  E  E   C  aV J z2 J qj exp   ik   5   11 57   k 0 j    where    is the imaginary constant  y   1   Differentiation of the potential gives the long range electrostatic force    on a particle     q BY Sika  A  EL Eoo  w  RAO       Charged frozen particles may interact with non frozen particles but interactions between frozen particles must  be excluded  While the real space electrostatic potential and forces between charged frozen particles can be  ignored  pairwise correction terms are required to remove their contributions in reciprocal space  The potential  energy to be removed between a pair of charged frozen particles with Slater like charge distributions is given as          rqiq  Ug   a erflar     1      1   Brij  exp  28r 5    11 59   ij  while the pairwise force is  PEineorr     FHM  erfforyg      Z exp
202. ly     import_shear  Parallel version only     e Arguments    nlimit input output integer    e Comments  This subroutine is applicable for integrators thermostats using single sets of particle forces  i e  standard  Velocity Verlet  Lowe Andersen  Peters      importdata_dpdvv1    e Header records  SUBROUTINE importdata_dpdvvi  nlimit     e Function  Applies import of particle forces  constant and variable  from boundary halos of neighbouring domains  and or across periodic boundary conditions for the DPD Velocity Verlet algorithm     e Dependencies    importvariable  Parallel version only     e Arguments    nlimit input output integer    importdata_dpdvv1_shear    e Header records  SUBROUTINE importdata_dpdvvi_shear  nlimit     e Function  Applies import of particle forces  constant and variable  from boundary halos of neighbouring domains  and or across periodic boundary conditions for the DPD Velocity Verlet algorithm with Lees Edwards    shearing     13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 201    e Dependencies  importvariable  Parallel version only     importvariable_shear  Parallel version only   e Arguments    nlimit input output integer    importdata_dpdvv2    e Header records  SUBROUTINE importdata_dpdvv2  nlimit     e Function  Applies import of variable particle forces from boundary halos of neighbouring domains and or across  periodic boundary conditions for the DPD Velocity Verlet algorithm     e Dependencies    importvariable  Parallel version only   e Argum
203. masses    in parallel running  fPrintSystemMass    would be needed     7 2  DL MESO _LBE SUBROUTINES AND FUNCTIONS 77    fPrintDomainMomentum    e Header records    int   PrintDomainMomentum      e Function    Calculates and prints the total fluid momentum in domain     e Dependencies    int fGetTotMomentDomain double  momentum     e Comments  This routine only produces the entire system momentum if running in serial  to obtain system momentum    in parallel running  fPrintSystemMomentum   would be needed     fOutput    e Header records    int fOutput  const char  filename  lbout      e Function    Outputs all system data in required format     e Dependencies  int fOutputPlot3D    int fOutputLegacyVTK    int fOutputVTK      e Comments  This routine is used to write output files in parallel running  a serial version of this routine  fsOutput   also exists     fInput Parameters    e Header records    int fInputParameters const char  filename  lbin sys      e Function    Reads system parameters in from 1bin  sys data file     e Dependencies    lbin sys data file    e Arguments    filename input array of characters    e Comments  The default file name is 1bin  sys  to use different file names the argument for this routine can be changed  by the user     fReadSpaceParameter    e Header records    int fReadSpaceParameter const char  filename  lbin spa      78    CHAPTER 7  DL_MESO_LBE PACKAGE REFERENCE    Function    Reads 2D or 3D space parameters from data file 1bin  spa     Depe
204. mbforce     e Function  Calculates many body DPD interaction force and non density dependent potential energies between par     ticles i and j using parameter set k and inter particle distance rrr     e Dependencies    None    e Arguments    i input integer  j input integer  k input integer  rrr input  real KIND dp     mbforce output real KIND dp     e Comments  The default form for the many body DPD interaction force is a two term style suitable for modelling    vapour liquid mixtures 68      a re ri    Fs  ES   A     2    Bi  pi   pj   1  3  n  Te Td Tij    This subroutine may be changed by users who wish to use different many body interaction functional    forms     184 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    manybody_potential    e Header records  SUBROUTINE manybody_potential    e Function  Calculates the self energy for every particle resulting from density dependent  many body  interactions     e Dependencies    None    e Comments  The default form is based on the two term vapour liquid interactions used for many body forces 68    although only the density dependent potential energies are calculated using this routine  the rest are  calculated in manybody force   Users may wish to modify this routine to use their own many body    interaction models     13 2 9 bond_module    This module requires the modules constants  variables  error_module  comms_module and numeric_container    to be loaded beforehand     shellsort_list    e Header records  SUBROUTINE shellsort_l
205. me of  the simulation  up to 80 characters  in the first line  this file contains a number of directives  each indicating  the type and number of interactions to follow     The species information must be provided first  as this will be required to specify interaction data  which can  be included in any order   using the directive species n  This indicates that data for n species are to follow   each species given in a single line using the following format     name a8 name of species   mass real particle mass for species   charge real particle charge for species   populations integer unbonded population of species   frozen integer determines whether particles of this species are frozen  1  or not  0     The unbonded population can be omitted for species which are wholly contained in molecules  as can the frozen    particle parameter for unfrozen species     160 CHAPTER 12  DL MESO DPD INPUT AND OUTPUT FILES    Non bonded interactions are specified with the directive interactions n  with n pairwise interactions to follow     each is given in a single line using the format     species 1 a8 name of species 1   species 2 a8 name of species 2   key a4 interaction key  see Table 12 2  variable 1 real interaction parameter  see Table 12 2  variable 2 real interaction parameter  see Table 12 2  variable 3 real interaction parameter  see Table 12 2  variable 4 real interaction parameter  see Table 12 2  variable 5 real interaction parameter  see Table 12 2  variable 6 real interactio
206. ms with periodic boundary conditions DL_MESO_DPD uses the Ewald sum to calculate Coulombic  interactions  see Section 11 5   Calculation of the real space component  in routine ewald_real_slater  uses  the same link cell algorithm as for other pairwise interactions  albeit using a larger cutoff radius  re  and requires    a larger boundary halo than for standard pairwise interactions     11 2 Thermostats and integration algorithms    The integration algorithms in DL_MESO_DPD are based on the second order Velocity Verlet  VV  scheme 67    which yields the positions  velocities and forces of particles at the same time and is generally used in molecular  dynamics simulations  This algorithm has two stages  The first stage advances the particle velocities to time  t    At by integrating the forces and uses the new half step velocities to advance the position to time t   At     A a At F  t   Ti  t   At   F   t    Atv   t   4At   11 2     The positions at the end of the time step allow the forces to be recalculated  before the second stage of the  algorithm is applied to advance the half step velocities to the end of the time step by integrating with the new  force  5   0   t   At   0   t   At  poaa  11 3    Mi   Five thermostatting algorithms are currently available in DL_MESO_DPD  two variants of the standard DPD  thermostat and three alternative schemes which apply velocity corrections to the particles after force integration   The algorithm can be selected in the CONTROL file u
207. n  73   concave edges and corners use equilibrium boundary con   ditions with the density on the edge and at the grid point assumed to be equal to the values at their  nearest neighbours in the bulk fluid  The array uwal1 is the velocity at the grid point for all fluids  which    is subsequently used for solute concentration and temperature boundary conditions     fFixedDensityFluid    e Header records    int fFixedDensityFluid long tpos  int prop  double  uwall     e Function    Calculates the particle distribution function at a fixed density boundary     e Dependencies    Many for different lattice schemes    e Arguments  tpos input long integer  prop input long integer  uwall output array of doubles  e Comments  Planar surface calculations are based on  73   concave edges and corners assume zero speed at the boundary   The array uwall is the velocity at the grid point for all fluids  which is subsequently used for solute    concentration and temperature boundary conditions     fFixedSoluteConcen    e Header records    int fFixedSoluteConcen long tpos  int prop  double  uwall     e Function    Calculates the particle distribution function at a fixed composition boundary     e Dependencies  Many for different lattice schemes    e Arguments  tpos input long integer  prop input long integer  uwall input array of doubles    90 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Comments  Planar surface calculations are based on  28   concave edges and corners assume zero speed at th
208. n dimension a by the factor    Ha   1  BAP  a Po    Tp   with the option of keeping the system isotropic by using equal values of P  for all dimensions   This may  be switched off if imposing constant surface tensions at given planar surfaces   Rescaling of the simulation  volume takes place in the first stage  while calculation of the rescaling factor Ha takes place in the second    stage after force integration   13 2 15 statistics module  This module requires the modules constants  variables  start module  comms _module and numeric_container  to be loaded beforehand     printout    e Header records  SUBROUTINE printout  time  lbegin     e Function  Writes summary of simulation at the current time step to OUTPUT file     e Dependencies    None    e Arguments  time input real KIND dp   lbegin input logical    e Comments    The logical 1begin indicates whether or not the column titles should be printed before the data     corout    e Header records  SUBROUTINE corout  time     e Function  Writes statistical data to CORREL data file     e Dependencies    None    e Arguments  time input  real KIND dp     214 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    histout    e Header records  SUBROUTINE histout  time     e Function  Writes trajectory data  particle positions and velocities  to HISTORY  data files     e Dependencies    None    e Arguments  time input  real KIND dp     result    e Header records  SUBROUTINE result    e Function    Writes final summary of simulation to OUTPUT
209. n parameter  see Table 12 2  variable 7 real interaction parameter  see Table 12 2    If any interactions are many body DPD  the interactions for all possible species pairs must be specified in the  FIELD file and values for all parameters must be given  even if not all of them are required for the many body  DPD model in use  Otherwise only like like  same species  i e  i   j  interactions are required  as any missing  interaction data can be derived using mixing rules  If using the Lowe Andersen or Stoyanov Groot thermostats     the dissipative factor yi  should be replaced with the bath collision frequency Tij     Table 12 2  Non bonded interactions          key interaction type Parameters  1 7    lj Lennard Jones Eij   Cig   Vij S 7 A J   wca Weeks Chandler Andersen       j Gij Vig           dpd Groot Warren DPD Aij   Teij   Vag z z a j   mdpd   Many body DPD Aij   Big   Ci   Dig   Ei   Seijo Tij                                     Molecules are specified using the directive molecules n  with data for n molecule types to follow  Immediately  after this directive  the following records are included to define each molecule type     1  Molecule name  which can be a character string of up to 8 characters in length    2  nummols n  where n is the number of times a molecule of this type appears in the system  This is followed by the  data for the molecule type     3  beads n  where n gives the number of beads  particles  in this molecule type  A number of records follow for eac
210. n the data type for the array    indicates that it is allocatable     4 3  THE PARAMETERS AND THEIR FUNCTIONS    Table 4 8  DL_MESO_LBE Parameters    41                      function parameter data type notation  system information lbsy structure   domain information 1bdm structure   neighbour information 1bnb structure A6   space dimension lbsy nd int   number of discrete speeds lbsy nq int   number of fluids lbsy nf int  gt 1  number of solutes lbsy nc int   temperature scalars lbsy nt int 1 or 0  phase field order parameter lbsy pf int 1 or 0   grid points in x direction lbsy  nx int   grid points in y direction lbsy ny int   grid points in z direction lbsy nz int   domain boundary width lbsy bwid int  gt 1  system dimension along x lbxsize double   total calculation steps lbtotstep int   equilibration calculation steps lbequstep int   data save interval lbsave int   current calculation step lbcurstep int   steering lbsteer int lor 0  noise intensity lbnoise double   evaporation limit lbevaplim double   initial system velocity lbiniv double A3   top boundary velocity lbtopv double A3  bottom boundary velocity lbbotv double A3   front boundary velocity lbfrov double A3   back boundary velocity lbbakv double A3   left boundary velocity lblefv double A3   right boundary velocity lbrigv double A3  constant incompressible fluid density  po    lbincp double  A lbsy nf  initial fluid density lbinip double  A lbsy nf  top boundary fluid density lbtopp double  A lbsy nf  bottom bou
211. nBlockCommunication  may be required for using the combined swap prop     agation routine fPropagationCombinedSwap in serial running     fsForcePeriodic    e Header records    int fsForcePeriodic      92 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Function  Applies periodic boundary condition for serial calculations with non zero boundary domain widths by  copying interaction forces from edges of fluid points     e Dependencies  fsForcePeriodic2D    fsForcePeriodic3D    e Comments  Serial equivalent of fForceNonBlockCommunication  may be required for using the combined swap propa     gation routine fPropagationCombinedSwap in serial running for any system requiring non constant forces     fsIndexPeriodic    e Header records    int fsIndexPeriodic      e Function  Applies periodic boundary condition for serial calculations with non zero boundary domain widths by    copying phase index spatial derivatives from edges of fluid points     e Dependencies  fsIndexPeriodic2D  fsIndexPeriodic3D    e Comments  Serial equivalent of fIndexNonBlockCommunication  may be required for using the combined swap prop     agation routine fPropagationCombinedSwap in serial running with the Lishchuk mesophase algorithm     7 2 10 IbpFORCE    fInteractionForceZero    e Header records    int fInteractionForceZero      e Function    Resets all interaction forces to zero prior to calculations     e Dependencies    None    e Comments  This routine should be called before any non constant forces  e g 
212. nbonded potential models in use     If interaction parameters between different particle species are not specified in the FIELD file  these can be  determined by mixing rules  Energy and dissipative parameters  e g  Aag and Yag for DPD  can be determined  for unlike particle pairs as geometric means of these parameters for same species interactions  e g     Aap   Y Ano Age    while interaction lengths are set to the arithmetic mean  e g     Te aa T Tc  BB  2    Teab      It should be noted that interaction lengths have to be less than or equal to the maximum interaction cut off  radius re  which applies for dissipative and random force interactions   if the maximum interaction cut off  radius is not specified in the CONTROL file  the maximum specified value of reag will be used  Frozen particles    are included in all interactions but the resultant forces on these particles are not subsequently integrated     Four types of pairwise interactions between particles are available in DL_ MESO_DPD  Lennard Jones  Weeks   Chandler Andersen  Groot Warren  standard  DPD and many body  density dependent  DPD  In the case that  many body DPD interactions are used for any particle pair  mixing rules cannot be used and thus interaction    parameters for all particle pairs must be specified by the user     148 CHAPTER 11  DL MESO DPD FEATURES    11 4 1 Lennard Jones  1j     The Lennard Jones potential 30  is a mathematically simple model that approximates interactions  both attrac   tive a
213. nctions  sitting on each wall node  Zw   i e    filEw t    fj  Ew  t   5 11   where j is the opposite lattice link to 7  i e                 The reflection of distribution functions occurs on grid   On grid bounce back is a first order approximation of the boundary condition 45   i e  the error is proportional    to the lattice spacing Az  but it is completely local  i e  only uses distribution functions at the wall node      5 2 3 Mid grid bounce back    Like the on grid version  the mid grid bounce back condition applies a no slip condition at a boundary halfway  between lattice points 63   This is applied by assigning post collisional distribution functions to the wall node  based on those values at neighbouring points  i e     filGw t     fi Ew   EAt  tt    5 12     This method essentially applies the actual reflection halfway between timesteps and is a spatially second order  method  although it is weakly non local due to its use of distribution functions from neighbouring nodes     5 2 4 Constant pressure velocity    To specify either velocities or densities  pressures  at planar boundaries  the Zou He method 73  is available in  DL_MESO_LBE  This is based upon applying the bounce back rule to the non equilibrium distribution functions   1 e    EOS Gas   5 13     where qa   fi    fj   with the equilibrium distribution function ff  as a function of density and velocity  This  function can be used to determine the missing wall velocity or density along with the known dist
214. nd repulsive  between pairs of neutral atoms or molecules     U  rij    4eij  2  as  2   11 34     where       is the depth of the potential well and   g   is the finite distance at which the potential is zero between  particles i and j  This potential and its related force are calculated for all interparticle distances  r     less than  the interaction cutoff radius re  Long range system wide corrections to the potential and virial are required     g    ur   SPR     5ap NaN peas  Fe      11 35     a B gt a    12013 20     a a    wr   A 2     dap Na Nocas     ao os 773    11 36     a B gt a       where dag is the Kronecker delta  1 when a   8  0 when a 4 B  and Na the total number of particles of species  a  These corrections multiplied by the volume are stored in the array clr to eliminate the need to adjust them  if the system volume is changed by a barostat     11 4 2 Weeks Chandler Andersen  wca     The Weeks Chandler Andersen potential 69  is a modification of the Lennard Jones potential to produce purely  repulsive  short range interactions     R O    U  rij    4  ij om 0 H    ij   11 37   ij ij    1  This interaction is applied for interparticle distances up to 280    which should be less than or equal to the       interaction cutoff radius re  No long range corrections to potential energy or virials are required     11 4 3 Standard DPD  dpd     The Groot Warren  standard  form of DPD 16  uses the following purely repulsive  soft potential        1 ea NS  U  rij    gis
215. nd side2 are the domain dimensions     deportdata    e Header records  SUBROUTINE deportdata  nlimit     e Function  Applies deport of particles from boundary halos to neighbouring domains and or periodic boundary  conditions     e Dependencies    deport  Parallel version only     e Arguments    nlimit input output integer    deportdata_shear    e Header records  SUBROUTINE deportdata_shear  nlimit     e Function  Applies deport of particles from boundary halos to neighbouring domains and or periodic boundary  conditions with Lees Edwards shearing     e Dependencies  deport  Parallel version only     deport_shear  Parallel version only   e Arguments    nlimit input output integer    importdata    e Header records  SUBROUTINE importdata  nlimit     e Function  Applies import of particle forces from boundary halos of neighbouring domains and or across periodic    boundary conditions     200 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    e Dependencies    import  Parallel version only     e Arguments    nlimit input output integer    e Comments  This subroutine is applicable for integrators thermostats using single sets of particle forces  i e  standard  Velocity Verlet  Lowe Andersen  Peters      importdata_shear    e Header records  SUBROUTINE importdata_shear  nlimit     e Function  Applies import of particle forces from boundary halos of neighbouring domains and or across periodic    boundary conditions with Lees Edwards shearing     e Dependencies  import  Parallel version on
216. ndary fluid density lbbotp double  A lbsy nf  front boundary fluid density lbfrop double  A lbsy nf  back boundary fluid density lbbakp double  A lbsy nf  left boundary fluid density lblefp double  A lbsy nf  right boundary fluid density lbrigp double  A lbsy nf  initial composition lbinic double  A lbsy nc  top boundary composition lbtopc double  A lbsy nc  bottom boundary composition lbbotc double  A lbsy nc  front boundary composition lbfroc double  A lbsy nc  back boundary composition lbbakc double  A lbsy nc  left boundary composition lblefc double  A lbsy nc  right boundary composition lbrigc double  A 1bsy nc  initial temperature lbinit double   top boundary temperature lbtopt double   bottom boundary temperature lbbott double   front boundary temperature lbfrot double   back boundary temperature lbbakt double   left boundary temperature lbleft double   right boundary temperature lbrigt double   system heating rate lbsysdt double   top boundary heating rate lbtopdt double                42 CHAPTER 4  DL MESO LBE BASIC DEFINITION   Table 4 8  DL_MESO_LBE Parameters  continued    function parameter data type notation   bottom boundary heating rate lbbotdt double   front boundary heating rate lbfrodt double   back boundary heating rate lbbakdt double   left boundary heating rate lblefdt double   right boundary heating rate lbrigdt double   Boussinesq high temperature lbbousth double   Boussinesq low temperature 1bboustl double   fluid inverse relaxation time  Fe  lbtf dou
217. ndencies  lbin  spa data file  fReadSpace2D  fReadSpace3D    Arguments    filename input array of characters    Comments   The default file name is lbin spa  this can be changed by the user if the space data file has a different  name  If system is to be equilibrated  on grid bounce back is initially and temporarily used in place  all boundary conditions specifying fixed values for fluid velocities densities  solute concentrations and    temperatures     fReadInitialState    Header records    int fReadInitialState const char  filename  lbin init      Function  Reads initial velocities  densities  concentrations and temperatures from data file lbin  init and calculates    initial distribution functions     Dependencies  lbin init data file  fReadInitialState2D  fReadInitialState3D    Arguments    filename input array of characters    Comments   The default file name is lbin init  this can be changed by the user if the initial state data file has a  different name  This routine will replace the default values of all properties at specified points and should  be called after fInitializeSysten     fSetoffSteer    e Header records    int fSetoffSteer      e Function    Creates a file called notsteer to prevent DL_MESO_LBE from creating new 1bin sys and 1bin  spa files     which occurs if notsteer is missing      e Dependencies    None    e Comments    If the user has changed the input datafiles  the code will run with new parameters     7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 7
218. ndex  This algorithm requires  a modification to the collision step  at each lattice point all fluids are collided as a single fluid  which is then    segregated back out into the individual fluids     3 6 Summary of Lattice Boltzmann Equation    Lattice Boltzmann is an established numerical methodology for handling hydrodynamics in fluid  It is particu   larly suited to simulating systems with complex boundary conditions and is also suitable for systems with phase    transitions since mesoscale interactions can be merged into the method easily     Chapter 4    DL MESO LBE Basic Definition    4 1 Lattice models    DL_MESO LBE utilizes a right handed Cartesian coordinate system with the x axis from left to right in the  horizontal direction  the y axis from low to high in the vertical direction and z axis from back to front     D2Q9  D3Q15  D3Q19 and D3Q27 lattice models have been included  The speed vectors and weight factors are  arranged to allow the use of swap algorithms for propagation 43   The transformation matrices T for Multiple   Relaxation Time  MRT  schemes are included for each lattice  except D3Q27   along with the equilibrium  moments  M    41  expressed for the incompressible case  for the compressible case  pg is substituted with p       gt     collision operators  5   definition of bulk viscosity  1  and forcing source terms  5      D2Q9    Weight factor                                                                2 Wi   0 4  2 4 6 8 i  153 957   z  Speed 
219. ne to compile both sets  for use with the GUI   The latter can be invoked using the command    e make  f Makefile utils    Some further details on these utilities can be found in the README files in the source directories     B 1 DL_MESO LBE    lbeinitcreate    lbeinitcreate is a utility written in C   to create initialisation files  lbin init  to override the default  initial conditions  This utility can add fluid drops to the system  either circular in 2D or spherical in 3D  and    rectangular    sources    of specified solute concentrations or temperature to a system     If c   is the command for the available C   compiler  the executable init  exe can be produced by typing  e c    o init exe lbeinitcreate cpp    and run at the command line  init exe or   init exe      A pre existing 1bin sys file needs to exist in the directory where the utility is run  as this provides information  on the dimensions and size of the simulation system  the numbers of fluids and initial and constant densities for  each fluid  the number of solutes  whether or not a thermal lattice is included and the default initial velocity   This information is displayed on the screen when the utility is run  if no 1bin sys file can be found  an error    message will be displayed and the utility will terminate     If more than one fluid is specified in the lbin  sys file  the utility will then attempt to determine the continuous  fluid for the system from the initial densities and  if necessary  ask the u
220. nergy corrections for charged systems     ewald_frozen_slater    e Header records  SUBROUTINE ewald_frozen_slater    e Function  Calculates corrective forces  potential energies  virials and stress tensors to remove electrostatic interac     tions between charged frozen particles in the Ewald summation     e Dependencies  erfdp    images    e Comments  This routine uses a replicated data strategy to determine all electrostatic interactions between charged  frozen particles  If a simulation does not use a barostat  only one call prior to force calculations is required     it otherwise has to be called whenever the simulation volume changes     13 2 8 manybody_module    This module requires pre loading of the constants and variables modules     local_density    e Header records  SUBROUTINE local_density    13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 183    e Function    Calculates local densities for many body DPD interactions     e Dependencies    weight_rho    e Comments    Uses the parallel link cell structure to calculate local densities for each component     Pi  5 wP  rij       A    omitting self contributions for each particle 66      weight_rho    e Header records  REAL KIND dp  FUNCTION weight_rho  rrr     e Function    Calculates normalized weight function for local densities     e Dependencies    None    e Comments  The default weight function 68  is    which may be changed by the user     manybody_force    e Header records  SUBROUTINE manybody_force  i  j  k  rrr  
221. ng charge distribution f r   The current approach uses a Slater type distribution  i e     q 2r  Fr    e   7   11 52   where A is the decay length of the charge  This gives a potential energy between charged particles    and j of  Paid   U rij    2  1      1  Brij  exp    26ri     11 53        Arr     11 5  LONG RANGED ELECTROSTATIC  COULOMBIC  POTENTIALS 151    and the corresponding electrostatic force is      Pag  rig  Ex  rig    37 2 L exp    26rig   1   28ra   Bray    2  11 54   ij ij        e    where 6      For large particle separations these expressions reduce down to the standard expressions for  point charges and thus the reciprocal space part of the Ewald sum can be calculated without modification     The real space terms for the Ewald sum are modifications of the above expressions  evaluated for particle pairs  when the separation is less than the electrostatic short range  real space  cutoff  re  The short range potential    energy between particles i and j is given as          Taig   ust   PU erfe ari    1      1   Brij  exp    28ri     11 55   3 4TTij  and the pairwise force is  FPES     Tuay   20785 exp    a r      erfe arj      1     exp    26r     1   28r   1   Br  yy 5  11 56   ij 4rr   yT ij    ij a ij ij Tij 2    where a is a convergence parameter that controls the real space contribution  chosen to give negligible contribu     tions beyond the real space cutoff  If a calculational precision of e is required for the Ewald sum  the required      In ere  va
222. ng equilibration  temp scaling    interval   The latter can be set to zero if no temperature rescaling is required       The starting time step  save start  and the number of time steps between saves  save interval  of    trajectory data to HISTORY files for later visualization  The latter can be set to zero if no trajectory data  are required     The numbers of time steps between printing summaries in the OUTPUT file  print interval  and outputs  of statistical data  system energy  potential energies  pressure  temperature etc   to a plottable CORREL  file  plot interval   The latter value can be set to zero if no plot file is required     The number of time steps between dumps of system configurations to export files for simulation restarts   dump interval  and the percentage variation in particle density  density var  to allow for unevenly  distributed systems     The job time is the maximum  real  time that can be spent carrying out the DPD simulation  the close    time gives the time needed to write restart files and shut down the calculation in a controlled manner     The restart key for the simulation  this can either be set to none for a new simulation  a full restart  to continue a previous run using export  files  a new run which takes a starting state  particle positions  and velocities  for a new simulation from export  files  and rescaled does the same as a new run but  additionally rescales the particle velocities to give the specified system temperature     The
223. nged cutoff for interparticle potentials and forces  There is a need for processing units to  exchange    halo data     i e  sending the contents of link cells at the boundaries of each domain to neighbouring  units so each may have all the necessary information to compute pairwise forces acting on the particles in  its allotted domain  Similarly the force and virial contributions from particles in boundary halos need to be  returned to their original processing units for summation  The link cell algorithm is also applied in serial by  duplicating system data to create the boundary halo across periodic boundaries     The size of the boundary halo     which can be specified by the user in the CONTROL file     should not be greater  than the minimum system dimension per domain  for good parallel performance  it is recommended that the halo  size should be no larger than one third of the smallest subdomain dimension  The value of maxdim calculated  after reading the input files  in config_module  gives the maximum sizes of force  velocity and position arrays   This value should be large enough to hold all particles in each domain plus any particles in boundary halos   including duplicates when running in serial or using smaller numbers of processing units  If the density of  the system is likely to be uneven  the user can increase the size of maxdim by specifying an additional density  variation in the CONTROL file     11 1 1 Intramolecular interactions    Intramolecular interac
224. nown  or calculated  velocity for all fluids at the same boundary     DL MESO LBE includes implementations of the Inamuro boundary condition for all four lattice schemes  Only  planar surfaces can be dealt with using this method  as for constant pressure boundaries  concave edges and  corners use the equilibrium distribution function for the required concentration  temperature and the known or  calculated velocity  On grid bounce back is used for Neumann  zero gradient  conditions of solute concentrations  and or temperature to keep this type of boundary condition entirely local     5 3 Mesoscale interactions    DL_MESO_LBE includes a number of algorithms that can be used to apply interactions between fluid compo   nents at the mesoscale  most commonly to model immiscible fluids  The user should take care to ensure the    correct model is used for the type of system being modelled     If 1bin  init files are used to insert fluid drops into the simulation domain  DL MESO LBE includes the option  of carrying out equilibration to allow the shapes of drops to settle by modelling the system without external    5 3  MESOSCALE INTERACTIONS 51    body forces and boundaries imposing specific velocities  densities  solute concentrations or temperatures  This    option can be selected using the equilibration_step keyword in the lbin sys file     5 3 1 Shan Chen pseudopotential model    The Shan Chen model 55  56  models interactions between multiple phases and components by calculating 
225. ny    many body DPD interactions as universal mixing rules are unavailable for many body DPD parameters     234 APPENDIX C  DL MESO _DPD ERROR MESSAGES    Action  Check the FIELD file to ensure that unbonded interactions between every possible species pair is defined     Message 44  no interaction data in FIELD file for single species i  Unbonded interaction data between particle pairs of the same species    are unavailable in the FIELD file  mixing  rules to determine any missing interaction data thus cannot be applied     Action  Check the FIELD file to ensure that unbonded interactions exist for same species pairs     Message 45  zero reciprocal vector range for ewald sum    The maximum reciprocal vector  Mili has not been defined for systems requiring Ewald sum electrostatics     Action  Look in the CONTROL file and make sure the ewald directive includes the convergence parameter    and    the extents of the maximum reciprocal vector  k    ka and ks     Message 50  insufficient number of beads per node allocated for required initialization    The value of maxdim is not large enough to include the unbonded particles assigned to each processor for a new  simulation  without a CONFIG file      Action  This error is unlikely to happen as maxdim is calculated according to the numbers of particles and  processors available  but the user may wish to use the densvar directive in the CONTROL file to increase this    value     Message 51  discrepency in total number of starting bea
226. o  1 2 0   20   ul de  3 7    270       3 4  STRUCTURAL RELAXATION AND MACROSCOPIC EQUATIONS 25    Using Gaussian quadrature  Equation  3 7  changes into          v20p Ena  gt  ww 2      vee  sae  1 2 2 0   2 2  u  3 8   Let os  Da CE wes  3 9    276     and  fit   wip  1  2  E0   2   0   ul   3 10     The value of w  c   can be obtained from Gauss Hermite integration  Equation  3 10  is the equilibrium particle  distribution function in the discrete regime  w  is called the weight factor for speed vector ci  Equation  3 10     can also be written as        3 11     fo   wip E _  Gi    9      a  a    T  c2 2c4 2c     where c   v30   4  Shed is the modulus of the basic lattice vector and equivalent to the fluid speed of sound     e g  for water at 20  C  c   367 8 m s      3 4 Structural Relaxation and Macroscopic Equations    The Lattice Boltzmann method often uses the BGK  Bhatnagar  Gross and Krook  approximation 4  to describe  the structural relaxation  The single particle distribution function evolves to the equilibrium state via    fi  2      At  t  At    fi  z  t          fs   8  F  3 12     where Ty is called the relaxation time and is related to the kinetic viscosity of fluid  This evolution equation  can be divided into two separate processes of collision  where tt denotes a time after collision has taken place     A     fi    t       7   3 13   and propagation  or free streaming     fi  Z     At t  At    fi  2 4      3 14     To derive the macroscopic equations  th
227. o Gaussian random variables with zero mean and unity variance     sclsum    e Header records  REAL KIND dp  FUNCTION sclsum  n  a  i     e Function    Calculates the scalar sum of an array     e Dependencies    None    13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 171    e Arguments    n input integer  a input array of real KIND dp   i input integer    sclsum output  real KIND dp     erfcdp    e Header records  REAL KIND dp  FUNCTION erfcdp  x     e Function    Calculates the complementary error function for x  erfc x      e Dependencies    None    e Arguments  x input  real KIND dp   erfcdp output  real KIND dp     e Comments    This approximation for the function is based on a Chebyshev polynomial fitting 22      erfdp    e Header records  REAL  KIND dp  FUNCTION erfdp  x     e Function    Calculates the error function for x  erf x      e Dependencies  None    e Arguments  x input  real KIND dp   erfdp output real KIND dp     e Comments    This approximation for the function is based on a Chebyshev polynomial fitting 22      images    e Header records  SUBROUTINE images  dx  dy  dz  1x  ly  lz  shearx  sheary  shearz  sldx  sldy  sldz     e Function  Calculates the minimum distance between two particles in a periodic orthogonal box  adjusting for Lees     Edwards shear if necessary     e Dependencies  None    172    e Arguments    dx   dy   dz   1x   ly   1z  shearx  sheary  shearz  sldx  sldy  sldz    input  output  input  output  input  output  input  input  input  input  
228. obal identity numbers  from nusyst 1  to nsyst  are assigned to particles belonging to molecules  When particles are copied into boundary halos     the processor numbers and local particle numbers in their original processors are stored in the integer arrays    131    132    CHAPTER 10  DL MESO DPD BASIC DEFINITION    Table 10 1  System information                parameter   meaning   text name of calculation   nsyst total number of particles   nusyst total number of unbonded particles   nfsyst total number of frozen particles   nspe number of particle species   nmoldef number of molecule types   temp specified system temperature  kgT    prszero specified system pressure  Po    rcut interaction cutoff radius  re    rmbcut many body interaction cutoff radius  r      relec short range electrostatic interaction cutoff radius  re   sr  zcut surface repulsion cutoff distance  ze    rhalo size of boundary halo   nrun number of calculation timesteps   nseql number of equilibration timesteps   tstep duration of calculation timestep  At    timjob maximum time available to run calculation   tclose time required to shut down calculation   kres calculation restart parameter   nsbpo interval for printing data to OUTPUT file   ltraj switch for saving trajectory data to HISTORY file s   straj starting timestep saving trajectory data to HISTORY file s   ntraj interval for saving trajectory data to HISTORY file s   nstk size of statistical data stack   ltemp switch for temperature scaling bef
229. odic     Define initial condition  lbin init  This optional file cannot currently be created by the GUI  the user must create this file or use the utility    lbeinitcreate if it is required  The following format is required for each lattice point whose default velocity   fluid densities  solute concentrations or temperature needs replacing     0 lbsy nf   1 0 lbsy nc   1  X Y Z Uz Uy Uz p    p Y A add T    Note that three values for each grid position and velocity must be included  the values for z components in two   dimensional simulations must be set to zero   At each grid point specified  density  concentration temperature  values must be included for all lattices used in calculations  the total number of values in each line must be  equal to 6   1bsy nf   lbsy nc   lbsy nt     6 2 Output files    DL_MESO_LBE prints information about the simulation to the screen or standard output     e welcome messages    a description of the simulation to be carried out  e details of domain decomposition if running in parallel    e reports on the masses and momentum of fluids in the system at user specified intervals    a final summary including a calculation efficiency measure and a reminder to cite DL_MESO for any  published results    This information can be directed to a file specified at the command line  e g  by launching DL MESO_LBE    using the command    e   lbe exe  gt  OUTPUT    Snapshots of the simulation can be written in Structured Grid XML VTK  Structured Grid Legacy VTK 
230. odule requires preloading of the constants  variables  domain module  surface module  comms_module   error module  numeric_container and field module modules  Like the field module  different versions of    the subroutine  mdvv  dpdvv  lowe  peters  stoyanov  are available for each thermostat  integrator     verlet_     e Header records  SUBROUTINE verlet_   stage     e Function    Solves the equations of motion using the Velocity Verlet scheme  67      e Dependencies  hardreflect  deportdata  error  exportvelocitydata  DPD VV only   dragforces_dpdvv  DPD VV only   importforcedata  DPD VV only   global_sca_sca_int  global_sca_sca_dble  global_sum_int  Lowe  Peters  Stoyanov     e Arguments    stage input integer    e Comments  All versions of this subroutine use the standard Velocity Verlet algorithm to integrate the equations       de  _ F    dt mi  dj _  a       Both the MD VV and DPD VV algorithms use dissipative and random forces as the thermostat  with  the DPD VV algorithm repeating the calculation of dissipative forces at the end of the time step  The  Lowe Andersen  Peters and Stoyanov Groot thermostats are applied after all other forces are integrated     212    verlet_ _lang    e Header records    SUBROUTINE verlet_ _lang  stage     Function    CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    Solves the equations of motion using the Velocity Verlet scheme coupled with a Langevin barostat 29      Dependencies   hardreflect   deportdata   frozenbead   error   exportveloci
231. ody DPD interactions are not included and mixing rules are to be used between  unlike species  the file can subsequently be edited to remove extraneous definitions     4  The maximum interaction length between the two species  7       or cij  can be typed into this box and  set using the button SET I     5  The dissipative factor  7    or collision frequency  I    for the species pair  i e  the parameter for the  selected thermostat  can be typed into this box and set using the SET I button     18 CHAPTER 2  THE DL_MESO GUI    6  If a non periodic frozen bead surface is defined  the species of beads making up the walls can be selected  using this pull down box     7  The wall density of frozen beads can be typed into this box   This is greyed out if frozen bead walls are  not specified      8  The wall thickness of frozen beads can be typed into this box   This is greyed out if frozen bead walls  are not specified      The parameters for external force fields can be given in the pop up window shown in Figure 2 8 c      1  The type of external field to be used in the simulation     2  External field parameters  for constant gravitational fields  or similar constant external force fields   the x     y  and z components of gravitational acceleration  G  need to be specified  For linear shear boundaries     the x   y  and z components of the boundary velocity  V    need to be defined  although the component  orthogonal to the wall will be ignored in simulations     After filling 
232. ody interaction parameters per species pair can be specified  in the FIELD file     The many body DPD example provided with DL_MESO_DPD produces a van der Waals like equation of state    and can be used to model vapour liquid interfaces 68   The potential  excess free energy  per particle is given  by     4  ee To  _ Tr E  Y7  p    39 Ais    30 Pub   11 47     150 CHAPTER 11  DL MESO DPD FEATURES    where P is equivalent to p but with the cutoff set to re instead of rg  The associated pairwise force is equal to    FS   As  1 ES      Bi   pi   p3   1 13   T    11 48     Tc ij Pa Tij       In the routine provided  the terms with A    for both force and potential are calculated as though they are  standard DPD  By setting A    lt  0 and Bij  gt  0  a vapour liquid mixture can be modelled and its equation of    state for a single component is given as  p  pkgT   aAp    20 Br   p      cp   d     where a   0 101  c and d are numerical offsets  Parameters A   and B   for each interacting pair of species can  be specified in the FIELD file     11 5 Long ranged Electrostatic  Coulombic  Potentials    Compared to other interactions in DPD  electrostatic interactions act over considerably longer ranges  which  can also include periodic images of the system  The governing equation for finding the electric potential is the    Poisson equation  shown here in dimensionless form  15    V  PVY    Tp  11 49     where y is the electric potential  p the charge density  concentration of cations m
233. of particle 7  Additional pairwise forces may be    BD and ES are the conservative  drag and random  or stochastic  pair forces respectively  Each    included for more complicated systems  such as those involving chains of particles bonded together 52      The conservative interactions are usually    soft     i e  weakly interacting  so that the particles can pass by each  other  or even through each other  relatively easily so that equilibrium is achieved quickly  A common form of    interaction potential is an inverse parabola     2  1 Taj  V  rij      Aijle  1 a 2   9 4   2 Te  where rj     r      Til  re is a cutoff radius and Aj  is the interaction strength  A   may be the same for all    particle pairs or may be different for different particle types     Equation  9 4  gives rise to a repulsive force of the form    RO Cip Tii Tij   Tig   Fg   Arg  rij    Aij     1  man  9 5   ij c ij   This is the deterministic or conservative force ES exerted on particle i by particle j  Note the switching function   w    rij  and the force are zero when rj   gt  re and thus the particles have an effective diameter of 1 in units of    the cutoff radius re    The stochastic forces experienced by the particles is again pairwise in nature and takes the form  R 1 ij     OijWw  rij  Cig At 2      Tij    BR  bij     9 6   in which At is the time step and w     r j  is a switching function which imposes a finite limit on the range of  the stochastic force       is a random number with zero me
234. on engsic real KIND dp    charged system correction qfixv real KIND dp    Slater charge smearing coefficient  8  betaew real KIND dp    bond interaction parameter a aabond real KIND dp   A nbonddef   bond interaction parameter b bbbond real KIND dp   A nbonddef   bond interaction parameter c ccbond real KIND dp   A nbonddef   bond interaction parameter d ddbond real KIND dp   A nbonddef   angle interaction parameter a aaang real KIND dp   A nbonddef   angle interaction parameter b bbang real KIND dp   A nbonddef   angle interaction parameter c ccang real KIND dp   A nbonddef   angle interaction parameter d ddang real KIND dp   A nbonddef  dihedral interaction parameter a aadhd real KIND dp   A nbonddef  dihedral interaction parameter b bbdhd real KIND dp   A nbonddef  dihedral interaction parameter c ccdhd real KIND dp   A nbonddef  dihedral interaction parameter d dddhd real KIND dp   A nbonddef   bond types bdtype integer  A nbonddef   bond angle types angtype integer  A nbonddef   bond dihedral types dhdtype integer  A nbonddef  molecule isomer switch moliso logical  A nbonddef   bond table bndtbl integer  A numbond 3   bond angle table angtbl integer  A numang 4   bond dihedral table dhdtbl integer  A numdhd 5  global local particle number list lblclst integer  A maxdim  2  number of bonds in table nbonds integer   number of bond angles in table nangles integer   number of bond dihedrals in table ndiheds integer   number of entries in global local particle number list nli
235. onvective  flow fields at the final time step for a Prandtl number of 1 and a Rayleigh number of   10000        Es  Figure 8 10  Plot of fluid temperature for LBE 3D_RayleighBenard test case  scale  blue to red  with streamlines  depicting convective flow    Part II    Dissipative Particle Dynamics  DPD     125    Chapter 9    Dissipative Particle Dynamics  Basic Theory    9 1 Introduction    Dissipative Particle Dynamics  DPD  is an off lattice  discrete particle method for modelling mesoscopic systems   It has little in common with Lattice Boltzmann methods  except in its application to systems of similar length    and time scales     The DPD method inherits its methodology from classical Molecular Dynamics  MD   particularly from Brownian  Dynamics  BD   It differs from BD  however  in an important way  it is Galilean invariant and for this reason  conserves hydrodynamic behaviour  while the BD method does not  Many systems are crucially dependent on  hydrodynamic interactions and it is essential to retain this feature in the model  DPD is particularly useful for  simulating systems on the near molecular scale  such as polymers  biopolymers  lipids  emulsions and surfactants      systems in which large scale structure evolves on a time scale that is too long to be modelled effectively by  MD  DPD may also be used when such systems experience shear and flow gradients     The DPD algorithm can be summarized by the following     A condensed phase system may be modelled as a s
236. or wall normal to z axis npzfwz integer   frozen bead density of walls frzwdens real KIND dp    width of frozen bead wall normal to x axis frzwxwid real KIND dp    width of frozen bead wall normal to y axis frzwywid real KIND dp    width of frozen bead wall normal to z axis frzwzwid real KIND dp    x component of external body acceleration per particle bdfrcx real KIND dp        138 CHAPTER 10  DL MESO DPD BASIC DEFINITION    Table 10 4  DL _MESO_DPD Parameters  continued                                function parameter data type notation  y component of external body acceleration per particle bdfrcy real KIND dp    z component of external body acceleration per particle bdfrez real KIND dp    x component of Lees Edwards shearing velocity shrvx real KIND dp    y component of Lees Edwards shearing velocity shrvy real KIND dp    z component of Lees Edwards shearing velocity shrvz real KIND dp    x component of Lees Edwards shearing displacement shrdx real KIND dp    y component of Lees Edwards shearing displacement shrdy real KIND dp    z component of Lees Edwards shearing displacement shrdz real KIND dp    force x component on particle   xx real KIND dp   A maxdim  force y component on particle fyy real KIND dp   A maxdim  force z component on particle fzz real KIND dp   A maxdim  variable force z component on particle fvx  real KIND dp   A maxdim  variable force y component on particle fvy real KIND dp   A maxdim  variable force z component on particle fvz real KIND dp   A ma
237. orce    e Header records  SUBROUTINE angle force  angtype  theta  rab  rcb  a  b  c  d  force  potential  virial  dfab   dfcb     e Function    Determines the bond angle force  potential energy and virial across a triple of bonded particles     e Dependencies    None    13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 187    e Arguments          angtype input integer   theta input  real KIND dp   rab input  real KIND dp   rcb input  real KIND dp   a input  real KIND dp   b input  real KIND dp   c input real KIND dp   d input real KIND dp   force output real KIND dp   potential output real KIND dp   virial output real KIND dp   dfab output real KIND dp   dfcb output real KIND dp     e Comments  If required  the user can add extra bond angle interaction types in this subroutine as additional cases     this would also require changes to read_control in config_module     dihedral_force    e Header records  SUBROUTINE dihedral_force  dhdtype  phi  pb  pc  a  b  c  d  force  potential     e Function    Determines the bond dihedral force and potential energy across a quadruple of bonded particles     e Dependencies    None    e Arguments  dhdtype input integer          phi input  real KIND dp   pb input  real KIND dp   pc input  real KIND dp   a input  real KIND dp   b input  real KIND dp   c input real KIND dp   d input real KIND dp   force output real KIND dp   potential output real KIND dp     e Comments  If required  the user can add extra bond dihedral  and improper dihedral  inter
238. ords  where necessary   and numerical values separated from each other with spaces or tabs     Define system  lbin sys    The use of the DL_MESO GUI is recommended for producing 1bin  sys  although existing files of that name can  also be edited  Its format consists of a keyword and an associated numerical parameter on each line separated  by spaces or tabs  No allowances are made for typographical errors or abbreviations in keywords  which must    be included in full and in the form described below     Ten keywords are compulsory for all LBE simulations  as these determine the lattice scheme to be used  the    number of lattices to use  and the sizes of the system and boundary regions     keyword  meaning    space dimension sets the number of dimensions in the system  2 or 3    discrete_speed sets the number of lattice links per grid point  9  15  19 or 27    number_of fluid sets the number of fluid lattices for the system  if modelling solutes  this must  be set to 1    number of solute sets the number of solutes to be modelled   temperature_scalar determines whether or not a lattice is needed to model heat transfers  set to 1  if needed  0 if not    phase_field determines whether or not a lattice is needed to represent phase fields  set to  1 if needed  0 if not     grid number_x sets the number of grid points in the z dimension   grid_number_y sets the number of grid points in the y  dimension   grid_number_z sets the number of grid points in the 2 dimension  if a two dim
239. ore equilibration  nsbts interval for temperature scaling   lcorr switch for saving statistical data to CORREL file  iscorr interval for saving statistical data to CORREL file  itype integrator  thermostat selection   btype barostat selection   etype electrostatic algorithm selection   srftype surface boundary selection   lbond switch for modelling bonds between particles  langle switch for modelling bond angles   ldihed switch for modelling bond dihedrals   lgbnd switch for globally storing all bond data   lisoprs switch for isotropic variation of system dimensions with pressure       Imp i  and loc i  respectively  Numbers representing species and molecule types are stored in arrays 1tp  i   and 1tm i   which are used to assign particle masses and the names of particles and molecules respectively to    the arrays weight  i   atmnam i  and molnam i      All of these arrays are allocatable and their sizes set equal to maxdim  which is an estimate of the maximum  possible number of particles likely to be stored in each processor based on the total number of particles  the  numbers of available link cells and the number of processors available  Since the calculation for this parameter  makes the assumption that the particle density is constant throughout the system  possible variations in density  can be specified by the user and taken into account when calculating maxdim  A similar parameter  maxpair   is also calculated to determine the maximum possible number of particle pai
240. os  ypos  zpos   The latter two are more readable to the    user but a bit slower to carry out     fGet Tot MassSite    e Header records  two cases   double fGetTotMassSite double  startpos   double fGetTotMassSite long tpos     e Function    Calculates the total mass density of all fluids at a grid point     e Dependencies    None    e Arguments  startpos input double pointer  tpos input long integer  fGetTotMassSite output double precision  e Comments    Mass density is calculated according to the definition p    gt  gt   fi  The second case carries out the same  calculation as the first but using tpos for the grid point     70 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    fGetOneMassDomain    e Header records    double fGetOneMassDomain int fpos     e Function  Calculates the total mass of fpos th fluid in the domain     e Dependencies    None    e Arguments  fpos input integer  fGetOneMassDomain output double precision  e Comments  The total mass of the domain does not include boundary areas used for message passing or nodes used to    apply boundary conditions     fGet TotMassDomain    e Header records  double fGetTotMassDomain      e Function    Calculates the total mass of all fluids in the domain     e Dependencies  None    e Arguments    fGetTotMassDomain output double precision    e Comments  The total mass of the domain does not include boundary areas used for message passing or nodes used to  apply boundary conditions     fGetFracSite    e Header records  three cas
241. ot read CONFIG file   The supplied CONFIG file cannot be read by DL_MESO_DPD  it might have been corrupted   Action  Check the CONFIG file to ensure it is complete and in ANSI  text  format    Message 20  missing CONTROL file   No input file named CONTROL can be found    Action  Make sure there is a CONTROL file in the same directory as the DL_MESO_DPD executable   Message 21  cannot read CONTROL file   The supplied CONTROL file cannot be read by DL_MESO_DPD  it might have been corrupted   Action  Check the CONTROL file to ensure it is complete and in ANSI  text  format    Message 30  missing FIELD file   No input file named FIELD can be found    Action  Make sure there is a FIELD file in the same directory as the DL_MESO_DPD executable   Message 31  cannot read FIELD file   The supplied FIELD file cannot be read by DL _MESO_DPD  it might have been corrupted   Action  Check the FIELD file to ensure it is complete and in ANST  text  format    Message 32  unrecognised bond type defined in FIELD file    A bond type not included in Table 12 3 has been found in the FIELD file     Action  Check the FIELD file to ensure all bond types are valid  if adding a new bond type to DL_MESO_DPD     the scan field and read field routines in config_module need to be modified     Message 33  unrecognised bond angle type defined in FIELD file    A bond angle type not included in Table 12 4 has been found in the FIELD file     Action  Check the FIELD file to ensure all bond angle types are valid 
242. ottom boundary speed  in lattice units   i e  at the minimum y value for the grid   The specified left boundary speed  in lattice units   i e  at the minimum x value for the grid   The specified right boundary speed  in lattice units   i e  at the maximum zx value for the grid     The specified front boundary speed  in lattice units   i e  at the maximum z value for the grid  For  two dimensional systems this can be omitted and is thus greyed out     14    15     16     17     18     Ka    CHAPTER 2  THE DL_MESO GUI      The specified back boundary speed  in lattice units   i e  at the minimum z value for the grid  For    two dimensional systems this can be omitted and is thus greyed out     The noise magnitude only has an effect for initializing multiple phase simulations  DL_MESO_LBE may  include either a phase field parameter or no phase field parameter for systems with multiple phases   neither mesophase algorithm requires it and thus this option is currently disabled     The number of fluids  phases  can be increased if a multiple fluid system is to be studied  up to 6  fluids may be modelled in DL MESO_LBE  The parameters and boundary conditions for the fluid s  must  then be set by clicking the set fluid parameters button     see below for more details     The number of solutes needs changing if solute parameters are required  if the number of solutes is  greater than zero  and up to 6   the number of fluids in the above row must be set to 0 or 1  If used  the  paramet
243. ource terms are to be used  the vector S for    this lattice scheme is defined as  0    6 uz Fs   uy Fy      6 uz Fr   uy Fy    Fo    F   Fy    f  2 Ua Fy     UyFy    Ug Fy   Uy Py    Y  II    Similar schemes are available for the D3Q15 and D3Q19 lattices  there is currently no MRT scheme available  for D3Q27   The MRT schemes without source terms can be applied using fCollisionMRT  while the schemes    with Guo like moment transformed source terms can be invoked using fCollisionMRTGuo     5 1 2 Propagation algorithms    The simplest implementation  the two lattice algorithm  involves the use of a temporary array  1bft  to copy  post collisional distribution functions to their new positions  which are subsequently copied back to the main  distribution function array 1bf  While this particular method is clear  easy to understand and can be applied  throughout the system   s lattice points in any order  its drawbacks include the use of two loops for propagation    48 CHAPTER 5  DL MESO_LBE FEATURES    and array copying  two large arrays for the distribution functions at each lattice node and significant amounts of  time expended in memory access  If the user wishes to use this method  the routine fPropagationTwoLattice    is available     An alternative  more efficient implementation of propagation is the swap algorithm 43   whereby this process  is carried out by systematic swapping of pairs of collided distribution function values  To make this easier to  implement  the latti
244. p 0     e Function  Outputs macroscopic mass density of fluid iprop and velocity  speeds along x   y  and z directions  at  each lattice point for system in Plot3D format     e Dependencies  fOutputQP2D  fOutputQP3D    e Arguments  filename input array of characters    iprop input integer    e Comments  The default output file name is 1bout  q and the density of fluid O is output by default  This can be  changed by specifying an output file name and fluid number  up to 1bsy nf   1  when calling the routine     fOutputQCA    e Header records    int fOutputQCA const char  filename  1bout   int iprop 0     e Function  Outputs mass fraction of fluid iprop and speeds along x   y  and z directions at each lattice point for    system in Plot3D format     e Dependencies  fOutputQCA2D  fOutputQCA3D    e Arguments  filename input array of characters    iprop input integer    e Comments  The default output file name is 1bout  q and the mass fraction of fluid 0 is output by default  These  can be changed by specifying an output file name and fluid number  up to 1bsy nf   1  when calling the    routine     fOutputQCB    e Header records    int fOutputQCB const char  filename  lbout   int iprop 0     e Function  Outputs concentration of solute iprop and fluid velocity at each lattice point for system in Plot3D format     e Dependencies  fOutputQcB2D  fOutputQCB3D    7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 81    e Arguments  filename input array of characters    iprop input integer    e 
245. p interval  ooo     density var      bo    11  job time  s    3600 0   close time  s   Roo    12  restart key  13    thermostat   barostat     electrostatics            surface     e   v  o   gt   F  QEJEJEJE    O global bonds    ignore CONFIG    override index        00          Figure 2 5  Define DPD System    2 3 1 1 Thermostat  barostat  electrostatic and surface parameters    Examples of the pop up windows for thermostat  barostat  electrostatic and surface parameters can be seen in  Figure 2 6 with the rows labelled in red numbering  multiple columns of dialogue boxes are made available for    systems with multiple species     The thermostat pop up window is formatted as in Figure 2 6 a      1  The type of thermostat to be used in the simulation   2  Thermostat parameters  for the Stoyanov Groot thermostat  currently the only type that requires an  additional parameter   a global coupling parameter for the Nos   Hoover part  a  is required     Figure 2 6 b  gives the layout for the barostat pop up window     1  The type of barostat to be used in the simulation     2  Barostat parameters  for the Langevin barostat  a barostat relaxation time  7   and piston drag  coefficient  yp  are required  while the Berendsen barostat requires the compressibility  relaxation  o  8  ratio i   3  This check box determines whether or not an isotropic system  i e  one where pressure acts uniformly  in all dimensions  should be modelled  If unchecked  the barostat will act differently in 
246. particles are selected and used     134 CHAPTER 10  DL MESO DPD BASIC DEFINITION    10 2 The Parameters and Their Functions    Table 10 4 lists all the globally used parameters defined in DL_MESO_DPD  as given in the constants   variables and numeric_container modules  Because DL_MESO is an ongoing project and new parame   ters might be added to the package in the future  it is strongly recommended that users of DL_MESO check the  names of any self defined variables whenever the package is updated to reduce the possibility of duplications    causing unexpected errors     The notation column in Table 10 4 gives the restrictions applicable on the parameters     A    indicates an array  of data  followed by the number of elements in the array  For example     A maxdim    means the parameter is  actually an array with maxdim elements  numbered from 1 to maxdim       gt  1    means the number must be greater  or equal to one  while for a Boolean parameter    T or F    means its value can either be  true  or  false   An    asterisk in the data type for the array indicates that it is allocatable and defined during the run     10 2  THE PARAMETERS AND THEIR FUNCTIONS    Table 10 4  DL_MESO_DPD Parameters    135                            function parameter data type notation  kind parameter for double precision numbers dp integer   kind parameter for long integers di  integer   maximum word length mxword integer   I O channel for reading input files nread integer   I O channel for wr
247. party and that third party needs  to use the DL_MESO Software in connection with that  collaboration  or if the Licensee wishes to make the DL_MESO  Software available online to any third party for Academic  Purposes  the Licensee must direct that third party to the  DL_MESO Website  That third party may use the DL_MESO Software  and any Derived Work  whether obtained from STFC or from the  Licensee  only if it has completed the registration process on  the DL_MESO Website and agreed to the terms and conditions of the  Licence Agreement for the use of the DL_MESO Software for  Academic Purposes that then appear on the DL_MESO Website     This Licence Agreement allows the Licensee to use only the  release or version of the DL_MESO Software downloaded by the  Licensee from the DL_MESO Website immediately after the Licensee  agrees to the terms and conditions of this Licence Agreement  the  Licensee must acquire a new licence for any future release or  version of the DL_MESO Software that it wishes to use     The Licensee will not tamper with  or remove  any copyright or  other proprietary notice or any disclaimer that appears on or in  any part of the DL_MESO Software  and will reproduce the same in  all copies of any of the DL_MESO Software and in all Derived  Works     3  WARRANTIES AND LIABILITY    3 1    3 2    The DL_MESO Software is provided for Academic Purposes free of  charge  Therefore STFC gives no warranty and makes no  representation in relation to the DL_MESO Soft
248. peeds along x   y  and z directions  at each lattice point  of compressible fluid iprop for system in Structured Grid Legacy VTK format     Dependencies  fOutputLegacyVTKP2D  fOutputLegacyVTKP3D  Arguments  filename input array of characters  iprop input integer  Comments    The default output file name is lbout  vtk and the density of fluid 0 is output by default  This can be  changed by specifying an output file name and fluid number  up to 1bsy nf   1  when calling the routine     fOutputLegacyVTKCA    e Header records    int fOutputLegacyVTKCA const char  filename  lbout   int iprop 0     Function  Outputs mass fraction of fluid iprop and speeds along x   y  and z directions at each lattice point for  system in Structured Grid Legacy VTK format     Dependencies  fOutputLegacyVTKCA2D  fOutputLegacyVTKCA3D  Arguments  filename input array of characters  iprop input integer  Comments    The default output file name is lbout  vtk and the mass fraction of fluid 0 is output by default  These  can be changed by specifying an output file name and fluid number  up to 1bsy nf   1  when calling the    routine     fOutputLegacy VTKCB    e Header records    int fOutputLegacyVTKCB const char  filename  lbout   int iprop 0     e Function    Outputs concentration of solute iprop and fluid velocity at each lattice point for system in Structured  Grid Legacy VTK format     e Dependencies    fOutputLegacyVTIKCB2D  fOutputLegacyVTKCB3D    e Arguments    filename input array of characters    
249. periodic walls orthogonal to i axis  x  y  z  if specified   a single wall can be specified and only the first specified dimension will be used   set required simulation temperature  kgT  to f  target temperature for con   stant temperature ensembles    write trajectory data to HISTORY file s  with controls      start timestep for  dumping configurations  default  equilibration time   j   timestep interval    between configurations    timestep f set timestep to f time units  volume f    f2 f3  set system size to either cubic volume f   or orthorhombic dimensions  fi  fa   fs     While not every directive has to be included in the CONTROL file for a valid simulation and many hold default  values if unspecified  the following are mandatory and must be set to values greater than zero     cutoff    temperature    timestep    volume  if no CONFIG file is available     Superfluous parameters and switches for particular systems  e g  specified pressure for constant volume simu   lations  can be safely omitted from the CONTROL file without causing runtime problems  If the user wishes to  include new directives in the CONTROL file  modifications to the parameter recognition loop in the read_config    subroutine  config module  will be required     Define interactions  FIELD    The FIELD file contains the species and force field information required for both bonded and unbonded interac   tions  and is read by the read_field and scan_field subroutines in config_module  Apart from the na
250. placing the result on processor nod     e Dependencies    None    e Arguments    iii input output array of logical  nnn input integer  nod input integer  idnode input integer    e Comments  For Boolean scalars  the alternative SUBROUTINE global_sca_and  iii  nod  idnode  is available     global_and_all    e Header records  SUBROUTINE global_and_all  iii  nnn     e Function  Finds global logical AND from a Boolean array iii   of size nnn and broadcasts result to all processors     e Dependencies    None    e Arguments  iii input output array of logical  nnn input integer  e Comments  For Boolean scalars  the alternative SUBROUTINE global_sca_and_all  iii  is available     global_sum_dble    e Header records  SUBROUTINE global_sum_dble  aaa  nnn     e Function    Globally sums double precision array aaa   of size nnn     174 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    e Dependencies    None    e Arguments  aaa input output array of real KIND dp     nnn input integer    e Comments  For double precision scalars  the alternative SUBROUTINE global_sca_sum_dble  aaa  is available     global_sum_int    e Header records  SUBROUTINE global_sum_int  iii  nnn     e Function    Globally sums integer array iii   of size nnn     e Dependencies    None    e Arguments  iii input output array of integers    non input integer    e Comments  For integer scalars  the alternative SUBROUTINE global_sca_sum_int  iii  is available     global_sca_max_dble    e Header records  SUBROUTINE global_sca_ma
251. pletion     e If the compilation fails  you may need to edit the code  An editing panel is available for this purpose  using either the Change LBE Code or Change DPD code buttons  Its function is similar to the  compilation panel in operation with a choice of text editors  including one packaged with the DL_MESO  GUL         The files in the LBE code that can be edited include the parallel and serial main files  the lattice  model file  the boundary condition file  the core routines for LBE calculations  the file for user   defined routines  the main head file and the head file for user defined routines  Others can be edited  by selecting other and typing the name of the file in the neighbouring box         The files in the DPD code that may be edited include the main program  constants  global variables  and the modules configuration  start  for system initialization   field  for force calculations   bond  interactions  many body DPD  surfaces and statistics  Other code files can be edited by selecting  other and typing the name in the neighbouring box     2 5  NOTES 19    2 5    Running the LBE DPD code is made possible through the Run LBE Program or Run DPD Program  button  which activates a panel that allows you to select the required submission command and then submit  the job  You may need to create a suitable run script in your working directory beforehand if running the  job in parallel     Collecting data from multiple processors and processing it for visualization i
252. put would be welcome nevertheless     1 2 1 Lattice Boltzmann Equation    DL_MESO_LBE can simulate lattice gas systems using the Lattice Boltzmann Equation  LBE   The following    properties and features are currently available     e Multiple fluid components  solutes and coupled heat transfers 72     e Collisions  Bhatnagar Gross Krook  BGK  single relaxation time 4  or Multiple Relaxation Time  MRT  33   8     e Boundary conditions  Periodic  bounce back  including stationary objects   constant pressure velocity at    planar surfaces 73     CHAPTER 1  DL MESO GENERAL INFORMATION    Mesoscale interactions  Shan Chen pseudopotential method 55  56   Lishchuk continuum based method 35     Initial conditions can either be determined by DL_MESO_LBE or specified by the user    1 2 2 Dissipative Particle Dynamics    DL_MESO_DPD can model DPD particles     beads     with soft or hard potential fields  along with thermostatting  dissipative and random forces  The following properties and features are currently available     1 3    Choice of integrators thermostats  standard Velocity Verlet  DPD Velocity Verlet 13   Lowe Andersen 36    Peters 47  and Stoyanov Groot 62     Constant volume  NVT  or constant pressure  NPT  simulations with Berendsen 2  or Langevin 29     barostats    User selection of interaction lengths  conservative and dissipative force parameters for each species and    between unlike species  Bond stretching  angles and dihedrals between beads in user defined    mol
253. r DPD Velocity Verlet algorithm  with Lees Edwards shearing     e Dependencies  error  msg_receive_unblocked  msg_receive_sca_blocked  msg_send_blocked  msg_send_sca_blocked    msg_wait    e Arguments  nlimit input output integer          mdir input integer   begin input real KIND dp   final input real KIND dp   shove input real KIND dp   shovel input real KIND dp   shove2 input real KIND dp   sidel input real KIND dp   side2 input real KIND dp     e Comments  Only exists in parallel version of DL_MESO_DPD  This routine requires information for the two dimensions  along the surface of the shearing boundary  the variables shove1 and shove2 represent the displacement    due to shear  while side1 and side2 are the domain dimensions     exportdensity    e Header records  SUBROUTINE exportdensity  nlimit  mdir  mp  begin  final  shove   Parallel version   SUBROUTINE exportdensity  nlimit  mdir  begin  final   Serial version     198 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    e Function  Exports particle data  local densities  to neighbouring domain as boundary halo for calculation of many     body DPD interaction forces     e Dependencies  error  global_sca_and_all  Parallel version only   msg_receive_unblocked  Parallel version only   msg_receive_sca_blocked  Parallel version only   msg_send_blocked  Parallel version only   msg_send_sca_blocked  Parallel version only     msg_wait  Parallel version only     e Arguments  nlimit input output integer    mdir input integer  mp input 
254. r interactions and used to define  the maximum sizes of arrays for storing information for thermostats that correct particle velocities after force    integration  i e  Lowe Andersen  Peters and Stoyanov Groot     Bonded particles are listed by global identity numbers in the integer array bndtb1 i j  for bond i  with  j 1 representing the first particle in the pair  j 2 for the second and j 3 giving the user defined bond type   The location of the first particle in each bond pair determines the processing unit which holds this data  thus    movement of this reference particle across processes also causes the bond list entry to be transferred with it     10 1  DATA STRUCTURE    133    Table 10 2  Domain information                      parameter   meaning  idnode name of the processor  nodes number of processors  idx x coordinate of the processor  idy y coordinate of the processor  idz z coordinate of the processor  npx number of processors along x axis  npy number of processors along y axis  npz number of processors along z axis  volm volume of system  dimx size of system in x dimension  dimy size of system in y dimension  dimz size of system in z dimension  sidex size of domain in x dimension  sidey size of domain in y dimension  sidez size of domain in z dimension  delx absolute x coordinate of domain origin  dely absolute y coordinate of domain origin  delz absolute z coordinate of domain origin  nlx number of link cells in domain along x axis  nly number of link cells in 
255. ractions between particles    2    aa 152  TET Suttace interactions toa la e a A e al ee A a a a aa 155  12 DL_MESO_DPD Input and Output Files 157  Pa Input  les tf hc AA A a a a AS A E ARA A A a F 157  122  Output tiles   r esisi ek A AA ee i  ee ee a 164  13 DL_MESO_DPD Package Reference 167  ABs CVCLVICWS o ONS  heen ete eS onda DAR OD eee a ee tee eh eS 167  13 2 DL_MESO_DPD Subroutines and Functions            e    168  14 DL_MESO DPD Examples 215    14 1 Mixture_Small    CONTENTS 111    C    D       14 2  Maxtur  liarge dc ari aa A AA A a aE a a A we dd Das 215  14 3    PhaseSeparation    24 04 a ca a A da a a da a ee ala 216  TAA APOT a A a A A ed ene bt E E A aS 216  145  Polyelectrolyte  E mi   nuk dd ta a A A a a ee et 217  14 6 AmphiphileMesophases 2    0  0 ee 217  14 7 VesicleFormation  io a ee  a e ee eee A Po ae ee 218  14 8  PoiscuilleFloW e aoa a Re ok ba ede FOR eh ane eh ee ee RO 219  14 9     Shear Elow sa iaa BR  Bo ed he BAG i eee ele tae Bo ae Oe ee GA 219  14 10 Vapour liquids  lt s 25 os Boe o A tok A ee Boe ie he ak eg et 220  Manual compiliation and running of DL_MESO 221  Ant  SDE MES OU BES to a AE A Bae a a ae ome lene de o ELE A 221  AQ DE MESO DPD ii way ee ee a Se bol BR A ee ee  Re a 222  DL_MESO Utilities 225  BL   DE MESOLUBE   amp  222408 Site ae a BAe ws aoe SYP A eee i GS A ke ee di 225  B 2  DLMESO DPD a i Sak Sh ae ee ha es ee RS AS yt  o Reh Geta ek  Bo 227  DL_MESO_DPD Error Messages 231  DL_MESO Licence Agreement  Academic Purposes 
256. replicated data strategy to carry out the velocity corrections  this  requires additional memory on each processing unit for the velocities of all particles and the data required to  modify the velocities of particle pairs  The efficiency of the Lowe Andersen thermostat thus decreases with    increasing numbers of particles in the entire system and I     11 2 4 Peters thermostat  peters     The Peters thermostat 47  is a modification of the Lowe Andersen thermostat that reduces to standard DPD as  the time step tends to zero  After integrating all forces using the Velocity Verlet scheme  all particle pairs have  their velocities modified  in a random order  using        I   Vi   Ui AS  ass    s  4 Vij  At  F big Gig V At    i  11 10   Mi  1   Uj   Uj   Ti   as  tes d Tiz  At Tr big Gig V At  Ci   1 11     where the coefficients as  and b   are chosen so that      A  bij   2kgTaij  1   is Z       215     To ensure that the thermostat both reduces to the DPD thermostat as the time step reduces to zero and is not          restricted by the choice of time step  the coefficients are chosen as follows              Hg Yijw rij At  tij   Ai  1 exp    11 12   kBT hi  27 50  rij  At  bi    1 11 1  i FH  1exp       11 13     The above velocity corrections give an equivalent thermostatting force of        gt  Ra bis Giz a  Fi     mas  es    Uiz       se   Cij  11 14     and a correction to the virial of FE   Tij is also applied for each particle pair     This thermostat can be used with 
257. return  a lt lbevaplim  0 a     e Function    Returns zero for values of a less than the specified evaporation limit 1bevaplim     e Dependencies    None    e Arguments  a input any datatype  fEvapLimit output same datatype asa    e Comments  This function is used to eliminate spurious production of non continuous fluids at boundary edges and  corners  The default value of lbevaplim  1078  can be overridden by the user     fSwapPair    e Header records  template  lt class T gt  void fSwapPair   T  a  T amp  b     e Function    Swaps pair of numbers  a and b     e Dependencies    None    e Arguments  a input output any datatype  b input output any datatype    fGet NumberOrdered    e Header records  two cases   int fGetNumberOrdered int  amp iox  int  amp ioy  int  amp ioz     int fGetNumberOrdered int  amp iox  int  amp ioy     e Function    Rearrange the integers in descending order     e Dependencies    None    7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 65    e Arguments  iox input output integer reference  ioy input output integer reference    ioz input output integer reference    fGet Number OrderFixed    e Header records  two cases   int fGetNumberOrderFixed int  amp iox  int  amp ioy  int  amp ioz  int ix  int iy  int iz     int fGetNumberOrderFixed int  amp iox  int  amp ioy  int ix  int iy     e Function    Rearrange a set of integers so they appear in the same order as another set of integers     e Dependencies    GetNumberOrdered    e Arguments  iox input output inte
258. rguments  xpos input integer  ypos input integer    zpos input integer    e Comments  Further details can be found in  35  20      fInteractionForceLishchuk    e Header records    int fInteractionForceLishchuk       e Function  Calculates interaction forces for all fluids based on the Lishchuk model 35  20      7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 95    e Dependencies    fCalcInteraction_Lishchuk    e Comments    The phase indices need to be calculated prior to calling this routine     fCalcForce_Boussinesq    e Header records    int fCalcForce Boussinesq long tpos  double temph  double templ     e Function    Calculates buoyancy driven thermal convection force according to the Boussinesq approximation     e Dependencies  fGetOneMassSite  fGetTemperatureSite    e Arguments  tpos input long integer  temph input double precision    templ input double precision    e Comments    The buoyancy force for compressible fluids calculated by this routine is    na  gt 24 T     To  7   00  7 h        with the reference temperature To    gt   Tn  T    The expression for incompressible fluids is similar with  the constant fluid density po substituted for p     fConvectionForceBoussinesq    e Header records    int fConvectionForceBoussinesq double temph  double templ     e Function    Calculates Boussinesq thermal convection forces for all fluids based on  18      e Dependencies    fCalcForce Boussinesq    e Arguments  temph input double precision    templ input double precision    7 2
259. ribution function  values  For instance  for a top edge with a known velocity 7  using the D2Q9 lattice scheme  V  CEDF    the    wall density and missing distribution functions  all for the boundary node at Zw  are given as     fot f2   fet2 fi t fr t  fs                   1  Voy  20w0  fi  i ie aw    s   fr fo fe  PV Dilo  fs   fi fo f2  H Pb   PwUw y       1      denotes any valid letters for the solute composition and temperature     50 CHAPTER 5  DL MESO_LBE FEATURES    The other form  specifying the wall fluid density  requires the calculation of the wall velocity  which can be  simplified by setting non orthogonal velocity components to zero  For the analogous example at the top wall  for D2Q9  P  CEDF   the same equations for f4  f3 and fs can be used together with    PwUVw x   0  Pu Uwy   fo   fo   fe   2 fi   fz   fs      Pw     One complication for three dimensional lattices is the requirement to apply the non equilibrium bounce back  to all unknown distribution functions  which ordinarily overspecifies the system but can be counteracted using  transverse momentum corrections for directions other than orthogonal to the boundary  which are non zero for  e g  shearing flows  It should be noted that if the wall velocity is set to zero  the boundary condition reduces  to on grid bounce back     DL_MESO_LBE includes implementations of the Zou He boundary condition for all four lattice schemes  D2Q9   D3Q15  D3Q19 and D3Q27  Only planar surfaces can be dealt with using t
260. rintDoubleLine      e Function    Prints a line of 76   characters     e Dependencies    None    fRandom    e Header records  double fRandom      e Function    Creates a double precision random number between    1 and 1     e Dependencies  None    e Arguments    fRandom output double precision    e Comments    There is a built in seed in the function  which is only activated when the function is initially called     7 2  DL MESO _LBE SUBROUTINES AND FUNCTIONS 67    fBigEndian    e Header records  int fBigEndian      e Function    Determines endianness for machine  returns 1 for big endian  0 for little endian     e Dependencies    None    fByteSwap    e Header records    void fByteSwap void  data  int len  int count     e Function  Converts between endian types by swapping byte order of array data  with byte size per entry len and    count entries      e Dependencies    None    e Arguments  data input output void  len input integer    count input integer    e Comments  Primarily required for writing binary files where a specific endianness is required  e g   vtk files are    required in big endian     fCheckTimeSerial    e Header records  double fCheckTimeSerial       e Function    Outputs time in seconds since initial call     e Dependencies    None    e Arguments    fCheckTimeSerial output double    e Comments  Obtains calculation time based on system clock  parallel calculations may obtain greater timing accuracy  with fCheckTimeMPI     7 2 4 IbpGET    fGetNodePosi    e He
261. roperties of dissipative particle dynamics   Physical Review E  56 2  1676 1691  August 1997     Nicos S  Martys and Hudong Chen  Simulation of multicomponent fluids in complex three dimensional  geometries by the lattice Boltzmann method  Physical Review E  53 1  743 750  January 1996     Makoto Matsumoto and Takuji Nishimura  Mersenne twister  a 623 dimensionally equidistributed uniform  pseudo random number generator  ACM Transactions on Modeling and Computer Simulation  8 1  3 30   1998     Keijo Mattila  Jari Hyv  luoma  Tuomo Rossi  Mats Aspn  s  and Jan Westerholm  An efficient swap  algorithm for the lattice Boltzmann method  Computer Physics Communications  176 3  200 210  February  2007     Philip M  Morse  Diatomic molecules according to the wave mechanics  II  Vibrational levels  Physical  Review  34 1  57 64  July 1929     David R  Noble  Shiyi Chen  John G  Georgiadis  and Richard O  Buckius  A consistent hydrodynamic  boundary condition for the lattice Boltzmann method  Physics of Fluids  7 1  203 209  1995     I  Pagonabarraga and D  Frenkel  Dissipative particle dynamics for interacting systems  Journal of Chemical  Physics  115 11  5015 5026  2001     E  A  J  F  Peters  Elimination of time step effects in DPD  EPL  Europhysics Letters   66 3  311 317   May 2004     Igor V  Pivkin and George Em Karniadakis  A new method to impose no slip boundary conditions in  dissipative particle dynamics  Journal of Computational Physics  207 1  114 128  2005     Kannan N
262. rostat velocity   At Fo a  t   Ug a  t   3At    ug a  t    z m  11 24   before the positions and simulation box dimensions are updated   Tia  t  At    exp  uga  t  4At  At   ria  t    Atvi a  t  5At    11 25   Lo  t  At    exp  uga  t  At  At  La  t   11 26           At this point the forces at the end of the time step are calculated  including thermostatting forces   along with  the system pressure  Since the the barostat force requires correct velocities for both the particles and barostat   an iterative procedure is required which begins by calculating an initial guess for the barostat velocity at the    end of the time step   2F  a  t  At    g    u   t   At    uga  t     At  4    g 0       Each iteration starts by calculating the particle velocities in a slightly modified second Velocity Verlet step        exp  g a  t   3At  At  via  E  340    LESS  11 27   1  ul  At       uit   t  At       The barostat force is then calculated using the same Gaussian random numbers for each iteration   1 2  FY  t  At    V Pa     Po    N  Y mi  of tD      of    oppa  11 28     and the barostat velocity is recalculated     FA    t  At  At    11 29       UD  t  At    uga  t  ZAt       11 4  PARTICLE PARTICLE INTERACTIONS 147    Equations 11 27 to 11 29 are repeated until convergence in particle velocities is achieved  i e  when    2  Es  at   t  At      a     t  At    3N         lt         with e as a numerical tolerance  set to 107  by default   This normally takes a few iterations per tim
263. rpose functions which may be replaced with any suitable functions in Fortran90    standard libraries  as well as bookkeeping subroutines for the global local particle number list     duni    Header records  REAL KIND dp  FUNCTION duni  idnode     Function    Creates a double precision random number between 0 and 1     Dependencies    None    170 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    e Arguments  idnode input integer  duni output  real KIND dp     e Comments  The random number generator is an implementation of the Universal Random Number Generator 39      The processor name idnode is used as a seed  which is activated the first time the function is called     mtrnd    e Header records  REAL KIND dp  FUNCTION mtrnd  idnode     e Function    Creates a double precision random number between 0 and 1     e Dependencies  None    e Arguments  idnode input integer  mtrnd output  real KIND dp     e Comments  The random number generator is an implementation of the Mersenne Twister random number generator 42      The processor name idnode is used as a seed  which is activated the first time the function is called     gaussmp    e Header records  REAL KIND dp  FUNCTION gaussmp  idnode     e Function    Creates a Gaussian random number     e Dependencies    mtrnd    e Arguments  idnode input integer  gaussmp output  real KIND dp     e Comments  This is an implementation of the Marsaglia polar method 38  to convert linear random numbers  generated    by the Mersenne Twister method  t
264. rtical position          Figure 8 1  Results from LBE 2D_Pressure test case    8 2 2D_Shear    This is a 2D simulation of a single fluid on a 42 x 42 grid with a shear boundary condition  The vector plot  in Figure 8 2 demonstrates the ability of the applied boundary conditions to generate a linear shearing Couette  flow throughout the grid  which is confirmed by the plot of horizontal velocity component as a function of  vertical position at the last time step for the simulation     119    120 CHAPTER 8  DL MESO LBE EXAMPLES                                        0 001  _ 0 0005    4  E L  S  k  5 F J  E F  E  3  3 L    a   0 0005    4  Dm a a a a oe ee  ooog 0 0001 0 0002  Vertical position   a  Vector plot of system  b  Variation of horizontal velocity with vertical posi   tion    Figure 8 2  Results from LBE 2D_Shear test case    8 3 2D_CylinderFlow    This is a 2D simulation of a single fluid on a 125 x 50 grid with a constant horizontal body force and a circular  obstacle of radius 12  representing channel flow past an infinitely long cylinder  Figure 8 3 shows this flow  against a density map of the system  with solid black lines representing the solid boundaries  both walls and  the cylinder         Figure 8 3  Density  scale  blue to red  and velocity vector plot from LBE 2D_CylinderFlow test case    8 4 2D KarmanVortex    This is a 2D simulation of a single fluid on a 250 x 50 grid with a constant horizontal body force and a circular  obstacle of radius 8  represent
265. s   Since a limited amount of data is included in restart  files  the FIELD file for the simulation is needed to provide some additional information     The source code for this utility  exportconfig f90  can be used for export or export   files created by both  the serial and parallel versions of DL_MESO_DPD  their endianness is automatically detected  so the utility  can be run on a different machine to the one used for DPD calculations  If the available Fortran90 compiler is  invoked by the command   90  the executable config exe can be produced by typing    e   90  o config exe exportconfig f90    and either run at the command line or by using the GUI in Process DPD Data after entering the number of  processes used in the required field and selecting the required CONFIG file key in the pulldown list     This utility can be run with two command line arguments  the first indicating the number of processes used to  generate the restart data and the second denoting the CONFIG file key  levcfg  0   positions only  1   positions  and velocities  2   positions  velocities and force   e g  if 16 processes were used and the particle positions and    velocities are required  either of the following commands can be used     e export exe 16 1    e   export exe 16 1    If no command line argument is given  the utility will ask the user to type in the number of processes and the  CONFIG file key     exportimage    exportimage is a utility written in Fortran90 to produce a VTF format tr
266. s  It should be noted that all computed interactions are pairwise  which means that the principle of the  conservation of momentum in the system  or    Galilean invariance     is preserved  The conservation of momentum    is required for the preservation of hydrodynamic forces     Chapter 10    DL MESO DPD Basic Definition    10 1 Data structure    10 1 1 Storage of running information    DL_MESO_DPD contains storage for information on the system being modelled  the domain and neighbour  information for parallel running  The parameters for these aspects of calculations can be found in Tables 10 1   10 2 and 10 3    It should be noted for the parameters in Table 10 1 that the fundamental units for the simulation are those of  mass  M   length  L  and energy  E   the DPD unit of time is equivalent to ic   ea while temperature  in the  form kgT  is defined as two thirds of the kinetic energy per particle     10 1 2 Storage of particle and bond properties    The total number of particles in a system is nsyst  of which nusyst particles are    loose     i e  not bonded  to other particles  and nfsyst are    frozen     i e  remain fixed in position but still interact with other particles   DL_MESO_DPD divides up the particles and total system volume  volm  between the processing units available   At any given time each process holds nbeads particles  including nfbeads frozen particles  Each process also  has nbonds bonds  nangles bond angles and ndiheds bond dihedrals to deal with  
267. s  Simulations with frozen bead walls can be restarted but these walls must already be included in  the restart  export   files and cannot subsequently be added     11 7 3 Shearing periodic walls  shear     Shearing walls moving at a specified velocity are applied using the Lees Edwards boundary condition 34   each  particle that moves through the otherwise periodic boundary has its velocity modified and is shifted by a  distance related to the wall velocity  i e    AZo   Vot  11 91   where Vo is the velocity of the moving boundary  Interactions between pairs of particles across the periodic  boundary  taking the positional shift into account  are still calculated  but pairwise thermostats are not applied  across this boundary to avoid quenching the modification of particle velocities  particularly with high values for  dissipative force coefficients  y  or collision frequencies  T   and maintain the correct shear rate 5      The directive surface is used in the CONTROL file to specify which boundaries should move  while the external  directive in the FIELD file is used to specify the velocity of the moving walls  This boundary condition is only  applied after equilibration has taken place     Chapter 12    DL_MESO_DPD Input and Output Files    12 1 Input files    All user specified input files for DL_ MESO_DPD must be in ANSI text format  with keywords  where necessary   and numerical values separated from each other with spaces or commas  tabs are currently not recognised b
268. s  follows     1  Cosine torsion     U   ijx1    A  L   cos  m  ijr           11 79   2  Harmonic   U  Qijr1    5  dista     do      11 80   3  Harmonic cosine   U    ijki    5  cos hijri     cos bo      11 81     where A and    are dihedral force constants  m is the multiplicity     the dihedral at minimum potential and   o  an equilibrium bond dihedral     The dihedral angle across all four particles  or between planes ij and kl  is given by  Qijri   cos   B  Fiz  Fit  Fes   11 82   where     Fig X Tik     Tin X Tri    Fij X Pol Pim X Fil       B  Tij  Tjk  Tki     11 83     which gives a negative value for   4  if the vector  Tij X Fix   Tjk X Tki  is in the same direction as the bond    vector Fi and positive if in the opposite direction     11 7  SURFACE INTERACTIONS 155    The force on particle   acting in the a direction is given by    a  Fe    gz U  ij   11 84   1 a    O     a ee i  B T  a m  j     11 85  sin di  Ipizki Uo ijkl  5 are  Figs Fito Pet     Using the following definition    k  gu n    B    the derivative of B  fij  Tjk  Tkl  is given by             1 talas Bo aoe   Da ijs  gt  ij XTik   ik X   AN TELE OI   COS Piz Kl 1 o 3 1 0 of 5  ig X ik X 11 86  2 iz x Fil  Org  Fag Fn Ta x Fal Ore  Tje Tea      with  Bra   Fig Fin   gt   Fe PRD    T     lFpeF jel   ek     da     Feet    ex     de5      2    ro   FigP ikl  Ser     See     Fin Tio    005     5ei        re   Fig Pyle  Sex     Sej    Fikira  Ses     0e5                 arse  TigTktlg  Ser     Sek   11 87
269. s possible using the Gather  LBE Data and Process DPD Data buttons  Note that the utilities need to be compiled in the working  directory prior to use  details on this and their functions can be found in Appendix B     The results of LBE and DPD calculations may be plotted using the Plot LBE Results and Plot DPD  Results buttons  which allows the user to select plotting and visualization applications  including those  not available in the pull down lists  Note that these need to be already installed on the workstation in use  before being invoked by the GUI  if they require running from a command line  tick the run in terminal  box before launching the application     Notes    There are some inactive buttons reserved for later use     The GUI does not produce initial state files  1bin init for LBE  CONFIG for DPD  prior to simulations   although there are utilities available to do this  see Appendix B for further details     Click EXIT to close down the GUI     Part I    Lattice Boltzmann Equation  LBE     Chapter 3    The Lattice Boltzmann Equation  Basic    Theory    3 1 Introduction    The Lattice Boltzmann Equation  LBE  method is based on modelling a fluid consisting of fictional particles   which collide and move over a discrete lattice grid  This method is similar to its ancestor  Lattice Gas Cellular  Automata  LGCA   but the main difference is that while LGCA represents the existence or otherwise for each  particle at a grid point  LBE describes the physical state of
270. s the end of details for a molecule type  Each subsequent molecule type can be entered after this  directive  beginning with its name and ending with the finish directive     Table 12 3  Bond potentials             key potential type Variables  1 4  functional form  harm   Harmonic K ro E   U r    3x r     roy   2  fene    Shifted  FENE        To   tinae      U r      0 5krmae In i    1512    oe    U r  00 7  gt  max  70             wle Worm like chain   Ap   maz       U r    e E    E   gt         T lt  Tmaz    U r   00 7  gt  mar    mors   Morse De ro B   U r    De 1     exp    B r     ro                                   Table 12 4  Bond angle potentials          key potential type Variables  1 4  functional form  harm   Harmonic Kk   A        U 0      8     0    hcos   Harmonic cosine   k   09           U          cos     cos 6    cos Cosine A  m       U     A 1 cos m                                          Table 12 5  Bond dihedral potentials          key potential type Variables  1 4  functional form   cos Cosine torsion Ajim 8   U 6   A 1  cos mo     6    harm   Harmonic kK   bdo         U     irlo  do    hcos   Harmonic cosine   k   do           U        4 cos      cos bp                                 Surface interactions can be specified using the directive surface  If hard adsorbing surfaces are to be used  this    directive should be followed by entries specifying the soft short range repulsions for all species   name a8 name of species    Awall real soft short r
271. ser to identify it  The utility will then  ask for the number of drops to be added to the system  for each drop  the user will need to specify the fluid  its  radius and where its centre is located on the lattice grid   Note that it is possible for a drop to extend beyond    the grid boundaries if periodic boundaries are in use         lif using the GUI and the utilties are to be compiled manually or in their source directories  copies of the executables are  required in the directory from which the GUl is to be launched  e g   WORK     225    226 APPENDIX B  DL_MESO UTILITIES    If any solutes are to be included  the utility will ask for the number of solute    sources     i e  regions of constant  solute concentration   for each source  it will then ask for the solute number  the required concentration  the  location of one corner of the rectangular source and its extent in each dimension  which can extend beyond  periodic boundaries   Similarly  if a temperature grid is included in the system  the utility will ask for the  number of temperature    sources     followed by the required temperature and the location of the corner and the    extent of the source     Once all of the above information is obtained  the utility will then create the 1bin init file  which specifies the  grid points  velocities  fluid densities  solute concentrations and temperatures for any locations in the system  that require non default initial conditions     lbeplot3dgather    lbeplot3dgather is 
272. sing the directive ensemble with the keyword nvt for  constant volume simulations or npt for constant pressure simulations  Dissipative force parameters and collision  frequencies can be specified for each interacting species pair in the FIELD file  Frozen particles are involved  in thermostatting algorithms due to the contributions they make to system virials and pressure  however they  are excluded from the force integration algorithm and their velocities are reset to their previous values  usually    zero      11 2 1 DPD thermostat with standard Velocity Verlet integration  MD VV   mdvv     This algorithm uses the drag  dissipative  and random forces  FP and FR respectively as described in Chapter  9  as the system thermostat  i e  the thermostatting force FE   FP   FR  This thermostatting force is  combined with all other forces between particles     pairwise conservative  standard and or density dependent    bonding  electrostatic  planar surface  external  body  forces     and integrated using the standard Velocity Verlet  integrator          This is the first referenced particle in stretching bonds and the second for bond angles and dihedrals     11 2  THERMOSTATS AND INTEGRATION ALGORITHMS 143    The combination of the DPD thermostat with the standard MD type VV algorithm is the simplest and least  time consuming thermostatting algorithm available in DL_MESO_DPD   If no ensemble type is selected in the  CONTROL file  DL_MESO_DPD will use this algorithm by default   Th
273. sion parameters for conserved moments should be set to unity when applying external forces     5 1  COLLISION AND PROPAGATION ALGORITHMS AT    An example can be given for the D2Q9 lattice system 33   the moment vector is    p y   T  M 1 pP 46150 qy  P    Pey     with p as the density  e the energy  e the square of energy  j momentum  q energy flux  Pax the diagonal stress    tensor component and pz  the off diagonal stress tensor component  The transformation matrix is          1 1 1 1 1 1 T   chy           4 2  1 2  1 2  1 2  I  4 1 2 1 2 1 2 1  2  0     1  1  1 0 1 1 1 0   T  0  1 2  1 0 1    2 1 0  0 1 0  1  1  1 0 1 1  0 1 0  1 2  1 0 1 2  0 0 1 0  1 0 1 0  1  0  1 0 1 0  1l 0 1 O   The equilibrium moment vector is  T  Jaz   gt  A 5  ig E Ht tee    p p 3p 3p    with we and wej as adjustable parameters  for convergence to the single relaxation time BGK scheme  these  are set equal to 1 and    3 respectively  Of the 9 collision parameters available  sy  s3 and ss have no effect   except when applying external forces  when they should be set equal to one  as the associated moments are  preserved and sa  s4 and sg are tuneable parameters for calculational stability with the condition that s4   sg     The remaining parameters represent the viscosities of the fluid  i e   1 1 SEN Na 1 1 ANA 1 1   Ar          Tr     Sep  2  De    als 2  DE    aL 2  A    ibn La  2    Ax   1  Esmas 5   Ax               6 s  2 At 6 2 At    Le  Te       x and Tf bulk   A  If the moment transformed s
274. snapshots  two  AVI video files have been rendered from an example calculation  one  giving a 3D view of the system  the other showing a plane normal to the y axis  which can be found in the    Example Simulations page of the DL_MESO website        Lg 7 i i      i        a  t   400  b  t   1200  c  t   2000  Figure 8 8  Progressive density plots in plane normal to y axis from LBE 3D_PhaseSeparation test case  red  for fluid 0  blue for fluid 1     8 9 3D_Shear    This is a 3D simulation of a single fluid on a 40 x 30 x 25 grid with a shear boundary condition  Figure 8 9  shows a vector plot for this system  demonstrating that linear shear is generated and maintained by the moving    8 10  3D RAYLEIGHBENARD 123    boundaries in the planes normal to the y axis  and a plot of the horizontal component of fluid velocity against  vertical position at the last time step     0 001       0 0005   4    Fluid velocity  x component  o        0 0005               0 001            0          0 0001  Vertical position     a  Vector plot of system  b  Plot of horizontal velocity with vertical position    Figure 8 9  Results from LBE 3D_Shear test case    8 10 3D_RayleighBenard    This is a 3D simulation of a single fluid undergoing natural  Rayleigh B  nard  convection on a 80 x 40 x 80  grid  The fluid is contained between two solid walls  the wall at the bottom of the system is maintained at a  higher temperature than that at the top  Figure 8 10 shows the fully developed temperature and c
275. st  primary  chain  the user will also be asked for a pre existing  bead number as the starting point for the chain     After this  the default species for the beads in the molecule will be requested  the user will then be asked enter  the bead numbers for each of the other species  0 can be entered to finish specifying bead numbers   If more  than one bond type is to be included  the user will be asked to select the default bond type and then select the  bonds that are of different types by typing the index bead number  and optionally the destination bead if more  than one is available   Bond angles and or dihedrals can also be selected by typing in the index bead number  and then selecting the required bead triple or quadruple if more than one is available     The molecules will be appended to the FIELD file in the correct format  see Section 12 1 for more details  with  positions for the beads relative to each molecule   s centre of mass  Note that this file will not be quite complete  after running this utility  data for unbonded interactions and external force fields may be required  if the FIELD  file is created using the utility  and a close directive will be required at the end     exportconfig    exportconf ig is a utility written in Fortran90 to produce a configuration file in DL_POLY format  CONFIG  from  DL_MESO_DPD restart files  export    which can be used as a starting point for new simulations  including  restarting simulations on different numbers of processe
276. st integer   species population of unbonded particles nspec integer  A nspe   species population of bonded particles nspecmol integer A mxspe   molecule type population nmol integer  A nmoldef   bead numbers in molecule types nbdmol integer A mxmoldef  molecule name nammol character 8   A O nmoldef  species number for molecule insertion mlstrtspe integer  A nmoldef  mxmolsize  x coordinate for molecule insertion mlstrtxxx real KIND dp   A nmoldef  mxmolsize  y coordinate for molecule insertion mlstrtyyy real KIND dp   A nmoldef  mxmolsize  z coordinate for molecule insertion mlstrtzzz real KIND dp   A nmoldef  mxmolsize  cube size for molecule insertion cbsize real KIND dp   A nmoldef  number of bonds for molecule type nbond integer  A nmoldef  number of bond angles for molecule type nangle integer  A nmoldef  number of bond dihedrals for molecule type ndihed integer  A nmoldef   bond table storage for molecule insertion bdinp1 integer  A nmoldef  mxbonds  bond table storage for molecule insertion bdinp2 integer  A nmoldef  mxbonds  bond table storage for molecule insertion bdinp3 integer  A nmoldef  mxbonds  angle table storage for molecule insertion anginp1 integer  A nmoldef  mxbonds  angle table storage for molecule insertion anginp2 integer  A nmoldef  mxbonds  angle table storage for molecule insertion anginp3 integer  A nmoldef  mxbonds  angle table storage for molecule insertion anginp4 integer  A nmoldef  mxbonds  dihedral table storage for molecule insertion dhdinp1
277. step  to be written in the trajectory file  This version of the  utility cannot be invoked using the GUI     local    local is a utility written in Fortran90 that can read in HISTORY  output data files generated by DL_MESO_DPD  and produce series of VTK format files containing statistical properties     number of beads  density  compositions  per particle and molecule types  temperature and mean velocity     in cuboidal subdivisions of the simulation    volume for plotting and or visualization     230 APPENDIX B  DL_MESO UTILITIES    The source code for this utility  local   90  can read both HISTORY and HISTORY  files generated by the serial  and parallel versions of DL_MESO_DPD respectively  their endianness is automatically detected  so the utility  can be run on a different machine to the one used for DPD calculations  If   90 is the command for the available  Fortran90 compiler  the executable local exe can be produced by typing    e   90  o local exe local f90    and either run at the command line or via the GUI in Process DPD Data after entering both the number of    processes used in simulations and the number of divisions required in each dimension     This utility can be run with four command line arguments  the first denoting the number of processes and the  others giving the number of divisions required in x   y  and z directions respectively  If these arguments are  omitted  the user will be asked to enter these values     Files named local_  vtk are produced for
278. t cij  1 eo   a  11 38     Te ij  This conservative interaction is applied for interparticle distances up to r  ij  which should be less than or equal    to the maximum value re     11 4 4 Many body DPD  mdpd     The conservative force in standard DPD depends only upon the species interacting and the interparticle sepa   ration  which yields a quadratic equation of state  Many body DPD 46  66  is a method of providing alternative  thermodynamic behaviours to DPD particles by making conservative forces additionally dependent on local  densities     The free energy of an inhomogeneous system with density p r  can be defined as the following in both continuous    and ensemble averaged discrete forms     F    II    J oE   11 39      E aa  ay     11 4  PARTICLE PARTICLE INTERACTIONS 149    where Y p  is the free energy per particle in a homogeneous system and p 7   is a function related to the density  at  and near  the position of particle i  r    The latter can be approximated by a function dependent on the  positions of particles close to particle     6   to allow the calculation of an instantaneous free energy     F  dvi      The effective  conservative  force on particle    can be obtained from the spatial derivative of the free energy   although only the excess part  equivalent to the potential energy U  is required since the kinetic motion of  particles automatically accounts for the ideal contribution   FO   OPE  225   OY Nes   OF  Or         11 41     The force can also b
279. tMassDomain  fGetOneMassDomain  fGlobalValue    fPrintSystemMomentum    e Header records    int fPrintSystemMomentum      e Function    Calculates and prints the total fluid momentum in entire system     e Dependencies  fGetTotMomentDomain  fGlobalValue    117    Chapter 8    DL MESO LBE Examples    Test cases for Lattice Boltzmann Equation simulations using DL_MESO   including the required input and  sample output files     can be found in the DEMO LBE subdirectory  They can be run using either the serial or  parallel versions of DL_MESO_LBE     Images of all test cases and videos for some can be found in the Example Simulations page of the DL_MESO  website  a link to it can be found at www ccp5 ac uk DL_MESO    8 1 2D Pressure    This is a 2D simulation of a single fluid on a 42 x 42 grid with fixed pressure  density  boundary conditions on the  left and right boundaries and solid walls  represented by bounce back  at the top and bottom  A visualization  with vector glyphs and a plot of fluid speed against vertical position can be seen in Figure 8 1  which show the  boundary conditions result in a laminar flow with a parabolic velocity profile        0 0025                     0 002  gt           HE                       gt   z      0 0015     gt  E             yyy          Y  Fluid speed             0 001                        0 0005                    o n y y l y ror   y  0 0 0001 0 0002  Vertical position     a  Vector plot of system  b  Variation of fluid speed with ve
280. table for square lattices  Other lattice models  e g  FHP 11   would require modification  or alternative versions of this routine     fGetEquilibriumFIncom    e Header records  int fGetEquilibriumFIncom double  feq  double  v  double rho  double rho0     e Function    Calculates equilibrium distribution function for incompressible fluid     e Dependencies  None    e Arguments  feq output double pointer  v input double pointer  rho input double precision  rho0 input double precision    e Comments    Equilibrium distribution function calculated here is       pisu form       which is only suitable for square lattices  Further details can be found in  24      7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 99    fGet EquilibriumC    e Header records  int fGetEquilibriumC double  feq  double  v  double rho     e Function    Calculates equilibrium distribution function for solute     e Dependencies    None    e Arguments  feq output double pointer  v input double pointer  rho input double precision    e Comments    The equilibrium distribution function calculated here is    gl   wiC i  A    using the solute concentration C and the velocity of the bulk fluid 27   This subroutine can be changed  for other Lattice Boltzmann models  e g  free energy model 64      fGetEquilibriumT    e Header records  int fGetEquilibriumT double  feq  double  v  double tem     e Function    Calculates equilibrium distribution function for temperature     e Dependencies    None    e Arguments  feq output dou
281. tains     angle key ad potential key  see Table 12 4   index 1  i  integer first bead index in bond angle   index 2  j  integer second bead index in bond angle  central site   index 3  k  integer third bead index in bond angle   variable 1 real potential parameter  see Table 12 4   variable 2 real potential parameter  see Table 12 4   variable 3 real potential parameter  see Table 12 4   variable 4 real potential parameter  see Table 12 4    Angle based parameters  e g  99  should be given in degrees  This directive and associated data records  need not be specified if the molecule contains no bond angles     7  dihedrals n  where n gives the number of dihedral interactions in the molecule  Each of the following n records contains     dihedral key ad potential key  see Table 12 5   index 1  i  integer first bead index in bond dihedral   index 2  j  integer second bead index in bond dihedral  central site   index 3  k  integer third bead index in bond dihedral   index 4  1  integer fourth bead index in bond dihedral   variable 1 real potential parameter  see Table 12 5   variable 2 real potential parameter  see Table 12 5   variable 3 real potential parameter  see Table 12 5    variable 4 real potential parameter  see Table 12 5    162 CHAPTER 12  DL MESO DPD INPUT AND OUTPUT FILES    Angle based parameters  e g  fp  should be given in degrees  This directive and associated data records  need not be specified if the molecule contains no bond dihedrals     8  finish    indicate
282. tdata shear  nlimit     e Function  Applies export of particle properties  positions  velocities  to boundary halos of neighbouring domains  and or across periodic boundary conditions with Lees Edwards shearing     e Dependencies  export    export_shear    e Arguments    nlimit input output integer    exportvelocitydata    e Header records  SUBROUTINE exportvelocitydata  nlimit     e Function  Applies export of particle velocities to boundary halos of neighbouring domains and or across periodic    boundary conditions for recalculation of dissipative forces     e Dependencies    exportvelocity    e Arguments    nlimit input output integer    e Comments  Non periodic boundaries either do not require boundary halos or require them to be constructed differently     these are thus excluded from the export of particle velocities     204 CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    exportvelocitydata_shear    e Header records  SUBROUTINE exportvelocitydata_shear  nlimit     e Function  Applies export of particle velocities to boundary halos of neighbouring domains and or across periodic    boundary conditions with Lees Edwards shearing for recalculation of dissipative forces     e Dependencies  exportvelocity    exportvelocity_shear  Parallel version only     e Arguments    nlimit input output integer    exportdensitydata    e Header records  SUBROUTINE exportdensitydata  nlimit     e Function  Applies export of local densities for particles to boundary halos of neighbouring domains
283. te    e Header records  three cases   int fGetOneMomentSite double  speed  double  startpos   int fGetOneMomentSite double  speed  int fpos  long tpos     int fGetOneMomentSite double  speed  int fpos  int xpos  int ypos  int zpos     e Function  Calculates the momentum of one of the fluids at the grid point     e Dependencies    None    74 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Arguments  startpos input double pointer    fpos input integer   tpos input long integer   xpos input integer   ypos input integer   Zpos input integer   speed output double precision array    e Comments  The calculation is based on pa   5    fi   ia  The second and third cases are more readable than the first  but also slightly slower     fGet TotMomentSite    e Header records  int fGetTotMomentSite double  speed  double  startpos     e Function    Calculates the momentum of all fluids at the grid point     e Dependencies    None    e Arguments  startpos input double pointer    speed output double precision array    fGet TotMoment Domain    e Header records    int fGetTotMomentDomain double  momentum     e Function    Calculates the momentum of all fluids in the domain     e Dependencies  fGetTotMomentSite    e Arguments    momentum output double precision array    e Comments    This function is mainly used to verify that the domain momentum along each axis is conserved     fGetOneDirecSpeedSite    e Header records  three cases   float fGetOneDirecSpeedSite int dire  double  startpos   float 
284. tem    e Header records    int fInitializeSystem      e Function    Initializes distribution function for lattice system     e Dependencies  fGetEquilibriumF  fGetEquilibriumFIncom  fGetEquilibriumC  fGetEquilibriumT    e Comments    This subroutine as it stands is suitable for initializing most Lattice Boltzmann systems  although the user    may modify it if it can otherwise be faster  more stable or more suitable for a particular calculation     fSiteFluidCollisionBGK    e Header records    int fSiteFluidCollisionBGK double  startpos  double  sitespeed  double  bodyforce     e Function    Calculates fluid collisions at a grid point using the Bhatnagar Grook Krook  BGK  model for compressible    fluids     102 CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    e Dependencies  fGetOneMassSite  fReciprocal  fGetEquilibriumF    e Arguments  startpos input double pointer  sitespeed input array of doubles  bodyforce input double pointer    e Comments  Collisions for each fluid species are carried out using the BGK single relaxation time 4        e657    gt   fi     F     fSiteFluidCollisionBGK Segregation    e Header records  int fSiteFluidCollisionBGKSegregation doublex  startpos  double  sitespeed  double  bodyforce     double  phaseindex     e Function  Calculates collisions and phase segregation for the Lishchuk algorithm at a grid point using the Bhatnagar   Grook Krook  BGK  model for compressible fluids     e Dependencies  fGetAllMassSite  fGetTotMassSite  fReciprocal  fGetEquil
285. th in z direction wdthewz real KIND dp    species name namspe character LEN 8   A nspe  potential interaction type ktype integer  A npot  species particle mass amass real KIND dp   A nspe  species particle charge chge real KIND dp   A nspe  species frozen status lfrzn integer  A nspe  interaction parameter storage vvv real KIND dp   A mxprm npot  Lennard Jones long range potential correction clr real KIND dp  A 2  charged frozen particle correction to system stress tensor strcfz real KIND dp  AQ  charged frozen particle correction to system virial vrlcfz real KIND dp  A 3  charged frozen particle correction to system potential energy potcfz real KIND dp   integrator thermostat type itype integer   dissipative coefficient  y  collision frequency  T  gamma real KIND dp   A npot  random force parameter  0    probability of velocity rescaling  TAt  sigma real KIND dp   A npot  Stoyanov Groot Nos   Hoover coupling parameter  a  alphasg real KIND dp    thermostat pair list   particle    pairlsti integer  A maxpair  thermostat pair list  particle j pairlstj integer  A maxpair  thermostat pair list  Maxwell distributed velocity  v5  veleq real KIND dp   A maxpair  number of particle pairs in thermostat pair list npair integer   barostat type btype integer   barostat target pressure  Po  prszero real KIND dp    barostat parameter a abaro real KIND dp    barostat parameter b bbaro real KIND dp    x component of piston velocity upx real KIND dp    y component of piston velocity upy real
286. the distribution function  initially at  each grid point and then between them  in two separate loops   as described by  43  and in section 5 1   This version can be used for either serial or parallel calculations and no boundary layer is necessary  this    is the default propagation routine for serial calculations     fPropagationCombinedSwap    e Header records    int fPropagationCombinedSwap      e Function  Moves lattice particles  distribution functions  to neighbouring grid points using the swap algorithm     e Dependencies    fSwapPair    e Comments  This routine is fundamental to Lattice Boltzmann calculations and should not be modified  Propagation  is carried out by systematic swapping of post collisional values for the distribution function  initially at  each grid point and then between them  in the same loop   as described by  43  and in section 5 1  This  version can only be used for calculations with non zero boundary layers  this is the default propagation    routine for parallel calculations     7 2 12 IbpMPI    This package is only required for parallel running and does not require detailed knowledge for its use  Sev   eral subroutines in this package are not described here  interested users should consult the code for further    information     fStartMPI    e Header records    int fStartMPI int argc  char  argv       e Function  Starts Message Passing Interface  MPI      e Dependencies    None    fCloseMPI    e Header records  int fCloseMPI      e Function 
287. the number of processing units to be used for simulations  The value of maxdim can be increased    by the user to allow for non evenly distributed systems by setting a value for densvar in the CONTROL file     If using alternative many body DPD interactions to the vapour liquid example provided  the routines manybody_force  and manybody_potential in manybody_module f90 should be modified by the user as necessary  the routine  local density should not be altered by the user but the function weight_rho can be changed if an alternative  weighting function for calculating local densities is required  Additional bond  angle and dihedral types can also   be added to the subroutines bond_force  angle_force and dihedral_force respectively in bond_module f90    but this will also require changes to read_field in config_module f90 to include a four letter code for the  bond angle dihedral type that can be read from the FIELD file     Appendix B    DL MESO Utilities    DL_MESO includes a number of utility programs which are not directly needed for Lattice Boltzmann or DPD  simulations but are useful both for producing files required as inputs for those calculations and to process output  files for visualization  These may be found in the  LBE utility and  DPD utility directories     Compilation can either be carried out individually or collectively using makefiles  each utility directory includes  a makefile to compile all the utilities therein and the working directory  WORK includes o
288. the related distribution  function     12    8     CHAPTER 2  THE DL_MESO GUI    e A block has a vertex at  x0  y0  z0  and has size  dx  dy  dz   both z0 and dz can be omitted for    two dimensional blocks     Note that lattice points well within an obstacle are set as blank sites  i e  they will be ignored in LBE    calculations     The entire system can be set up as a porous solid by selecting the bounce back type  specifying a pore  fraction and clicking set pore to randomly select an appropriate number of solid lattice sites     Clicking the Create button will write all the lattice space data to a lbin spa file  any lattice point defined    more than once will hold its latest definition     2 3    Dissipative Particle Dynamics and the DL_MESO GUI    To access the DPD facilities in the DL_MESO GUI  proceed as follows     Click the DPD button to get the DPD panel     Click the Define DPD System button and supply the required information  The CONTROL file will be  created by this step     Note that currently no simulation space settings or molecular structure data can be entered using the  GUI     Click EXIT to finish the settings     2 3 1 Defining the System    Figure 2 5 shows the Define DPD System panel with the rows for data entry labelled in red numbering     The required data are as follows     1     2     The job header  a line of text up to 80 characters long describing the simulation     The system volume  the pull down list can be used to specify whether this is 
289. ticles i  j and k can be determined from the bond vectors rj    T      Tj and Tp    Tk     Tj     Osjx   cos   ate   11 72     Tig    kj  The most general form for the bond angle potential is given thus     U  ijk  ij  Pkg    A  Big  S  rij  S  145  S  Tak   11 73        2This expression is also used for the virial contribution from the standard DPD pairwise forces  i e  Equation  9 3   again only  applying a single contribution per particle pair     154 CHAPTER 11  DL MESO DPD FEATURES    with A 0  as a purely angular function and S  r  a screening or truncation function  The force on particle    in    dimension a is thus given by        0  F      gg Y Out Piss Tki   11 74   o     S  rij  S  rrj  S  rik  apa  0551   ro  ro fa    A ijn  S  rig  S  rin   Sei     Seg  278  ris   Tij Tij  re        A  0ijx  S  rij  S  rik   Sex     Sej  PREE PR  rej   J J  0   A  Bigr  S  rig  S  113   See     001  LES  rir   11 75   Tik OTik    with ab   1 if a   b and dq    0 if a    b  In the absence of screening terms  the above formula reduces to          o  F     57 Adi   11 76       1 0              A 6    sin Dijk olijk   ik  A   ip S E A EE Gn So  naa    ee  7 Pag  ej    Tijfkj   i Siy    ej l  The contribution to the virial from the angle is given by  WE  Fa F    Fey Fa   11 78     which is equal to zero for bond angle potentials without screening terms 59      11 6 3 Bond dihedrals    Three potential models for bond dihedrals along particles 2  j  k and l are provided in DL MESO_DPD a
290. tion  such that  snapshots at the recorded timesteps and animations can be produced     Two versions of the utility are provided  traject f90 outputs every particle for all recorded timesteps  and  trajectselected f90 allows the user to select the number of particles and the number of timesteps to output  to the trajectory file  Both versions of the utility can be used with both HISTORY and HISTORY files produced  by the serial and parallel versions of DL_MESO_DPD respectively  their endianness is automatically detected   so the utility can be run on a different machine to the one used for DPD calculations  If   90 is the command  for the available Fortran90 compiler  the executable traject exe can be produced by typing    e   90  o traject exe traject f90    and either run at the command line or via the GUI in Process DPD Data  A command line argument  indicating the number of processes  and therefore the number of HISTORY or HISTORY  files  can be included in    a similar way to the exportimage utility     The alternative version can be compiled in the same way  by default the makefiles create executables named  trajects exe  This version takes the same command line argument as traject f90  After the number of  processes is typed in  the utility displays the total number of particles  the number of unbonded particles in  the simulation and the total number of timesteps available  before asking for the particle number range and  number of timesteps  including a starting time
291. tions may be handled in two different ways  either  1  locally with each processing unit  being allocated a subset of bonds to deal with  including bonds across neighbouring units   or  2  globally with  all units holding all bond data and sharing bonded particle positions  each carrying out all bond calculations  and appropriately allocating forces to local particles  The former method may require larger boundary halo    sizes for the bond lengths being simulated but is more efficient for larger numbers of molecules and processing    141    142 CHAPTER 11  DL MESO DPD FEATURES    units  while the latter method requires the sharing of information between all units but does not require halo    information and is guaranteed to find all bonds     Bookkeeping arrays  bndtbl  angtbl and dhdtb1  list all particles involved in bonded interactions according  to global index numbers and point to appropriate arrays of parameters to define the potential  If the    key     bonded particle for a bond  moves from one processing unit to another  the entry in the bookkeeping array is  also moved  At each time step a list of bonded particles in each domain  1b1c1st  is created to relate global  index numbers to the local index numbers used by the processing unit in force  velocity and coordinate arrays   This global local index list is sorted by global index number to allow cross referencing to local index numbers  by means of a binary search     11 1 2 Electrostatic interactions    For syste
292. to happen as maxdim is calculated according to the numbers of particles and  processors available  taking into account any nfold duplications   but the user may wish to use the densvar  directive in the CONTROL file to increase this value     235    Message 54  non existent species given in CONFIG file for bead i    An undefined species has been found in the definition for the    th particle in the CONFIG file     Action  Check the species definitions in the FIELD file and the    th particle in the CONFIG file to ensure that  species is defined     Message 61  deport coordinate buffers exceeded    The amount of particle data received during deport is greater than the current processor can accommodate     Action  This error message suggests non constant particle densities across the system and poor load balancing   The user may wish to use the densvar directive in the CONTROL file to increase the value of maxdim and thus  accommodate larger numbers of particles     Message 62  deport coordinate buffers exceeded for lees edwards shear    The amount of particle data received during deport with Lees Edwards shearing is greater than the current  processor can accommodate     Action  This error message suggests non constant particle densities across the system and poor load balancing   The user may wish to use the densvar directive in the CONTROL file to increase the value of maxdim and thus  accommodate larger numbers of particles     Message 71  import coordinate buffers exceeded
293. trnd    global_sum_int    e Comments  This routine assigns frozen bead walls and other unbonded beads as cubic lattices  the latter may be  incomplete and species of unbonded beads are randomly assigned according to the numbers specified in    the FIELD file  No duplication of system using nfold is assumed     revive    e Header records  SUBROUTINE revive  key     e Function    Saves and reads restart configurations     e Dependencies    export  files  if reading restart configuration     e Arguments    key input integer    e Comments  No duplication of system using nfold is assumed when reading restart files  if this is required  a CONFIG  file should be created and used instead     206    CHAPTER 13  DL MESO DPD PACKAGE REFERENCE    read_config    e Header records    SUBROUTINE read config    e Function    Reads initial system configuration  positions  velocities  forces  from DL POLY style CONFIG file and    assigns particles  bonds etc  to system  accounting for system duplication using nfold     Dependencies  CONFIG file   getword   getint   getdble  initialvelocity  global_sca_and  global_sum_sca_int    error    Comments   The number of particles in the CONFIG file must match up with the number described in the corresponding  FIELD file  as should any molecule and bond information  The periodic boundary key imcon 65  is ignored   since all DL_MESO systems are orthorhombic  This routine also adds any required frozen bead walls as    cubic lattices  No checks are made to 
294. tydata  DPD VV only   dragforces_dpdvv  DPD VV only   importforcedata  DPD VV only   global_sca_sca_int  global_sca_sca_dble  global_sum_dble   global_sum_int  Lowe  Peters  Stoyanov     Arguments    stage input integer    Comments    The Langevin barostat is configured to apply the following piston force  rate of change of momentum  in    dimension a      1 2 e le  Pga   V Pa _ Po   P Ny 2 MV      YpPg a   Oppa At 2    with the option of keeping the system isotropic by using equal values of Py and Cp o for all dimensions      This may be switched off if imposing constant surface tensions at given planar surfaces   Rescaling of    the simulation volume takes place in the first stage coupled with the integration of particle forces  while    iteration of the barostat force to achieve convergence of particle velocities  to machine precision  takes    place in the second stage     verlet_ _berend    e Header records    SUBROUTINE verlet_ _berend  stage     e Function    Solves the equations of motion using the Velocity Verlet scheme coupled with the Berendsen barostat 2      Dependencies   hardreflect   deportdata   frozenbead   error   exportvelocitydata  DPD VV only   dragforces_dpdvv  DPD VV only   importforcedata  DPD VV only   global_sca_sca int  global_sum_dble   global_sum_int  Lowe  Peters  Stoyanov     13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 213    e Arguments    stage input integer    e Comments  The Berendsen barostat rescales particle positions and system sizes i
295. u0     0  2     3 23     where the kinetic viscosity is given by y   E   3  ry     3      Similarly  the convection diffusion equation governing the evolution of solute transfer and the convection conduction    equation governing the evolution of thermal transfer can be obtained     3 5 Mesoscale Interaction    The rate of change of momentum is proportional to the force    Pua  t   At    pua  t    Fo At  3 24     The Lattice Boltzmann Equation takes into account the effect of relaxation and it is possible to express Equation   3 24  in a new format  41    Pua  t   At    pua  t    FaTf  3 25     F   with Fa as the component in the a direction  can be a long ranged body force or any local interactions     In the Shan Chen pseudopotential model for multiple phases and components 55   the force on component a is  defined as  F        p   2  Y gas Y wih   Z     i    s  3 26   b i    where gap is the interaction coefficient between elements a and b     is related to the density of element a and  can take many different forms  e g   a  wa  o fi    2   3 27   Po  In the Lishchuk continuum based model for single phases and multiple components 35   the force acting between  components a and b is expressed as    1  Fab   3900 Kay V Pas  3 28     3 6  SUMMARY OF LATTICE BOLTZMANN EQUATION 27    a b  where o5      24  is a phase index between the two components and Ka   is the local curvature from the    pe p   interface model  which can be determined from spatial gradients of the phase i
296. uding the boundary  lbdm touter   total number of grid points in the domain including the boundary  Table 4 6  Neighbour information  parameter meaning  lbnb k  rank   processor name of neighbour k  lbnb  k    spos start position for sending distribution function message  lbnb k   rpos start position for receiving distribution function message  lbnb k   bspos   start position for sending boundary condition message  lbnb k   brpos   start position for receiving boundary condition message  k 0 right neighbour  k 1 left neighbour  k 2 upper neighbour  k 3 lower neighbour  k 4 front neighbour  k 5 back neighbour  Table 4 7  Simulation information  parameter   meaning possible values  collide collision and forcing type 0   BGK  1   BGK with Guo forcing   2   MRT  3   MRT with Guo like forcing  interact mesophase interaction type   0   none  1   Shan Chen  2   Shan Chen with wetting   3   Lishchuk  incompress   incompressibility of fluids 0   compressible fluids  1   incompressible fluids  outtype output file type 0   VTK  1   Legacy VTK  2   Plot3D             The notation column in Table 4 8 gives the restrictions applicable on the parameters     A    indicates an array    of data  followed by the number of elements in the array  For example     A lbsy nf    means the parameter is    actually an array with lbsy nf elements      gt  1    means the number must be greater or equal to one  while    1    or 0    means the value of the parameter can either be one or zero  An asterisk i
297. ue from a Maxwellian distribution  i e              kgT  Yi   Qij iF  11 4   where Hij   ae is the reduced mass between the two particles  The velocities of particles    and j thus  become    Ui   Uj    Kij     es  s Viz  Sie vg  ij  11 5    mi  Uy  U    a           lt  Viz    v  ij  11 6    o    The probability of a particle pair being thermostatted is equal to TAt  where I is defined as the collision  frequency  with a maximum effective value of 27   and the velocity corrections to particle pairs are applied in    a random order to prevent biasing     The above pairwise correction of velocities is equivalent to applying a thermostatting force equal to    a a a da eek  ES   aa       ig   Gig    055  big  11 7     and thus a virial correction of FE   Tij is applied for each particle pair being thermostatted     The viscosity and self diffusion generated by this thermostat for a single species are          norr     11 8     75m ce  kgT  mi BA ED  11 9   m    where Tp is the decay time for velocity correlations and inversely proportional to the collision frequency  The    Schmidt number is therefore proportional to ir and can thus reach values up to O 10       This thermostat is suited to systems with higher viscosities and low diffusitivies while giving the correct system    temperature for a wide range of time step sizes  within numerical errors due to Velocity Verlet force integration      144 CHAPTER 11  DL MESO DPD FEATURES    Its implementation in parallel running uses a 
298. uk DL_MESO      TERMINATION    This Licence Agreement will take effect and the Licence Period  will start when the Licensee has agreed to the terms and  conditions of this Licence Agreement and downloaded the DL_MESO  Software from the DL_MESO Website     This Licence Agreement will terminate immediately and    automatically if     5 2 1 the Licensee is in breach of this Licence Agreement  or    5 2 2 the Licensee becomes insolvent  or if an order is made or a  resolution is passed for its winding up  except voluntarily  for the purpose of solvent amalgamation or reconstruction    or if an administrator  administrative receiver or receiver  is appointed over the whole or any part of its assets  or    if it makes any arrangement with its creditors     The Licensee   s right to use the DL_MESO Software will cease  immediately on the termination of this Licence Agreement  and the  Licensee will destroy all copies of the DL_MESO Software that it    or any of its employees or students then holds     Clauses 1  2 2  3  4  5 3  5 4  5 5 and 6 will survive the expiry  of the Licence Period and the termination of this Licence    Agreement  and will continue indefinitely     STFC may stop providing any assistance or advice in relation to     or any corrections  new releases or versions of the DL_MESO  and    244    APPENDIX D  DL_MESO LICENCE AGREEMENT  ACADEMIC PURPOSES     may stop updating or publishing the DL_MESO Website at any time     6  GENERAL    6 1    6 2    6 3    6 4    6 
299. uld be hard and reflecting     11 7 2 Frozen bead walls  frozen     This boundary condition is applied by adding layers of frozen beads which do not move during the simulation  but still interact with all other particles  If appropriate choices for the density of frozen beads in the walls and  interactions between frozen and non frozen particles are made  non porous boundaries with no slip conditions  can be obtained  albeit at the cost of density fluctuations near the walls 51      To use this boundary condition  a species of frozen beads needs to be specified in the FIELD file  along with  the interaction types and parameters between this species and all others  The directive surface is used in the  CONTROL file to specify which boundary surfaces should include frozen beads  while the same directive in the  FIELD file identifies the frozen bead species  the bead density and thickness of the wall regions  the number of  beads required is automatically determined and the size of the system is adjusted to include the additional wall  regions  i e  the user does not have to include the walls in the system dimensions given in the CONTROL file     This boundary condition can only be set up in this manner for new simulations  either starting from scratch  or using a CONFIG file  If creating a CONFIG file from a previous simulation  users are advised to use the hard  reflecting boundary condition described above to ensure molecules remain within the required non periodic  boundarie
300. ult mixing  rules for unlike particle parameters  Figure 14 1 gives a snapshot of the system at the end of the simulation   demonstrating mixing between the three particle types  represented by different colours         Figure 14 1  Visualization of system at final time step from DPD Mixture Ser test case    14 2 Mixture_Large    This simulation example is similar to Mixture_Smal1 but larger  it consists of 512 000 particles with 2 species   each with a population of 256 000 particles  The particle types have identical sizes and masses but different    215    216 CHAPTER 14  DL MESO DPD EXAMPLES    energy parameters  using the default mixing rules for unlike particle parameters  Figure 14 2 gives a snapshot  of the system at the end of the simulation  demonstrating good mixing between the two particle types        Figure 14 2  Visualization of system at final time step from DPD Mixture_ Par test case    14 3 PhaseSeparation    This simulation example consists of 3000 particles with 2 species  each with a population of 1500  Both particle  types have identical sizes  masses and like like energy parameters  but the unlike energy parameter has been  set to a larger value to produce phase separation  which can clearly be seen in Figure 14 3  The initial state of  this simulation has been provided in a CONFIG file  An  AVI video file of the first half of the simulation can be  found in the Example Simulations page of the DL_MESO website      a  t 2  t 20  t 50   t  100    Figure 1
301. um based  algorithm is to be used  a non zero segregation parameter  8  is required to ensure immiscible fluids  separate out from each other     Solutes require the following data in the following row numbers     1     The initial concentrations of the solutes throughout the system  as used for initialization     10    CHAPTER 2  THE DL_MESO GUI      The solute concentrations at the top boundary     The solute concentrations at the bottom boundary     The solute concentrations at the left boundary       The solute concentrations at the right boundary     The solute concentrations at the front boundary   Greyed out for two dimensional systems    The solute concentrations at the back boundary   Greyed out for two dimensional systems      The relaxation time  7   for each solute  representing diffusivities     If selected for inclusion  the required thermal properties are     1     2     10     11     The initial T  temperature  for the system     The initial dT dt  rate of change of temperature  related to heat transfers in or out  for the entire    system     The Boussinesq high reference temperature  Th  for heat convection in the system       The Boussinesq low reference temperature  T   for heat convection in the system       The heat relaxation time  7   for the system  which represents the thermal diffusivity     The temperature and rate of temperature change at the top boundary   The temperature and rate of temperature change at the bottom boundary   The temperature and
302. ution  function and that the fluid modelled using LBE is generally athermal  It is possible  however  to alleviate this  problem by defining a temperature at each grid point and either using a thermal lattice scheme with additional  link vectors or modelling either the temperature or internal energy on an additional lattice grid     3 3 Derivation of Equilibrium    There are two methods by which the local equilibria for the Lattice Boltzmann Equation can be constructed   The bottom up method obtains the equilibrium from the Maxwell Boltzmann equilibrium distribution  The  top down method constructs the equilibrium so that the required macroscopic properties can be reproduced   Only the bottom up method is shown here  the top down method can be found in  6      The Maxwell Boltzmann single particle equilibrium distribution function is      2  eq _ P  E a   f      Te exp 28  3 4        where 9   kgT  m  kg is the Boltzmann constant  T is temperature  m is molar mass  D is the space dimension         is the thermal velocity and u the macroscopic velocity     When          l  lt  v    Equation  3 4  can be expanded into          3 3  eq P    da 3 5  f Oro   A   T a T 202 20 ee    For a microscopic quantity Y        the associated macroscopic quantity Y is calculated by  w  fu    suas  3 6     Let E   y 20     where   is a rescaled thermal velocity  the macroscopic velocity i can be similarly rescaled to  v20u  Equations  3 5  and  3 6  can thus be combined to give       v  feyt  
303. va   hisia  The second and third cases are slightly slower than the first    but more readable     fGetSpeedSite    e Header records  three cases   int fGetSpeedSite double  speed  double  startpos   int fGetSpeedSite double  speed  long tpos   int fGetSpeedSite double  speed  int xpos  int ypos  int zpos     e Function  Calculates the macroscopic speed of all  compressible  fluids at the grid point     e Dependencies    fReciprocal    7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 73    e Arguments  startpos input double pointer    tpos input long integer   xpos input integer   ypos input integer   Zpos input integer   speed output double precision array    e Comments    The calculation is based on vg   Palit The second and third cases are more readable than the first    but also slightly slower     fGetSpeedIncomSite    e Header records  three cases   int fGetSpeedIncomSite double  speed  double  startpos   int fGetSpeedIncomSite double  speed  long tpos   int fGetSpeedIncomSite double  speed  int xpos  int ypos  int zpos     e Function  Calculates the macroscopic speed of all incompressible fluids at the grid point     e Dependencies    fReciprocal    e Arguments  startpos input double pointer    tpos input long integer   xpos input integer   ypos input integer   Zpos input integer   speed output double precision array    e Comments    The calculation is based on vg   Za The second and third cases are more readable than the first    but also slightly slower     fGetOneMomentSi
304. values in neighbouring grid points     fSiteBlankF    e Header records  int fSiteBlankF  long tpos     e Function    Sets the fluid particle distribution function at the tpos th grid point to zero     e Dependencies    None    e Arguments    tpos input long integer    e Comments    This routine is used to ensure e g  flows inside solid boundaries are negligible     fSiteBlankC    e Header records  int fSiteBlankC long tpos     e Function    Sets the solute particle distribution function at the tpos th grid point to zero     e Dependencies    None    e Arguments    tpos input long integer    e Comments    This routine is used to ensure e g  diffusion inside a bulk solid is negligible compared to that in a liquid     fSiteBlankT    e Header records  int fSiteBlankT long tpos     e Function    Sets the temperature particle distribution function at the tpos th grid point to zero     e Dependencies    None    e Arguments    tpos input long integer    e Comments    This routine is used to ensure e g  negligible heat transfer through an insulator     7 2  DL MESO_LBE SUBROUTINES AND FUNCTIONS 89    fFixedSpeedFluid    e Header records    int fFixedSpeedFluid long tpos  int prop  double  uwall     e Function    Calculates the particle distribution function at a fixed speed boundary     e Dependencies    Many for different lattice schemes    e Arguments  tpos input long integer  prop input long integer  uwall output array of doubles  e Comments  Planar surface calculations are based o
305. vector  1 Cia Ciy  0 0 0  1  1 1  2  1 0  3  1  1  4 0  1  5 1  1  6 1 0  7 1 1  8 0 1             29    30    CHAPTER 4  DL  MESO _LBE BASIC DEFINITION             1 1 1 1 1 1 di   el     4 2  1 2  1 2  1 2  I  4 1 2 12 1 2 1  2  0  1  1  1 0 1 1 1 0  T  0  1 2  1 0 1    2 1 0  0 1 0  1  1  1 0 1 1  0 1 0  1 2  1 0 1 2  0 0 1 0  1 0 1 0  1  0 1 0 1 0  1 0 1 0  p P  ee 20   3  j     jy   es wep   M2 432   M9   go       jz  eq as  ace  Poh om  vis jody  0    6 vz Fy   VyFy    6 0  Fs ty Fy     Y  II     a     F   2 Ur Fy     Uy Fy   Un Py   vy Fy    T     1 mh ea  a Gia 1  sa  1  54 T   TF      1 1   Ax    v    ron     5   Ari       2 At    31    4 1  LATTICE MODELS    D3Q15       Wi    aoo      72       Weight factor             1 3  8 10  47  11 14             Speed vector       Ci z       Ciy       Cix                                           10  11          12  13  14                   1     4     1       4       1     4          4  4    4    16             1     1       1     1       1       1       4 1       1       1     1     1    E A    0    heel Ht    0       32          1 7     CHAPTER 4  DL_MESO_LBE BASIC DEFINITION          p Cn  eea 2p   Gett H   eo wep   FH  ja   jy   j2   qe de  dy Jy  Gy      y  Jz   Jz  qs  rie   3ne4 2j2   j2   j   pes jody  pet dude  pet dede  ae J  0  2 Ug Ey   Vy Fy   vzF 2      10 vz Fr   vy Fy   vF   Fo     iF   Fy  2  3Fy  S  F     FF     2 2u  Fr     Uy Fy     v  Fz   2 vy Fy     vzF    Uy Fy   vy Fy  Vy    uzFy  vz Fy   Vrt  0      
306. ware or any  assistance or advice that STFC may give in connection with the  DL_MESO Software  The Licensee will indemnify STFC against any  and all claims arising as a result of the Licensee having made  any of the DL_MESO Software or any Derived Work available to any  third party     Before using any of the DL_MESO Software  the Licensee will check  that the DL_MESO Software does not contain any Harmful Element   STFC does not warrant that the DL_MESO Software will run without  interruption or be error free  or be free from any Harmful  Element  STFC is not obliged to provide any support or error  correction service  assistance or advice in relation to the  DL_MESO Software  but the Licensee may access any error    corrections and online assistance that STFC chooses to make    242    3 3    3 4    3 6    3 7    3 8    APPENDIX D  DL_MESO LICENCE AGREEMENT  ACADEMIC PURPOSES     available on the DL_MESO Website from time to time  If STFC does  provide that sort of service  assistance or advice  subject to  clause 3 7  STFC will not be liable for any loss or damage    suffered by the Licensee as a result     STFC will not be liable to the Licensee to the extent that any  loss or damage is caused  by the Licensee   s failure to implement   or the Licensee   s delay in implementing  any correction or advice  in relation to the DL_MESO Software that STFC has made available  on the DL_MESO Website  or by the Licensee   s failure to acquire a  licence of and to implement any new r
307. well as plots of y component  velocity  density of the fluid particles and temperature  defined only by x  and z components of velocity in this  case   The snapshot demonstrates a slight porosity of the frozen particle wall due to soft DPD interactions   which could be alleviated by a higher frozen particle density 48   while the emergent velocity profile is similar to  that expected for Poiseuille flow  The temperature and density profiles are mainly flat across the entire spacing  between the walls  apart from significant density fluctuations close to the walls         a  Visualization of system at t   2 000       5 T T T T T T T T    i e   e Density  s   s Temperature                      a      PAT  ES  ATT    y    w  rrr    Time averaged vertical velocity   lt v  gt   o   gt  a  a a    N  Pt    e  a  Time averaged particle density  lt p gt  or temperature  lt T gt        o  gr                   A   pg i  ope    i     1 l i i i   RY E 1 l    i y l i l y   3  6 8 10 12          0 2 4 6 8 10 12 0 2 4  Horizontal position  x Horizontal position  x   b  Time averaged y component of velocity  c  Time averaged fluid density and temperature    Figure 14 8  Visualization and plots from DPD PoiseuilleFlow test case  broken lines denote positions of  no slip boundaries due to frozen particle walls    14 9 ShearFlow    This simulation example consists of 3000 unbonded particles in a box of 10 x 10 x 10 DPD length units with  Lees Edwards shearing boundaries orthogonal to the y axis 
308. wen Shan and Hudong Chen  Simulation of nonideal gases and liquid gas phase transitions by the lattice  Boltzmann equation  Physical Review E  Statistical Physics  Plasmas  Fluids  and related interdisciplinary  topics  49 4  2941 2948  April 1994     W  Smith  Molecular dynamics on hypercube parallel computers  Computer Physics Communications   62 2 3  229 248  March 1991     W  Smith  A replicated data molecular dynamics strategy for the parallel Ewald sum  Computer Physics  Communications  67 3  392 406  January 1992     W  Smith  Calculating the pressure  CCP3 Information Quarterly  39 14 20  October 1993     W  Smith  T  R  Forester  and I T  Todorov  The DL_POLY Classic user manual  STFC  STFC Daresbury  Laboratory  Daresbury  Warrington  Cheshire  WA4 4AD  United Kingdom  version 1 0 edition  December  2010     T  J  Spencer  I  Halliday  and C  M  Care  Lattice Boltzmann equation method for multiple immiscible  continuum fluids  Physical Review E  82 6  066701  December 2010     Simeon D  Stoyanov and Robert D  Groot  From molecular dynamics to hydrodynamics  A novel Galilean  invariant thermostat  Journal of Chemical Physics  122 11  114112  2005     Sauro Succi  The Lattice Boltzmann Equation for Fluid Dynamics and Beyond  Clarendon Press  Oxford   2001     Michael R  Swift  W  R  Osborn  and J  M  Yeomans  Lattice Boltzmann simulation of nonideal fluids   Physical Review Letters  75 5  830 833  July 1995     I  T  Todorov and W  Smith  The DL_POLY_4 user manual  ST
309. where c is the speed of sound for the lattice  Re the Reynolds number for the flow  t the time step  p the  density  U the x component of velocity  V the y component of velocity  W the z component of velocity and     the space  boundary condition  property   The 1 0 between the lattice speed of sound and flow Reynolds number  represents the freestream angle of attack   The density of the fluid may be replaced with its concentration or  scalar temperature     If all properties are output  each property is given a uniquely named file based on the number of fluid or  solute  e g  lbout0O0dens  q for the density of fluid 0  and its property  1bout dens  q  lbout frac  q   lbout conc  q and lbouttemp  q      Chapter 7    DL MESO LBE Package Reference    7 1 Overview  DL_MESO LBE consists of nine packages     e 1bpMODEL  Contains subroutines to assign lbw  1bv and 1bopv for D2Q9  D3Q15  D3Q19 and D3Q27 lattice models     e IbpBASIC  Contains general purpose subroutines which can be used elsewhere  e g  a random number generator    producing values between    1 and 1     e 1bpGET    Contains subroutines to calculate macroscopic quantities  e g  macroscopic density  speed and momentum     e lbpI0   Contain subroutines to read parameters and write numerical results for plotting and visualization     1bpI0  Contains subroutines to read input files  calculate and write summaries       1bpI0Plot3D  Contains subroutines to write calculation output files in Plot3D format       lbpIOLegacyV
310. x_dble  aaa     e Function    Finds global maximum value of double precision number aaa     e Dependencies    None    e Arguments    aaa input output array of real KIND dp     global_sca_max_int    e Header records  SUBROUTINE global_scamax_int  iii     e Function    Finds global maximum value of integer iii     e Dependencies    None    e Arguments    iii input output array of integers    13 2  DL MESO _DPD SUBROUTINES AND FUNCTIONS 175    global_sca_min_dble    e Header records  SUBROUTINE global_sca_min_dble  aaa     e Function    Finds global minimum value of double precision number aaa     e Dependencies    None    e Arguments    aaa input output array of real KIND dp     global_sca_min_int    e Header records  SUBROUTINE global_scamin_int  iii     e Function    Finds global minimum value of integer iii     e Dependencies    None    e Arguments    iii input output array of integers    msg_receive_blocked    e Header records  SUBROUTINE msg_receive_blocked  msgtag  buf  length     e Function    In a blocking call  receives data in the form of a double precision array buf O      e Dependencies  None    e Arguments  buf output array of real KIND dp     msgtag input integer  length input integer    e Comments  For a double precision scalar  the alternative SUBROUTINE msg_receive_sca_blocked  msgtag  buf   length  is available     msg_receive_unblocked    e Header records  INTEGER FUNCTION msg_receive_unblocked  msgtag  buf  length     e Function    In a non blocking call  re
311. xdim  corrective force z component on charged frozen particle fcfx real KIND dp   A maxdim  corrective force y component on charged frozen particle fcfy real KIND dp   A maxdim  corrective force z component on charged frozen particle fcfz real KIND dp   A maxdim  velocity z component of particle VXX real KIND dp   A maxdim  velocity y component of particle vyy real KIND dp   A maxdim  velocity z component of particle vzz real KIND dp   A maxdim  Cartesian coordinate x for particle XXX real KIND dp   A maxdim  Cartesian coordinate y for particle yyy real KIND dp   A maxdim  Cartesian coordinate z for particle zzz real KIND dp   A maxdim  particle global identity number lab integer  A maxdim  particle species number ltp integer  A maxdim  particle molecule type number ltm integer  A maxdim  particle link cell population number lct integer  A maxdim  particle link cell number link integer  A maxdim  particle local domain cell identity number loc integer  A maxdim  particle domain cell number lmp integer  A maxdim  particle molecule type number ltm integer  A maxdim  species name for particle atmnam character 8   A maxdim  molecule name for particle molnam character 8   A maxdim  particle mass weight real KIND dp   A maxdim  potential energy accumulator pe real KIND dp    virial accumulator vir real KIND dp    stress tensor accumulator stress real KIND dp  A9  kinetic energy accumulator tke real KIND dp    bond potential energy accumulator be real KIND dp    angle potential energ
312. ximum specified length for the  potential  or cannot be calculated due to lack of available information for both particles  The bond s  identified  as overly long or lost is are printed either in the OUTPUT file or in the standard output  e g  screen      Action  If calculating bonds locally  increasing the size of boundary halos may reduce the likelihood of bonds  being    broken     alternatively global bond calculations can ensure all data is available at the cost of replication  over all processors  Adjusting the parameters for the bond potential may also help ensure bonds do not get too  long     Message 201  too many interacting pairs    The number of interacting pairs for non DPD thermostats  Lowe Andersen  Peters  Stoyanov Groot  exceeds    the maximum number calculated from the number of particles in the system  maxpair     Action  The user may wish to use the densvar directive in the CONTROL file to increase the values of maxdim  and maxpair  thus accommodating larger numbers of interacting pairs     Messages 1001 1096  allocation deallocation errors       Allocation or deallocation of arrays for DPD calculations  including reading of input data  transfer buffers for    communications between processors  global arrays of particle velocities for Lowe Andersen Peters Stoyanov     237    Groot thermostats etc   has failed  This may be due to a lack of addressable memory required for the DPD  calculations  These messages identify which allocation deallocation has failed
313. xpansions  of simulation volume    set permittivity constant for system  I  to f   set required system pressure to f  target pressure for constant pressure ensem   bles    print system data every n timesteps   see cutoff   restart job from end point of previous run  i e  continue current simulation  using export files    restart job from previous run without rescaling to system temperature  i e   begin a new simulation from older run without temperature reset    restart job from previous run after rescaling to system temperature  i e  begin  a new simulation from older run with temperature reset    rescale system temperature every n steps during equilibration   apply Slater type  exponential  charge smearing with coefficient  6  set to f  set rolling average stack to n timesteps   accumulate statistics data and write to CORREL file every n timesteps   run simulation for n timesteps   set required surface repulsive range  Zc  to f length units  default f   re    set hard adsorbing walls orthogonal to i axis  x  y  z  if specified  multiple  walls can be specified if separated with spaces or commas     12 1  INPUT FILES    surface frozen i    surface shear i  temperature f    trajectory  i  j    159    set frozen bead walls orthogonal to i axis  x  y  z  if specified  multiple walls  can be specified if separated with spaces or commas   Note that this can only  be used for brand new simulations  this directive is ignored if a simulation is  restarted    set moving Lees Edwards 
314. y    the parsing utilities     Define system  CONTROL    The CONTROL file contains the control variables for running a DPD simulation and is read by the subroutine  read_control in config_module  Such files can can be obtained either via use of the DL_MESO GUI or by  editing existing files of that name  such as those in the DEMO DPD directory  These consist primarily of directives   character strings that appear as the first entry of a data record and invoke a particular operation or provide  numerical parameters  Extra options may be added by the inclusion of keywords to qualify a particular directive   Directives can be included in any order except for the simulation name  up to 80 characters long  on the first  line of the file and the finish directive which marks the end of the file     A list of the directives available follows  with bold type specifying the minimum number of letters required by    DL_MESO_DPD  Some directives may include optional words or parameters as indicated by brackets     directive    boundary halo f  close time f   cutoff f   densvar f  electrostatic cutoff f  ensemble nvt mdvv  ensemble nvt dpdvv  ensemble nvt lowe    ensemble nvt peters    ensemble nvt stoyanov a    meaning     set size of boundary halo  overriding default values determined from interaction  cutoff  maximum bond lengths and short range electrostatics  as f length units  set job closure time to f seconds   set maximum interaction cutoff radius  re  to f length units   allow for 
315. y accumulator ae real KIND dp    dihedral potential energy accumulator de real KIND dp    electrostatic potential energy accumulator ee real KIND dp    bond length accumulator bdlng real KIND dp    bond length maximum value bdlmax real KIND dp    bond length minimum value bdlmin real KIND dp    bond angle accumulator bdang real KIND dp    bond dihedral accumulator bddhd real KIND dp    average system potential energy avepe real KIND dp    average system virial avevir real KIND dp    average system kinetic energy avetke real KIND dp    average system total energy avete real KIND dp    average system pressure aveprs real KIND dp    average system volume avevlm real KIND dp    average system temperature avettp real KIND dp    average system bond potential energy avebe real KIND dp    average system angle potential energy aveae real KIND dp    average system dihedral potential energy avede real KIND dp    average system electrostatic potential energy aveee real KIND dp    system potential energy fluctuation flcpe real KIND dp    system virial fluctuation flevir real KIND dp    system kinetic energy fluctuation flcke real KIND dp    system total energy fluctuation flcte real KIND dp    system pressure fluctuation flcprs real KIND dp    system volume fluctuation flcvlm real KIND dp    system temperature fluctuation flcttp real KIND dp    system bond potential energy fluctuation flcbe real KIND dp    system angle potential energy fluctuation flcae real KIND dp    system dihedral pot
316. y molecule generate cpp to create molecules for the DPD simulation and write them    16 CHAPTER 2  THE DL_MESO GUI                   DL_MESO LBE DPD SPH Manual Help Exit  Dissipative Particle Dynamics DUDES Peles LH la set species  1  set interactions 2  operating system     gt  v create molecules 3                 Prior compilation of molecule generate utility required    external force  none v set parameters 4    text editor  dimesoEditor   w edit FIELD file 5                                     Figure 2 7  Set DPD Interactions    to the FIELD file  The utility should be compiled beforehand to give the executable molecule exe  refer  to Appendix B for more details      4  It is possible to define an external force field on all particles in the system  using the pull down box to  define the type  Constant gravitational fields and linear shear boundaries can be defined  Clicking on the  button set parameters opens a pop up window to define the parameters for the external force field and  write them to the FIELD file     5  A text editor  including the built in dlmesoEditor  may be selected using the pull down box to view  and edit the FIELD file  An alternative editor can be used by selecting    other    and typing its name in the  text box before clicking on the edit FIELD file button     After the data for particle species  interactions  molecules and external fields are entered and written to the  FIELD file  clicking SAVE will complete the file  which can still be viewed 
317. ystem    e Header records    int fDefineSystem const char  filename    lbin sys      e Function    Reads calculation parameters  lattice scheme  types of collisions and forcing  mesophase algorithms  num     bers of fluids  solutes  temperature scalars  phase field order parameters  grid size  from input system file    lbin sys     76    CHAPTER 7  DL MESO _LBE PACKAGE REFERENCE    Dependencies    lbin sys data file    Arguments    filename input array of characters    Comments  The default file name is 1bin  sys  to use different file names the argument for this routine can be changed  by the user     fPrintSystemInfo    Header records  int fPrintSystemInfo      Function  Prints system information  lattice model  dimensions  boundary width  numbers of fluids  solutes and    temperature scalars  collision model  forcing type and mesophase interactions      Dependencies    None    fPrintEndEquilibration    Header records  int fPrintEndEquilibration      Function    Prints message indicating end of static equilibration process     Dependencies    None    Comments  This message is not printed if no equilibration steps are specified in the lbin sys file     fPrint DomainMass    Header records    int fPrintDomainMass      Function    Calculates and prints total and individual fluid masses in domain     Dependencies  double fGetTotMassDomain    double fGetOneMassDomain      Comments  This routine only produces the masses for the entire system if running in serial  to obtain system 
318. ystem corrections     e Dependencies  error    global_sca_and    zero    e Header records  SUBROUTINE zero    e Function  Sets step counters  initial time parameters  system parameters  accumulators for statistical properties and    long range potential corrections to zero  initializes random number generators     e Dependencies  duni    mtrnd    13 2 13 field module    This module requires the modules constants  variables  bond_module  manybody_module  ewald_module     surface_module  numeric_container and domain_module to be loaded beforehand     Different versions of each subroutine are available in this module for different integrators and or thermostats     e DPD thermostat with standard  molecular dynamics  Velocity Verlet integration  MD VV   67   mdvv     DPD thermostat with DPD Velocity Verlet integration  DPD VV  3   dpdvv     Lowe Andersen thermostat 36   lowe   e Peters thermostat 47   peters     Stoyanov Groot thermostat 62   stoyanov     forces_     e Header records  SUBROUTINE forces_   nlimit     e Function  Calculates all forces between particles  particularly pairwise forces within cut off radius     210    CHAPTER 13     e Dependencies    mtrnd  duni  gaussmp   manybody_force  manybody_potential  ewald_real  ewald_reciprocal  bondforcesglobal  bondforceslocal  hardreflect    Arguments    nlimit input integer    Comments    DL_MESO_DPD PACKAGE REFERENCE    DPD random forces are calculated using a uniform random number generator 16   by default the Mersenne  
319. ystem of free particles interacting directly through    soft       forces   e The system is coupled to a heat bath via stochastic forces  which act on the particles in a pairwise manner   e The particles also experience a damping or drag force  which also acts in a pairwise manner     e Thermodynamic equilibrium is maintained through the balance of the stochastic and drag forces  i e  the  method satisfies the fluctuation dissipation theorem     e At equilibrium  or steady state  the properties of the system are calculated as averages over the individual    particles  as in Molecular Dynamics     9 2 Outline of Method    In DPD  the system is modelled as a system of free particles  which are spherical and interact over a range  that is of the same order as their diameters  The particles can be thought of as assemblies or aggregates of    molecules  such as solvent molecules or polymers  or more simply as carriers of momentum        lThe outline of the DPD method supplied here is based on  16      127    128 CHAPTER 9  DISSIPATIVE PARTICLE DYNAMICS  BASIC THEORY    The equations governing the time evolution in a DPD simulation resemble those of ordinary MD     di  F    d    E   Si cih 2  T v  9 2     in which r   v  and F  are the position  velocity and force of the ith particle  which has mass m   The force on    the particle is a sum of pair forces   N    R PC  AD  BR  A Y  ES   FD   FR   9 3   IA  in which ES  represents the force exerted on particle    due to the presence 
    
Download Pdf Manuals
 
 
    
Related Search
    
Related Contents
  Magnochem (B)  Benutzerhandbuch und Wartungshandbuch  Untitled - 京都外国語大学・京都外国語短期大学  IBM System Storage & TotalStorage DS3950  CMS200 User Manual VERSION 2.4.0.0 (Build 100831    Copyright © All rights reserved. 
   Failed to retrieve file