Solution models

Solution objects in BurnMan are instances of one of three classes: type Solution (alias SolidSolution), type ElasticSolution and type AnisotropicSolution.

The Solution class implements commonly used models (in petrology). Excess properties are defined relative to the endmember properties at fixed pressure and temperature. The formulations are defined with interaction parameters such as excess energies, volumes and entropies.

The AnisotropicSolution class extends the Solution class to include anisotropic elastic properties.

The standard and anisotropic solution classes can also be “relaxed” via two derived classes: RelaxedSolution and RelaxedAnisotropicSolution. In these classes, specific linear combinations of molar fractions can be designated as relaxation vectors. These are allowed to vary freely to minimize the Gibbs free energy of the solution.

An independent class of solution models is provided by the ElasticSolution class. This class instead defines excess properties are relative to the endmember properties at fixed volume and temperature. Such models have their roots in atom-scale considerations; mixing of two instances of the same lattice type requires deformation (local lattice distortions), that can be considered to induce a local chemical stress. Therefore, volume may be a more useful independent variable than pressure. For more details, see [Myh18].

Available solution classes

Inheritance diagram of burnman.Solution, burnman.RelaxedSolution, burnman.ElasticSolution, burnman.AnisotropicSolution, burnman.RelaxedAnisotropicSolution

All of the above classes accept several models which define the properties of the solution. The standard and anisotropic solution classes share the same solution models, while the elastic solution class has its own set of closely related solution models.

Available solution model classes

Inheritance diagram of burnman.classes.solutionmodel.MechanicalSolution, burnman.classes.solutionmodel.IdealSolution, burnman.classes.solutionmodel.AsymmetricRegularSolution, burnman.classes.solutionmodel.SymmetricRegularSolution, burnman.classes.solutionmodel.SubregularSolution, burnman.classes.solutionmodel.FunctionSolution

Available elastic solution model classes

Inheritance diagram of burnman.classes.elasticsolutionmodel.ElasticMechanicalSolution, burnman.classes.elasticsolutionmodel.ElasticIdealSolution, burnman.classes.elasticsolutionmodel.ElasticAsymmetricRegularSolution, burnman.classes.elasticsolutionmodel.ElasticSymmetricRegularSolution, burnman.classes.elasticsolutionmodel.ElasticSubregularSolution, burnman.classes.elasticsolutionmodel.ElasticFunctionSolution

Base classes

class burnman.Solution(name=None, solution_model=None, molar_fractions=None)[source]

Bases: Mineral

The Solution class has overall responsibility for calculating thermodynamically self-consistent properties of a solution phase.

In this class, solutions are treated as a collection of independent endmember phases (components), plus a model that describes the excess properties of the solution. It stores the current state (pressure, temperature and molar fractions of all the endmembers) of the solution, and interrogates a SolutionModel object to calculate the excess properties of the solution. It then combines these with the properties of the individual endmember phases (also stored in the SolutionModel) to calculate the overall properties of the solution. This is done using standard thermodynamic relations:

\[\begin{split}G = \sum_i X_i G_i + G^{\text{excess}} \\ V = \sum_i X_i V_i + V^{\text{excess}} \\ S = \sum_i X_i S_i + S^{\text{excess}} \\ C_p = \sum_i X_i C_{p,i} + C_p^{\text{excess}} \\ \alpha V = \sum_i X_i \alpha_i V_i + (\alpha V)^{\text{excess}} \\ \frac{V}{K_T} = \sum_i X_i \frac{V_i}{K_{T,i}} + \left(\frac{V}{K_T}\right)^{\text{excess}}\end{split}\]

After instantiation, the user can set the composition of the solution using the set_composition() method, and the pressure and temperature using the set_state() method.

Instantiation of a Solution object can be achieved in just a few lines:

from burnman import Solution, SolutionModel

# Create a SolutionModel object (explained in the documentation for that class)
solution_model = SolutionModel(...)

# Create a Solution object
solution = Solution(name="MySolution", solution_model=solution_model, molar_fractions=...)

where the arguments are as follows:

Parameters:
  • name (string) – Name of the solution.

  • solution_model (burnman.SolutionModel) – The SolutionModel object defining the properties of the solution.

  • molar_fractions (numpy.array) – The initial molar fractions of each endmember in the solution. Can be reset using the set_composition() method.

property name

Human-readable name of this material.

By default this will return the name of the class, but it can be set to an arbitrary string. Overriden in Mineral.

property endmembers
set_composition(molar_fractions)[source]

Set the composition for this solution. Resets cached properties.

Parameters:

molar_fractions (list of float) – Molar abundance for each endmember, needs to sum to one.

set_method(method)[source]

Set the equation of state to be used for this mineral. Takes a string corresponding to any of the predefined equations of state: ‘bm3shear2’, ‘bm3’, ‘mgd2’, ‘mgd3’, ‘slb2’, ‘slb3’, ‘mt’, ‘hp_tmt’, or ‘cork’. Alternatively, you can pass a user defined class which derives from the equation_of_state base class. After calling set_method(), any existing derived properties (e.g., elastic parameters or thermodynamic potentials) will be out of date, so set_state() will need to be called again.

set_state(pressure, temperature)[source]

(copied from set_state):

Set the material to the given pressure and temperature.

Parameters:
  • pressure (float) – The desired pressure in [Pa].

  • temperature (float) – The desired temperature in [K].

property formula

Returns molar chemical formula of the solution. :rtype: Counter

property site_occupancies
Returns:

The fractional occupancies of species on each site as a flat vector.

Return type:

numpy.ndarray

site_formula(precision=2, print_absent_species=True, site_occupancies=None)[source]
Returns the molar chemical formula of the solution with

site occupancies. For example, [Mg0.4Fe0.6]2SiO4.

Parameters:
  • precision (int) – Precision with which to print the site occupancies

  • print_absent_species (bool) – If True, prints site occupancies that are absent (i.e., zero).

  • site_occupancies (numpy.ndarray) – Optional site occupancies to use instead of the current ones.

Returns:

Molar chemical formula of the solution with site occupancies

Return type:

str

property activities

Returns a list of endmember activities [unitless].

property activity_coefficients

Returns a list of endmember activity coefficients (gamma = activity / ideal activity) [unitless].

property molar_internal_energy

Returns molar internal energy of the mineral [J/mol]. Aliased with self.energy

property excess_partial_gibbs

Returns excess partial molar gibbs free energy [J/mol]. Property specific to solutions.

property excess_partial_volumes

Returns excess partial volumes [m^3]. Property specific to solutions.

property excess_partial_entropies

Returns excess partial entropies [J/K]. Property specific to solutions.

property partial_gibbs

Returns endmember partial molar gibbs free energy [J/mol]. Property specific to solutions.

property partial_volumes

Returns endmember partial volumes [m^3]. Property specific to solutions.

property partial_entropies

Returns endmember partial entropies [J/K]. Property specific to solutions.

property excess_gibbs

Returns molar excess gibbs free energy [J/mol]. Property specific to solutions.

property gibbs_hessian

Returns an array containing the second compositional derivative of the Gibbs free energy [J]. Property specific to solutions.

property entropy_hessian

Returns an array containing the second compositional derivative of the entropy [J/K]. Property specific to solutions.

property volume_hessian

Returns an array containing the second compositional derivative of the volume [m^3]. Property specific to solutions.

property molar_gibbs

Returns molar Gibbs free energy of the solution [J/mol]. Aliased with self.gibbs.

property molar_helmholtz

Returns molar Helmholtz free energy of the solution [J/mol]. Aliased with self.helmholtz.

property molar_mass

Returns molar mass of the solution [kg/mol].

property excess_volume

Returns excess molar volume of the solution [m^3/mol]. Specific property for solutions.

property molar_volume

Returns molar volume of the solution [m^3/mol]. Aliased with self.V.

property density

Returns density of the solution [kg/m^3]. Aliased with self.rho.

property excess_entropy

Returns excess molar entropy [J/K/mol]. Property specific to solutions.

property molar_entropy

Returns molar entropy of the solution [J/K/mol]. Aliased with self.S.

property excess_enthalpy

Returns excess molar enthalpy [J/mol]. Property specific to solutions.

property molar_enthalpy

Returns molar enthalpy of the solution [J/mol]. Aliased with self.H.

property isothermal_bulk_modulus_reuss

Returns isothermal bulk modulus of the solution [Pa]. Aliased with self.K_T.

property isentropic_bulk_modulus_reuss

Returns adiabatic bulk modulus of the solution [Pa]. Aliased with self.K_S.

property isothermal_compressibility_reuss

Returns isothermal compressibility of the solution. (or inverse isothermal bulk modulus) [1/Pa]. Aliased with self.K_T.

property isentropic_compressibility_reuss

Returns adiabatic compressibility of the solution. (or inverse adiabatic bulk modulus) [1/Pa]. Aliased with self.K_S.

property shear_modulus

Returns shear modulus of the solution [Pa]. Aliased with self.G.

property p_wave_velocity

Returns P wave speed of the solution [m/s]. Aliased with self.v_p.

property bulk_sound_velocity

Returns bulk sound speed of the solution [m/s]. Aliased with self.v_phi.

property shear_wave_velocity

Returns shear wave speed of the solution [m/s]. Aliased with self.v_s.

property grueneisen_parameter

Returns grueneisen parameter of the solution [unitless]. Aliased with self.gr.

property thermal_expansivity

Returns thermal expansion coefficient (alpha) of the solution [1/K]. Aliased with self.alpha.

property molar_heat_capacity_v

Returns molar heat capacity at constant volume of the solution [J/K/mol]. Aliased with self.C_v.

property molar_heat_capacity_p

Returns molar heat capacity at constant pressure of the solution [J/K/mol]. Aliased with self.C_p.

property stoichiometric_matrix

A sympy Matrix where each element M[i,j] corresponds to the number of atoms of element[j] in endmember[i].

property stoichiometric_array

A numpy array where each element arr[i,j] corresponds to the number of atoms of element[j] in endmember[i].

property reaction_basis

Returns a basis for the reaction space, represented as the left nullspace of the stoichiometric matrix.

Each row of the returned array corresponds to a linearly independent chemical reaction that conserves mass and charge. The value at arr[i, j] gives the number of moles of endmember[j] involved in reaction[i].

Returns:

An array where each row defines a balanced chemical reaction in terms of molar amounts of endmembers.

Return type:

numpy.ndarray

property n_reactions

The number of reactions in reaction_basis.

property compositional_basis
Returns:

A basis for the compositional degrees of freedom, orthogonal to the reaction space.

Each row of the returned array defines an independent compositional constraint in terms of moles of endmembers. These constraints span the row space of the stoichiometric matrix and are complementary to the reaction basis (which spans the left null space).

For example, endmembers with site-species occupancies [Fe][Mg] and [Mg][Fe] have reaction basis vector [1, -1]. A compositional basis vector orthogonal to this is: [1, 1], which satisfies the requirement that the Fe-Mg ratio of the system remains fixed and the total amount of the two sites remains equal.

Return type:

numpy.ndarray

property independent_element_indices

A list of an independent set of element indices. If the amounts of these elements are known (element_amounts), the amounts of the other elements can be inferred by -compositional_null_basis[independent_element_indices].dot(element_amounts).

property dependent_element_indices

The element indices not included in the independent list.

property compositional_null_basis

Returns a basis for the compositional nullspace (kernel) of the stoichiometric matrix.

This basis consists of vectors that represent linear constraints any valid bulk composition must satisfy to be formed from the endmembers. In other words, for any bulk composition vector b that can be expressed as a combination of the endmembers, multiplying it by these vectors results in zero (N @ b = 0).

These constraints typically reflect conserved properties such as elemental mass balance or charge neutrality.

Example: Suppose the stoichiometric matrix corresponds to elements C and O in species, and the nullspace basis vector is [1, -2]. Then for any bulk composition vector b = [b_C, b_O], the constraint 1 * b_C - 2 * b_O = 0 must hold. This means the ratio of carbon to oxygen must satisfy that relationship to be achievable from the given endmembers.

Returns:

A 2D array where each row is a basis vector of the nullspace.

Return type:

numpy.ndarray

property endmember_formulae

A list of formulae for all the endmembers in the solution.

property endmember_names

A list of names for all the endmembers in the solution.

property n_endmembers

The number of endmembers in the solution.

property elements

A list of the elements which could be contained in the solution, returned in the IUPAC element order.

property C_p

Alias for heat_capacity_p()

property C_v

Alias for heat_capacity_v()

property G

Alias for shear_modulus()

property G_eff

Alias for effective_shear_modulus()

property H

Alias for enthalpy()

property K_S

Alias for isentropic_bulk_modulus_reuss()

property K_T

Alias for isothermal_bulk_modulus_reuss()

property K_eff

Alias for effective_isentropic_bulk_modulus()

property P

Alias for pressure()

property S

Alias for entropy()

property T

Alias for temperature()

property V

Alias for volume()

property alpha

Alias for thermal_expansivity()

property beta_S

Alias for isentropic_compressibility_reuss()

property beta_T

Alias for isothermal_compressibility_reuss()

copy()
debug_print(indent='')

Print a human-readable representation of this Material.

property effective_isentropic_bulk_modulus

Returns the effective isentropic bulk modulus of the mineral.

Note

Needs to be implemented in derived classes. Aliased with K_eff().

Returns:

Effective isentropic bulk modulus in [Pa].

Return type:

float

property effective_shear_modulus

Returns the effective shear modulus of the mineral.

Note

Needs to be implemented in derived classes. Aliased with G_eff().

Returns:

Effective shear modulus in [Pa].

Return type:

float

property enthalpy

Extensive enthalpy of the material (J).

property entropy

Extensive entropy of the material (J/K).

evaluate(vars_list, pressures, temperatures, molar_fractions=None)

Returns an array of material properties requested through a list of strings at given pressure and temperature conditions. At the end it resets the set_state to the original values. The user needs to call set_method() before.

Parameters:
  • vars_list (list of strings) – Variables to be returned for given conditions

  • pressures (numpy.array, n-dimensional) – ndlist or ndarray of float of pressures in [Pa].

  • temperatures (numpy.array, n-dimensional) – ndlist or ndarray of float of temperatures in [K].

Returns:

List or array returning all variables at given pressure/temperature values. output[i][j] is property vars_list[j] for temperatures[i] and pressures[i]. Attempts to return an array, falls back to a list if the returned properties have different shapes.

Return type:

list or numpy.array, n-dimensional

evaluate_with_volumes(vars_list, volumes, temperatures, molar_fractions=None)

Returns an array of material properties requested through a list of strings at given volume and temperature conditions. At the end it resets the set_state to the original values. The user needs to call set_method() before.

Parameters:
  • vars_list (list of strings) – Variables to be returned for given conditions

  • volumes (numpy.array, n-dimensional) – ndlist or ndarray of float of volumes in [m^3].

  • temperatures (numpy.array, n-dimensional) – ndlist or ndarray of float of temperatures in [K].

Returns:

List or array returning all variables at given pressure/temperature values. output[i][j] is property vars_list[j] for temperatures[i] and pressures[i]. Attempts to return an array, falls back to a list if the returned properties have different shapes.

Return type:

list or numpy.array, n-dimensional

property gibbs

Extensive Gibbs free energy of the material (J).

property gr

Alias for grueneisen_parameter()

property heat_capacity_p

Extensive heat capacity at constant pressure of the material (J/K).

property heat_capacity_v

Extensive heat capacity at constant volume of the material (J/K).

property helmholtz

Extensive Helmholtz free energy of the material (J).

property internal_energy

Extensive internal energy of the material (J).

property isentropic_thermal_gradient
Returns:

dTdP, the change in temperature with pressure at constant entropy [Pa/K]

Return type:

float

property mass

Returns the mass of this material.

Returns:

Mass in [kg].

Return type:

float

property number_of_moles

Returns the number of moles in this material.

Returns:

Number of moles.

Return type:

float

property pressure

Returns current pressure that was set with set_state().

Note

Aliased with P().

Returns:

Pressure in [Pa].

Return type:

float

print_minerals_of_current_state()

Print a human-readable representation of this Material at the current P, T as a list of minerals. This requires set_state() has been called before.

reset()

Resets all cached material properties.

It is typically not required for the user to call this function.

property rho

Alias for density()

set_state_with_volume(volume, temperature, pressure_guesses=[0.0, 10000000000.0])

This function acts similarly to set_state, but takes volume and temperature as input to find the pressure.

If the mineral is an endmember that has a pressure(T, V) function and does not have property modifiers, this function evaluates the pressure directly. Otherwise, it finds the pressure using the brentq root-finding method on the molar_volume attribute of the mineral. This ensures self-consistency even if the mineral has a pressure-dependent volume modifier.

Parameters:
  • volume (float) – The desired molar volume of the mineral [m^3].

  • temperature (float) – The desired temperature of the mineral [K].

  • pressure_guesses (list) – A list of floats denoting the initial low and high guesses for bracketing of the pressure [Pa]. These guesses should preferably bound the correct pressure, but do not need to do so. More importantly, they should not lie outside the valid region of the equation of state. Defaults to [0.e9, 10.e9].

property temperature

Returns current temperature that was set with set_state().

Note

Aliased with T().

Returns:

Temperature in [K].

Return type:

float

to_string()

Returns the name of the mineral class

unroll()

Unroll this material into a list of burnman.Mineral and their molar fractions. All averaging schemes then operate on this list of minerals. Note that the return value of this function may depend on the current state (temperature, pressure).

Note

Needs to be implemented in derived classes.

Returns:

A list of molar fractions which should sum to 1.0, and a list of burnman.Mineral objects containing the minerals in the material.

Return type:

tuple

property v_p

Alias for p_wave_velocity()

property v_phi

Alias for bulk_sound_velocity()

property v_s

Alias for shear_wave_velocity()

property volume

Extensive volume of the material (m^3).

class burnman.ElasticSolution(name=None, solution_model=None, molar_fractions=None)[source]

Bases: Mineral

This is the base class for all Elastic solutions. Site occupancies, endmember activities and the constant and volume and temperature dependencies of the excess properties can be queried after using set_composition(). States of the solution can only be queried after setting the pressure, temperature and composition using set_state() and set_composition.

This class is available as burnman.ElasticSolution. It uses an instance of burnman.ElasticSolutionModel to calculate interaction terms between endmembers.

All the solution parameters are expected to be in SI units. This means that the interaction parameters should be in J/mol, with the T and V derivatives in J/K/mol and Pa/mol.

The parameters are relevant to all Elastic solution models. Please see the documentation for individual models for details about other parameters.

Parameters:
  • name (string) – Name of the solution.

  • solution_model (burnman.ElasticSolutionModel) – The ElasticSolutionModel object defining the properties of the solution.

  • molar_fractions (numpy.array) – The molar fractions of each endmember in the solution. Can be reset using the set_composition() method.

property name

Human-readable name of this material.

By default this will return the name of the class, but it can be set to an arbitrary string. Overriden in Mineral.

property endmembers
set_composition(molar_fractions)[source]

Set the composition for this solution. Resets cached properties.

Parameters:

molar_fractions (list of float) – Molar abundance for each endmember, needs to sum to one.

set_method(method)[source]

Set the equation of state to be used for this mineral. Takes a string corresponding to any of the predefined equations of state: ‘bm3shear2’, ‘bm3’, ‘mgd2’, ‘mgd3’, ‘slb2’, ‘slb3’, ‘mt’, ‘hp_tmt’, or ‘cork’. Alternatively, you can pass a user defined class which derives from the equation_of_state base class. After calling set_method(), any existing derived properties (e.g., elastic parameters or thermodynamic potentials) will be out of date, so set_state() will need to be called again.

set_state(pressure, temperature)[source]

(copied from set_state):

Set the material to the given pressure and temperature.

Parameters:
  • pressure (float) – The desired pressure in [Pa].

  • temperature (float) – The desired temperature in [K].

property formula

Returns molar chemical formula of the solution.

property activities

Returns a list of endmember activities [unitless].

property activity_coefficients

Returns a list of endmember activity coefficients (gamma = activity / ideal activity) [unitless].

property molar_internal_energy

Returns molar internal energy of the mineral [J/mol]. Aliased with self.energy

property partial_gibbs

Returns endmember partial molar Gibbs energy at constant pressure [J/mol]. Property specific to solutions.

property partial_volumes

Returns endmember partial molar volumes [m^3/mol]. Property specific to solutions.

property partial_entropies

Returns endmember partial molar entropies [J/K/mol]. Property specific to solutions.

property gibbs_hessian

Returns an array containing the second compositional derivative of the Gibbs energy at constant pressure [J/mol]. Property specific to solutions.

property molar_helmholtz

Returns molar Helmholtz energy of the solution [J/mol]. Aliased with self.helmholtz.

property molar_gibbs

Returns molar Gibbs free energy of the solution [J/mol]. Aliased with self.gibbs.

property molar_mass

Returns molar mass of the solution [kg/mol].

property excess_pressure

Returns excess pressure of the solution [Pa]. Specific property for solutions.

property molar_volume

Returns molar volume of the solution [m^3/mol]. Aliased with self.V.

property density

Returns density of the solution [kg/m^3]. Aliased with self.rho.

property excess_entropy

Returns excess molar entropy [J/K/mol]. Property specific to solutions.

property molar_entropy

Returns molar entropy of the solution [J/K/mol]. Aliased with self.S.

property excess_enthalpy

Returns excess molar enthalpy [J/mol]. Property specific to solutions.

property molar_enthalpy

Returns molar enthalpy of the solution [J/mol]. Aliased with self.H.

property isothermal_bulk_modulus_reuss

Returns isothermal bulk modulus of the solution [Pa]. Aliased with self.K_T.

property isentropic_bulk_modulus_reuss

Returns adiabatic bulk modulus of the solution [Pa]. Aliased with self.K_S.

property isothermal_compressibility_reuss

Returns isothermal compressibility of the solution. (or inverse isothermal bulk modulus) [1/Pa]. Aliased with self.K_T.

property isentropic_compressibility_reuss

Returns adiabatic compressibility of the solution. (or inverse adiabatic bulk modulus) [1/Pa]. Aliased with self.K_S.

property shear_modulus

Returns shear modulus of the solution [Pa]. Aliased with self.G.

property p_wave_velocity

Returns P wave speed of the solution [m/s]. Aliased with self.v_p.

property bulk_sound_velocity

Returns bulk sound speed of the solution [m/s]. Aliased with self.v_phi.

property shear_wave_velocity

Returns shear wave speed of the solution [m/s]. Aliased with self.v_s.

property grueneisen_parameter

Returns grueneisen parameter of the solution [unitless]. Aliased with self.gr.

property thermal_expansivity

Returns thermal expansion coefficient (alpha) of the solution [1/K]. Aliased with self.alpha.

property molar_heat_capacity_v

Returns molar heat capacity at constant volume of the solution [J/K/mol]. Aliased with self.C_v.

property molar_heat_capacity_p

Returns molar heat capacity at constant pressure of the solution [J/K/mol]. Aliased with self.C_p.

property stoichiometric_matrix

A sympy Matrix where each element M[i,j] corresponds to the number of atoms of element[j] in endmember[i].

property stoichiometric_array

An array where each element arr[i,j] corresponds to the number of atoms of element[j] in endmember[i].

property reaction_basis

An array where each element arr[i,j] corresponds to the number of moles of endmember[j] involved in reaction[i].

property n_reactions

The number of reactions in reaction_basis.

property independent_element_indices

A list of an independent set of element indices. If the amounts of these elements are known (element_amounts), the amounts of the other elements can be inferred by -compositional_null_basis[independent_element_indices].dot(element_amounts).

property dependent_element_indices

The element indices not included in the independent list.

property compositional_null_basis

An array N such that N.b = 0 for all bulk compositions that can be produced with a linear sum of the endmembers in the solution.

property endmember_formulae

A list of formulae for all the endmember in the solution.

property endmember_names

A list of names for all the endmember in the solution.

property n_endmembers

The number of endmembers in the solution.

property elements

A list of the elements which could be contained in the solution, returned in the IUPAC element order.

property C_p

Alias for heat_capacity_p()

property C_v

Alias for heat_capacity_v()

property G

Alias for shear_modulus()

property G_eff

Alias for effective_shear_modulus()

property H

Alias for enthalpy()

property K_S

Alias for isentropic_bulk_modulus_reuss()

property K_T

Alias for isothermal_bulk_modulus_reuss()

property K_eff

Alias for effective_isentropic_bulk_modulus()

property P

Alias for pressure()

property S

Alias for entropy()

property T

Alias for temperature()

property V

Alias for volume()

property alpha

Alias for thermal_expansivity()

property beta_S

Alias for isentropic_compressibility_reuss()

property beta_T

Alias for isothermal_compressibility_reuss()

copy()
debug_print(indent='')

Print a human-readable representation of this Material.

property effective_isentropic_bulk_modulus

Returns the effective isentropic bulk modulus of the mineral.

Note

Needs to be implemented in derived classes. Aliased with K_eff().

Returns:

Effective isentropic bulk modulus in [Pa].

Return type:

float

property effective_shear_modulus

Returns the effective shear modulus of the mineral.

Note

Needs to be implemented in derived classes. Aliased with G_eff().

Returns:

Effective shear modulus in [Pa].

Return type:

float

property enthalpy

Extensive enthalpy of the material (J).

property entropy

Extensive entropy of the material (J/K).

evaluate(vars_list, pressures, temperatures, molar_fractions=None)

Returns an array of material properties requested through a list of strings at given pressure and temperature conditions. At the end it resets the set_state to the original values. The user needs to call set_method() before.

Parameters:
  • vars_list (list of strings) – Variables to be returned for given conditions

  • pressures (numpy.array, n-dimensional) – ndlist or ndarray of float of pressures in [Pa].

  • temperatures (numpy.array, n-dimensional) – ndlist or ndarray of float of temperatures in [K].

Returns:

List or array returning all variables at given pressure/temperature values. output[i][j] is property vars_list[j] for temperatures[i] and pressures[i]. Attempts to return an array, falls back to a list if the returned properties have different shapes.

Return type:

list or numpy.array, n-dimensional

evaluate_with_volumes(vars_list, volumes, temperatures, molar_fractions=None)

Returns an array of material properties requested through a list of strings at given volume and temperature conditions. At the end it resets the set_state to the original values. The user needs to call set_method() before.

Parameters:
  • vars_list (list of strings) – Variables to be returned for given conditions

  • volumes (numpy.array, n-dimensional) – ndlist or ndarray of float of volumes in [m^3].

  • temperatures (numpy.array, n-dimensional) – ndlist or ndarray of float of temperatures in [K].

Returns:

List or array returning all variables at given pressure/temperature values. output[i][j] is property vars_list[j] for temperatures[i] and pressures[i]. Attempts to return an array, falls back to a list if the returned properties have different shapes.

Return type:

list or numpy.array, n-dimensional

property gibbs

Extensive Gibbs free energy of the material (J).

property gr

Alias for grueneisen_parameter()

property heat_capacity_p

Extensive heat capacity at constant pressure of the material (J/K).

property heat_capacity_v

Extensive heat capacity at constant volume of the material (J/K).

property helmholtz

Extensive Helmholtz free energy of the material (J).

property internal_energy

Extensive internal energy of the material (J).

property isentropic_thermal_gradient
Returns:

dTdP, the change in temperature with pressure at constant entropy [Pa/K]

Return type:

float

property mass

Returns the mass of this material.

Returns:

Mass in [kg].

Return type:

float

property number_of_moles

Returns the number of moles in this material.

Returns:

Number of moles.

Return type:

float

property pressure

Returns current pressure that was set with set_state().

Note

Aliased with P().

Returns:

Pressure in [Pa].

Return type:

float

print_minerals_of_current_state()

Print a human-readable representation of this Material at the current P, T as a list of minerals. This requires set_state() has been called before.

reset()

Resets all cached material properties.

It is typically not required for the user to call this function.

property rho

Alias for density()

set_state_with_volume(volume, temperature, pressure_guesses=[0.0, 10000000000.0])

This function acts similarly to set_state, but takes volume and temperature as input to find the pressure.

If the mineral is an endmember that has a pressure(T, V) function and does not have property modifiers, this function evaluates the pressure directly. Otherwise, it finds the pressure using the brentq root-finding method on the molar_volume attribute of the mineral. This ensures self-consistency even if the mineral has a pressure-dependent volume modifier.

Parameters:
  • volume (float) – The desired molar volume of the mineral [m^3].

  • temperature (float) – The desired temperature of the mineral [K].

  • pressure_guesses (list) – A list of floats denoting the initial low and high guesses for bracketing of the pressure [Pa]. These guesses should preferably bound the correct pressure, but do not need to do so. More importantly, they should not lie outside the valid region of the equation of state. Defaults to [0.e9, 10.e9].

property temperature

Returns current temperature that was set with set_state().

Note

Aliased with T().

Returns:

Temperature in [K].

Return type:

float

to_string()

Returns the name of the mineral class

unroll()

Unroll this material into a list of burnman.Mineral and their molar fractions. All averaging schemes then operate on this list of minerals. Note that the return value of this function may depend on the current state (temperature, pressure).

Note

Needs to be implemented in derived classes.

Returns:

A list of molar fractions which should sum to 1.0, and a list of burnman.Mineral objects containing the minerals in the material.

Return type:

tuple

property v_p

Alias for p_wave_velocity()

property v_phi

Alias for bulk_sound_velocity()

property v_s

Alias for shear_wave_velocity()

property volume

Extensive volume of the material (m^3).

class burnman.AnisotropicSolution(name, solution_model, psi_excess_function, anisotropic_parameters, molar_fractions=None)[source]

Bases: Solution, AnisotropicMineral

A class implementing the anisotropic solution model described in [Myh24]. This class is derived from Solution and AnisotropicMineral, and inherits most of the methods from those classes.

Instantiation of an AnisotropicSolution is similar to that of a scalar Solution, except that each of the endmembers must be an instance of an AnisotropicMineral, and an additional function and parameter dictionary are passed to the constructor of AnisotropicSolution that describe excess contributions to the anisotropic state tensor (Psi_xs) and its derivatives with respect to volume and temperature. The function arguments should be ln(V), Pth, p (a vector of proportions) and the parameter dictionary, in that order. The output variables Psi_xs_Voigt, dPsidf_Pth_Voigt_xs and dPsidPth_f_Voigt_xs (all 6x6 matrices) and dPsiIdp_xs (a 3 x 3 x n_endmember matrix) must be returned in that order in a tuple. States of the mineral can only be queried after setting the pressure and temperature using set_state() and the composition using set_composition().

This class is available as burnman.AnisotropicSolution.

set_state(pressure, temperature)[source]

(copied from set_state):

Set the material to the given pressure and temperature.

Parameters:
  • pressure (float) – The desired pressure in [Pa].

  • temperature (float) – The desired temperature in [K].

compute_base_properties()[source]
set_composition(molar_fractions)[source]

Set the composition for this solution. Resets cached properties.

Parameters:

molar_fractions (list of float) – Molar abundance for each endmember, needs to sum to one.

property ones
property eye
property depsdn_fixed_VT

Gradient in strain with respect to composition at fixed volume and temperature under hydrostatic conditions.

property C_p

Alias for heat_capacity_p()

property C_v

Alias for heat_capacity_v()

property G

Alias for shear_modulus()

property G_eff

Alias for effective_shear_modulus()

property H

Alias for enthalpy()

property K_S

Anisotropic minerals do not have a single isentropic bulk modulus. This function returns a NotImplementedError. Users should instead consider either using isentropic_bulk_modulus_reuss, isentropic_bulk_modulus_voigt (both derived from AnisotropicMineral), or directly querying the elements in the isentropic_stiffness_tensor.

property K_T

Anisotropic minerals do not have a single isothermal bulk modulus. This function returns a NotImplementedError. Users should instead consider either using isothermal_bulk_modulus_reuss, isothermal_bulk_modulus_voigt, or directly querying the elements in the isothermal_stiffness_tensor.

property K_eff

Alias for effective_isentropic_bulk_modulus()

property P

Alias for pressure()

property S

Alias for entropy()

property T

Alias for temperature()

property V

Alias for volume()

property activities

Returns a list of endmember activities [unitless].

property activity_coefficients

Returns a list of endmember activity coefficients (gamma = activity / ideal activity) [unitless].

property alpha

Alias for thermal_expansivity()

property beta_S

Anisotropic minerals do not have a single isentropic compressibility. This function returns a NotImplementedError. Users should instead consider either using isentropic_compressibility_tensor, isentropic_compressibility_reuss or isentropic_compressibility_voigt (all derived from AnisotropicMineral), or directly querying the elements in the isentropic_compliance_tensor.

property beta_T
Returns:

The Reuss bound on the isothermal compressibility in [1/Pa].

Return type:

float

property bulk_sound_velocity

Returns bulk sound speed of the solution [m/s]. Aliased with self.v_phi.

property cell_parameters
Returns:

The molar cell parameters of the mineral, given in standard form: [\(a\), \(b\), \(c\), \(\alpha\), \(\beta\), \(\gamma\)], where the first three floats are the lengths of the vectors in [m] defining the cell constructed from one mole of formula units. The last three floats are angles between vectors (given in radians). See the documentation for the function cell_parameters_to_vectors() for the assumed relationships between the cell vectors and spatial coordinate axes.

Return type:

numpy.array (1D)

property cell_vectors
Returns:

The vectors of the cell constructed from one mole of formula units [m]. See the documentation for the function cell_parameters_to_vectors() for the assumed relationships between the cell vectors and spatial coordinate axes.

Return type:

numpy.array (2D)

check_standard_parameters(anisotropic_parameters)
christoffel_tensor(propagation_direction)
Returns:

The Christoffel tensor from an elastic stiffness tensor and a propagation direction for a seismic wave relative to the stiffness tensor: T_ik = C_ijkl n_j n_l.

Return type:

float

property compositional_basis
Returns:

A basis for the compositional degrees of freedom, orthogonal to the reaction space.

Each row of the returned array defines an independent compositional constraint in terms of moles of endmembers. These constraints span the row space of the stoichiometric matrix and are complementary to the reaction basis (which spans the left null space).

For example, endmembers with site-species occupancies [Fe][Mg] and [Mg][Fe] have reaction basis vector [1, -1]. A compositional basis vector orthogonal to this is: [1, 1], which satisfies the requirement that the Fe-Mg ratio of the system remains fixed and the total amount of the two sites remains equal.

Return type:

numpy.ndarray

property compositional_null_basis

Returns a basis for the compositional nullspace (kernel) of the stoichiometric matrix.

This basis consists of vectors that represent linear constraints any valid bulk composition must satisfy to be formed from the endmembers. In other words, for any bulk composition vector b that can be expressed as a combination of the endmembers, multiplying it by these vectors results in zero (N @ b = 0).

These constraints typically reflect conserved properties such as elemental mass balance or charge neutrality.

Example: Suppose the stoichiometric matrix corresponds to elements C and O in species, and the nullspace basis vector is [1, -2]. Then for any bulk composition vector b = [b_C, b_O], the constraint 1 * b_C - 2 * b_O = 0 must hold. This means the ratio of carbon to oxygen must satisfy that relationship to be achievable from the given endmembers.

Returns:

A 2D array where each row is a basis vector of the nullspace.

Return type:

numpy.ndarray

copy()
debug_print(indent='')

Print a human-readable representation of this Material.

property deformation_gradient_tensor
Returns:

The deformation gradient tensor describing the deformation of the mineral from its undeformed state (i.e. the state at the reference pressure and temperature).

Return type:

numpy.array (2D)

property deformed_coordinate_frame
Returns:

The orientations of the three spatial coordinate axes after deformation of the mineral [m]. For orthotropic minerals, this is equal to the identity matrix, as hydrostatic stresses only induce rotations in monoclinic and triclinic crystals.

Return type:

numpy.array (2D)

property density

Returns density of the solution [kg/m^3]. Aliased with self.rho.

property dependent_element_indices

The element indices not included in the independent list.

property effective_isentropic_bulk_modulus

Returns the effective isentropic bulk modulus of the mineral.

Note

Needs to be implemented in derived classes. Aliased with K_eff().

Returns:

Effective isentropic bulk modulus in [Pa].

Return type:

float

property effective_shear_modulus

Returns the effective shear modulus of the mineral.

Note

Needs to be implemented in derived classes. Aliased with G_eff().

Returns:

Effective shear modulus in [Pa].

Return type:

float

property elements

A list of the elements which could be contained in the solution, returned in the IUPAC element order.

property endmember_formulae

A list of formulae for all the endmembers in the solution.

property endmember_names

A list of names for all the endmembers in the solution.

property endmembers
property enthalpy

Extensive enthalpy of the material (J).

property entropy

Extensive entropy of the material (J/K).

property entropy_hessian

Returns an array containing the second compositional derivative of the entropy [J/K]. Property specific to solutions.

evaluate(vars_list, pressures, temperatures, molar_fractions=None)

Returns an array of material properties requested through a list of strings at given pressure and temperature conditions. At the end it resets the set_state to the original values. The user needs to call set_method() before.

Parameters:
  • vars_list (list of strings) – Variables to be returned for given conditions

  • pressures (numpy.array, n-dimensional) – ndlist or ndarray of float of pressures in [Pa].

  • temperatures (numpy.array, n-dimensional) – ndlist or ndarray of float of temperatures in [K].

Returns:

List or array returning all variables at given pressure/temperature values. output[i][j] is property vars_list[j] for temperatures[i] and pressures[i]. Attempts to return an array, falls back to a list if the returned properties have different shapes.

Return type:

list or numpy.array, n-dimensional

evaluate_with_volumes(vars_list, volumes, temperatures, molar_fractions=None)

Returns an array of material properties requested through a list of strings at given volume and temperature conditions. At the end it resets the set_state to the original values. The user needs to call set_method() before.

Parameters:
  • vars_list (list of strings) – Variables to be returned for given conditions

  • volumes (numpy.array, n-dimensional) – ndlist or ndarray of float of volumes in [m^3].

  • temperatures (numpy.array, n-dimensional) – ndlist or ndarray of float of temperatures in [K].

Returns:

List or array returning all variables at given pressure/temperature values. output[i][j] is property vars_list[j] for temperatures[i] and pressures[i]. Attempts to return an array, falls back to a list if the returned properties have different shapes.

Return type:

list or numpy.array, n-dimensional

property excess_enthalpy

Returns excess molar enthalpy [J/mol]. Property specific to solutions.

property excess_entropy

Returns excess molar entropy [J/K/mol]. Property specific to solutions.

property excess_gibbs

Returns molar excess gibbs free energy [J/mol]. Property specific to solutions.

property excess_partial_entropies

Returns excess partial entropies [J/K]. Property specific to solutions.

property excess_partial_gibbs

Returns excess partial molar gibbs free energy [J/mol]. Property specific to solutions.

property excess_partial_volumes

Returns excess partial volumes [m^3]. Property specific to solutions.

property excess_volume

Returns excess molar volume of the solution [m^3/mol]. Specific property for solutions.

property formula

Returns molar chemical formula of the solution. :rtype: Counter

property full_isentropic_compliance_tensor
Returns:

The isentropic compliance tensor [1/Pa] in standard form (\(\mathbb{S}_{\text{N} ijkl}\)).

Return type:

numpy.array (4D)

property full_isentropic_stiffness_tensor
Returns:

The isentropic stiffness tensor [Pa] in standard form (\(\mathbb{C}_{\text{N} ijkl}\)).

Return type:

numpy.array (4D)

property full_isothermal_compliance_tensor
Returns:

The isothermal compliance tensor [1/Pa] in standard form (\(\mathbb{S}_{\text{T} ijkl}\)).

Return type:

numpy.array (4D)

property full_isothermal_stiffness_tensor
Returns:

The isothermal stiffness tensor [Pa] in standard form (\(\mathbb{C}_{\text{T} ijkl}\)).

Return type:

numpy.array (4D)

property gibbs

Extensive Gibbs free energy of the material (J).

property gibbs_hessian

Returns an array containing the second compositional derivative of the Gibbs free energy [J]. Property specific to solutions.

property gr

Alias for grueneisen_parameter()

property grueneisen_parameter

Returns grueneisen parameter of the solution [unitless]. Aliased with self.gr.

property grueneisen_tensor
Returns:

The grueneisen tensor [unitless]. This is defined by [BM67] as \(\mathbb{C}_{\text{N} ijkl} \alpha_{kl} V/C_{P}\).

Return type:

numpy.array (2D)

property heat_capacity_p

Extensive heat capacity at constant pressure of the material (J/K).

property heat_capacity_v

Extensive heat capacity at constant volume of the material (J/K).

property helmholtz

Extensive Helmholtz free energy of the material (J).

property independent_element_indices

A list of an independent set of element indices. If the amounts of these elements are known (element_amounts), the amounts of the other elements can be inferred by -compositional_null_basis[independent_element_indices].dot(element_amounts).

property internal_energy

Extensive internal energy of the material (J).

property isentropic_bulk_modulus_reuss

Returns adiabatic bulk modulus of the solution [Pa]. Aliased with self.K_S.

property isentropic_bulk_modulus_voigt
Returns:

The Voigt bound on the isentropic bulk modulus in [Pa].

Return type:

float

property isentropic_bulk_modulus_vrh
Returns:

The Voigt-Reuss-Hill average of the isentropic bulk modulus [Pa].

Return type:

float

property isentropic_compliance_tensor
Returns:

The isentropic compliance tensor [1/Pa] in Voigt form (\(\mathbb{S}_{\text{N} pq}\)).

Return type:

numpy.array (2D)

property isentropic_compressibility_reuss

Returns adiabatic compressibility of the solution. (or inverse adiabatic bulk modulus) [1/Pa]. Aliased with self.K_S.

property isentropic_compressibility_tensor
Returns:

The isentropic compressibility tensor [1/Pa].

Return type:

numpy.array (2D)

property isentropic_compressibility_voigt
Returns:

The Voigt bound on the isentropic compressibility in [1/Pa].

Return type:

float

property isentropic_isotropic_poisson_ratio
Returns:

The isotropic Poisson ratio (mu) [unitless]. A metric of the lateral response to loading.

Return type:

float

isentropic_linear_compressibility(direction)
Returns:

The linear isentropic compressibility in a given direction relative to the stiffness tensor [1/Pa].

Return type:

float

isentropic_poissons_ratio(axial_direction, lateral_direction)
Returns:

The isentropic poisson ratio given loading and response directions relative to the stiffness tensor [unitless].

Return type:

float

isentropic_shear_modulus(plane_normal, shear_direction)
Returns:

The isentropic shear modulus on a plane in a given shear direction relative to the stiffness tensor [Pa].

Return type:

float

property isentropic_shear_modulus_reuss
Returns:

The Reuss bound on the isentropic shear modulus [Pa].

Return type:

float

property isentropic_shear_modulus_voigt
Returns:

The Voigt bound on the isentropic shear modulus [Pa].

Return type:

float

property isentropic_shear_modulus_vrh
Returns:

The Voigt-Reuss-Hill average of the isentropic shear modulus [Pa].

Return type:

float

property isentropic_stiffness_tensor
Returns:

The isentropic stiffness tensor [Pa] in Voigt form (\(\mathbb{C}_{\text{N} pq}\)).

Return type:

numpy.array (2D)

property isentropic_thermal_gradient
Returns:

dTdP, the change in temperature with pressure at constant entropy [Pa/K]

Return type:

float

property isentropic_universal_elastic_anisotropy
Returns:

The universal elastic anisotropy [unitless]

Return type:

float

isentropic_youngs_modulus(direction)
Returns:

The isentropic Youngs modulus in a given direction relative to the stiffness tensor [Pa].

Return type:

float

property isothermal_bulk_modulus_reuss

Returns isothermal bulk modulus of the solution [Pa]. Aliased with self.K_T.

property isothermal_bulk_modulus_voigt
Returns:

The Voigt bound on the isothermal bulk modulus in [Pa].

Return type:

float

property isothermal_compliance_tensor
Returns:

The isothermal compliance tensor [1/Pa] in Voigt form (\(\mathbb{S}_{\text{T} pq}\)).

Return type:

numpy.array (2D)

property isothermal_compressibility_reuss

Returns isothermal compressibility of the solution. (or inverse isothermal bulk modulus) [1/Pa]. Aliased with self.K_T.

property isothermal_compressibility_tensor
Returns:

The isothermal compressibility tensor [1/Pa].

Return type:

numpy.array (2D)

property isothermal_compressibility_voigt
Returns:

The Voigt bound on the isothermal compressibility in [1/Pa].

Return type:

float

property isothermal_stiffness_tensor
Returns:

The isothermal stiffness tensor [Pa] in Voigt form (\(\mathbb{C}_{\text{T} pq}\)).

Return type:

numpy.array (2D)

property mass

Returns the mass of this material.

Returns:

Mass in [kg].

Return type:

float

property molar_enthalpy

Returns molar enthalpy of the solution [J/mol]. Aliased with self.H.

property molar_entropy

Returns molar entropy of the solution [J/K/mol]. Aliased with self.S.

property molar_gibbs

Returns molar Gibbs free energy of the solution [J/mol]. Aliased with self.gibbs.

property molar_heat_capacity_p

Returns molar heat capacity at constant pressure of the solution [J/K/mol]. Aliased with self.C_p.

property molar_heat_capacity_v

Returns molar heat capacity at constant volume of the solution [J/K/mol]. Aliased with self.C_v.

property molar_helmholtz

Returns molar Helmholtz free energy of the solution [J/mol]. Aliased with self.helmholtz.

property molar_internal_energy

Returns molar internal energy of the mineral [J/mol]. Aliased with self.energy

property molar_isometric_heat_capacity
Returns:

The molar heat capacity at constant strain [J/K/mol].

Return type:

float

property molar_mass

Returns molar mass of the solution [kg/mol].

property molar_volume

Returns molar volume of the solution [m^3/mol]. Aliased with self.V.

property n_endmembers

The number of endmembers in the solution.

property n_reactions

The number of reactions in reaction_basis.

property name

Human-readable name of this material.

By default this will return the name of the class, but it can be set to an arbitrary string. Overriden in Mineral.

property number_of_moles

Returns the number of moles in this material.

Returns:

Number of moles.

Return type:

float

property p_wave_velocity

Returns P wave speed of the solution [m/s]. Aliased with self.v_p.

property partial_entropies

Returns endmember partial entropies [J/K]. Property specific to solutions.

property partial_gibbs

Returns endmember partial molar gibbs free energy [J/mol]. Property specific to solutions.

property partial_volumes

Returns endmember partial volumes [m^3]. Property specific to solutions.

property pressure

Returns current pressure that was set with set_state().

Note

Aliased with P().

Returns:

Pressure in [Pa].

Return type:

float

print_minerals_of_current_state()

Print a human-readable representation of this Material at the current P, T as a list of minerals. This requires set_state() has been called before.

property reaction_basis

Returns a basis for the reaction space, represented as the left nullspace of the stoichiometric matrix.

Each row of the returned array corresponds to a linearly independent chemical reaction that conserves mass and charge. The value at arr[i, j] gives the number of moles of endmember[j] involved in reaction[i].

Returns:

An array where each row defines a balanced chemical reaction in terms of molar amounts of endmembers.

Return type:

numpy.ndarray

reset()

Resets all cached material properties.

It is typically not required for the user to call this function.

property rho

Alias for density()

property rotation_matrix
Returns:

The matrix required to rotate the properties of the deformed mineral into the deformed coordinate frame. For orthotropic minerals, this is equal to the identity matrix.

Return type:

numpy.array (2D)

set_method(method)

Set the equation of state to be used for this mineral. Takes a string corresponding to any of the predefined equations of state: ‘bm3shear2’, ‘bm3’, ‘mgd2’, ‘mgd3’, ‘slb2’, ‘slb3’, ‘mt’, ‘hp_tmt’, or ‘cork’. Alternatively, you can pass a user defined class which derives from the equation_of_state base class. After calling set_method(), any existing derived properties (e.g., elastic parameters or thermodynamic potentials) will be out of date, so set_state() will need to be called again.

set_state_with_volume(volume, temperature, pressure_guesses=[0.0, 10000000000.0])

This function acts similarly to set_state, but takes volume and temperature as input to find the pressure.

If the mineral is an endmember that has a pressure(T, V) function and does not have property modifiers, this function evaluates the pressure directly. Otherwise, it finds the pressure using the brentq root-finding method on the molar_volume attribute of the mineral. This ensures self-consistency even if the mineral has a pressure-dependent volume modifier.

Parameters:
  • volume (float) – The desired molar volume of the mineral [m^3].

  • temperature (float) – The desired temperature of the mineral [K].

  • pressure_guesses (list) – A list of floats denoting the initial low and high guesses for bracketing of the pressure [Pa]. These guesses should preferably bound the correct pressure, but do not need to do so. More importantly, they should not lie outside the valid region of the equation of state. Defaults to [0.e9, 10.e9].

property shear_modulus

Returns shear modulus of the solution [Pa]. Aliased with self.G.

property shear_wave_velocity

Returns shear wave speed of the solution [m/s]. Aliased with self.v_s.

site_formula(precision=2, print_absent_species=True, site_occupancies=None)
Returns the molar chemical formula of the solution with

site occupancies. For example, [Mg0.4Fe0.6]2SiO4.

Parameters:
  • precision (int) – Precision with which to print the site occupancies

  • print_absent_species (bool) – If True, prints site occupancies that are absent (i.e., zero).

  • site_occupancies (numpy.ndarray) – Optional site occupancies to use instead of the current ones.

Returns:

Molar chemical formula of the solution with site occupancies

Return type:

str

property site_occupancies
Returns:

The fractional occupancies of species on each site as a flat vector.

Return type:

numpy.ndarray

standard_psi_function(f, Pth, params)
property stoichiometric_array

A numpy array where each element arr[i,j] corresponds to the number of atoms of element[j] in endmember[i].

property stoichiometric_matrix

A sympy Matrix where each element M[i,j] corresponds to the number of atoms of element[j] in endmember[i].

property temperature

Returns current temperature that was set with set_state().

Note

Aliased with T().

Returns:

Temperature in [K].

Return type:

float

property thermal_expansivity

Returns thermal expansion coefficient (alpha) of the solution [1/K]. Aliased with self.alpha.

property thermal_expansivity_tensor
Returns:

The tensor of thermal expansivities [1/K].

Return type:

numpy.array (2D)

property thermal_stress_tensor
Returns:

The change in stress with temperature at constant strain [Pa/K].

Return type:

numpy.array (2D)

to_string()

Returns the name of the mineral class

unroll()

Unroll this material into a list of burnman.Mineral and their molar fractions. All averaging schemes then operate on this list of minerals. Note that the return value of this function may depend on the current state (temperature, pressure).

Note

Needs to be implemented in derived classes.

Returns:

A list of molar fractions which should sum to 1.0, and a list of burnman.Mineral objects containing the minerals in the material.

Return type:

tuple

property unrotated_cell_vectors
Returns:

The vectors of the cell [m] constructed from one mole of formula units after deformation of the mineral from its undeformed state (i.e. the state at the reference pressure and temperature). See the documentation for the function cell_parameters_to_vectors() for the assumed relationships between the cell vectors and spatial coordinate axes.

Return type:

numpy.array (2D)

property v_p

Alias for p_wave_velocity()

property v_phi

Alias for bulk_sound_velocity()

property v_s

Alias for shear_wave_velocity()

property volume

Extensive volume of the material (m^3).

property volume_hessian

Returns an array containing the second compositional derivative of the volume [m^3]. Property specific to solutions.

wave_velocities(propagation_direction)
Returns:

The compressional wave velocity, and two shear wave velocities in a given propagation direction [m/s].

Return type:

list, containing the wave speeds and directions of particle motion relative to the stiffness tensor

class burnman.SolutionModel[source]

Bases: object

This is the base class for a solution model, intended for use in defining solutions and performing thermodynamic calculations on them. All minerals of type burnman.Solution use a solution model for defining how the endmembers in the solution interact.

A user wanting a new solution model should define the functions included in the base class. All of the functions in the base class return zero, so if the user-defined solution model does not implement them, they essentially have no effect, and the Gibbs free energy and molar volume of a solution will be equal to the weighted arithmetic averages of the different endmember values.

excess_gibbs_energy(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Gibbs free energy of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess Gibbs energy.

Return type:

float

excess_volume(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess volume of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess volume of the solution.

Return type:

float

excess_entropy(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess entropy of the solution.

Return type:

float

excess_enthalpy(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess enthalpy of the solution. The base class implementation assumes that the excess enthalpy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess enthalpy of the solution.

Return type:

float

excess_partial_gibbs_energies(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Gibbs free energy for each endmember of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial Gibbs free energy of each endmember.

Return type:

numpy.array

excess_partial_entropies(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial entropy of each endmember.

Return type:

numpy.array

excess_partial_volumes(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess volume for each endmember of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial volume of each endmember.

Return type:

numpy.array

Cp_excess(pressure, temperature, molar_fractions)[source]
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess isobaric heat capacity of the solution.

Return type:

float

alphaV_excess(pressure, temperature, molar_fractions)[source]
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess alpha*V of the solution model

Return type:

float

VoverKT_excess(pressure, temperature, molar_fractions)[source]
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess V/K_T of the solution model

Return type:

float

class burnman.ElasticSolutionModel[source]

Bases: object

This is the base class for an Elastic solution model, intended for use in defining solutions and performing thermodynamic calculations on them. All minerals of type burnman.Solution use a solution model for defining how the endmembers in the solution interact.

A user wanting a new solution model should define the functions included in the base class. All of the functions in the base class return zero, so if the user-defined solution model does not implement them, they essentially have no effect, and the Helmholtz energy and pressure of a solution will be equal to the weighted arithmetic averages of the different endmember values.

excess_helmholtz_energy(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Helmholtz free energy of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy.

Return type:

float

excess_pressure(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess pressure of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of the solution.

Return type:

float

excess_entropy(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of the solution.

Return type:

float

excess_partial_helmholtz_energies(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Helmholtz energy for each endmember of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy of each endmember

Return type:

numpy.array

excess_partial_entropies(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of each endmember.

Return type:

numpy.array

excess_partial_pressures(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess pressure for each endmember of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of each endmember.

Return type:

numpy.array

Relaxed solutions

class burnman.RelaxedSolution(solution, relaxation_vectors, unrelaxed_vectors)[source]

Bases: Solution

A class implementing a relaxed solution model. This class is derived from Solution, and inherits most of the methods from that class.

Instantiation of a RelaxedSolution involves passing an Solution, plus a set of vectors that represent rapid deformation modes. For example, a solution of MgO, FeHSO and FeLSO (high and low spin wuestite) can rapidly change proportion of high spin and low spin iron, and so a single vector should be passed: np.array([[0., -1., 1.]]) or some multiple thereof.

States of the mineral can only be queried after setting the pressure and temperature using set_state() and the composition using set_composition().

This class is available as burnman.RelaxedSolution.

set_state(pressure, temperature, relaxed=True)[source]

Sets the state of the solution. Also relaxes the structure parameters if set_composition() has already been used and if the relaxed argument has been set to True.

Parameters:
  • pressure (float) – The pressure of the solution [Pa]

  • temperature (float) – The temperature of the solution [K]

  • relaxed (bool, optional) – Whether to minimize the Gibbs energy of the material by changing the values of the structure parameters. Defaults to True.

set_composition(molar_fractions, q_initial=None, relaxed=True)[source]

Sets the composition of the model. Also relaxes the structure parameters if set_state() has already been used and if the relaxed argument has been set to True.

Parameters:
  • molar_fractions (1D numpy array) – Molar fractions of the independent endmembers corresponding to the unrelaxed vectors specified during initialisation.

  • q_initial (1D numpy array, optional) – Initial values of the structure parameters. Defaults to None, in which case the preexisting initial values are used (first set to 0.001 during initialisation).

  • relaxed (bool, optional) – Whether to minimize the Gibbs energy of the material by changing the values of the structure parameters. Defaults to True.

set_state_with_volume(volume, temperature, pressure_guesses=[0.0, 10000000000.0])[source]

This function acts similarly to set_state, but takes volume and temperature as input to find the pressure. In order to ensure self-consistency, this function does not use any pressure functions from the material classes, but instead finds the pressure using the brentq root-finding and Nelder-Mead minimization methods.

Composition should have been set before this function is used.

Parameters:
  • volume (float) – The desired molar volume of the mineral [m^3].

  • temperature (float) – The desired temperature of the mineral [K].

  • pressure_guesses (list) – A list of floats denoting the initial low and high guesses for bracketing of the pressure [Pa]. These guesses should preferably bound the correct pressure, but do not need to do so. More importantly, they should not lie outside the valid region of the equation of state. Defaults to [0.e9, 10.e9].

property dqdz_relaxed

The change of the structure parameters with respect to strain and temperature that minimizes the Gibbs energy.

property isothermal_compressibility_reuss

Returns isothermal compressibility of the solution. (or inverse isothermal bulk modulus) [1/Pa]. Aliased with self.K_T.

property thermal_expansivity

Returns thermal expansion coefficient (alpha) of the solution [1/K]. Aliased with self.alpha.

property molar_heat_capacity_p

Returns molar heat capacity at constant pressure of the solution [J/K/mol]. Aliased with self.C_p.

property isothermal_bulk_modulus_reuss

Returns isothermal bulk modulus of the solution [Pa]. Aliased with self.K_T.

property molar_heat_capacity_v

Returns molar heat capacity at constant volume of the solution [J/K/mol]. Aliased with self.C_v.

property isentropic_bulk_modulus_reuss

Returns adiabatic bulk modulus of the solution [Pa]. Aliased with self.K_S.

property isentropic_compressibility_reuss

Returns adiabatic compressibility of the solution. (or inverse adiabatic bulk modulus) [1/Pa]. Aliased with self.K_S.

property C_p

Alias for heat_capacity_p()

property C_v

Alias for heat_capacity_v()

property G

Alias for shear_modulus()

property G_eff

Alias for effective_shear_modulus()

property H

Alias for enthalpy()

property K_S

Alias for isentropic_bulk_modulus_reuss()

property K_T

Alias for isothermal_bulk_modulus_reuss()

property K_eff

Alias for effective_isentropic_bulk_modulus()

property P

Alias for pressure()

property S

Alias for entropy()

property T

Alias for temperature()

property V

Alias for volume()

property activities

Returns a list of endmember activities [unitless].

property activity_coefficients

Returns a list of endmember activity coefficients (gamma = activity / ideal activity) [unitless].

property alpha

Alias for thermal_expansivity()

property beta_S

Alias for isentropic_compressibility_reuss()

property beta_T

Alias for isothermal_compressibility_reuss()

property bulk_sound_velocity

Returns bulk sound speed of the solution [m/s]. Aliased with self.v_phi.

property compositional_basis
Returns:

A basis for the compositional degrees of freedom, orthogonal to the reaction space.

Each row of the returned array defines an independent compositional constraint in terms of moles of endmembers. These constraints span the row space of the stoichiometric matrix and are complementary to the reaction basis (which spans the left null space).

For example, endmembers with site-species occupancies [Fe][Mg] and [Mg][Fe] have reaction basis vector [1, -1]. A compositional basis vector orthogonal to this is: [1, 1], which satisfies the requirement that the Fe-Mg ratio of the system remains fixed and the total amount of the two sites remains equal.

Return type:

numpy.ndarray

property compositional_null_basis

Returns a basis for the compositional nullspace (kernel) of the stoichiometric matrix.

This basis consists of vectors that represent linear constraints any valid bulk composition must satisfy to be formed from the endmembers. In other words, for any bulk composition vector b that can be expressed as a combination of the endmembers, multiplying it by these vectors results in zero (N @ b = 0).

These constraints typically reflect conserved properties such as elemental mass balance or charge neutrality.

Example: Suppose the stoichiometric matrix corresponds to elements C and O in species, and the nullspace basis vector is [1, -2]. Then for any bulk composition vector b = [b_C, b_O], the constraint 1 * b_C - 2 * b_O = 0 must hold. This means the ratio of carbon to oxygen must satisfy that relationship to be achievable from the given endmembers.

Returns:

A 2D array where each row is a basis vector of the nullspace.

Return type:

numpy.ndarray

copy()
debug_print(indent='')

Print a human-readable representation of this Material.

property density

Returns density of the solution [kg/m^3]. Aliased with self.rho.

property dependent_element_indices

The element indices not included in the independent list.

property effective_isentropic_bulk_modulus

Returns the effective isentropic bulk modulus of the mineral.

Note

Needs to be implemented in derived classes. Aliased with K_eff().

Returns:

Effective isentropic bulk modulus in [Pa].

Return type:

float

property effective_shear_modulus

Returns the effective shear modulus of the mineral.

Note

Needs to be implemented in derived classes. Aliased with G_eff().

Returns:

Effective shear modulus in [Pa].

Return type:

float

property elements

A list of the elements which could be contained in the solution, returned in the IUPAC element order.

property endmember_formulae

A list of formulae for all the endmembers in the solution.

property endmember_names

A list of names for all the endmembers in the solution.

property endmembers
property enthalpy

Extensive enthalpy of the material (J).

property entropy

Extensive entropy of the material (J/K).

property entropy_hessian

Returns an array containing the second compositional derivative of the entropy [J/K]. Property specific to solutions.

evaluate(vars_list, pressures, temperatures, molar_fractions=None)

Returns an array of material properties requested through a list of strings at given pressure and temperature conditions. At the end it resets the set_state to the original values. The user needs to call set_method() before.

Parameters:
  • vars_list (list of strings) – Variables to be returned for given conditions

  • pressures (numpy.array, n-dimensional) – ndlist or ndarray of float of pressures in [Pa].

  • temperatures (numpy.array, n-dimensional) – ndlist or ndarray of float of temperatures in [K].

Returns:

List or array returning all variables at given pressure/temperature values. output[i][j] is property vars_list[j] for temperatures[i] and pressures[i]. Attempts to return an array, falls back to a list if the returned properties have different shapes.

Return type:

list or numpy.array, n-dimensional

evaluate_with_volumes(vars_list, volumes, temperatures, molar_fractions=None)

Returns an array of material properties requested through a list of strings at given volume and temperature conditions. At the end it resets the set_state to the original values. The user needs to call set_method() before.

Parameters:
  • vars_list (list of strings) – Variables to be returned for given conditions

  • volumes (numpy.array, n-dimensional) – ndlist or ndarray of float of volumes in [m^3].

  • temperatures (numpy.array, n-dimensional) – ndlist or ndarray of float of temperatures in [K].

Returns:

List or array returning all variables at given pressure/temperature values. output[i][j] is property vars_list[j] for temperatures[i] and pressures[i]. Attempts to return an array, falls back to a list if the returned properties have different shapes.

Return type:

list or numpy.array, n-dimensional

property excess_enthalpy

Returns excess molar enthalpy [J/mol]. Property specific to solutions.

property excess_entropy

Returns excess molar entropy [J/K/mol]. Property specific to solutions.

property excess_gibbs

Returns molar excess gibbs free energy [J/mol]. Property specific to solutions.

property excess_partial_entropies

Returns excess partial entropies [J/K]. Property specific to solutions.

property excess_partial_gibbs

Returns excess partial molar gibbs free energy [J/mol]. Property specific to solutions.

property excess_partial_volumes

Returns excess partial volumes [m^3]. Property specific to solutions.

property excess_volume

Returns excess molar volume of the solution [m^3/mol]. Specific property for solutions.

property formula

Returns molar chemical formula of the solution. :rtype: Counter

property gibbs

Extensive Gibbs free energy of the material (J).

property gibbs_hessian

Returns an array containing the second compositional derivative of the Gibbs free energy [J]. Property specific to solutions.

property gr

Alias for grueneisen_parameter()

property grueneisen_parameter

Returns grueneisen parameter of the solution [unitless]. Aliased with self.gr.

property heat_capacity_p

Extensive heat capacity at constant pressure of the material (J/K).

property heat_capacity_v

Extensive heat capacity at constant volume of the material (J/K).

property helmholtz

Extensive Helmholtz free energy of the material (J).

property independent_element_indices

A list of an independent set of element indices. If the amounts of these elements are known (element_amounts), the amounts of the other elements can be inferred by -compositional_null_basis[independent_element_indices].dot(element_amounts).

property internal_energy

Extensive internal energy of the material (J).

property isentropic_thermal_gradient
Returns:

dTdP, the change in temperature with pressure at constant entropy [Pa/K]

Return type:

float

property mass

Returns the mass of this material.

Returns:

Mass in [kg].

Return type:

float

property molar_enthalpy

Returns molar enthalpy of the solution [J/mol]. Aliased with self.H.

property molar_entropy

Returns molar entropy of the solution [J/K/mol]. Aliased with self.S.

property molar_gibbs

Returns molar Gibbs free energy of the solution [J/mol]. Aliased with self.gibbs.

property molar_helmholtz

Returns molar Helmholtz free energy of the solution [J/mol]. Aliased with self.helmholtz.

property molar_internal_energy

Returns molar internal energy of the mineral [J/mol]. Aliased with self.energy

property molar_mass

Returns molar mass of the solution [kg/mol].

property molar_volume

Returns molar volume of the solution [m^3/mol]. Aliased with self.V.

property n_endmembers

The number of endmembers in the solution.

property n_reactions

The number of reactions in reaction_basis.

property name

Human-readable name of this material.

By default this will return the name of the class, but it can be set to an arbitrary string. Overriden in Mineral.

property number_of_moles

Returns the number of moles in this material.

Returns:

Number of moles.

Return type:

float

property p_wave_velocity

Returns P wave speed of the solution [m/s]. Aliased with self.v_p.

property partial_entropies

Returns endmember partial entropies [J/K]. Property specific to solutions.

property partial_gibbs

Returns endmember partial molar gibbs free energy [J/mol]. Property specific to solutions.

property partial_volumes

Returns endmember partial volumes [m^3]. Property specific to solutions.

property pressure

Returns current pressure that was set with set_state().

Note

Aliased with P().

Returns:

Pressure in [Pa].

Return type:

float

print_minerals_of_current_state()

Print a human-readable representation of this Material at the current P, T as a list of minerals. This requires set_state() has been called before.

property reaction_basis

Returns a basis for the reaction space, represented as the left nullspace of the stoichiometric matrix.

Each row of the returned array corresponds to a linearly independent chemical reaction that conserves mass and charge. The value at arr[i, j] gives the number of moles of endmember[j] involved in reaction[i].

Returns:

An array where each row defines a balanced chemical reaction in terms of molar amounts of endmembers.

Return type:

numpy.ndarray

reset()

Resets all cached material properties.

It is typically not required for the user to call this function.

property rho

Alias for density()

set_method(method)

Set the equation of state to be used for this mineral. Takes a string corresponding to any of the predefined equations of state: ‘bm3shear2’, ‘bm3’, ‘mgd2’, ‘mgd3’, ‘slb2’, ‘slb3’, ‘mt’, ‘hp_tmt’, or ‘cork’. Alternatively, you can pass a user defined class which derives from the equation_of_state base class. After calling set_method(), any existing derived properties (e.g., elastic parameters or thermodynamic potentials) will be out of date, so set_state() will need to be called again.

property shear_modulus

Returns shear modulus of the solution [Pa]. Aliased with self.G.

property shear_wave_velocity

Returns shear wave speed of the solution [m/s]. Aliased with self.v_s.

site_formula(precision=2, print_absent_species=True, site_occupancies=None)
Returns the molar chemical formula of the solution with

site occupancies. For example, [Mg0.4Fe0.6]2SiO4.

Parameters:
  • precision (int) – Precision with which to print the site occupancies

  • print_absent_species (bool) – If True, prints site occupancies that are absent (i.e., zero).

  • site_occupancies (numpy.ndarray) – Optional site occupancies to use instead of the current ones.

Returns:

Molar chemical formula of the solution with site occupancies

Return type:

str

property site_occupancies
Returns:

The fractional occupancies of species on each site as a flat vector.

Return type:

numpy.ndarray

property stoichiometric_array

A numpy array where each element arr[i,j] corresponds to the number of atoms of element[j] in endmember[i].

property stoichiometric_matrix

A sympy Matrix where each element M[i,j] corresponds to the number of atoms of element[j] in endmember[i].

property temperature

Returns current temperature that was set with set_state().

Note

Aliased with T().

Returns:

Temperature in [K].

Return type:

float

to_string()

Returns the name of the mineral class

unroll()

Unroll this material into a list of burnman.Mineral and their molar fractions. All averaging schemes then operate on this list of minerals. Note that the return value of this function may depend on the current state (temperature, pressure).

Note

Needs to be implemented in derived classes.

Returns:

A list of molar fractions which should sum to 1.0, and a list of burnman.Mineral objects containing the minerals in the material.

Return type:

tuple

property v_p

Alias for p_wave_velocity()

property v_phi

Alias for bulk_sound_velocity()

property v_s

Alias for shear_wave_velocity()

property volume

Extensive volume of the material (m^3).

property volume_hessian

Returns an array containing the second compositional derivative of the volume [m^3]. Property specific to solutions.

class burnman.RelaxedAnisotropicSolution(anisotropic_solution, relaxation_vectors, unrelaxed_vectors)[source]

Bases: AnisotropicSolution

A class implementing the relaxed anisotropic solution model described in [Myh25b]. This class is derived from AnisotropicSolution, and inherits most of the methods from that class.

Instantiation of a RelaxedAnisotropicSolution involves passing an AnisotropicSolution, plus a set of vectors that represent rapid deformation modes. For example, a solution of MgO, FeHSO and FeLSO (high and low spin wuestite) can rapidly change proportion of high spin and low spin iron, and so a single vector should be passed: np.array([[0., -1., 1.]]) or some multiple thereof.

States of the mineral can only be queried after setting the pressure and temperature using set_state() and the composition using set_composition().

This class is available as burnman.RelaxedAnisotropicSolution.

set_state(pressure, temperature, relaxed=True)[source]

Sets the state of the solution. Also relaxes the structure parameters if set_composition() has already been used and if the relaxed argument has been set to True.

Parameters:
  • pressure (float) – The pressure of the solution [Pa]

  • temperature (float) – The temperature of the solution [K]

  • relaxed (bool, optional) – Whether to minimize the Gibbs energy of the material by changing the values of the structure parameters. Defaults to True.

set_composition(molar_fractions, q_initial=None, relaxed=True)[source]

Sets the composition of the model. Also relaxes the structure parameters if set_state() has already been used and if the relaxed argument has been set to True.

Parameters:
  • molar_fractions (1D numpy array) – Molar fractions of the independent endmembers corresponding to the unrelaxed vectors specified during initialisation.

  • q_initial (1D numpy array, optional) – Initial values of the structure parameters. Defaults to None, in which case the preexisting initial values are used (first set to 0.001 during initialisation).

  • relaxed (bool, optional) – Whether to minimize the Gibbs energy of the material by changing the values of the structure parameters. Defaults to True.

set_state_with_volume(volume, temperature, pressure_guesses=[0.0, 10000000000.0])[source]

This function acts similarly to set_state, but takes volume and temperature as input to find the pressure. In order to ensure self-consistency, this function does not use any pressure functions from the material classes, but instead finds the pressure using the brentq root-finding and Nelder-Mead minimization methods.

Composition should have been set before this function is used.

Parameters:
  • volume (float) – The desired molar volume of the mineral [m^3].

  • temperature (float) – The desired temperature of the mineral [K].

  • pressure_guesses (list) – A list of floats denoting the initial low and high guesses for bracketing of the pressure [Pa]. These guesses should preferably bound the correct pressure, but do not need to do so. More importantly, they should not lie outside the valid region of the equation of state. Defaults to [0.e9, 10.e9].

property dqdz_relaxed

The change of the structure parameters with respect to strain and temperature that minimizes the Helmholtz energy.

property isothermal_stiffness_tensor
Returns:

The isothermal stiffness tensor [Pa] in Voigt form (\(\mathbb{C}_{\text{T} pq}\)).

Return type:

numpy.array (2D)

property thermal_stress_tensor
Returns:

The change in stress with temperature at constant strain [Pa/K].

Return type:

numpy.array (2D)

property molar_isometric_heat_capacity
Returns:

The molar heat capacity at constant strain [J/K/mol].

Return type:

float

property isothermal_compliance_tensor
Returns:

The isothermal compliance tensor [1/Pa] in Voigt form (\(\mathbb{S}_{\text{T} pq}\)).

Return type:

numpy.array (2D)

property full_isothermal_compliance_tensor
Returns:

The isothermal compliance tensor [1/Pa] in standard form (\(\mathbb{S}_{\text{T} ijkl}\)).

Return type:

numpy.array (4D)

property thermal_expansivity_tensor
Returns:

The tensor of thermal expansivities [1/K].

Return type:

numpy.array (2D)

property isothermal_compressibility_reuss
Returns:

The Reuss bound on the isothermal compressibility in [1/Pa].

Return type:

float

property isothermal_bulk_modulus_reuss

Returns isothermal bulk modulus of the material.

Note

Needs to be implemented in derived classes. Aliased with K_T().

Returns:

Isothermal bulk modulus in [Pa].

Return type:

float

property isentropic_compressibility_reuss
Returns:

The Reuss bound on the isentropic compressibility in [1/Pa].

Return type:

float

property isentropic_bulk_modulus_reuss

Returns the adiabatic bulk modulus of the mineral.

Note

Needs to be implemented in derived classes. Aliased with K_S().

Returns:

Adiabatic bulk modulus in [Pa].

Return type:

float

property thermal_expansivity

Returns thermal expansion coefficient of the mineral.

Note

Needs to be implemented in derived classes. Aliased with alpha().

Returns:

Thermal expansivity in [1/K].

Return type:

float

property molar_heat_capacity_p

Returns molar heat capacity at constant pressure of the mineral.

Note

Needs to be implemented in derived classes. Aliased with C_p().

Returns:

Isobaric heat capacity in [J/K/mol].

Return type:

float

property C_p

Alias for heat_capacity_p()

property C_v

Alias for heat_capacity_v()

property G

Alias for shear_modulus()

property G_eff

Alias for effective_shear_modulus()

property H

Alias for enthalpy()

property K_S

Anisotropic minerals do not have a single isentropic bulk modulus. This function returns a NotImplementedError. Users should instead consider either using isentropic_bulk_modulus_reuss, isentropic_bulk_modulus_voigt (both derived from AnisotropicMineral), or directly querying the elements in the isentropic_stiffness_tensor.

property K_T

Anisotropic minerals do not have a single isothermal bulk modulus. This function returns a NotImplementedError. Users should instead consider either using isothermal_bulk_modulus_reuss, isothermal_bulk_modulus_voigt, or directly querying the elements in the isothermal_stiffness_tensor.

property K_eff

Alias for effective_isentropic_bulk_modulus()

property P

Alias for pressure()

property S

Alias for entropy()

property T

Alias for temperature()

property V

Alias for volume()

property activities

Returns a list of endmember activities [unitless].

property activity_coefficients

Returns a list of endmember activity coefficients (gamma = activity / ideal activity) [unitless].

property alpha

Alias for thermal_expansivity()

property beta_S

Anisotropic minerals do not have a single isentropic compressibility. This function returns a NotImplementedError. Users should instead consider either using isentropic_compressibility_tensor, isentropic_compressibility_reuss or isentropic_compressibility_voigt (all derived from AnisotropicMineral), or directly querying the elements in the isentropic_compliance_tensor.

property beta_T
Returns:

The Reuss bound on the isothermal compressibility in [1/Pa].

Return type:

float

property bulk_sound_velocity

Returns bulk sound speed of the solution [m/s]. Aliased with self.v_phi.

property cell_parameters
Returns:

The molar cell parameters of the mineral, given in standard form: [\(a\), \(b\), \(c\), \(\alpha\), \(\beta\), \(\gamma\)], where the first three floats are the lengths of the vectors in [m] defining the cell constructed from one mole of formula units. The last three floats are angles between vectors (given in radians). See the documentation for the function cell_parameters_to_vectors() for the assumed relationships between the cell vectors and spatial coordinate axes.

Return type:

numpy.array (1D)

property cell_vectors
Returns:

The vectors of the cell constructed from one mole of formula units [m]. See the documentation for the function cell_parameters_to_vectors() for the assumed relationships between the cell vectors and spatial coordinate axes.

Return type:

numpy.array (2D)

check_standard_parameters(anisotropic_parameters)
christoffel_tensor(propagation_direction)
Returns:

The Christoffel tensor from an elastic stiffness tensor and a propagation direction for a seismic wave relative to the stiffness tensor: T_ik = C_ijkl n_j n_l.

Return type:

float

property compositional_basis
Returns:

A basis for the compositional degrees of freedom, orthogonal to the reaction space.

Each row of the returned array defines an independent compositional constraint in terms of moles of endmembers. These constraints span the row space of the stoichiometric matrix and are complementary to the reaction basis (which spans the left null space).

For example, endmembers with site-species occupancies [Fe][Mg] and [Mg][Fe] have reaction basis vector [1, -1]. A compositional basis vector orthogonal to this is: [1, 1], which satisfies the requirement that the Fe-Mg ratio of the system remains fixed and the total amount of the two sites remains equal.

Return type:

numpy.ndarray

property compositional_null_basis

Returns a basis for the compositional nullspace (kernel) of the stoichiometric matrix.

This basis consists of vectors that represent linear constraints any valid bulk composition must satisfy to be formed from the endmembers. In other words, for any bulk composition vector b that can be expressed as a combination of the endmembers, multiplying it by these vectors results in zero (N @ b = 0).

These constraints typically reflect conserved properties such as elemental mass balance or charge neutrality.

Example: Suppose the stoichiometric matrix corresponds to elements C and O in species, and the nullspace basis vector is [1, -2]. Then for any bulk composition vector b = [b_C, b_O], the constraint 1 * b_C - 2 * b_O = 0 must hold. This means the ratio of carbon to oxygen must satisfy that relationship to be achievable from the given endmembers.

Returns:

A 2D array where each row is a basis vector of the nullspace.

Return type:

numpy.ndarray

compute_base_properties()
copy()
debug_print(indent='')

Print a human-readable representation of this Material.

property deformation_gradient_tensor
Returns:

The deformation gradient tensor describing the deformation of the mineral from its undeformed state (i.e. the state at the reference pressure and temperature).

Return type:

numpy.array (2D)

property deformed_coordinate_frame
Returns:

The orientations of the three spatial coordinate axes after deformation of the mineral [m]. For orthotropic minerals, this is equal to the identity matrix, as hydrostatic stresses only induce rotations in monoclinic and triclinic crystals.

Return type:

numpy.array (2D)

property density

Returns density of the solution [kg/m^3]. Aliased with self.rho.

property dependent_element_indices

The element indices not included in the independent list.

property depsdn_fixed_VT

Gradient in strain with respect to composition at fixed volume and temperature under hydrostatic conditions.

property effective_isentropic_bulk_modulus

Returns the effective isentropic bulk modulus of the mineral.

Note

Needs to be implemented in derived classes. Aliased with K_eff().

Returns:

Effective isentropic bulk modulus in [Pa].

Return type:

float

property effective_shear_modulus

Returns the effective shear modulus of the mineral.

Note

Needs to be implemented in derived classes. Aliased with G_eff().

Returns:

Effective shear modulus in [Pa].

Return type:

float

property elements

A list of the elements which could be contained in the solution, returned in the IUPAC element order.

property endmember_formulae

A list of formulae for all the endmembers in the solution.

property endmember_names

A list of names for all the endmembers in the solution.

property endmembers
property enthalpy

Extensive enthalpy of the material (J).

property entropy

Extensive entropy of the material (J/K).

property entropy_hessian

Returns an array containing the second compositional derivative of the entropy [J/K]. Property specific to solutions.

evaluate(vars_list, pressures, temperatures, molar_fractions=None)

Returns an array of material properties requested through a list of strings at given pressure and temperature conditions. At the end it resets the set_state to the original values. The user needs to call set_method() before.

Parameters:
  • vars_list (list of strings) – Variables to be returned for given conditions

  • pressures (numpy.array, n-dimensional) – ndlist or ndarray of float of pressures in [Pa].

  • temperatures (numpy.array, n-dimensional) – ndlist or ndarray of float of temperatures in [K].

Returns:

List or array returning all variables at given pressure/temperature values. output[i][j] is property vars_list[j] for temperatures[i] and pressures[i]. Attempts to return an array, falls back to a list if the returned properties have different shapes.

Return type:

list or numpy.array, n-dimensional

evaluate_with_volumes(vars_list, volumes, temperatures, molar_fractions=None)

Returns an array of material properties requested through a list of strings at given volume and temperature conditions. At the end it resets the set_state to the original values. The user needs to call set_method() before.

Parameters:
  • vars_list (list of strings) – Variables to be returned for given conditions

  • volumes (numpy.array, n-dimensional) – ndlist or ndarray of float of volumes in [m^3].

  • temperatures (numpy.array, n-dimensional) – ndlist or ndarray of float of temperatures in [K].

Returns:

List or array returning all variables at given pressure/temperature values. output[i][j] is property vars_list[j] for temperatures[i] and pressures[i]. Attempts to return an array, falls back to a list if the returned properties have different shapes.

Return type:

list or numpy.array, n-dimensional

property excess_enthalpy

Returns excess molar enthalpy [J/mol]. Property specific to solutions.

property excess_entropy

Returns excess molar entropy [J/K/mol]. Property specific to solutions.

property excess_gibbs

Returns molar excess gibbs free energy [J/mol]. Property specific to solutions.

property excess_partial_entropies

Returns excess partial entropies [J/K]. Property specific to solutions.

property excess_partial_gibbs

Returns excess partial molar gibbs free energy [J/mol]. Property specific to solutions.

property excess_partial_volumes

Returns excess partial volumes [m^3]. Property specific to solutions.

property excess_volume

Returns excess molar volume of the solution [m^3/mol]. Specific property for solutions.

property eye
property formula

Returns molar chemical formula of the solution. :rtype: Counter

property full_isentropic_compliance_tensor
Returns:

The isentropic compliance tensor [1/Pa] in standard form (\(\mathbb{S}_{\text{N} ijkl}\)).

Return type:

numpy.array (4D)

property full_isentropic_stiffness_tensor
Returns:

The isentropic stiffness tensor [Pa] in standard form (\(\mathbb{C}_{\text{N} ijkl}\)).

Return type:

numpy.array (4D)

property full_isothermal_stiffness_tensor
Returns:

The isothermal stiffness tensor [Pa] in standard form (\(\mathbb{C}_{\text{T} ijkl}\)).

Return type:

numpy.array (4D)

property gibbs

Extensive Gibbs free energy of the material (J).

property gibbs_hessian

Returns an array containing the second compositional derivative of the Gibbs free energy [J]. Property specific to solutions.

property gr

Alias for grueneisen_parameter()

property grueneisen_parameter

Returns grueneisen parameter of the solution [unitless]. Aliased with self.gr.

property grueneisen_tensor
Returns:

The grueneisen tensor [unitless]. This is defined by [BM67] as \(\mathbb{C}_{\text{N} ijkl} \alpha_{kl} V/C_{P}\).

Return type:

numpy.array (2D)

property heat_capacity_p

Extensive heat capacity at constant pressure of the material (J/K).

property heat_capacity_v

Extensive heat capacity at constant volume of the material (J/K).

property helmholtz

Extensive Helmholtz free energy of the material (J).

property independent_element_indices

A list of an independent set of element indices. If the amounts of these elements are known (element_amounts), the amounts of the other elements can be inferred by -compositional_null_basis[independent_element_indices].dot(element_amounts).

property internal_energy

Extensive internal energy of the material (J).

property isentropic_bulk_modulus_voigt
Returns:

The Voigt bound on the isentropic bulk modulus in [Pa].

Return type:

float

property isentropic_bulk_modulus_vrh
Returns:

The Voigt-Reuss-Hill average of the isentropic bulk modulus [Pa].

Return type:

float

property isentropic_compliance_tensor
Returns:

The isentropic compliance tensor [1/Pa] in Voigt form (\(\mathbb{S}_{\text{N} pq}\)).

Return type:

numpy.array (2D)

property isentropic_compressibility_tensor
Returns:

The isentropic compressibility tensor [1/Pa].

Return type:

numpy.array (2D)

property isentropic_compressibility_voigt
Returns:

The Voigt bound on the isentropic compressibility in [1/Pa].

Return type:

float

property isentropic_isotropic_poisson_ratio
Returns:

The isotropic Poisson ratio (mu) [unitless]. A metric of the lateral response to loading.

Return type:

float

isentropic_linear_compressibility(direction)
Returns:

The linear isentropic compressibility in a given direction relative to the stiffness tensor [1/Pa].

Return type:

float

isentropic_poissons_ratio(axial_direction, lateral_direction)
Returns:

The isentropic poisson ratio given loading and response directions relative to the stiffness tensor [unitless].

Return type:

float

isentropic_shear_modulus(plane_normal, shear_direction)
Returns:

The isentropic shear modulus on a plane in a given shear direction relative to the stiffness tensor [Pa].

Return type:

float

property isentropic_shear_modulus_reuss
Returns:

The Reuss bound on the isentropic shear modulus [Pa].

Return type:

float

property isentropic_shear_modulus_voigt
Returns:

The Voigt bound on the isentropic shear modulus [Pa].

Return type:

float

property isentropic_shear_modulus_vrh
Returns:

The Voigt-Reuss-Hill average of the isentropic shear modulus [Pa].

Return type:

float

property isentropic_stiffness_tensor
Returns:

The isentropic stiffness tensor [Pa] in Voigt form (\(\mathbb{C}_{\text{N} pq}\)).

Return type:

numpy.array (2D)

property isentropic_thermal_gradient
Returns:

dTdP, the change in temperature with pressure at constant entropy [Pa/K]

Return type:

float

property isentropic_universal_elastic_anisotropy
Returns:

The universal elastic anisotropy [unitless]

Return type:

float

isentropic_youngs_modulus(direction)
Returns:

The isentropic Youngs modulus in a given direction relative to the stiffness tensor [Pa].

Return type:

float

property isothermal_bulk_modulus_voigt
Returns:

The Voigt bound on the isothermal bulk modulus in [Pa].

Return type:

float

property isothermal_compressibility_tensor
Returns:

The isothermal compressibility tensor [1/Pa].

Return type:

numpy.array (2D)

property isothermal_compressibility_voigt
Returns:

The Voigt bound on the isothermal compressibility in [1/Pa].

Return type:

float

property mass

Returns the mass of this material.

Returns:

Mass in [kg].

Return type:

float

property molar_enthalpy

Returns molar enthalpy of the solution [J/mol]. Aliased with self.H.

property molar_entropy

Returns molar entropy of the solution [J/K/mol]. Aliased with self.S.

property molar_gibbs

Returns molar Gibbs free energy of the solution [J/mol]. Aliased with self.gibbs.

property molar_heat_capacity_v

Returns molar heat capacity at constant volume of the solution [J/K/mol]. Aliased with self.C_v.

property molar_helmholtz

Returns molar Helmholtz free energy of the solution [J/mol]. Aliased with self.helmholtz.

property molar_internal_energy

Returns molar internal energy of the mineral [J/mol]. Aliased with self.energy

property molar_mass

Returns molar mass of the solution [kg/mol].

property molar_volume

Returns molar volume of the solution [m^3/mol]. Aliased with self.V.

property n_endmembers

The number of endmembers in the solution.

property n_reactions

The number of reactions in reaction_basis.

property name

Human-readable name of this material.

By default this will return the name of the class, but it can be set to an arbitrary string. Overriden in Mineral.

property number_of_moles

Returns the number of moles in this material.

Returns:

Number of moles.

Return type:

float

property ones
property p_wave_velocity

Returns P wave speed of the solution [m/s]. Aliased with self.v_p.

property partial_entropies

Returns endmember partial entropies [J/K]. Property specific to solutions.

property partial_gibbs

Returns endmember partial molar gibbs free energy [J/mol]. Property specific to solutions.

property partial_volumes

Returns endmember partial volumes [m^3]. Property specific to solutions.

property pressure

Returns current pressure that was set with set_state().

Note

Aliased with P().

Returns:

Pressure in [Pa].

Return type:

float

print_minerals_of_current_state()

Print a human-readable representation of this Material at the current P, T as a list of minerals. This requires set_state() has been called before.

property reaction_basis

Returns a basis for the reaction space, represented as the left nullspace of the stoichiometric matrix.

Each row of the returned array corresponds to a linearly independent chemical reaction that conserves mass and charge. The value at arr[i, j] gives the number of moles of endmember[j] involved in reaction[i].

Returns:

An array where each row defines a balanced chemical reaction in terms of molar amounts of endmembers.

Return type:

numpy.ndarray

reset()

Resets all cached material properties.

It is typically not required for the user to call this function.

property rho

Alias for density()

property rotation_matrix
Returns:

The matrix required to rotate the properties of the deformed mineral into the deformed coordinate frame. For orthotropic minerals, this is equal to the identity matrix.

Return type:

numpy.array (2D)

set_method(method)

Set the equation of state to be used for this mineral. Takes a string corresponding to any of the predefined equations of state: ‘bm3shear2’, ‘bm3’, ‘mgd2’, ‘mgd3’, ‘slb2’, ‘slb3’, ‘mt’, ‘hp_tmt’, or ‘cork’. Alternatively, you can pass a user defined class which derives from the equation_of_state base class. After calling set_method(), any existing derived properties (e.g., elastic parameters or thermodynamic potentials) will be out of date, so set_state() will need to be called again.

property shear_modulus

Returns shear modulus of the solution [Pa]. Aliased with self.G.

property shear_wave_velocity

Returns shear wave speed of the solution [m/s]. Aliased with self.v_s.

site_formula(precision=2, print_absent_species=True, site_occupancies=None)
Returns the molar chemical formula of the solution with

site occupancies. For example, [Mg0.4Fe0.6]2SiO4.

Parameters:
  • precision (int) – Precision with which to print the site occupancies

  • print_absent_species (bool) – If True, prints site occupancies that are absent (i.e., zero).

  • site_occupancies (numpy.ndarray) – Optional site occupancies to use instead of the current ones.

Returns:

Molar chemical formula of the solution with site occupancies

Return type:

str

property site_occupancies
Returns:

The fractional occupancies of species on each site as a flat vector.

Return type:

numpy.ndarray

standard_psi_function(f, Pth, params)
property stoichiometric_array

A numpy array where each element arr[i,j] corresponds to the number of atoms of element[j] in endmember[i].

property stoichiometric_matrix

A sympy Matrix where each element M[i,j] corresponds to the number of atoms of element[j] in endmember[i].

property temperature

Returns current temperature that was set with set_state().

Note

Aliased with T().

Returns:

Temperature in [K].

Return type:

float

to_string()

Returns the name of the mineral class

unroll()

Unroll this material into a list of burnman.Mineral and their molar fractions. All averaging schemes then operate on this list of minerals. Note that the return value of this function may depend on the current state (temperature, pressure).

Note

Needs to be implemented in derived classes.

Returns:

A list of molar fractions which should sum to 1.0, and a list of burnman.Mineral objects containing the minerals in the material.

Return type:

tuple

property unrotated_cell_vectors
Returns:

The vectors of the cell [m] constructed from one mole of formula units after deformation of the mineral from its undeformed state (i.e. the state at the reference pressure and temperature). See the documentation for the function cell_parameters_to_vectors() for the assumed relationships between the cell vectors and spatial coordinate axes.

Return type:

numpy.array (2D)

property v_p

Alias for p_wave_velocity()

property v_phi

Alias for bulk_sound_velocity()

property v_s

Alias for shear_wave_velocity()

property volume

Extensive volume of the material (m^3).

property volume_hessian

Returns an array containing the second compositional derivative of the volume [m^3]. Property specific to solutions.

wave_velocities(propagation_direction)
Returns:

The compressional wave velocity, and two shear wave velocities in a given propagation direction [m/s].

Return type:

list, containing the wave speeds and directions of particle motion relative to the stiffness tensor

Mechanical solution

class burnman.classes.solutionmodel.MechanicalSolution(endmembers)[source]

Bases: SolutionModel

An extremely simple class representing a mechanical solution model. A mechanical solution experiences no interaction between endmembers. Therefore, unlike ideal solutions there is no entropy of mixing; the total gibbs free energy of the solution is equal to the dot product of the molar gibbs free energies and molar fractions of the constituent materials.

excess_gibbs_energy(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Gibbs free energy of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess Gibbs energy.

Return type:

float

excess_volume(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess volume of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess volume of the solution.

Return type:

float

excess_entropy(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess entropy of the solution.

Return type:

float

excess_enthalpy(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess enthalpy of the solution. The base class implementation assumes that the excess enthalpy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess enthalpy of the solution.

Return type:

float

excess_partial_gibbs_energies(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Gibbs free energy for each endmember of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial Gibbs free energy of each endmember.

Return type:

numpy.array

excess_partial_volumes(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess volume for each endmember of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial volume of each endmember.

Return type:

numpy.array

excess_partial_entropies(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial entropy of each endmember.

Return type:

numpy.array

activity_coefficients(pressure, temperature, molar_fractions)[source]
activities(pressure, temperature, molar_fractions)[source]
Cp_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess isobaric heat capacity of the solution.

Return type:

float

VoverKT_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess V/K_T of the solution model

Return type:

float

alphaV_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess alpha*V of the solution model

Return type:

float

class burnman.classes.elasticsolutionmodel.ElasticMechanicalSolution(endmembers)[source]

Bases: ElasticSolutionModel

An extremely simple class representing a mechanical solution model. A mechanical solution experiences no interaction between endmembers. Therefore, unlike ideal solutions there is no entropy of mixing; the total Helmholtz energy of the solution is equal to the dot product of the molar Helmholtz energies and molar fractions of the constituent materials.

excess_helmholtz_energy(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Helmholtz free energy of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy.

Return type:

float

excess_pressure(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess pressure of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of the solution.

Return type:

float

excess_entropy(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of the solution.

Return type:

float

excess_partial_helmholtz_energies(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Helmholtz energy for each endmember of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy of each endmember

Return type:

numpy.array

excess_partial_pressures(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess pressure for each endmember of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of each endmember.

Return type:

numpy.array

excess_partial_entropies(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of each endmember.

Return type:

numpy.array

Ideal solution

class burnman.classes.solutionmodel.IdealSolution(endmembers)[source]

Bases: SolutionModel

A solution model representing ideal mixing between endmembers. In ideal solutions, the enthalpy of mixing is equal to zero; i.e. chemical mixing of endmembers at fixed pressure and temperature does not involve the absorption or release of heat. The only contribution to the Gibbs energy of mixing is the configurational entropy \(S_{\textrm{conf}}\):

\[\begin{split}\mathcal{G}_{\textrm{mixing}} = - T \Delta S_{\textrm{conf}}, \\ S_{\textrm{conf}} = R x_c^s \ln \frac{x_c^s}{\sum_{c^s} x_c^s}\end{split}\]

where \(s\) is a site in the lattice, \(c\) are the species mixing on site \(s\). \(x_c^s\) is the absolute number of species \(c\) on site \(s\) in the lattice; it is calculated by multiplying the proportion of the species on the site by the multiplicity of the site per formula unit and the number of moles of formula units. This class allows the site multiplicities to vary linearly between endmembers. This is known as a Temkin model [Tem45].

excess_partial_gibbs_energies(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Gibbs free energy for each endmember of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial Gibbs free energy of each endmember.

Return type:

numpy.array

excess_partial_entropies(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial entropy of each endmember.

Return type:

numpy.array

excess_partial_volumes(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess volume for each endmember of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial volume of each endmember.

Return type:

numpy.array

gibbs_hessian(pressure, temperature, molar_fractions)[source]
entropy_hessian(pressure, temperature, molar_fractions)[source]
volume_hessian(pressure, temperature, molar_fractions)[source]
configurational_entropy(molar_fractions)[source]
activity_coefficients(pressure, temperature, molar_fractions)[source]
activities(pressure, temperature, molar_fractions)[source]
property ones

A vector of ones with length equal to the number of endmembers :return: ones :rtype: 1D numpy array

property eye

An identity matrix with size equal to the number of endmembers :return: eye :rtype: 2D numpy array

property eyeones

A convenience function consisting of two concatenations of an identity matrix and ones vector with size equal to the number of endmembers. :return: delta_ij 1_k + delta_ik 1_j :rtype: 3D numpy array

Cp_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess isobaric heat capacity of the solution.

Return type:

float

VoverKT_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess V/K_T of the solution model

Return type:

float

alphaV_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess alpha*V of the solution model

Return type:

float

excess_enthalpy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess enthalpy of the solution. The base class implementation assumes that the excess enthalpy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess enthalpy of the solution.

Return type:

float

excess_entropy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess entropy of the solution.

Return type:

float

excess_gibbs_energy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess Gibbs free energy of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess Gibbs energy.

Return type:

float

excess_volume(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess volume of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess volume of the solution.

Return type:

float

class burnman.classes.elasticsolutionmodel.ElasticIdealSolution(endmembers)[source]

Bases: ElasticSolutionModel

A class representing an ideal solution model. Calculates the excess Helmholtz energy and entropy due to configurational entropy. Excess internal energy and volume are equal to zero.

The multiplicity of each type of site in the structure is allowed to change linearly as a function of endmember proportions. This class is therefore equivalent to the entropic part of a Temkin-type model [Tem45].

excess_partial_helmholtz_energies(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Helmholtz energy for each endmember of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy of each endmember

Return type:

numpy.array

excess_partial_entropies(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of each endmember.

Return type:

numpy.array

excess_partial_pressures(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess pressure for each endmember of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of each endmember.

Return type:

numpy.array

helmholtz_hessian(volume, temperature, molar_fractions)[source]
entropy_hessian(volume, temperature, molar_fractions)[source]
pressure_hessian(volume, temperature, molar_fractions)[source]
configurational_entropy(molar_fractions)[source]
excess_entropy(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of the solution.

Return type:

float

excess_helmholtz_energy(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess Helmholtz free energy of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy.

Return type:

float

excess_pressure(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess pressure of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of the solution.

Return type:

float

Asymmetric regular solution

class burnman.classes.solutionmodel.AsymmetricRegularSolution(endmembers, alphas, energy_interaction, volume_interaction=None, entropy_interaction=None)[source]

Bases: IdealSolution

Solution model implementing the asymmetric regular solution model formulation as described in [HollandPowell03].

The excess nonconfigurational Gibbs energy is given by the expression [DPWH07]:

\[\mathcal{G}_{\textrm{excess}} = \alpha^T p (\phi^T W \phi)\]

\(\alpha\) is a vector of van Laar parameters governing asymmetry in the excess properties.

\[\phi_i = \frac{\alpha_i p_i}{\sum_{k=1}^{n} \alpha_k p_k}, W_{ij} = \frac{2 w_{ij}}{\alpha_i + \alpha_j} \textrm{for i<j}\]

The \(w_{ij}\) terms are a set of interaction terms between endmembers \(i\) and \(j\). If all the \(\alpha\) terms are equal to unity, a non-zero \(w\) yields an excess with a quadratic form and a maximum of \(w/4\) half-way between the two endmembers.

Parameters:
  • endmembers (list of tuples) – A list of tuples defining the endmembers of the solution. Each tuple contains a burnman.Mineral object and a string defining the site formula of that endmember.

  • alphas (list of floats) – A list of van Laar parameters governing asymmetry in the excess properties.

  • energy_interaction (list of lists of floats) – A 2D list of interaction parameters defining the energetic interactions between endmembers. The list should be upper-triangular, such that the first row has n-1 elements (for n endmembers), the second row has n-2 elements, etc.

  • volume_interaction (list of lists of floats) – (optional) A 2D list of interaction parameters defining the volumetric interactions between endmembers. The list should be upper-triangular, such that the first row has n-1 elements (for n endmembers), the second row has n-2 elements, etc.

  • entropy_interaction (list of lists of floats) – (optional) A 2D list of interaction parameters defining the entropic interactions between endmembers. The list should be upper-triangular, such that the first row has n-1 elements (for n endmembers), the second row has n-2 elements, etc.

excess_partial_gibbs_energies(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Gibbs free energy for each endmember of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial Gibbs free energy of each endmember.

Return type:

numpy.array

excess_partial_entropies(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial entropy of each endmember.

Return type:

numpy.array

excess_partial_volumes(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess volume for each endmember of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial volume of each endmember.

Return type:

numpy.array

gibbs_hessian(pressure, temperature, molar_fractions)[source]
entropy_hessian(pressure, temperature, molar_fractions)[source]
volume_hessian(pressure, temperature, molar_fractions)[source]
activity_coefficients(pressure, temperature, molar_fractions)[source]
activities(pressure, temperature, molar_fractions)[source]
Cp_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess isobaric heat capacity of the solution.

Return type:

float

VoverKT_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess V/K_T of the solution model

Return type:

float

alphaV_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess alpha*V of the solution model

Return type:

float

configurational_entropy(molar_fractions)
excess_enthalpy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess enthalpy of the solution. The base class implementation assumes that the excess enthalpy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess enthalpy of the solution.

Return type:

float

excess_entropy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess entropy of the solution.

Return type:

float

excess_gibbs_energy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess Gibbs free energy of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess Gibbs energy.

Return type:

float

excess_volume(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess volume of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess volume of the solution.

Return type:

float

property eye

An identity matrix with size equal to the number of endmembers :return: eye :rtype: 2D numpy array

property eyeones

A convenience function consisting of two concatenations of an identity matrix and ones vector with size equal to the number of endmembers. :return: delta_ij 1_k + delta_ik 1_j :rtype: 3D numpy array

property ones

A vector of ones with length equal to the number of endmembers :return: ones :rtype: 1D numpy array

class burnman.classes.elasticsolutionmodel.ElasticAsymmetricRegularSolution(endmembers, alphas, energy_interaction, pressure_interaction=None, entropy_interaction=None)[source]

Bases: ElasticIdealSolution

Solution model implementing the asymmetric regular solution model formulation as described in [HollandPowell03].

The excess nonconfigurational Helmholtz energy is given by the expression:

\[\mathcal{F}_{\textrm{excess}} = \alpha^T p (\phi^T W \phi)\]

\(\alpha\) is a vector of van Laar parameters governing asymmetry in the excess properties.

\[\phi_i = \frac{\alpha_i p_i}{\sum_{k=1}^{n} \alpha_k p_k}, W_{ij} = \frac{2 w_{ij}}{\alpha_i + \alpha_j} \textrm{for i<j}\]
excess_partial_helmholtz_energies(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Helmholtz energy for each endmember of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy of each endmember

Return type:

numpy.array

excess_partial_entropies(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of each endmember.

Return type:

numpy.array

excess_partial_pressures(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess pressure for each endmember of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of each endmember.

Return type:

numpy.array

helmholtz_hessian(volume, temperature, molar_fractions)[source]
entropy_hessian(volume, temperature, molar_fractions)[source]
pressure_hessian(volume, temperature, molar_fractions)[source]
configurational_entropy(molar_fractions)
excess_entropy(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of the solution.

Return type:

float

excess_helmholtz_energy(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess Helmholtz free energy of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy.

Return type:

float

excess_pressure(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess pressure of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of the solution.

Return type:

float

Symmetric regular solution

class burnman.classes.solutionmodel.SymmetricRegularSolution(endmembers, energy_interaction, volume_interaction=None, entropy_interaction=None)[source]

Bases: AsymmetricRegularSolution

Solution model implementing the Symmetric Regular Solution Model. This is a special case of the burnman.solutionmodel.AsymmetricRegularSolution class where all van Laar parameters are equal to unity.

The excess terms in the Symmetric Regular Solution Model have the matrix form [DPWH07]

\[\mathcal{G}_{\textrm{excess}} = RT \ln \gamma = p^T W p\]

where \(p\) is a vector of molar fractions of each of the \(n\) endmembers and \(W\) is a strictly upper-triangular matrix of interaction terms between endmembers. Excesses within binary systems (\(i\)-\(j\)) have a quadratic form and a maximum of \(W_{ij}/4\) half-way between the two endmembers.

Parameters:
  • endmembers (list of tuples) – A list of tuples defining the endmembers of the solution. Each tuple contains a burnman.Mineral object and a string defining the site formula of that endmember.

  • energy_interaction (list of lists of floats) – A 2D list of interaction parameters defining the energetic interactions between endmembers. The list should be upper-triangular, such that the first row has n-1 elements (for n endmembers), the second row has n-2 elements, etc.

  • volume_interaction (list of lists of floats) – (optional) A 2D list of interaction parameters defining the volumetric interactions between endmembers. The list should be upper-triangular, such that the first row has n-1 elements (for n endmembers), the second row has n-2 elements, etc.

  • entropy_interaction (list of lists of floats) – (optional) A 2D list of interaction parameters defining the entropic interactions between endmembers. The list should be upper-triangular, such that the first row has n-1 elements (for n endmembers), the second row has n-2 elements, etc.

Cp_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess isobaric heat capacity of the solution.

Return type:

float

VoverKT_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess V/K_T of the solution model

Return type:

float

activities(pressure, temperature, molar_fractions)
activity_coefficients(pressure, temperature, molar_fractions)
alphaV_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess alpha*V of the solution model

Return type:

float

configurational_entropy(molar_fractions)
entropy_hessian(pressure, temperature, molar_fractions)
excess_enthalpy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess enthalpy of the solution. The base class implementation assumes that the excess enthalpy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess enthalpy of the solution.

Return type:

float

excess_entropy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess entropy of the solution.

Return type:

float

excess_gibbs_energy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess Gibbs free energy of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess Gibbs energy.

Return type:

float

excess_partial_entropies(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial entropy of each endmember.

Return type:

numpy.array

excess_partial_gibbs_energies(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess Gibbs free energy for each endmember of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial Gibbs free energy of each endmember.

Return type:

numpy.array

excess_partial_volumes(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess volume for each endmember of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial volume of each endmember.

Return type:

numpy.array

excess_volume(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess volume of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess volume of the solution.

Return type:

float

property eye

An identity matrix with size equal to the number of endmembers :return: eye :rtype: 2D numpy array

property eyeones

A convenience function consisting of two concatenations of an identity matrix and ones vector with size equal to the number of endmembers. :return: delta_ij 1_k + delta_ik 1_j :rtype: 3D numpy array

gibbs_hessian(pressure, temperature, molar_fractions)
property ones

A vector of ones with length equal to the number of endmembers :return: ones :rtype: 1D numpy array

volume_hessian(pressure, temperature, molar_fractions)
class burnman.classes.elasticsolutionmodel.ElasticSymmetricRegularSolution(endmembers, energy_interaction, pressure_interaction=None, entropy_interaction=None)[source]

Bases: ElasticAsymmetricRegularSolution

Solution model implementing the symmetric regular solution model. This is a special case of the burnman.solutionmodel.AsymmetricRegularSolution class.

configurational_entropy(molar_fractions)
entropy_hessian(volume, temperature, molar_fractions)
excess_entropy(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of the solution.

Return type:

float

excess_helmholtz_energy(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess Helmholtz free energy of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy.

Return type:

float

excess_partial_entropies(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of each endmember.

Return type:

numpy.array

excess_partial_helmholtz_energies(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess Helmholtz energy for each endmember of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy of each endmember

Return type:

numpy.array

excess_partial_pressures(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess pressure for each endmember of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of each endmember.

Return type:

numpy.array

excess_pressure(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess pressure of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of the solution.

Return type:

float

helmholtz_hessian(volume, temperature, molar_fractions)
pressure_hessian(volume, temperature, molar_fractions)

Subregular solution

class burnman.classes.solutionmodel.SubregularSolution(endmembers, energy_interaction, volume_interaction=None, entropy_interaction=None, energy_ternary_terms=None, volume_ternary_terms=None, entropy_ternary_terms=None)[source]

Bases: IdealSolution

Solution model implementing the subregular solution model formulation as described in [HW89]. The excess nonconfigurational Gibbs energy is given by the expression:

\[\mathcal{G}_{\textrm{excess}} = \sum_i \sum_{j > i} (p_i p_j^2 W_{ij} + p_j p_i^2 W_{ji} + \sum_{k > j > i} p_i p_j p_k W_{ijk})\]

Interaction parameters are inserted into a 3D interaction matrix during initialization to make use of numpy vector algebra.

Parameters:
  • endmembers (list of lists) – A list of all the independent endmembers in the solution. The first item of each list gives the Mineral object corresponding to the endmember. The second item gives the site-species formula.

  • energy_interaction (list of list of lists) – The binary endmember interaction energies. Each interaction[i, j-i-1, 0] corresponds to W(i,j), while interaction[i, j-i-1, 1] corresponds to W(j,i).

  • volume_interaction (list of list of lists) – The binary endmember interaction volumes. Each interaction[i, j-i-1, 0] corresponds to W(i,j), while interaction[i, j-i-1, 1] corresponds to W(j,i).

  • entropy_interaction (list of list of lists) – The binary endmember interaction entropies. Each interaction[i, j-i-1, 0] corresponds to W(i,j), while interaction[i, j-i-1, 1] corresponds to W(j,i).

  • energy_ternary_terms (list of lists) – The ternary interaction energies. Each list should contain four entries: the indices i, j, k and the value of the interaction.

  • volume_ternary_terms (list of lists) – The ternary interaction volumes. Each list should contain four entries: the indices i, j, k and the value of the interaction.

  • entropy_ternary_terms (list of lists) – The ternary interaction entropies. Each list should contain four entries: the indices i, j, k and the value of the interaction.

excess_partial_gibbs_energies(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Gibbs free energy for each endmember of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial Gibbs free energy of each endmember.

Return type:

numpy.array

excess_partial_entropies(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial entropy of each endmember.

Return type:

numpy.array

excess_partial_volumes(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess volume for each endmember of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial volume of each endmember.

Return type:

numpy.array

gibbs_hessian(pressure, temperature, molar_fractions)[source]
entropy_hessian(pressure, temperature, molar_fractions)[source]
volume_hessian(pressure, temperature, molar_fractions)[source]
activity_coefficients(pressure, temperature, molar_fractions)[source]
activities(pressure, temperature, molar_fractions)[source]
Cp_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess isobaric heat capacity of the solution.

Return type:

float

VoverKT_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess V/K_T of the solution model

Return type:

float

alphaV_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess alpha*V of the solution model

Return type:

float

configurational_entropy(molar_fractions)
excess_enthalpy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess enthalpy of the solution. The base class implementation assumes that the excess enthalpy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess enthalpy of the solution.

Return type:

float

excess_entropy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess entropy of the solution.

Return type:

float

excess_gibbs_energy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess Gibbs free energy of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess Gibbs energy.

Return type:

float

excess_volume(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess volume of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess volume of the solution.

Return type:

float

property eye

An identity matrix with size equal to the number of endmembers :return: eye :rtype: 2D numpy array

property eyeones

A convenience function consisting of two concatenations of an identity matrix and ones vector with size equal to the number of endmembers. :return: delta_ij 1_k + delta_ik 1_j :rtype: 3D numpy array

property ones

A vector of ones with length equal to the number of endmembers :return: ones :rtype: 1D numpy array

class burnman.classes.elasticsolutionmodel.ElasticSubregularSolution(endmembers, energy_interaction, pressure_interaction=None, entropy_interaction=None, energy_ternary_terms=None, pressure_ternary_terms=None, entropy_ternary_terms=None)[source]

Bases: ElasticIdealSolution

Solution model implementing the subregular solution model formulation as described in [HW89]. The excess conconfigurational Helmholtz energy is given by the expression:

\[\mathcal{F}_{\textrm{excess}} = \sum_i \sum_{j > i} (p_i p_j^2 W_{ij} + p_j p_i^2 W_{ji} + \sum_{k > j > i} p_i p_j p_k W_{ijk})\]

Interaction parameters are inserted into a 3D interaction matrix during initialization to make use of numpy vector algebra.

Parameters:
  • endmembers (list of lists) – A list of all the independent endmembers in the solution. The first item of each list gives the Mineral object corresponding to the endmember. The second item gives the site-species formula.

  • energy_interaction (list of list of lists) – The binary endmember interaction energies. Each interaction[i, j-i-1, 0] corresponds to W(i,j), while interaction[i, j-i-1, 1] corresponds to W(j,i).

  • pressure_interaction (list of list of lists) – The binary endmember interaction pressures. Each interaction[i, j-i-1, 0] corresponds to W(i,j), while interaction[i, j-i-1, 1] corresponds to W(j,i).

  • entropy_interaction (list of list of lists) – The binary endmember interaction entropies. Each interaction[i, j-i-1, 0] corresponds to W(i,j), while interaction[i, j-i-1, 1] corresponds to W(j,i).

  • energy_ternary_terms (list of lists) – The ternary interaction energies. Each list should contain four entries: the indices i, j, k and the value of the interaction.

  • pressure_ternary_terms (list of lists) – The ternary interaction pressures. Each list should contain four entries: the indices i, j, k and the value of the interaction.

  • entropy_ternary_terms (list of lists) – The ternary interaction entropies. Each list should contain four entries: the indices i, j, k and the value of the interaction.

excess_partial_helmholtz_energies(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Helmholtz energy for each endmember of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy of each endmember

Return type:

numpy.array

excess_partial_entropies(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of each endmember.

Return type:

numpy.array

excess_partial_pressures(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess pressure for each endmember of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of each endmember.

Return type:

numpy.array

helmholtz_hessian(volume, temperature, molar_fractions)[source]
entropy_hessian(volume, temperature, molar_fractions)[source]
pressure_hessian(volume, temperature, molar_fractions)[source]
configurational_entropy(molar_fractions)
excess_entropy(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of the solution.

Return type:

float

excess_helmholtz_energy(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess Helmholtz free energy of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy.

Return type:

float

excess_pressure(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess pressure of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of the solution.

Return type:

float

Function solution

class burnman.classes.solutionmodel.FunctionSolution(endmembers, excess_gibbs_function)[source]

Bases: IdealSolution

Solution model implementing a generalized solution model. The extensive excess nonconfigurational Gibbs energy is provided as a function by the user.

Derivatives are calculated using the autograd module, and so the user-defined excess Gibbs energy function should be defined using autograd-friendly expressions.

Parameters:
  • endmembers (list of lists) – A list of all the independent endmembers in the solution. The first item of each list gives the Mineral object corresponding to the endmember. The second item gives the site-species formula.

  • excess_gibbs_function (function) – The nonconfigurational Gibbs energy function with arguments pressure, temperature and molar_amounts, in that order. Note that the function must be extensive; if the molar amounts are doubled, the Gibbs energy must also double.

excess_partial_volumes(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess volume for each endmember of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial volume of each endmember.

Return type:

numpy.array

Cp_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess isobaric heat capacity of the solution.

Return type:

float

alphaV_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess alpha*V of the solution model

Return type:

float

VoverKT_excess(pressure, temperature, molar_fractions)
Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess V/K_T of the solution model

Return type:

float

volume_hessian(pressure, temperature, molar_fractions)
excess_partial_gibbs_energies(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Gibbs free energy for each endmember of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial Gibbs free energy of each endmember.

Return type:

numpy.array

excess_partial_entropies(pressure, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess partial entropy of each endmember.

Return type:

numpy.array

gibbs_hessian(pressure, temperature, molar_fractions)[source]
entropy_hessian(pressure, temperature, molar_fractions)[source]
activity_coefficients(pressure, temperature, molar_fractions)[source]
activities(pressure, temperature, molar_fractions)[source]
configurational_entropy(molar_fractions)
excess_enthalpy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess enthalpy of the solution. The base class implementation assumes that the excess enthalpy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess enthalpy of the solution.

Return type:

float

excess_entropy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess entropy of the solution.

Return type:

float

excess_gibbs_energy(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess Gibbs free energy of the solution. The base class implementation assumes that the excess gibbs free energy is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess Gibbs energy.

Return type:

float

excess_volume(pressure, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess volume of the solution. The base class implementation assumes that the excess volume is zero.

Parameters:
  • pressure (float) – Pressure at which to evaluate the solution model [Pa].

  • temperature (float) – Temperature at which to evaluate the solution model [K].

  • molar_fractions (list of floats) – List of molar fractions of the different independent endmembers in the solution model.

Returns:

The excess volume of the solution.

Return type:

float

property eye

An identity matrix with size equal to the number of endmembers :return: eye :rtype: 2D numpy array

property eyeones

A convenience function consisting of two concatenations of an identity matrix and ones vector with size equal to the number of endmembers. :return: delta_ij 1_k + delta_ik 1_j :rtype: 3D numpy array

property ones

A vector of ones with length equal to the number of endmembers :return: ones :rtype: 1D numpy array

class burnman.classes.elasticsolutionmodel.ElasticFunctionSolution(endmembers, excess_helmholtz_function)[source]

Bases: ElasticIdealSolution

Solution model implementing a generalized elastic solution model. The extensive excess nonconfigurational Helmholtz energy is provided as a function by the user.

Derivatives are calculated using the autograd module, and so the user-defined excess Helmholtz energy function should be defined using autograd-friendly expressions.

Parameters:
  • endmembers (list of lists) – A list of all the independent endmembers in the solution. The first item of each list gives the Mineral object corresponding to the endmember. The second item gives the site-species formula.

  • excess_helmholtz_function (function) – The nonconfigurational Helmholtz energy function with arguments volume, temperature and molar_amounts, in that order. Note that the function must be extensive; if the molar amounts are doubled, the Helmholtz energy must also double.

excess_partial_pressures(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess pressure for each endmember of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of each endmember.

Return type:

numpy.array

pressure_hessian(volume, temperature, molar_fractions)
excess_partial_helmholtz_energies(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess Helmholtz energy for each endmember of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy of each endmember

Return type:

numpy.array

excess_partial_entropies(volume, temperature, molar_fractions)[source]

Given a list of molar fractions of different phases, compute the excess entropy for each endmember of the solution. The base class implementation assumes that the excess entropy is zero (true for mechanical solutions).

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of each endmember.

Return type:

numpy.array

configurational_entropy(molar_fractions)
excess_entropy(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess entropy of the solution. The base class implementation assumes that the excess entropy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess entropy of the solution.

Return type:

float

excess_helmholtz_energy(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess Helmholtz free energy of the solution. The base class implementation assumes that the excess Helmholtz energy is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess Helmholtz energy.

Return type:

float

excess_pressure(volume, temperature, molar_fractions)

Given a list of molar fractions of different phases, compute the excess pressure of the solution. The base class implementation assumes that the excess pressure is zero.

Parameters:
  • volume (float) – Volume at which to evaluate the solution model. [m^3/mol]

  • temperature (float) – Temperature at which to evaluate the solution. [K]

  • molar_fractions (list of floats) – List of molar fractions of the different endmembers in solution.

Returns:

The excess pressure of the solution.

Return type:

float

helmholtz_hessian(volume, temperature, molar_fractions)[source]
entropy_hessian(volume, temperature, molar_fractions)[source]

Solution tools

burnman.tools.solution.transform_solution_to_new_basis(solution, new_basis, n_mbrs=None, solution_name=None, endmember_names=None, molar_fractions=None)[source]

Transforms a solution model from one endmember basis to another. Returns a new Solution object.

Parameters:
  • solution (burnman.Solution object) – The original solution object.

  • new_basis (2D numpy array) – The new endmember basis, given as amounts of the old endmembers.

  • n_mbrs (float, optional) – The number of endmembers in the new solution (defaults to the length of new_basis).

  • solution_name (str, optional) – A name corresponding to the new solution.

  • endmember_names (list of str, optional) – A list corresponding to the names of the new endmembers.

  • molar_fractions (numpy.array, optional) – Fractions of the new endmembers in the new solution.

Returns:

The transformed solution.

Return type:

burnman.Solution object