oxygen#

Relate oxygen partial pressure to chemical potentials

Functions

get_barycenter_chemical_potentials_absolute

Compute the barycenter of the feasible region for relative chemical potentials, constrained by:

get_barycenter_chemical_potentials_relative

Compute the barycenter of the feasible region for relative chemical potentials, constrained by:

get_oxygen_chempot_from_pO2

Get oxygen chemical potential (delta) from temperature and partial pressure.

get_oxygen_chempot_standard_finite_temperature

Get value of oxygen delta mu standard (mu_0(T,Po)) at a speficic temperature.

get_oxygen_pressure_reservoirs

Get PressureReservoirs object for oxygen starting from the reference value.

get_pressure_reservoirs_from_phase_diagram

Generate Reservoirs object with a set of different chemical potentials starting from a range of oxygen partial pressure.

get_pressure_reservoirs_from_precursors

Get PressureReservoirs object starting from the oxygen reference chemical potential at 0 K and the synthesis precursors.

get_barycenter_chemical_potentials_absolute(composition, energy, oxygen_chempot_absolute, mu_refs, min_absolute_chempots=None, max_absolute_chempots=None)[source]#

Compute the barycenter of the feasible region for relative chemical potentials, constrained by:

  • fixed absolute chemical potential of oxygen

  • Total energy of target phase

  • lower and/or upper chemical potential limits for each element.

Parameters:
  • composition (str or pymatgen.core.Composition) – Target composition.

  • formation_energy (float) – Formation energy (eV/f.u.)

  • oxygen_mu_relative (float) – fixed chemical potential of oxygen relative to the oxygen molecule.

  • min_relative_chempots (dict or Chempots) – Lower limit of chemical potentials, relative values ({element:chempot})

  • max_relative_chempots (dict or Chempots) – Higher limit of chemical potentials, relative values ({element:chempot})

  • Returns – Dictionary with chemical potentials, taken from the center of the allowed N-1 dimensional hyperplane.

get_barycenter_chemical_potentials_relative(composition, formation_energy, oxygen_chempot_relative, min_relative_chempots=None, max_relative_chempots=None)[source]#

Compute the barycenter of the feasible region for relative chemical potentials, constrained by:

  • fixed relative chemical potential of oxygen

  • Formation energy of target phase

  • lower and/or upper chemical potential limits for each element

Parameters:
  • composition (str or pymatgen.core.Composition) – Target composition.

  • formation_energy (float) – Formation energy (eV/f.u.)

  • oxygen_mu_relative (float) – fixed chemical potential of oxygen relative to the oxygen molecule.

  • min_relative_chempots (dict or Chempots) – Lower limit of chemical potentials, relative values ({element:chempot})

  • max_relative_chempots (dict or Chempots) – Higher limit of chemical potentials, relative values ({element:chempot})

Returns:

  • Dictionary with chemical potentials, taken from the center of the

  • allowed N-1 dimensional hyperplane.

get_oxygen_chempot_from_pO2(temperature=300, partial_pressure=0.2, muO_reference=None)[source]#

Get oxygen chemical potential (delta) from temperature and partial pressure.

Parameters:
  • temperature (float) – Temperature in Kelvin.

  • partial_pressure (float) – Partial pressure.

  • muO_ref (float) – Oxygen reference chemical potential (O2 molecule, T = 0K).

Returns:

chempot – Value of oxygen chemical potential (delta) at given T and p/p0.

Return type:

float

get_oxygen_chempot_standard_finite_temperature(temperature, muO_reference=None)[source]#

Get value of oxygen delta mu standard (mu_0(T,Po)) at a speficic temperature.

The data is taken from the following work: Reuter and Scheffler, “Composition, Structure, and Stability of RuO 2 (110) as a Function of Oxygen Pressure.” The value at a specific temperature is extracted from a linear fitting of the behaviour of mu_O with Temperature.

Parameters:
  • temperature (float) – Temperature in Kelvin.

  • muO_ref (float) – Oxygen reference chemical potential (O2 molecule, T = 0K)

Returns:

chempot – Chemical potential at standard p0 at given temperature.

Return type:

float

get_oxygen_pressure_reservoirs(oxygen_ref, temperature, pressure_range=(1e-20, 10000000000.0), npoints=50, get_pressures_as_strings=False)[source]#

Get PressureReservoirs object for oxygen starting from the reference value.

Parameters:
  • oxygen_ref (float) – Absolute chempot of oxygen at 0K.

  • temperature (float) – Temperature.

  • pressure_range (tuple) – Range in which to evaluate the partial pressure . The default is from 1e-20 to 1e10.

  • npoints (int) – Number of data points to interpolate the partial pressure with. The default is 50.

  • get_pressures_as_strings (bool) – Get pressure values (keys in the Reservoirs dict) as strings. The default is set to floats.

Returns:

pressure_reservoirs – PressureReservoirs object.

Return type:

PressureReservoirs

get_pressure_reservoirs_from_phase_diagram(phase_diagram, target_composition, temperature, extrinsic_chempots_range=None, pressure_range=(1e-20, 10000000000.0), interpolation_function=None, npoints=50, get_pressures_as_strings=False)[source]#

Generate Reservoirs object with a set of different chemical potentials starting from a range of oxygen partial pressure. The code distinguishes between 2-component and 3-component phase diagrams.

In the case of a 2-comp PD the other chemical potential is calculated directly from the formation energy of the phase with target composition. In the case of a 3-comp PD the set of chemical potentials is obtained first calculating the boundary phases starting from the constant value of muO, then the arithmetic average between this two points in the stability diagram is taken.

In the case where there are some extrinsic elements not belonging to the PD, they must be added in the extrinsic_chempots_range dictionary ({element:(O_poor_chempot,O_rich_chempot)}). The chempots of extrinsic elements are interpolated linearly between O_poor and O_rich values.

Parameters:
  • phase_diagram (PhaseDiagram) – Pymatgen PhaseDiagram object.

  • target_comp (str or Composition) – Composition of target phase.

  • temperature (float) – Temperature in Kelvin.

  • extrinsic_chempots_range (dict) – Dictionary with chemical potentials of elements not belonging to the PD ({element:(O_poor_chempot,O_rich_chempot)}). The default is None.

  • pressure_range (tuple) – Range in which to evaluate the partial pressure.

  • interpolation_function (function) –

    Function to determine the chemical potential for the other elements (the ones that are not oxygen).

    interpolation_function(element,boundary_reservoir): The function inputs are the target element and the boundary_reservoirs ({‘<label>’:{element:value}}). If None the mean is used.

  • npoints (int) – Number of data points to interpolate the partial pressure with. The default is 50.

  • get_pressures_as_strings (bool) – Get pressure values (keys in the Reservoirs dict) as strings. The default is set to floats.

Returns:

PressureReservoirs object. The dictionary is organized as {partial_pressure:chempots}.

Return type:

reservoirs

get_pressure_reservoirs_from_precursors(precursors, oxygen_ref, temperature, pressure_range=(1e-20, 10000000000.0), npoints=50, get_pressures_as_strings=False)[source]#

Get PressureReservoirs object starting from the oxygen reference chemical potential at 0 K and the synthesis precursors. Chemical potentials are found from the energies of the precursors and the oxygen chempot value (uses the np.linalg.lstsq function). If the system is underdetermined the minimum-norm solution is found.

Parameters:
  • precursors (dict) – Dictionaly with formulas (str) as keys and total energies (float) as values.

  • oxygen_ref (float) – Absolute chempot of oxygen at 0K.

  • temperature (float) – Temperature in K.

  • pressure_range (tuple) – Range in which to evaluate the partial pressure . The default is from 1e-20 to 1e10.

  • npoints (int) – Number of data points to interpolate the partial pressure with. The default is 50.

  • get_pressures_as_strings (bool) – Get pressure values (keys in the Reservoirs dict) as strings. The default is set to floats.

Returns:

pressure_reservoirs – PressureReservoirs object.

Return type:

PressureReservoirs