How to add global damp in a granular system?

Hello everyone!
Which command I can use to add global damp in a granular system? In other words, I want to simulate the drag force in suspending medium like ambient air in granular systems. How to achieve that ?

Your question is too generic. You need to describe what physics the damping should follow. This often means you need to use some MD-CFD coupling. There are multiple such available for LAMMPS, e.g. to couple to OpenFOAM, but none has (yet) been contributed to LAMMPS.

The only related feature in LAMMPS is the fix viscous command — LAMMPS documentation
Please check its documentation about whether its simple physics is sufficient for your model. I.e. it will only “see” point particles and thus not apply damping to rotations.

Thank you for your reply! I’ll check the document. My aim is to apply shear to a granular system, and I want to reach equilibrium by the overdamped mechanism. It is similar to the attached image. The doi of the above paper is 10.1103/PhysRevE.72.011301

There is no need to quote the paper you are following. The decision of whether what LAMMPS offers is suitable for your case or not is yours. So you have to compare what the LAMMPS documentation says with the physics you want to follow.

Thanks for your suggestion, I will check the documentation.

Hey akohlmey, sorry to bother you again. I used fix viscous command to add global damping but there is no change of the MSD of the system. I wonder if i inserted the command in the wrong place. And I also used fix viscous/sphere command and fix damping/cundall command, they report error: Unrecognized fix style ‘damping/cundall’ (src/modify.cpp:908) or Unrecognized fix style ‘viscous/sphere’ (src/modify.cpp:908). I search the manual but I didn’t find how to solve it.
This is my code, thanks a lot! I’m a new user so I can’t upload the file. Sorry for that.

# code
units		lj         # lj-所有量没有单位
atom_style      sphere  # 原子类型,sphere-具有直径,质量,角速度
boundary        p p p      # 边界,全为固定边界
dimension 3   #维度,可以取2或3,LAMMPS默认运行3d模拟,运行2d模拟时要注意其余命令协调             
comm_modify     vel yes    #定义分子作用方式,vel_yes-与幽灵原子(ghost atoms)交流速度

region          box block -125 125 -125 125 -0.75 0.75 units box  #定义区域,ID-区域名(box) style-区域类型(block)keyword-区域关键词(units)box代表几何定义在box units中
create_box      2 box      #创建了基于特定区域的模拟盒子,所以首先要用region命令定义区域;2-原子类型 box-区域ID

pair_style	hybrid gran/hertz/history 4000.0 NULL 100.0 NULL 0.5 1 

pair_coeff	* * gran/hertz/history   # 定义作用力参数,若共有N种原子,那么*代表从1到N的所有类型,*n代表从1到n,n*代表从n到N,m*n代表从m到n,此时必须m小于n 

region          container block -120 120 -120 120 -0.75 0.75 units box # 定义区域container
fix		container all wall/gran/region hooke/history &   
		4000.0 NULL 100.0 NULL 0.5 1 region container

		

neighbor	0.3 bin  

neigh_modify	delay 0 every 1 check yes 



fix          1 all nve/sphere
fix		      2 all gravity 1.0 vector 0 0 -1

#region          slab block -150 150 -150 150 -0.75 0.75 units box
fix          3  all pour 500 1 123456 region container ignore  vol 0.86 10 diam poly 2 1.0 0.5 1.4 0.5 


timestep	5e-8

compute         1 all temp  #ID取1,命名这一步计算为1, 对所有(all)原子作用;temp-计算系统温度(由动能出发)
compute_modify  1 dynamic/dof yes  # ID=1,即修正上一步计算。dynamic yes-重新计算影响温度的原子数,dof?

compute         2 all temp/sphere 
compute_modify  2 dynamic/dof yes

thermo		100   # 每N步(N=100)计算并打印热力学瞬时信息(温度,能量,压力等),N可以是一个变量,具体见manual
thermo_style	custom step atoms temp c_1 c_2 press 
compute1、compute2的全局温度;press-计算压力
thermo_modify   lost ignore     # 忽略运算中lost的原子
compute_modify  thermo_temp dynamic/dof yes    #修正的thermo_modify运算有定义吗?


run 500
unfix 3
unfix  2



change_box  all triclinic
#fix				7 all nvt/sllod temp 200 200 1

#fix      9 all viscous/sphere 0.01

fix     4 all deform 1 xy erate -0.24 remap v #每一时间步加载0.24,总形变0.24*5e-8*500=6e-6 (第500步时达到,可以继续加载);重新映射穿越周期边界的原子的速度(LE边界)
#fix     8 all viscous 1000
fix     9 all viscous/sphere 0.1
#fix      10 all damping/cundall 0.8 0.8

compute 3 all msd com yes #计算均方位移并输出
variable  msdx equal c_3[1]
variable  msdy equal c_3[2]
variable  msdz equal c_3[3]
variable  msd  equal  c_3[4]
variable istep equal step
fix 6 all print 50 " ${istep} ${msdx} ${msdy} ${msdz} ${msd}" screen no file msd.dat

dump 2 all atom 50 dump2.oscillatory

run 5000

Debugging your input is first and foremost your job. It would only become my job if you can confirm a bug. For that you need to simplify your input (and take out distractions like non-ASCII characters) or better yet create a minimal test case with only the absolute minimum number of commands to verify the function or failure.

Those errors usually mean that you have either a version of LAMMPS that is too old and thus does not include the functionality you want to use, or that your executable was not configured to include the optional packages that include those commands. In the latter case, there would be an indication of the package that is required. Please note that the online version always reflects the latest patch or - if selected - the latest stable release. If you use an older version, you have to check with the version of the manual that corresponds to your LAMMPS version.

Thanks for your detailed reply! I got a lot of problems since I’m a new user of LAMMPS. I will try to modify my code. Thanks again!