Use the rigid/npt/small command in 2d

########## 1. variable ##########
variable Rc equal 0.5 #radius of the centrail(big) particle
variable Ra equal 0.1 #radius of the small particle (asperities)
variable Na equal 16 #number of small particle
variable k equal (({Ra}/{Rc})^2)/2 #half of the radius ratio square
variable mc equal 1/({Na}*{k}+1) #mass of the central particle
variable ma equal (1-{mc})/{Na} #mass of the small particle
variable Dc equal 2*{Rc} #diameter of the central particle variable Da equal 2*{Ra} #diameter of the small particle
variable dc equal {mc}/({Rc}^2)
variable da equal {ma}/({Ra}^2)
########## 2. basic settings ##########
dimension 2 #set dimension
atom_style sphere # Qinghao uses hybrid sphere dipole
boundary p p p #set the periodic boundary condition
comm_modify vel yes #ghost atoms store the velocity information
atom_modify map array
timestep 0.0001
fix prop all property/atom mol ghost yes
#set ghost atom store the molecule property
region box block 0 10 0 10 -0.25 0.25 units box #the box region
create_box 2 box #create two kinds of atoms in the box
shell mkdir dump #create folder for dumping

########## 3. pair settings ##########
pair_style gran/hertz/history 1e8 0 0 0 0 0 #set interaction
pair_coeff * * #the same interaction for all particles

########## 4. create molecule ##########
molecule allmol mol_rough1.txt #read molecule file
create_atoms 0 random 20 666 box mol allmol 4565 overlap 0.5 maxtry 20 units box #create one molecule in box
set type 1 diameter {Dc} #set diameter of the central atom set type 2 diameter {Da} #set diameter of the small atom
set type 1 mass (v_mc) #set mass of the central atom set type 2 mass (v_ma) #set mass of the small atom

########## 6. compute and thermo ##########
compute 1 all erotate/sphere #compute rotational kinetic energy
compute 2 all temp/sphere #compute rotational and translational kinetic energy
thermo_style custom step temp atoms vol c_2 #set thermo style
thermo_modify temp 2 #set temp compute
compute_modify 2 dynamic/dof yes
thermo 100 #set thermo step
########## 5. molecule settings ##########
velocity all create 1.0 5454654#add kinetic energy
velocity all zero linear
fix 1 all rigid/small molecule #temp 0.6 0.6 0.01 iso 0.001 0.001 0.1#set the molecule rigid
#fix 2 all nve/sphere disc #set nve and disc
fix f2d all enforce2d # ensure the forces are in 2D
#fix_modify 1 dynamic/dof no
########## 7. run ##########
dump 1 all custom 10 dump/tmp.*.dump mol id type radius mass xu yu zu vx vy vz omegax omegay omegaz
#set dump custom step file and style
dump_modify 1 format 6 %lf format 7 %lf format 9 %lf format 10 %lf
#set the precision
run 30000
unfix 1
unfix f2d
fix 1 all rigid/npt/small molecule temp 1.0 1.0 0.1 iso 0.001 0.001 1.0
fix_modify 1 dynamic/dof yes
run 20000
This is the in file. I want to use the rigid/npt/small command to shrink the box.Thus,the number density increases.But it always report the error “Temperature compute degrees of freedom < 0”.Sorry if this is a basic question,and thank you in advance.

I think this solves your problem! :))

1 Like

Thank you for your reply.
I’m trying to use this.

Thank you for your help.I use the same way to sovle the problem.It doesn’t work.

Please simplify your input to have only the minimum number of commands necessary. Then try to recreate the issue with a very small system size and finally provide a complete input (best as an attached compressed tar archive) that can be more easily debugged. The input you posted is convoluted and difficult to understand from remote, in part also because it is badly typeset in the forum, because you didn’t mark it with triple backquotes (```) as program text and thus prevent the forum software to interpret special characters as embedded formatting (it is similar to markdown).

Thank you for your reminding.I am a new user,so I can’t upload the attchment.I will recreate the topic.Could you please have a look for this?

You have been upgraded to “basic user” level.

Please note you can always upload your files to a folder on Dropbox, Google Drive, One Drive, or similar and provide a shareable link.

mol_rough.zip (1.5 KB)
Thank you for your help.This is the complete input file.

There are actually two issues with computing temperature in your input.
The thermodynamic output is only one of them.

Once you switch to using fix rigid/npt/small, you also have a temperature compute created by that fix as well, and - same as for the thermodynamic output - it assumes point particles by default.

So you need to append: fix_modify 1 temp 2 after switching to fix rigid/npt/small to teach that fix how to correctly compute the temperature for your system.

I appreciate your help.It’s very useful for me.And your mean is have a another issue?

Please read my message again and try what I suggest.

Thank you very much.It works well.
All the best,
Xnq