Using NPT ensembles in deposit simulations

Dear everyone
I simulate homoepitaxy on SiC substrate(solid phase). For the substrate, I create the fixed layer and the thermostat layers . Then I use deposit command to add the C and Si atom (as gas phase). I want to control the temp and pressure ,So I use the npt command. But as the result of "thermo_style custom step pe ke etotal temp vol press " , I can control the temp ,but the pressure is negative. (I use units -metal, and sw potential file)
how should i do to control the gas pressure?
thank you

First off, you are using the term “ensemble” incorrectly. When using the fix npt command you are not automatically in the NPT ensemble. For starters, with the deposition, your number of particles is not constant. There are additional requirements. Please see a statistical mechanics textbook for details. So all you can say is that you try to apply a Nose-Hoover thermostat and a Nose-Hoover barostat.

It makes no sense to apply a barostat in your case. You have an open system, thus the total pressure has no real meaning, since - technically speaking - your volume is infinitely large (it is only finite due to convenience in the implementation) and thus pressure cannot be computed.

For your kind of setup, even a thermostat should not be applied globally, but only to a limited region in the bulk of your solid slab. You would apply no thermostat (i.e. using fix nve for time integration) to the majority of the system.

You would have in the most conservative case a layout as follows:

immobile atoms (1-2 layers, no time integration, no thermostat)
thermostatted atoms (4-5 layers, time integration and thermostat)
mobile and deposited atoms (2+ layers, only time integration)
gas/vacuum region (this is the slab grows into)
deposit region

Dear akohlmey,
Thank you very much for your advice.
I have followed it to change my in file. But there are two more questions to ask for your help.

  1. If I want to see the different results at different pressure, how should I change the code?
    As you said, the pressure cannot be computed.
    If I want to see results after doubling the relative pressure, it means the number of atoms in the vacuum region is doubled. So is it suitable to change the code as following?
    For example ,I change
    “fix 8 addSi deposit 10000 3 2000 12345 region slab near 0.1 vz -0.5 -0.5”
    “fix 8 addSi deposit 10000 3 1000 12345 region slab near 0.1 vz -0.5 -0.5”

“fix 8 addSi deposit 10000 3 2000 12345 region slab near 0.1 vz -0.5 -0.5”
“fix 8 addSi deposit 10000 3 2000 12345 region slab near 0.1 vz -0.25 -0.25”

Is it right? which is better?

2.For the temperature,
Should I use “velocity create” command to initial the velocity of all atoms (I have set)?
I have set the layers as following
(#--------- immobile atoms---------------
fix 1 fixSiC setforce 0 0 0

#--------- thermostatted atoms------------------------
fix 2 thermostat nvt temp 973.15 973.15 0.1

#--------- mobile atoms------------------------
fix 3 freeSiC nve

#--------- Minimize energy---------------------------------------
min_style cg
minimize 1.0e-12 1.0e-12 10000 10000

fix 4 addSi nve
fix 5 addC nve

Thank you very much.

Let me reiterate, you cannot think of this in terms of pressure. With an open system, you do not have a global pressure. The closest you can do is to determine a 1-d pressure profile. That is a bit convoluted and dependent on having a sufficient number of particles in the 1d-bins and averaging over a sufficient amount of time to be meaningful. There is an example for doing this in the documentation of the compute stress/atom command — LAMMPS documentation

There are no absolute rights or wrongs in these cases. What you do is a question of your choice of model. Which to choose is your decision. You will have to figure out for yourself which is more suitable for the point you want to make with your simulation in particular and your research in general.

Again, that is a choice you have to make. Whatever you do, you have to make certain that your system is properly equilibrated before you start depositing. Which settings get you there and which are more reliable differs for different systems and there are differences in opinion, too.