Page 1 of 2

MLFF NPT Pressure Question (solid/liquid interface)

Posted: Tue Jul 02, 2024 9:09 am
by jess_white
Hi everyone,

I am currently doing machine learning FF learning for a solid/liquid interface and have some questions about using NPT and as well as the pressure.

So I am currently doing two different systems, one system I call the fixed system and the other I call the free system.
For the fixed system I have fixed the x and y and let the z fluctuate. For the free system however I have let everything be free and will keep an eye on the volume/shape of the system. I was wondering if anyone has any experience with solid/liquid interface with NPT and which one they found to be the best?

The second question I have is I want to keep the pressure relatively constant at 150 bars and 600 bars. So for the PSTRESS input I but 0.15 and 0.6, but because it is very close to 0 it goes to the negatives and seems to fluctuate a bit. I was wondering if there is a way to keep the pressure more constant and if I could change the units from kB to bars so that the values are not so small?

Any feedback/tips would be greatly appreciated and if you require any input files etc. please let me know :)

Thanks in advance,
Jess

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Tue Jul 02, 2024 10:14 am
by alexey.tal
Dear Jess,

We have some tips in the best-practice guide for machine-learning calculations here.
In particular, note that in MD simulation of liquids only the volume changes should be allowed, otherwise the cell may "collapse".
To constrain the shape you can use the ICONST file as described in the wiki.

The pressure can fluctuate a bit in NPT, but the average value should be fixed. Reducing the step size POTIM can help to reduce fluctuations.
Also, if you use ICONST, you could try using lower SHAKETOL to reduce the fluctuations.

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Wed Jul 03, 2024 12:17 am
by jess_white
Hi Alexey,

Many thanks for the reply! Instead of using the ICONST I am instead in the INCAR using the tag: LATTICE_CONSTRAINTS = F F T
Would you recommend to use ICONST instead? I also have my POTIM to be 2 (but have my hydrogens weighing more). Would you recommend me to decrease it to 1 or even lower?

In my initial run I didn't specify a PSTRESS (so I believe the default is 0 --> running it from 200K to 1000K) and I can see that the pressure increases which is good as I want it to be liquid and supercritical the water phase (not gas). However, I am just concerned that I want the pressure at 600K to 900K to be around 600 bars and instead it is around 12kbars.

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Wed Jul 03, 2024 10:15 am
by alexey.tal
Instead of using the ICONST I am instead in the INCAR using the tag: LATTICE_CONSTRAINTS = F F T
Would you recommend to use ICONST instead?
If you have an orthorhombic system LATTICE_CONSTRAINTS is fine. Otherwise, I would suggest constraining the cell shape via ICONST.
I also have my POTIM to be 2 (but have my hydrogens weighing more). Would you recommend me to decrease it to 1 or even lower?
Yes, I would recommend decreasing POTIM.
In my initial run I didn't specify a PSTRESS (so I believe the default is 0 --> running it from 200K to 1000K) and I can see that the pressure increases which is good as I want it to be liquid and supercritical the water phase (not gas). However, I am just concerned that I want the pressure at 600K to 900K to be around 600 bars and instead it is around 12kbars.
Could you provide the files for this calculation (see forum guidelines)?

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Fri Jul 05, 2024 1:14 am
by jess_white
Thanks Alexey! Just letting you know I have seen your forum message and I will upload the files later. The jobs have a couple of more hours on them so I thought just wait for them to finish and then I will upload them :)

I have made an ICONST now as I believe my cell is monoclinic and not orthorhombic. I have just added the plain surface POSCAR and the INCAR just so you can see my use of LATTICE CONSTRAINTS and see if that would work for the system.

I will upload the others probably in the evening my time (so around 12 hours).

Many thanks,
Jess

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Fri Jul 05, 2024 1:25 am
by jess_white
Just to clarify the one I have uploaded now don't have the liquid. The ones with the pressure do - just wanted to add this to see if LATTICE CONSTRAINTS can be used for this system without the liquid :)

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Sat Jul 06, 2024 5:31 am
by jess_white
Hi,

Here are my files. I have also created the totalpressure.dat to compare. :)

I have three files:
1) no constraints but has a pressure
2) constraints using lattice constraint in INCAR and has pressure
3) constraints with ICONST and has pressure

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Sat Jul 06, 2024 5:32 am
by jess_white
Hi,

this fourth file has lattice constraints but I had not set PSTRESS. It has been running for a while which is why the temp is higher than the previous three :)

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Tue Jul 09, 2024 8:27 am
by alexey.tal
Thank you for providing the files.
I have made an ICONST now as I believe my cell is monoclinic and not orthorhombic.
Indeed, the cell is monoclinic, so you should use ICONST.

Regarding the files you sent. I see that you are changing the temperature from 300 to 900K during the simulation. As you change the temperature, the thermostat and barostat take some time to equilibrate the system and that is going to lead to variation in temperature and pressure. So if you would like to evaluate the pressure in your system, you should run a simulation at constant temperature and pressure in a proper NPT ensemble.

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Wed Jul 10, 2024 5:29 am
by jess_white
Thank you! Also do I need to then re-run the plain surface with no liquid with ICONST or is it ok as the ICONST is only important with the addition of liquid?

I also assume that the ICONST in the tutorial is ok for my system?

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Wed Jul 10, 2024 12:55 pm
by alexey.tal
Also do I need to then re-run the plain surface with no liquid with ICONST or is it ok as the ICONST is only important with the addition of liquid?
Correct. I don't think you need to worry about ICONST if you only include the solid.
I also assume that the ICONST in the tutorial is ok for my system?
Yes, you can find an example of ICONST file for an orthorhombic cell in the wiki. Keep in mind that you have a monoclinic cell, so you should adjust the file to correctly account for the relative proportions of lattice vectors a1:a2:a3

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Thu Jul 11, 2024 3:49 am
by jess_white
Thanks Alexey, really appreciate all the help and patience you are giving me! So I am struggling a bit with making the ICONST for a monoclinic cell - more in fact the S coordinates.

So I found the proportion of lattice vectors is 1: 0.79 : 2 instead of 1:1.5:2 of the orthorhombic cell in the wiki.


Orthorhombic in wiki:
S 1 0 0 0 0 0 0
S 0 1 0 0 0 0 0
S 0 0 1 0 0 0 0
S 0 0 0 1.5 -1.0 0.0 0
S 0 0 0 2.0 0.0 -1.0 0
S 0 0 0 0.0 4.0 -3.0 0

Maybe monoclinic if use same structure with different lattice proportion:
S 1 0 0 0 0 0 0
S 0 1 0 0 0 0 0
S 0 0 1 0 0 0 0
S 0 0 0 0.79 -1.0 0.0 0
S 0 0 0 2.0 0.0 -1.0 0
S 0 0 0 0.0 4.0 -1.58 0

Am I completely off the mark here? this is the lattice proportions for the supercell or do I need to do it for the simple bulk? Sorry for all these questions, I am now confusing myself a bit :-[ I just want to make sure I understand and get it. I am just comparing with the cubic and orthorhombic cell in the wiki and seeing the S are the main change. :))

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Thu Jul 11, 2024 8:31 am
by alexey.tal
No worries, ICONST file is not really straightforward to set up.
I assume that the first six lines of your ICONST are:

Code: Select all

LA 1 2 0
LA 1 3 0
LA 2 3 0
LR 1 0
LR 2 0
LR 3 0
Then your ICONST should be correct.

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Thu Jul 11, 2024 1:37 pm
by jess_white
Thanks so much Alexey! That is correct that I had the first lines like that. Appreciate all the help and hopefully the MLFF will go well :D

Re: MLFF NPT Pressure Question (solid/liquid interface)

Posted: Fri Jul 12, 2024 8:09 am
by jess_white
So I am just having a think and makes sense to use the ICONST for the liquid but because its liquid and solid - wouldn't the solid be able to constrain the system? This is also for machine learning forcefield so does the ICONST not matter as much? Once again my apologies for all the questions :D