# NUFEB simulation

atom_style	bio
atom_modify	map array sort 1000 5.0e-7
boundary	ff ff ff
newton		off
processors  * * *

comm_modify	vel yes
#variable reps loop ${Replicates}
read_data_bio atom_${n_cyanos}_${n_ecw}_${SucPct}_${Replicates}_${date}.in
#shell mkdir Run_${n_cyanos}_${n_ecw}_${SucPct}_${Replicates}
#shell cd Run_${n_cyanos}_${n_ecw}_${SucPct}_${Replicates}
##############Define initial particle distribution##############

lattice sc 1e-6 origin 0 0 0
region reg block 0 1000 0 1000 0 100

${CYANOGroup}
${ECWGroup}

neighbor	5e-7 bin
neigh_modify	delay 0 one 5000

##############Define DEM Variables&Commands##############

pair_style  gran/hooke/history 1.e-4 NULL 1.e-5 NULL 0.0 1
pair_coeff  * *

timestep 10

fix 1 all nve/limit 1e-8
fix fv all viscous 1e-5

fix zw all wall/gran hooke/history 2000 NULL 500.0 NULL 1.5 0 zplane  0.0  ${Zheight}

variable kanc equal 50

variable ke equal 5e+10


##############Define IBm Variables##############

#variables used in fix eps_extract
variable EPSdens equal 30
variable EPSratio equal 1.3

#variables used in fix division
variable divDia1 equal 1.96e-6
variable divDia2 equal 1.04e-6

#variables used in fix kinetics
variable diffT equal 1e-4
variable tol equal 1e-11
variable etaHET equal 0.6
variable layer equal -1

#variables used in fix death
#variable deadDia equal 9e-7


##############Define IBm Commands##############

fix k1 all kinetics 100 ${GridMesh} v_diffT v_layer niter 1000000
fix kgm all kinetics/growth/monod sucexp $SucRatio
fix g1 all kinetics/diffusion v_tol
${CYANODiv}
${ECWDiv}
#fix d2 all death 1 v_deadDia demflag 0


##############Define IBm Computes##############

compute myNtypes all ntypes
compute myMass all biomass
compute myCon all avg_con

##############Simulation exit condition##############
variable co2 equal c_myCon[4]
fix 10 all halt 100 v_co2 <= 1e-19

variable light equal c_myCon[1]
fix 11 all halt 100 v_light <= 1e-19

##############Simulation Output##############
dump    id all custom 100 output.lammmps id type diameter x y z
dump    du1 all vtk 100 atom_*.vtu id type diameter x y z
dump    du2 all grid 100 grid_%_*.vti con
dump    du3 all bio 100 ntypes biomass avg_con
dump    traj all bio/hdf5 100 trajectory.h5 id type radius x y z con
thermo_style    custom step cpu atoms c_myNtypes[*] c_myMass[*] c_myCon[*]
thermo		100
thermo_modify	lost ignore


run $Timesteps
#shell cd ..
#clear
#next reps
#jump SELF
