Dear all,
I am studying the simulation of the desalination process of salt water (containing NaCl ions) under an electric field of 1 V/A.
The positive and negative electrodes are made from graphene in the desalination process.
I have considered the water molecules as rigid using the “FIX SHAKE” command.
In the absence of the electric field and the “FIX EFIELD” command, the system runs correctly and no errors are seen.
But, by applying the “FIX EFIELD” command, the “Shake determinant = 0.0” error is observed (The simulation time step is 1 femtosecond).
According to Lammps manual, I have defined the “FIX SHAKE” command after the “FIX EFIELD” command. But the error still exists. Also, the error was not fixed with the time step of 0.5 fs.
(Some of the commands in my input file are given at the end. In the box of salt water, pure water and the space between the two electrodes, I used different names for the oxygen and hydrogen atoms of water. That is, in the salt water box, I considered the names OW1 and HW1 for water atoms. In the pure water box, I considered the names OW2 and HW2, and in the space between the two electrodes, I considered the names OW3 and HW3 for water atoms. For this reason, 6 atom types are defined in the H2O group).
Can you please guide me in solving the problem?
Thanks in advance
################ Electric Field #############################
group NaCl+H2O type 1 2 3 4 5 6 7 8
region ef block 20 49 INF INF INF INF units box
fix eField NaCl+H2O efield 0 1.0 0 region ef
fix_modify eField energy yes
group H2O type 1 2 3 4 5 6
fix SHAKE H2O shake 1e-6 500 0 b 7 8 9 a 9 10 11
########################################################
This is a very high field strength and not something that can be applied by an external field in a macroscopic experiment without “destroying” the sample.
Does this happen instantly or during the course of the simulation, and if the latter after how many simulation steps?
I don’t think that the size of the time step has that much of an impact here.
The error message you quote is caused by having forces and geometries where the constraint equation is impossible to solve. So you have to make certain that neither can happen.
- Is your water system properly equilibrated before adding
fix efield
?
- does the same happen if you lower the electric field strength?
Dear Dr. Axel Kohlmeyer
Thanks for your reply
Q) This is a very high field strength and not something that can be applied by an external field in a macroscopic experiment without “destroying” the sample.
A) Yes, it is absolutely correct. So that ab-initio simulation studies have shown that water dissociation is observed in electric field higher than E > 0.35 V/Å. However, in several molecular dynamics simulation studies performed with LAMMPS, a strong electric field (1–5 V/Å) has been applied to obtain distinguishable results. In these studies, it is suggested to use SHAKE algorithm to prevent water decomposition (the link of these papers has been sent below). Therefore, in our study we decided to use electric fields with a strength of 1 to 1.5 V/Å to obtain recognizable results.
https://www.nature.com/articles/s41598-021-04620-x
Q) Does this happen instantly or during the course of the simulation, and if the latter after how many simulation steps?
A) This happens after 2000 steps (with a time step of 1 fs). Of course, after 2000 steps, it first gives “NAN” and then it gives “Shake determinant = 0.0” error at about 5000 steps.
Q) Is your water system properly equilibrated before adding fix efield?
A) Yes, our system has completely reached equilibrium for 1 nanosecond before adding fix efield.
Q) Does the same happen if you lower the electric field strength?
A) The electric fields with lower strength have not yet been tested. I will test it and let you know.
Thanks again
Dear Dr. Axel Kohlmeyer
In electric fields of 0.1, 0.2 and 0.3 V/Å no error is seen. But the error can be seen in the electric field of 0.4 V/Å and above.
Dear all,
If anyone has an idea to solve the shake error problem in a strong electric field of 1-1.5 V/Å, I would be very grateful.
Hi,
If you really want to use such huge electric field and you can’t get it to work with shake, may be try a flexible water model instead?
Simon
I don’t think that that is a good idea. Because of the extremely large field, the water molecule atoms will be pulled apart a larger distance that what was anticipated and the model tested for. Those waters will be polarized by an amount corresponding to the (large) strength of the electric field.
The SHAKE errors have to be due to something that is special in the geometry of the setup. I can run the very large field with a properly equilibrated bulk water system and fix shake does not complain and error out.
My personal opinion is that such a large field strength is not worth using as its results will be far from physically meaningful.
For the sake of completeness. The shake errors are easily avoided by using fix rigid instead. However, that requires a significantly shorter timestep since the time integration of rigid body rotations is more sensitive to divergence due to time discretization than that of position updates.