示例#1
0
def gas_chemical_potential(species, temperature, fugacity):
    """For a gas, given its temperature (K) and fugacity (Pa), returns
    its chemical potential.

    Args:
        species (string)
        temperature (float)
        fugacity (float)

    Raises:
        RuntimeError
    """
    if not gasprops.has_key(species):
        raise RuntimeError('Data for this gas (%s) is not in gasprops'
                           'dictionary. Add to hori.thermo.gasprops' %
                           species)

    d = io.gasdata(species)
    p = gasprops[species]
    electronic_energy = (d['electronic energy'] +
                         p['electronic energy correction'])
    thermo = IdealGasThermo(vib_energies=d['vibrations'],
                            electronicenergy=electronic_energy,
                            geometry=p['geometry'],
                            atoms=d['atoms'],
                            symmetrynumber=p['symmetrynumber'],
                            spin=p['spin'])
    mu = thermo.get_gibbs_energy(temperature=temperature, pressure=fugacity)
    #mu = thermo.get_gibbs_energy(temperature=temperature,pressure=fugacity)
    return mu
示例#2
0
def gas_chemical_potential(species, temperature, fugacity):
    """For a gas, given its temperature (K) and fugacity (Pa), returns
    its chemical potential.

    Args:
        species (string)
        temperature (float)
        fugacity (float)

    Raises:
        RuntimeError
    """
    if not gasprops.has_key(species):
        raise RuntimeError('Data for this gas (%s) is not in gasprops'
                           'dictionary. Add to hori.thermo.gasprops' % species)

    d = io.gasdata(species)
    p = gasprops[species]
    electronic_energy = (d['electronic energy'] +
                         p['electronic energy correction'])
    thermo = IdealGasThermo(vib_energies=d['vibrations'],
                            electronicenergy=electronic_energy,
                            geometry=p['geometry'],
                            atoms=d['atoms'],
                            symmetrynumber=p['symmetrynumber'],
                            spin=p['spin'])
    mu = thermo.get_gibbs_energy(temperature=temperature, pressure=fugacity)
    #mu = thermo.get_gibbs_energy(temperature=temperature,pressure=fugacity)
    return mu
示例#3
0
 def __init__(self, temperature, voltage, functional):
     self.temperature = temperature
     self.voltage = voltage
     self.functional = functional
     d = io.gasdata('H2')  # hydrogen electrode
     d['electronic energy correction'] = gasprops['H2'][
         'electronic energy correction']
     d['geometry'] = gasprops['H2']['geometry']
     d['symmetrynumber'] = gasprops['H2']['symmetrynumber']
     d['spin'] = gasprops['H2']['spin']
     if functional == 'BEEF':
         d['electronic energy correction'] = gasprops_BEEF['H2'][
             'electronic energy correction']
     self.referencepressure = 101325.  # Pa, RHE definition
     self._previous = {'temperature': None, 'voltage': None}
     thermo = IdealGasThermo(
         vib_energies=d['vibrations'],
         electronicenergy=(d['electronic energy'] +
                           d['electronic energy correction']),
         geometry=d['geometry'],
         atoms=d['atoms'],
         symmetrynumber=d['symmetrynumber'],
         spin=d['spin'])
     self._thermo = thermo
     self._calculate_G()
示例#4
0
 def __init__(self, temperature, voltage, functional):
     self.temperature = temperature
     self.voltage = voltage
     self.functional = functional
     d = io.gasdata('H2')  # hydrogen electrode
     d['electronic energy correction'] = gasprops['H2']['electronic energy correction']
     d['geometry'] = gasprops['H2']['geometry']
     d['symmetrynumber'] = gasprops['H2']['symmetrynumber']
     d['spin'] = gasprops['H2']['spin']
     if functional == 'BEEF':
         d['electronic energy correction'] = gasprops_BEEF['H2']['electronic energy correction']
     self.referencepressure = 101325.  # Pa, RHE definition
     self._previous = {'temperature': None, 'voltage': None}
     thermo = IdealGasThermo(vib_energies=d['vibrations'],
                             electronicenergy=(d['electronic energy'] +
                                               d['electronic energy correction']),
                             geometry=d['geometry'],
                             atoms=d['atoms'],
                             symmetrynumber=d['symmetrynumber'],
                             spin=d['spin'])
     self._thermo = thermo
     self._calculate_G()
示例#5
0
 def __init__(self, gas_list, functional):
     gas_dict = {}
     for gas, temperature, fugacity in gas_list:
         gas_dict[gas] = io.gasdata(gas)
         if not gasprops.has_key(gas):
             raise RuntimeError('Data for this gas (%s) is not in '
                                'gasprops dictionary. Add to '
                                'hori.thermo.gasprops' % gas)
         gas_dict[gas]['geometry'] = gasprops[gas]['geometry']
         gas_dict[gas]['symmetrynumber'] = \
             gasprops[gas]['symmetrynumber']
         gas_dict[gas]['spin'] = gasprops[gas]['spin']
         gas_dict[gas]['electronic energy correction'] = \
             gasprops[gas]['electronic energy correction']
         gas_dict[gas]['temperature'] = temperature
         gas_dict[gas]['fugacity'] = fugacity
         if functional == 'BEEF':
             gas_dict[gas]['electronic energy correction'] = \
                 gasprops_BEEF[gas]['electronic energy correction']
     self.gas_dict = gas_dict
     self.G = {}
     self._calculate_all_Gs()
示例#6
0
 def __init__(self, gas_list, functional):
     gas_dict = {}
     for gas, temperature, fugacity in gas_list:
         gas_dict[gas] = io.gasdata(gas)
         if not gasprops.has_key(gas):
             raise RuntimeError('Data for this gas (%s) is not in '
                                'gasprops dictionary. Add to '
                                'hori.thermo.gasprops' % gas)
         gas_dict[gas]['geometry'] = gasprops[gas]['geometry']
         gas_dict[gas]['symmetrynumber'] = \
             gasprops[gas]['symmetrynumber']
         gas_dict[gas]['spin'] = gasprops[gas]['spin']
         gas_dict[gas]['electronic energy correction'] = \
             gasprops[gas]['electronic energy correction']
         gas_dict[gas]['temperature'] = temperature
         gas_dict[gas]['fugacity'] = fugacity
         if functional == 'BEEF':
             gas_dict[gas]['electronic energy correction'] = \
                 gasprops_BEEF[gas]['electronic energy correction']
     self.gas_dict = gas_dict
     self.G = {}
     self._calculate_all_Gs()