##############################################################################
#
#  Ludwig input file
#  Reference.
#
#  Lines introduced with # and blank lines are ignored.
#
#  The file is made up of a series of (case-sensitive) keyword value
#  pairs which should be separated by a space:
#
#  keyword value
#
#  Components of vector values are separated by an underscore, e.g.,
#  force 0.01_0.00_0.00
#
#  If a given keyword does not appear, or is commented out, a default
#  value will be used.
#
##############################################################################

##############################################################################
#
#  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 1000

##############################################################################
#
#  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).
#
#  reduced_halo  [yes|no] use reduced or full halos. Using reduced halos
#                is *only* appropriate for fluid only problems.
#                Default is no.
# 
##############################################################################

size 128_128_128
#grid GRID
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 1.0
#viscosity_bulk 1.0

isothermal_fluctuations off
temperature 0.00002133333

# ghost_modes off
# force 0.00_0.0_0.0

##############################################################################
#
#  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 3
fd_gradient_calculation 3d_7pt_fluid

###############################################################################
#
#  Symmetric / Brazovskii
#
#  A            symmetric bulk parameter (A < 0 for binary fluid)
#  B            symmetric bulk parameter (B = -A for binary fluid)
#  kappa        surface 'penalty' parameter (kappa > 0 for binary fluid)
#  C            additional brazovskki parameter (C = 0 for binary fluid)
#
#  mobility               Order parameter mobility M
#
#  phi_initialisation     spinodal or block [spinodal] 
#  noise        magnitude of initial order parameter noise [default 0.05]
#  phi0         mean order parameter
#
#
###############################################################################

A -0.0625
B 0.0625
K 0.04
C 0.0

mobility 0.15

noise 0.05
phi0 0.0
phi_initialisation    spinodal

###############################################################################
#
#  Surfactant free energy; set
#
#  In addition to A, B, K, of the symmrtric binary fluid, there are the
#  extra parameters
#
#  surf_kT             bulk surfactant parameter
#  surf_epsilon        surface term
#  surf_beta           non-linear term
#  surf_W              entropy term
#
#  surf_mobility_phi   fluid order parameter mobility
#  surf_mobility_psi   surfactant order parameter mobility
#  surf_psi_b          initial uniform (background) concentration
#             
###############################################################################

surf_A -0.0208333
surf_B  0.0208333
surf_kappa 0.12

surf_kT 0.00056587
surf_epsilon 0.03
surf_beta 0.0
surf_W 0.0

surf_mobility_phi 0.15
surf_mobility_psi 2.0
surf_psi_b 0.01

###############################################################################
#
#  Blue Phase free energy
#
#  lc_a0
#  lc_gamma
#  lc_q0
#  lc_kappa0
#  lc_kappa1
#  lc_xi
#
#  lc_q_initialisation  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_a0      0.01
lc_gamma   3.0
lc_q0      0.19635
lc_kappa0  0.000648456
lc_kappa1  0.000648456
lc_xi      0.7

lc_Gamma   0.5
lc_active_zeta 0.0

lc_q_initialisation twist
lc_q_init_amplitude 0.333333333333333
lc_init_redshift 1.0
lc_init_nematic 1.0_0.0_0.0

lc_anchoring_method two
lc_wall_anchoring normal
lc_coll_anchoring normal
lc_anchoring_strength_colloid 0.002593824


###############################################################################
#
#  polar active gel
#
###############################################################################

polar_active_a       -0.1
polar_active_b       +0.1
polar_active_k       0.01
polar_active_klc     0.02
polar_active_zeta    0.0
polar_active_lambda  0.0

leslie_ericksen_gamma 0.3
leslie_ericksen_swim  0.0

###############################################################################
#
#  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        no_colloids
colloid_type        inactive

colloid_random_no   1
colloid_random_a0   7.25
colloid_random_ah   7.25
colloid_random_dh   0.4
colloid_random_r0   32.0_32.0_32.0
colloid_random_v0   0.0_0.0_0.0
colloid_random_s0   1.0_0.0_0.0
colloid_random_m0   1.0_0.0_0.0

# Constant body force on all colloids ("gravity")

colloid_cell_list_interactions no
colloid_cell_min 4.0
colloid_gravity 0.0_0.0_0.0

# Colloid-colloid lubrication corrections

lubrication_on 0
lubrication_normal_cutoff 0.3
lubrication_tangential_cutoff 0.0

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

soft_sphere_on 0
soft_sphere_epsilon 0.04
soft_sphere_sigma 0.1
soft_sphere_nu 1.0
soft_sphere_cutoff 0.25

# Lennard Jones
lennard_jones_on 0
lj_sigma 2.3
lj_cutoff 4.6
lj_epsilon 0.0003

###############################################################################
#
#  Periodic conditions / boundaries
#
#  boundary_walls_on      [yes|no] Use built-in side walls [default no]
#  periodicity X_Y_Z      Sets periodic boundary conditions in coordinate
#                         directions [default is 1_1_1]. Best to leave this
#                         unchanged
#  boundary_speed_top     For use with built-in walls
#  boundary_speed_bottom  For use with built-in walls
#
#  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_on no
periodicity 1_1_1
boundary_speed_bottom 0.0
boundary_speed_top    0.0

#porous_media_format BINARY
#porous_media_file   capillary_8_8_32.dat
#porous_media_type   status_only

###############################################################################
#
#  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
#  The following for particle data are under review...
#  n_io_nodes               Number of I/O processors for particles
#  output_format            [ASCII|BINARY] default output format
#  input_format             [ASCII|BINARY] default input format
#
#  phi_format               Override default format for particular quantities
#  etc...                   (both input and output)
#
###############################################################################

freq_statistics 10000
freq_measure 500000
freq_config 200000
freq_phi    200000
freq_vel    300000
freq_shear_measurement 100000
freq_shear_output      100000
config_at_end no

distribution_io_grid 1_1_1

phi_format    BINARY
vel_format    BINARY

colloid_io_freq 10000000
colloids_io_grid 1_1_1
colloid_io_format_input  ASCII
colloid_io_format_output ASCII

qs_dir_format BINARY

###############################################################################
#
#  Lees-Edwards planes
#
#  These parameters set up a number of equally spaced planes
#  with constant velocity.
#
#  N_LE_plane       the number of planes
#  LE_plane_vel     the y-component of the plane velocity
#  LE_init_profile  set the initial velocity profile to be consistent with
#                   desired shear rate. (Only valid at t = 0). [0|1]
#
#  LE_oscillation_period
#                   Integer > 1, switches on u = u_0 cos(2\pi t/T) where
#                   u_0 is maximum plane velocity set via LE_plane_vel,
#                   and T is the oscillation period
#
###############################################################################

#N_LE_plane 2
#LE_plane_vel 0.008
#LE_init_profile 1
#LE_oscillation_period 0

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

#random_seed 7361237
random_seed 8361235
