Menu

Questions about the postprocedures in JDFTx

Artem
2015-10-22
2015-11-26
  • Artem

    Artem - 2015-10-22

    Dear JDFTx developers and users,

    I am a neophyte in using JDFTx and so far I have managed to run succesfuly test exemples (from the tutorial) of the metal-electrolyte interface (Pt3-vac, Pt3-neutral and Pt3-charged).
    I was trying to visualize the total electrostatic potential, electrostatic potential due to the explicit system and the fluid as well as the electronic density and teh fluid density.
    I used
    dump End Dtot Dvac Dfluid FluidDensity ElecDensity
    and I got .d_tot, d._vac, .fluidShape, .fluidState and .n files and .d_fluid as output.

    Then I used createXSF script with the var's defining one of the outputs mentioned above. It generates .xsf files that I was not though able to visualize in XcrySDen and the figures generated by VESTA are not comprehensive at all to me.

    Is there a way (script) to generate those quatities averaged over the planes parallel to the electrode surface?

    Also, could anyone explain the meaning of the generated Fluid densities (NO,NH,nWater for explicit fluids, cavity function for PCMs) and what information is in each of these files. Can I get the same plane averaged values for the local dielectric constant epsilon(z) and the screening length k*-1(z)?

    For the local liquid density N_{lq}(n(r)), how does the code defines the parameter gamma (see formula 9 in Phys. Rev. B 86, 075140 (2012)) for the different solvents (may I know the value of gamma the the code uses for a given solvent?) and where does this specific functional dependence come from? It reminds the solution of the Poisson equation for the 3D gaussian charge density...

    Any comments will be greatly appreciated,

    Artem

     
  • Deniz Gunceler

    Deniz Gunceler - 2015-10-23

    .dtot, d.vac, .fluidShape, .fluidState and .n files and .dfluid files are essentially binary files. The easiest way I've found to look at them is using python (matplotlib) or octave, where you can simply load them from file, and reshape into a 3d grid (ndarray in matplotlib, which I read using numpy.fromfile and reshape using the fftbox size). Once you have them as a 3d array, it is very easy to generate slices or planar averages.

    The cavity function fluidShape (denoted as s in the reference papers) is the fluid density profile used in the simpler versions of the theory (PCMs). In the linear version, the dielectric constant of the fluid is calculated as eps = 1 + (eps_bulk-1) * s. In the more complicated versions of the solvent theory, the densities of the different atoms constituting the solvent are outputted separately. For water, this means that there is a file for H and O.

    So far, we've kept gamma constant across different fluids. For more info, please take a look at:
    http://iopscience.iop.org/0965-0393/21/7/074005
    http://arxiv.org/abs/1403.6465
    The particular form of the function for the cavity shape function does not have a very direct impact on the physics, just that it satisfies certain conditions.

     
  • Artem

    Artem - 2015-10-23

    Hi Deniz,

    Thanks for your prompt rsponse and for the references.
    Could you provide a little more info about the procedure of extracting the data from the binary files using pyton.
    If I am not mistaken, in order to use numpy.fromfile and parse the data read from that file afterwards, I need to know the structure of the binary (separator, etc). What is then the structure of the data in each of these binary files? What exactly does the reshaping procedure look like in this case?

    I do have another question related to the output that JDFTx generates. Is it possible to get the info about the spatial ion distribution (n(Na+)(z), n(Cl-){z) near the electrified surface, not just the liquid density profile?

    Thanks,
    Artem

     
  • Deniz Gunceler

    Deniz Gunceler - 2015-10-26

    In my own pythn scripts, I read the jdftx binary dumps with

    numpy.reshape( numpy.fromfile(filename, dtype=data_type) , fftbox )
    

    where data_type is either a numpy.double or numpy.complex. The fftbox variable is a len=3 list of the grid size along each dimension.

    For the continuum models (PCMs), the only ion information you can get is the bound charge, which is the net ionic charge induced in the electrolyte. It lumps everything together including dielectric response of the solvent as well as the ionic aggregation. For the classical DFT based fluid models (e.g. ScalarEOS), you can actually dump densities of all species separately. (edit: we should also be able to do this for Nonlinear ions, but I don't think it is currently supported. What do you think Shankar?)

     

    Last edit: Deniz Gunceler 2015-10-26
  • Artem

    Artem - 2015-10-27

    Hi Deniz,
    Thanks again. Than was helpful.
    Now that I got plane (x-y) averaged values of all kind of quantities for Pt3 test example, I winder what are the units for .d_tot, .d_vac, .fluidShape, .n, .bound, .Moments etc. What are the quantities NO,NH,nWater for explicit fluids that are expected to be calculated when FluidDensity is includen in the list of dump?

    I calculated Pt3_charged.d_tot and averaged it with a python script for the cases when mu=-0.16 (~1V w/r to mu -0.195) and for mu=-0.12 (~2V) hoping to get a nice curve with the total electrostatic potential drop of 1V and 2 V, respectively, w/r to the bulk electrolyte (assuming that the units for the potential are Hartrees). However, the drop was far smaller than the targeted value. Am I doing something wrong? Has anyone calculated these quantities for the test example? I also increased the thickness of the Pt slab (5 layers instead of 3 as in the example) and the k-point sampling (10x10x1) but it had no effect on the value of the overall potential drop across the interface.

    Also, how can I control the finess of the real space grid. In the current version of the test examples the fftbox is 20x20x180 only (with 180 points in the z-direction, right?)

    Thanks,
    Artem

     
  • Deniz Gunceler

    Deniz Gunceler - 2015-10-27

    I think all 3d grids are in units of quantity/bohr^3. For example potentials (d's, V's...) would be Hartree/bohr^3 while densities (n, N...) would be no parrticles / bohr^3.

    The fineness/roughness of the real space grid is controlled by the fftbox command. the code chooses a default value based on the basis set size (elec-cutoff). You can override this default value and set it to something larger. For example by:

    fftbox 40 40 360
    
     
  • Artem

    Artem - 2015-10-27
     

    Last edit: Artem 2015-10-27
  • Artem

    Artem - 2015-11-19

    Hi Deniz,

    I recalculated the test examples with NonoLinearPCM option, and in addition to the .fluidShape output (when FluidDensity flag is on) I got a bunch of other files .fluidN-, .fluidN+, .fluidNSpherical. So now my question is what info is in there? (units, etc).

    Also, is there a way of evaluating the spatial variation of a dielectric constant across the interface (metal/solution)?

    Best,

    Artem

     
  • Deniz Gunceler

    Deniz Gunceler - 2015-11-25

    Sorry for not responding to your post. I'm in the process of relocating to another city, and will not be able to help much for another few weeks. Maybe one of the others (Shankar?) can help.

     
  • Artem

    Artem - 2015-11-26

    Thanks, Deniz. Take your time, hope that other guys could help me with these questions of general, I suppose, interest.