zincware / MDSuite

A post-processing engine for particle simulations
https://mdsuite.readthedocs.io/
Eclipse Public License 2.0
36 stars 7 forks source link

Zero GreenKubo/EinsteinHelfand Ionic Conductivity in NaCl_walkthrough MDSuite-0.2.0 #607

Closed Z-Rashid closed 3 months ago

Z-Rashid commented 3 months ago

Dear Developers, I just started using MDSuite-0.2.0 and following the NaCl_walkthrough example, provided in the example directory. Everything seems fine except the Green Kubo Ionic Conductivity which gives zero values for ionic conductivity, acf and integral. The full output is as follows

System {'ionic_conductivity': [0.0], 'uncertainty': [0.0], 'time': [0.0, 0.02, 0.04, 0.06, 0.08, 0.1, 0.12, 0.14, 0.16, ..............., 5.96, 5.9799999999999995], 'acf': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ........................... 0.0, 0.0, 0.0], 'integral': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ........................... 0.0, 0.0, 0.0], 'integral_uncertainty': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ............................ 0.0, 0.0, 0.0, 0.0]}

I also tried to calculated ionic conductivity using EinsteinHelfandIonicConductivity method but that too give zero value and msd is an array of zeros.

I use the following script

import mdsuite as mds
import matplotlib.pyplot as plt
project = mds.Project("NaCl_Example")
project.add_experiment(name="NaCl", timestep=0.002, temperature=1400.0, units="metal", simulation_data="NaCl.lammpstraj",)
data = project.run.RadialDistributionFunction(number_of_configurations=100, plot=True)
data = project.run.EinsteinDiffusionCoefficients(species=["Na"], data_range=50)
data = project.run.AngularDistributionFunction(number_of_configurations=50, plot=True, cutoff=3.6)
data = project.run.GreenKuboDiffusionCoefficients(data_range=102, plot=True, correlation_time=10)
print("<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>")
data = project.run.GreenKuboIonicConductivity(data_range=300, plot=True, correlation_time=10)
print(data)
for k in data.keys():
   print("GK ",k)
   for m in data[k].keys() :
       print("GK ",m,data[k][m])
   print("\n")
data = project.run.EinsteinHelfandIonicConductivity(data_range=300, plot=True, correlation_time=10)
print(data)
for k in data.keys():
   print("Einstein ",k)
   for m in data[k].keys() :
       print("Einstein ",m,data[k][m])
   print("\n")

where NaCl.lammpstraj was downloaded from https://github.com/zincware/DataHub/tree/main/NaCl_gk_i_q

Can you please check and suggest a fix for that?

Thank you. Zahid

SamTov commented 3 months ago

Hey, thanks for the issue! It seems to me the charges of the atoms might be setting zero? Have you given the atoms charges?

Z-Rashid commented 3 months ago

Dear Samuel Tovey, Thank you very much for your response and for pointing to the right direction. Yes indeed, the charges were the issue. Now have been solved. Thanks.

SamTov commented 3 months ago

No problem! That's a part of the code that should be better documented and probably contain a warning if the charges are set to zero! Feel free to make an issue or I'll get around to it during the week.