shankar1729 / jdftx

JDFTx: software for joint density functional theory
http://jdftx.org
79 stars 49 forks source link

Ensemble and computational details of molecular dynamics simulation of fixed potential #322

Closed moyulyy closed 1 month ago

moyulyy commented 2 months ago

Dear Shankar

In jdftx settings, setting both 'ionic-dynamics' and 'target-mu' parameters as below command line

ionic-dynamics  \
    dt         2 \
    nSteps     5000 \
    statMethod NoseHoover \
    T0         300 \
    P0         nan \
    stress0 nan nan nan  0 0 0 \
    tDampT       50 \
    tDampP       100 \
    chainLengthT 3 \
    chainLengthP 3 \
    B0           22000

target-mu -0.171252 no

does this setting start a correct fixed potential molecular dynamics simulation?

In addition, I was puzzled by the ensemble of systems using potentiostatic molecular dynamics simulations, on the one hand, it is the canonical ensemble of NVT, on the other hand, it is the μVT Grand canonical ensemble whose number of electrons varies to meet the requirement of constant potential. So, how do you define an ensemble of systems using molecular dynamics simulations of constant potential?

Furthermore, in the molecular dynamics simulations of N2 molecular systems currently tested with two-dimensional materials, Whether the "target-mu" parameter is applied directly affects whether the adsorption process occurs or not. Even the specific value of the "target-mu" parameter has an effect on the simulated adsorption process. Is this to be expected, or could it be a wrong result?

Best, lyy

shankar1729 commented 2 months ago

Hi lyy,

The simple and maybe unfortunate answer for you is that we don't support fixed-potential MD simulations in the sense that you're expecting. In fact, unless you include an implicit electrolyte, the target-mu command will fail with an error upfront. The grand-canonical DFT support in JDFTx works with implicit solvation as detailed in the corresponding GC-DFT paper.

The techniques for achieving a grand-canonical ensemble in MD are quite different, and in my opinion are still quite problematic for electrochemical systems because of difficulties in treating the ions grand canonically. (These techniques mostly simulate a solvent box with a varying electric field, physically different from how the double layer enables electrode charge to fluctuate.)

Best, Shankar

moyulyy commented 2 months ago

Dear Shankar

I am sorry that I omitted the setting information of the implicit solvent section about the parameter setting. Attached here are the previous test files, including parameter Settings, outputs, and corresponding trajectory files. It seems to be working well, although it may be a miscalculation. aimd.zip

Noting that jdftx does not support fixed-potential MD simulations, Can I use jdftx as a calculator for Atomic Simulation Environment (ASE), and fixed-potential MD simulations were conducted in conjunction with ASE MD. However, in my opinion, this strategy does not seem to reconcile NVT and μVT well, and it is still difficult to define the ensemble of the system.

More importantly, you talked about how there are problems with the approach to achieving fixed-potential MD simulations in electrochemical systems, Does it mean that fixed-potential MD simulations are not realistic enough at present? In other words, not accurate enough. In fact, I'm looking for a way to fixed-potential MD simulations. Do you have any suggestions?

Looking forward to your reply

Best, lyy

shankar1729 commented 2 months ago

Yes, you can use ASE with JDFTx as a calculator, and it should support whatever modes ASE has. See https://pubs.rsc.org/en/content/articlelanding/2023/ta/d3ta01411h for a review of the fixed-potential MD methods. The issue with these methods is not about accuracy, but more about understanding exactly what effects are captured and how to interpret the results. I am not an expert in this area though, so you should reach out to some of the people working in this area for better insights.

Best, Shankar