#===========================================================================#
#  System of colloidal particles under shear.                               #
#                                                                           #
#  Run consists of 10x12x4 particles, each composed of 3613 particle nodes  #
#    (3612 particles forming a spherical shell, and 1 central particle).    #
#  280 x 280 x 101 lattice-Boltzmann grid sites.                            #
#                                                                           #
#  This simulation is used to illustrate the simulation time of a realistic #
#    implementation of the lb_fluid fix.                                    #
#  The data file "confinedcolloids.dat" is quite large and so is not        #
#  included here.  It can be obtained from:                                 #
#  http://www.apmaths.uwo.ca/~cdennist/confinedcolloids.dat.gz              #
#                                                                           #
#  Sample output from this run can be found in the file:                    #
#    results64.out                                                          #
#===========================================================================#

units       micro
dimension   3
boundary    p p f
atom_style  molecular
read_data   confinedcolloids.dat

mass * 0.00010287

#----------------------------------------------------------------------------
# Need a neighbor bin size smaller than the lattice-Boltzmann grid spacing   
#   to ensure that the particles belonging to a given processor remain inside
#   that processors lattice-Boltzmann grid.   
# The arguments for neigh_modify have been set to "delay 0 every 1", again
#   to ensure that the particles belonging to a given processor remain inside
#   that processors lattice-Boltzmann grid.  However, these values can likely
#   be somewhat increased without issue.  If a problem does arise (a particle
#   is outside of its processors LB grid) an error message is printed and 
#   the simulation is terminated.                               
#---------------------------------------------------------------------------- 
neighbor 0.03 bin
neigh_modify delay 0 every 1
neigh_modify exclude type 2 2
neigh_modify exclude type 2 1

#----------------------------------------------------------------------------
# ForceAtoms are the particles at the center of each colloidal object which  
#   do not interact with the fluid, but are used to implement the hard-sphere
#   interactions.                                                              
#----------------------------------------------------------------------------
group ForceAtoms type 1  

#----------------------------------------------------------------------------
# FluidAtoms are the particles representing the surface of the colloidal
#   object which do interact with the fluid.
#----------------------------------------------------------------------------
group FluidAtoms type 2

#----------------------------------------------------------------------------
# Implement a hard-sphere interaction between the particles at the center of 
#   each colloidal object (use a truncated and shifted Lennard-Jones 
#   potential).
#----------------------------------------------------------------------------
pair_style lj/cut 1.572
pair_coeff * * 0.0 0.0 1.572
pair_coeff 1 1 10.0 1.400492785 1.572
pair_modify shift yes

timestep 0.0006

#---------------------------------------------------------------------------
# Create a lattice-Boltzmann fluid covering the simulation domain.
# This fluid feels a force due to the particles specified through FluidAtoms 
#   (however, this fix does not explicity apply a force back on to these 
#    particles...this is accomplished through the use of the viscous_lb fix).
# Use the standard LB integration scheme, a fluid density = 1.0, 
#   fluid viscosity = 1.0, lattice spacing dx=0.06, and mass unit, dm=0.00003.
# Use the default method to calculate the interaction force between the 
#   particles and the fluid.  This calculation makes use of the surface area 
#   of the composite object represented by each particle node.  Since this is 
#   not equal to dx*dx, it is input through the setArea keyword (i.e. 
#   particles of type 2 correspond to a surface area of 0.0018337299).
# Implement walls moving at speeds of 20.0 in opposite directions.
#----------------------------------------------------------------------------
fix   1 FluidAtoms lb/fluid 1 1 1.0 1.0 dx 0.06 dm 0.00003 setArea 2 0.0018337299 zwall_velocity -20.0 20.0 

#----------------------------------------------------------------------------
# Apply the force due to the fluid onto the FluidAtoms particles (again,
#   these atoms represent the surface of the colloidal object, which should
#   interact with the fluid).
#----------------------------------------------------------------------------
fix   2 FluidAtoms lb/viscous

#----------------------------------------------------------------------------
# Each colloidal object (spherical shell of particles and central particle)
#   is specified as a separate molecule in the confinedcolloids.dat data
#   file.  Integrate the motion of each of these sets of particles as rigid
#   objects which move and rotate together.
#----------------------------------------------------------------------------
fix   3 all rigid molecule 

#----------------------------------------------------------------------------
# Implement a repulsive interaction between the ForceAtoms particles, and the
#   upper and lower z-walls. (A truncated and shifted Lennard-Jones potential 
#   is used).
#----------------------------------------------------------------------------
fix   wallhi ForceAtoms wall/lj126 zhi 5.88 20.0 0.8071542386 0.906 units box
fix   walllo ForceAtoms wall/lj126 zlo 0.0  20.0 0.8071542386 0.906 units box

#dump  ParticleTracking ForceAtoms custom 50 test.track id mol x y z vx vy vz

run   400
