##############################################################################
#
#  Colloids in LC tutorial
#
##############################################################################

##############################################################################
#
#  Run duration
#
#  N_start        If N_start > 0, this is a restart from previous output
#
#  N_cycles       number of lattice Boltzmann time steps to run
#                 (if it's a restart, this is still the number of steps
#                 to run, not the final step)
#
###############################################################################

N_start  0
N_cycles 10000

##############################################################################
#
#  System and MPI
#
#  size NX_NY_NZ is the size of the system in lattice units
#  grid PX_PY_PZ is the processor decomposition
#                If PX*PY*PZ is not equal to the number of processors,
#                MPI will choose a default (may be implementation-dependent).
#
#  periodicity   Periodicity of MPI Cartesian communicator
#
#  reduced_halo  [yes|no] use reduced or full halos. Using reduced halos
#                is *only* appropriate for fluid only problems.
#                Default is no.
# 
##############################################################################

size 32_32_32
grid 2_2_2
periodicity 1_1_1
reduced_halo no

##############################################################################
#
#  Fluid parameters
#
#  viscosity      shear viscosity [default is 1/6, ie., relaxation time 1]
#  viscosity_bulk bulk viscosity  [default = shear viscosity]
#
#  isothermal_fluctuations  [on|off] Default is off.
#  temperature              isothermal fluctuation 'temperature'
#
#  ghost_modes           [on|off] Default is on.
#  force FX_FY_FZ        Uniform body force on fluid (default zero)
#
##############################################################################

viscosity 0.833333
viscosity_bulk 0.833333

isothermal_fluctuations off
temperature 0.000000002133333

##############################################################################
#
#  Free energy parameters
#
#  free_energy none               single fluid only [the default]
#
#  Otherwise
#
#  free_energy                    symmetric
#                                 brazovskii
#                                 surfactant
#                                 polar_active
#                                 lc_blue_phase
#
#                                 symmetric_lb symmetric with 2 distributions
#
#  fd_advection_scheme_order      1-7
#                                 sets order of finite difference
#                                 advection scheme
#
#  fd_gradient_calcualtion        Scheme to yse for gradient calculations
#                                 2d_5pt_fluid
#                                 3d_7pt_fluid
#                                 3d_27pt_fluid
#                                 3d_27pt_solid
#
#  Note: only parameters for the currently selected free energy at
#  run time are meaningful; you don't have to comment out all the others.
#
###############################################################################

free_energy lc_blue_phase

fd_advection_scheme_order 2
fd_gradient_calculation 3d_7pt_solid

###############################################################################
#
#  Blue Phase free energy
#
#  lc_a0
#  lc_gamma
#  lc_q0
#  lc_kappa0
#  lc_kappa1
#  lc_xi
#  lc_active_zeta
#
#  lc_q_initialisation  nematic, twist
#                       o8m
#                       o2
#
#  lc_q_init_amplitude  scalar order parameter amplitude for initialisation
#
#  Typically            BPI   o8m amplitude -0.2
#                       BPII  o2  amplitude +0.3
#                       simple cholesteric twist (z-axis) amplitude +1/3
#
#  lc_anchoring_method  [none|one|two] (default is none) one: Juho's method
#                       two: explicit surface free energy
#  lc_anchoring         [normal|planar|fixed] anchoring boundary conditions
#                       for solid (if present; defualt is normal)
#
#  lc_anchoring_strength the parameter w in the surface free energy
#                        [Default is zero = 'free' anchoring]
#
#  lc_init_redshift     Initial value of redshift.
#
#
#  lc_redshift_update   [0|1] Allow dynamic cubic redshift adjustment
#                       (default is none).
#
#  lc_init_nematic      Initial director vector [default 1.0_0.0_0.0] when
#                       nematic initialisation used (doesn't need to be
#                       unit vector)
#
###############################################################################

lc_a0      0.084334998544
lc_gamma   3.085714285714
lc_q0      0.0
lc_kappa0  0.01
lc_kappa1  0.01
lc_xi      0.7

lc_Gamma   0.3

lc_q_init_amplitude 0.2
lc_q_initialisation nematic
lc_init_redshift 1.0
lc_redshift_update 0
lc_init_nematic 1.0_0.0_0.0

lc_anchoring_method two
lc_coll_anchoring normal
lc_anchoring_strength_colloid 0.01

###############################################################################
#
#  Colloid parameters
#
#  colloid_init:  no_colloids [default]
#                 from_file
#                 random (see below)
#  colloid_type:  inactive bbl [default]
#                 active   Include active terms in BBL
#                 subgrid  No bbl ("unresolved particles")
#
#  colloid_cell_min:
#                 This MUST be set if colloids are present: it specifies
#                 the minimum cell list width, and must be at least 2ah
#                 + delta, where delta catches any colloid-colloid
#                 interactions. 
#
###############################################################################

colloid_init        from_file
colloid_rho0        1.0

# Constant body force on all colloids ("gravity") [default is zero]
# Uniform magnetic field [default is zero]

colloid_cell_list_interactions yes
colloid_cell_min 8.0
colloid_gravity  0.0_0.0_0.0
magnetic_b0      0.0_0.0_0.0

# Colloid-colloid lubrication corrections

lubrication_on 0

###############################################################################
#
# Colloid-colloid soft-sphere potential parameters
# The soft sphere is always needed
#
###############################################################################

soft_sphere_on 1
soft_sphere_epsilon 0.0004
soft_sphere_sigma 0.1
soft_sphere_nu 1.0
soft_sphere_cutoff 0.25

###############################################################################
#
#  Walls / boundaries
#
#  boundary_walls         X_Y_Z [0 for no wall; 1 for wall]
#                         Must be consistent with periodicity above
#  boundary_speed_top     For use with built-in walls
#  boundary_speed_bottom  For use with built-in walls
#  boundary_shear_init    Initialise shear flow (z direction only).
#
#  boundary_lubrication_rcnormal Normal lubrication correction cut off
#
#  porous_media_file filestub    If present, the file filestub.001-001
#                                should contain porous media data
#  porous_media_format           [ASCII|BINARY] file format [default BINARY]
#  porous_media_type             [status_only|status_with_h]
#                                determines type of porous media data to be
#                                supplied
#
###############################################################################

boundary_walls 0_0_0

###############################################################################
#
#  Output frequency and type
#
#  freq_statistics N        Output diagnostics every N steps
#  freq_output     N        Output field state every N steps
#  freq_config     N        Output full configuration (for restart) every
#                           N steps (can be large!)
#  freq_phi        N        phi data output frequency
#  freq_vel        N        velocity data output frequency
#  freq_shear_measurement   stress profile accumulator
#  freq_shear_output        stress profile output
#  config_at_end            [yes|no] write full configuration at end of run
#                           [default is yes]
#
#  io_grid  NX_NY_NZ        Cartesian processor I/O grid. Default is 1_1_1
#
#  phi_format               Override default format for particular quantities
#  etc...                   (both input and output)
#
#  distribution_io_grid         decomposition for parallel input/output
#  distribution_io_input_format BINARY or BINARY_SERIAL for single serial
#                               input files. Output always parallel.
#
###############################################################################

freq_statistics 250
freq_measure 1000000000
freq_config 10000
freq_phi    1000
freq_vel    1000
freq_shear_measurement 1000000000
freq_shear_output      1000000000
config_at_end yes

default_io_grid 1_1_1

distribution_io_grid 1_1_1

phi_io_grid 1_1_1
phi_format    BINARY
vel_format    BINARY

##############################################################################
#
#  colloid i/o
#
#  colloid_io_freq           currently set to freq_measure internally
#  colloid_io_grid           currently set to 1_1_1 internally
#  colloid_io_format_input   ASCII ASCII_SERIAL BINARY BINARY_SERIAL
#  colloid_io_format_output  ASCII BINARY
#
#  Note that the output is always parallel. A SERIAL input file must
#  be a single serial file.
#
##############################################################################

colloid_io_freq 1000
colloid_io_grid 1_1_1
colloid_io_format_input  ASCII_SERIAL
colloid_io_format_output ASCII

###############################################################################
#
#  Miscellaneous
#
#  random_seed  +ve integer is the random number generator seed
#
###############################################################################

random_seed 8361435
