Esempio n. 1
0
def phononics(ge_concentration='0'):

    # Set up Forceconstants Object
    folder_string = 'structures/1728_atom/aSiGe_C' + ge_concentration + '/'
    atoms = read(folder_string + 'replicated_atoms.xyz', format='xyz')

    forceconstants = ForceConstants(atoms=atoms, folder=folder_string + '/ald')

    # Calculate the 2nd + 3rd Forceconstant matrices
    lammps_inputs = {
        'lmpcmds': [
            "pair_style tersoff",
            "pair_coeff * * forcefields/SiCGe.tersoff Si(D) Ge"
        ],
        "log_file":
        "min.log",
        "keep_alive":
        True
    }
    calc = LAMMPSlib(**lammps_inputs)
    second = forceconstants.second
    second.load(folder=folder_string + '/ald')
    print('Third')
    #	second.calculate(calculator=calc)
    third = forceconstants.third
    third.calculate(calculator=calc, is_verbose=True)

    # Create Phonon Object
    phonons = Phonons(
        forceconstants=forceconstants,
        is_classic=False,  # quantum stats
        temperature=300,  # 300 K
        folder=folder_string,
        third_bandwidth=0.5 / 4.135,  # 0.5 eV smearing
        broadening_shape='gauss')  # shape of smearing

    # Phononic Data
    ## These save files to help us look at phononic properties
    ## with our plotter (4_plotting.py). These properties are "lazy" which
    ## means they won't be calculated unless explicitly called, or required
    ## by another calculation.

    np.save('frequency', phonons.frequency)
    np.save('bandwidth', phonons.bandwidth)
    np.save('diffusivity', phonons.diffusivity)
    #np.save('participation', phonons.participation_ratio)

    # Conductivity Object
    # This will print out the total conductivity and save the contribution per mode
    conductivity = Conductivity(phonons=phonons, method='qhgk').conductivity
    np.save('conductivity', 1 / 3 * np.einsum('iaa->i', conductivity))
    print("Thermal Conductivity (W/m/K): %.3f" %
          conductivity.sum(axis=0).diagonal().mean())
phonons = Phonons(forceconstants=forceconstants,
                  kpts=kpts,
                  is_classic=False,
                  temperature=temperature,
                  is_nw=True,
                  folder='ALD_CNT',
                  storage='numpy')

# Compute conductivity from direct inversion of
# scattering matrix for infinite size samples
# 29.92 is the rescale factor between
# the volume of the simulation box and the
# volume of the 10,0 Carbon Nanotube
inverse_conductivity = Conductivity(phonons=phonons,
                                    method='inverse').conductivity
inverse_conductivity_matrix = inverse_conductivity.sum(axis=0)
print('Infinite size conductivity from inversion (W/m-K): %.3f' %
      (29.92 * inverse_conductivity_matrix[2, 2]))

# Config finite size conductivity from direct inversion of scattering matrix
# Specific finite size length, in angstrom,
# along the direction of transport (z-axis)
# finite_length_method ='ms' for the Mckelvey-Schockley method
finite_size_conductivity_config = {
    'method': 'inverse',
    'length': (0, 0, 1000000000),
    'finite_length_method': 'ms',
    'storage': 'numpy'
}
finite_size_inverse_conductivity = Conductivity(
    phonons=phonons, **finite_size_conductivity_config)