Utility functions and constants

This module contains a few utility functions and constants that are used in Machball.

machball.utils.amu = 1.66e-27

Atomic mass unit in kg

machball.utils.densities = {'Al2O3': 3.95, 'HfO2': 9.68, 'TiO2': 3.78, 'ZnO': 5.61, 'ZrO2': 5.68}

Densities in g/cm3

machball.utils.kB = 1.38e-23

Boltzmann constant in SI units

machball.utils.molecularmasses = {'Al2O3': 101.96, 'HfO2': 210.49, 'TiO2': 79.87, 'ZnO': 81.41, 'ZrO2': 123.22}

Mass in mols per gram

machball.utils.save_saturation(filename, times, cov, csv=False)

Save a saturation curve in a text file

The saturation curve is saved as a two column text file.

Parameters:
  • filename (str) – Name of the file

  • times (numpy.array) – Time column

  • cov (numpy.array) – Coverage as a function of time

  • csv (bool, optional (default False)) – Save as comma separated (default is space separated)

machball.utils.save_saturationprofile(filename, times, covs, csv=False)

Save a time series of coverage profiles as a text file

The saturation curve is saved as a N+1 column text file, where N is the number of discrete zones in the feature

Parameters:
  • filename (str) – Name of the file

  • times (numpy.array) – Time column

  • cov (numpy.array) – 2D array with coverage profiles as a function of time

  • csv (bool, optional (default False)) – Save as comma separated (default is space separated)

machball.utils.sitearea(M, density, gpc, nmol=1)

Average area of a surface site

Calculate the average area of a surface site

Parameters:
  • M (float) – Molecular mass in atomic mass units

  • density (float) – Density of the film, in g/cm3

  • gpc (float) – Growth per cycle, in Angstroms

  • nmol (int, optional (default 1)) – Number of precursor molecules per unit formula of the solid

Returns:

Average area of a surface site in sq. meters

Return type:

float

machball.utils.sitearea_fromqcm(M, mpc, nmol=1)

Average area of a surface site

Calculate the average area of a surface site from qcm data

Parameters:
  • M (float) – Molecular mass in atomic mass units

  • mpc (float) – Mass per cycle in ng/cm2

  • nmol (int, optional (default 1)) – Number of precursor molecules per unit formula of the solid

Returns:

Average area of a surface site in sq. meters

Return type:

float

machball.utils.vth(T, M)

Mean thermal velocity

Calculate the mean thermal velocity, defined as:

\[v_{th} = \sqrt{\frac{8k_BT}{M}}\]
Parameters:
  • T (float) – Temperature in K

  • M (float) – Molecular mass in atomic mass units

Returns:

Mean thermal velocity

Return type:

float