Skip to content

andthum/transfer_Li

Repository files navigation

Transfer Lithium Ions

pre-commit pre-commit.ci status Test Status CodeQL Status MIT License DOI Made with Bash Made with Python Code style black

This is just a small helper package that contains scripts to

  • Find lithium ions directly attached to the negative electrode in a molecular dynamics (MD) simulation.
  • Find suitable insertion places at the positive electrode at which lithium ions can be inserted.
  • Transfer/Relocate the lithium ions from the negative to the positive electrode.
  • (Re-)Start the MD simulation.

Context / Overall Goal

Investigate how the electrolyte structure relaxes when taking away a lithium ion at the negative electrode. To do so, remove a lithium ion from the first layer at the negative electrode and insert it at the positive electrode.

Note that the lithium ion cannot simply be removed but must be re-inserted to keep an overall charge-neutral system. Otherwise, the Ewald summation will probably lead to artifacts (J. S. Hub, B. L. de Groot, H. Grubmüller, G. Groenhof, Quantifying Artifacts in Ewald Simulations of Inhomogeneous Systems with a Net Charge Journal of Chemical Theory and Computation, 2014, 10, 1, 381-390).

Steps to Prepare and Run Simulations with Transferred Lithium Ions

Structure of the project directory. after_<t0>ns is the working directory from which to start the scripts.

project_dir
|
+--topology
|  +--<system>.ndx
|  +--<system>.top
|  +--<settings>_<system>.tpr
|
+--after_<t0>ns
|  +--<settings>_out_<system>_after_<t0>ns.gro
|
+--<settings>_<system>0_density-z_number_Li_binsA.txt.gz

Scripts to run:

# Prepare directories.
python/transfer_Li.py --system <system> --settings <settings> --t0 <t0>
bash/prepare_sim_dir.sh -s <system>

# Launch simulations.
slurm/submit/submit_re_nvt423_ld.sh -s <system>
slurm/submit/submit_pr_nvt423_vr.sh -s <system>
bash/cleanup_sim_dir.sh -s <system>

# Launch analysis scripts for the relaxation run.
slurm/submit/submit_gmx_analyses.sh \
    -s <system> \
    -e re_nvt423_ld \
    -f "--begin 0 --dt 0.01 --binwidth 0.2 --restart 0.01 --time 0-02:00:00 --partition express,himsshort,q0heuer,hims,normal"
bash/cleanup_gmx_analyses.sh -s <system> -e re_nvt423_ld
slurm/submit/submit_mdt_analyses.sh \
    -s <system> \
    -e re_nvt423_ld \
    -f "--begin 0 --binwidth 2.0 --restart 1 --time 0-02:00:00 --partition express,himsshort,q0heuer,hims,normal"
bash/cleanup_mdt_analyses.sh -s <system> -e re_nvt423_ld

# Launch analysis scripts for the production run.
slurm/submit/submit_gmx_analyses.sh \
    -s <system> \
    -e pr_nvt423_vr \
    -f "--begin 0 --time 1-00:00:00 --partition q0heuer,hims,normal"
bash/cleanup_gmx_analyses.sh -s <system> -e pr_nvt423_vr
slurm/submit/submit_mdt_analyses.sh \
    -s <system> \
    -e pr_nvt423_vr \
    -f "--begin 0 --restart 1000 --time 1-00:00:00 --partition q0heuer,hims,normal"
bash/cleanup_mdt_analyses.sh -s <system> -e pr_nvt423_vr