Thermodynamics¶
Burnman has a number of functions and classes which deal with the thermodynamics of single phases and aggregates.
Lattice Vibrations¶
Debye model¶
- burnman.eos.debye.debye_fn(x)[source]¶
Evaluate the Debye function. Takes the parameter xi = Debye_T/T
- burnman.eos.debye.debye_fn_cheb(x)[source]¶
Evaluate the Debye function using a Chebyshev series expansion coupled with asymptotic solutions of the function. Shamelessly adapted from the GSL implementation of the same function (Itself adapted from Collected Algorithms from ACM). Should give the same result as debye_fn(x) to near machine-precision.
- burnman.eos.debye.thermal_energy(T, debye_T, n)[source]¶
calculate the thermal energy of a substance. Takes the temperature, the Debye temperature, and n, the number of atoms per molecule. Returns thermal energy in J/mol
- burnman.eos.debye.molar_heat_capacity_v(T, debye_T, n)[source]¶
Heat capacity at constant volume. In J/K/mol
- burnman.eos.debye.helmholtz_free_energy(T, debye_T, n)[source]¶
Helmholtz free energy of lattice vibrations in the Debye model. It is important to note that this does NOT include the zero point energy of vibration for the lattice. As long as you are calculating relative differences in F, this should cancel anyways. In Joules.
Einstein model¶
Chemistry parsing¶
- burnman.processchemistry.read_masses()[source]¶
A simple function to read a file with a two column list of elements and their masses into a dictionary
- burnman.processchemistry.atomic_masses = {'Ag': 0.107868, 'Al': 0.0269815, 'Ar': 0.039948, 'As': 0.0749216, 'Au': 0.196967, 'B': 0.010811, 'Ba': 0.137327, 'Be': 0.00901218, 'Bi': 0.20898, 'Br': 0.079904, 'C': 0.0120107, 'Ca': 0.040078, 'Cd': 0.112411, 'Ce': 0.140116, 'Cl': 0.035453, 'Co': 0.0589332, 'Cr': 0.0519961, 'Cs': 0.132905, 'Cu': 0.063546, 'Dy': 0.1625, 'Er': 0.167259, 'Eu': 0.151964, 'F': 0.0189984, 'Fe': 0.055845, 'Ga': 0.069723, 'Gd': 0.15725, 'Ge': 0.07264, 'H': 0.00100794, 'He': 0.0040026, 'Hf': 0.17849, 'Hg': 0.20059, 'Ho': 0.16493, 'I': 0.126904, 'In': 0.114818, 'Ir': 0.192217, 'K': 0.0390983, 'Kr': 0.083798, 'La': 0.138905, 'Li': 0.006941, 'Lu': 0.174967, 'Mg': 0.024305, 'Mn': 0.054938, 'Mo': 0.09596, 'N': 0.0140067, 'Na': 0.0229898, 'Nb': 0.0929064, 'Nd': 0.144242, 'Ne': 0.0201797, 'Ni': 0.0586934, 'O': 0.0159994, 'Os': 0.19023, 'P': 0.0309738, 'Pa': 0.231036, 'Pb': 0.2072, 'Pd': 0.10642, 'Pr': 0.140908, 'Pt': 0.195084, 'Rb': 0.0854678, 'Re': 0.186207, 'Rh': 0.102905, 'Ru': 0.10107, 'S': 0.032065, 'Sb': 0.12176, 'Sc': 0.0449559, 'Se': 0.07896, 'Si': 0.0280855, 'Sm': 0.15036, 'Sn': 0.11871, 'Sr': 0.08762, 'Ta': 0.180948, 'Tb': 0.158925, 'Te': 0.1276, 'Th': 0.232038, 'Ti': 0.047867, 'Tl': 0.204383, 'Tm': 0.168934, 'U': 0.238029, 'V': 0.0509415, 'Vc': 0.0, 'W': 0.18384, 'Xe': 0.131293, 'Y': 0.0889058, 'Yb': 0.173054, 'Zn': 0.06538, 'Zr': 0.091224}¶
IUPAC_element_order provides a list of all the elements. Element order is based loosely on electronegativity, following the scheme suggested by IUPAC, except that H comes after the Group 16 elements, not before them.
- burnman.processchemistry.dictionarize_formula(formula)[source]¶
A function to read a chemical formula string and convert it into a dictionary
- Parameters
- formulastring object
Chemical formula, written in the XnYm format, where the formula has n atoms of element X and m atoms of element Y
- Returns
- fdictionary object
The same chemical formula, but expressed as a dictionary.
- burnman.processchemistry.sum_formulae(formulae, amounts=None)[source]¶
Adds together a set of formulae.
- Parameters
- formulaelist of dictionary or counter objects
List of chemical formulae
- amountslist of floats
List of amounts of each formula
- Returns
- summed_formulaCounter object
The sum of the user-provided formulae
- burnman.processchemistry.formula_mass(formula)[source]¶
A function to take a chemical formula and compute the formula mass.
- Parameters
- formuladictionary or counter object
A chemical formula
- Returns
- massfloat
The mass per mole of formula
- burnman.processchemistry.convert_formula(formula, to_type='mass', normalize=False)[source]¶
Converts a chemical formula from one type (mass or molar) into the other. Renormalises amounts if normalize=True
- Parameters
- formuladictionary or counter object
A chemical formula
- to_typestring, one of ‘mass’ or ‘molar’
Conversion type
- normalizeboolean
Whether or not to normalize the converted formula to 1
- Returns
- fdictionary
The converted formula
- burnman.processchemistry.process_solution_chemistry(solution_model)[source]¶
This function parses a class instance with a “formulas” attribute containing site information, e.g.
[ ‘[Mg]3[Al]2Si3O12’, ‘[Mg]3[Mg1/2Si1/2]2Si3O12’ ]
It outputs the bulk composition of each endmember (removing the site information), and also a set of variables and arrays which contain the site information. These are output in a format that can easily be used to calculate activities and gibbs free energies, given molar fractions of the phases and pressure and temperature where necessary.
- Parameters
- solution_modelinstance of class
Class must have a “formulas” attribute, containing a list of chemical formulae with site information
- burnman.processchemistry.site_occupancies_to_strings(site_species_names, site_multiplicities, endmember_occupancies)[source]¶
Converts a list of endmember site occupancies into a list of string representations of those occupancies.
- Parameters
- site_species_names2D list of strings
A list of list of strings, giving the names of the species which reside on each site. List of sites, each of which contains a list of the species occupying each site.
- site_multiplicitiesnumpy array of floats
List of floats giving the multiplicity of each site Must be either the same length as the number of sites, or the same length as site_species_names (with an implied repetition of the same number for each species on a given site).
- endmember_occupancies2D numpy array of floats
A list of site-species occupancies for each endmember. The first dimension loops over the endmembers, and the second dimension loops over the site-species occupancies for that endmember. The total number and order of occupancies must be the same as the strings in site_species_names.
- Returns
- site_formulaelist of strings
A list of strings in standard burnman format. For example, [Mg]3[Al]2 would correspond to the classic two-site pyrope garnet.
- burnman.processchemistry.compositional_array(formulae)[source]¶
- Parameters
- formulaelist of dictionaries
List of chemical formulae
- Returns
- formula_array2D array of floats
Array of endmember formulae
- elementsList of strings
List of elements
- burnman.processchemistry.ordered_compositional_array(formulae, elements)[source]¶
- Parameters
- formulaelist of dictionaries
List of chemical formulae
- elementsList of strings
List of elements
- Returns
- formula_array2D array of floats
Array of endmember formulae
- burnman.processchemistry.formula_to_string(formula)[source]¶
- Parameters
- formuladictionary or counter
Chemical formula
- Returns
- formula_stringstring
A formula string, with element order as given in the list IUPAC_element_order. If one or more keys in the dictionary are not one of the elements in the periodic table, then they are added at the end of the string.
Chemical potentials¶
- burnman.chemicalpotentials.chemical_potentials(assemblage, component_formulae)[source]¶
The compositional space of the components does not have to be a superset of the compositional space of the assemblage. Nor do they have to compose an orthogonal basis.
The components must each be described by a linear mineral combination
The mineral compositions must be linearly independent
- Parameters
- assemblagelist of classes
List of material classes set_method and set_state should already have been used the composition of the solid solutions should also have been set
- component_formulaelist of dictionaries
List of chemical component formula dictionaries No restriction on length
- Returns
- component_potentialsarray of floats
Array of chemical potentials of components
- burnman.chemicalpotentials.fugacity(standard_material, assemblage)[source]¶
- Parameters
- standard_material: class
Material class set_method and set_state should already have been used material must have a formula as a dictionary parameter
- assemblage: list of classes
List of material classes set_method and set_state should already have been used
- Returns
- fugacityfloat
Value of the fugacity of the component with respect to the standard material
- burnman.chemicalpotentials.relative_fugacity(standard_material, assemblage, reference_assemblage)[source]¶
- Parameters
- standard_material: class
Material class set_method and set_state should already have been used material must have a formula as a dictionary parameter
- assemblage: list of classes
List of material classes set_method and set_state should already have been used
- reference_assemblage: list of classes
List of material classes set_method and set_state should already have been used
- Returns
- relative_fugacityfloat
Value of the fugacity of the component in the assemblage with respect to the reference_assemblage