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

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,
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”
to
“fix 8 addSi deposit 10000 3 1000 12345 region slab near 0.1 vz -0.5 -0.5”

or
change
“fix 8 addSi deposit 10000 3 2000 12345 region slab near 0.1 vz -0.5 -0.5”
to
“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