Skip to content

Utility functions and constants

machball.utils

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

kB = 1.38e-23 module-attribute

Boltzmann constant in SI units

amu = 1.66e-27 module-attribute

Atomic mass unit in kg

densities = {'Al2O3': 3.95, 'HfO2': 9.68, 'TiO2': 3.78, 'ZrO2': 5.68, 'ZnO': 5.61} module-attribute

Densities in g/cm3

molecularmasses = {'Al2O3': 101.96, 'HfO2': 210.49, 'TiO2': 79.87, 'ZrO2': 123.22, 'ZnO': 81.41} module-attribute

Mass in mols per gram

sitearea(M, density, gpc, nmol=1)

Average area of a surface site

Calculate the average area of a surface site

Parameters:

Name Type Description Default
M float

Molecular mass in atomic mass units

required
density float

Density of the film, in g/cm3

required
gpc float

Growth per cycle, in Angstroms

required
nmol int, optional (default 1)

Number of precursor molecules per unit formula of the solid

1

Returns:

Type Description
float

Average area of a surface site in sq. meters

sitearea_fromqcm(M, mpc, nmol=1)

Average area of a surface site

Calculate the average area of a surface site from qcm data

Parameters:

Name Type Description Default
M float

Molecular mass in atomic mass units

required
mpc float

Mass per cycle in ng/cm2

required
nmol int, optional (default 1)

Number of precursor molecules per unit formula of the solid

1

Returns:

Type Description
float

Average area of a surface site in sq. meters

vth(T, M)

Mean thermal velocity

Calculate the mean thermal velocity, defined as:

\[ v_{th} = \sqrt{\frac{8k_BT}{M}} \]

Parameters:

Name Type Description Default
T float

Temperature in K

required
M float

Molecular mass in atomic mass units

required

Returns:

Type Description
float

Mean thermal velocity

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:

Name Type Description Default
filename str

Name of the file

required
times array

Time column

required
cov array

Coverage as a function of time

required
csv bool, optional (default False)

Save as comma separated (default is space separated)

False

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:

Name Type Description Default
filename str

Name of the file

required
times array

Time column

required
covs array

2D array with coverage profiles as a function of time

required
csv bool, optional (default False)

Save as comma separated (default is space separated)

False