Add electrode in LAMMPS

Hi LAMMPS users,

I am a beginner of LAMMPS and currently trying studying an electrochemical system with ionic liquids. In detail, my plan is to place the ionic liquids between two charged carbon electrodes, each consisting of three graphite layers. I know the charged electrode can be modelled via constant potential method. However, I am not sure how should I get and add the topology information of electrode in data file. Any suggestion will be helpful.


It is very difficult to give advice on such a vague description.
Please explain in more detail what kind of system(s) you have set up, equilibrated, tested and run successfully already, what kind of force field you are using and how you have generated the starting geometries for those systems.

then you should explain in more detail what exactly the problem is by explaining what you have tried already or where exactly the conceptual problem is that you are facing.

only after we know what you know and how well you can manage and where exactly the stumbling block is, can people give you specific advice how to resolve your problems. for deeper, conceptual issues you are usually much better off discussing this would your adviser and senior colleagues, as they know much more about your specific skill level and research needs than any of us on this list.


Hi Axel

Thanks for the response.

The system I am trying to model is an electric double-layer capacitor where ionic liquids is used as electrolyte solution. The ionic liquids we are using is [C2mim][BF4] described using OPLS-AA force field. I have run simulation of ionic liquids system, the parameters of ionic liquids were taken from ilff (, the system was created using packmol and the LAMMPS input file was generated using fftool ( Firstly we run energy minimization, then 10 ns NPT simulation, then the simulation box is deformed to the average volume (cubic simulation box with box length equals 50.8 angstroms) calculated using last 1000 steps of the NPT simulation, then we run 10 ns NVT simulation. The time step in both NPT and NVT simulation is 1 ps.

Currently I am considering to add charged electrode into the system via the constant potential method implemented by Wang, Laird and co-workers ( We are using two electrodes, each consisting of three graphite layers. Follwing the details illustrated in this paper, we define z-axis as the direction normal to the electrode and apply periodic boundary conditions only in the x-y plane (parallel to the graphite layers). I have got the cif file of the unit cell of graphite and change the boundary in VESTA to make the length of x and y direction as around 60 angstroms (slightly larger than 50.8 angstroms mentioned above for pure ionic liquids systems). My problem is I am not sure how should I add the electrodes into the the data file of ionic liquids I have already got.

We are mainly a quantum chemical group and have few experience with MD simulation especially for LAMMPS. Any suggestion will be much appreciated.


please study the read_data documentation carefully. you could load a second data file with additional atoms/molecules, provided you reserve space for the atom, bond and other types when loading the first.
it is usually also best to not include the force field info into the data file, but have it separate and include it into the input for via an include file. you can use the write_coeff command to output the force field data from a data file as a file compatible with LAMMPS input. of course, when adding new atom/bond/etc. types, you need to edit this data with adding suitable entries for the new atom types interacting with the others.


1 Like