Solution models#

Solution objects in BurnMan are instances of one of two classes: type Solution (alias SolidSolution) and type ElasticSolution (alias ElasticSolidSolution). 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 ElasticSolution 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 [Myhill18].

The Solution and ElasticSolution classes both accept several methods which define the properties of the solution.

digraph inheritance03e7e7db87 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "burnman.classes.elasticsolutionmodel.ElasticAsymmetricRegularSolution" [URL="#burnman.classes.elasticsolutionmodel.ElasticAsymmetricRegularSolution",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Solution model implementing the asymmetric regular solution model"]; "burnman.classes.elasticsolutionmodel.ElasticIdealSolution" -> "burnman.classes.elasticsolutionmodel.ElasticAsymmetricRegularSolution" [arrowsize=0.5,style="setlinewidth(0.5)"]; "burnman.classes.elasticsolutionmodel.ElasticFunctionSolution" [URL="#burnman.classes.elasticsolutionmodel.ElasticFunctionSolution",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Solution model implementing a generalized elastic solution model."]; "burnman.classes.elasticsolutionmodel.ElasticIdealSolution" -> "burnman.classes.elasticsolutionmodel.ElasticFunctionSolution" [arrowsize=0.5,style="setlinewidth(0.5)"]; "burnman.classes.elasticsolutionmodel.ElasticIdealSolution" [URL="#burnman.classes.elasticsolutionmodel.ElasticIdealSolution",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A class representing an ideal solution model."]; "burnman.classes.elasticsolutionmodel.ElasticSolutionModel" -> "burnman.classes.elasticsolutionmodel.ElasticIdealSolution" [arrowsize=0.5,style="setlinewidth(0.5)"]; "burnman.classes.elasticsolutionmodel.ElasticMechanicalSolution" [URL="#burnman.classes.elasticsolutionmodel.ElasticMechanicalSolution",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="An extremely simple class representing a mechanical solution model."]; "burnman.classes.elasticsolutionmodel.ElasticSolutionModel" -> "burnman.classes.elasticsolutionmodel.ElasticMechanicalSolution" [arrowsize=0.5,style="setlinewidth(0.5)"]; "burnman.classes.elasticsolutionmodel.ElasticSolutionModel" [URL="#burnman.ElasticSolutionModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="This is the base class for an Elastic solution model, intended for use"]; "burnman.classes.elasticsolutionmodel.ElasticSubregularSolution" [URL="#burnman.classes.elasticsolutionmodel.ElasticSubregularSolution",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Solution model implementing the subregular solution model formulation"]; "burnman.classes.elasticsolutionmodel.ElasticIdealSolution" -> "burnman.classes.elasticsolutionmodel.ElasticSubregularSolution" [arrowsize=0.5,style="setlinewidth(0.5)"]; "burnman.classes.elasticsolutionmodel.ElasticSymmetricRegularSolution" [URL="#burnman.classes.elasticsolutionmodel.ElasticSymmetricRegularSolution",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Solution model implementing the symmetric regular solution model."]; "burnman.classes.elasticsolutionmodel.ElasticAsymmetricRegularSolution" -> "burnman.classes.elasticsolutionmodel.ElasticSymmetricRegularSolution" [arrowsize=0.5,style="setlinewidth(0.5)"]; "burnman.classes.solutionmodel.AsymmetricRegularSolution" [URL="#burnman.classes.solutionmodel.AsymmetricRegularSolution",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Solution model implementing the asymmetric regular solution model"]; "burnman.classes.solutionmodel.IdealSolution" -> "burnman.classes.solutionmodel.AsymmetricRegularSolution" [arrowsize=0.5,style="setlinewidth(0.5)"]; "burnman.classes.solutionmodel.FunctionSolution" [URL="#burnman.classes.solutionmodel.FunctionSolution",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Solution model implementing a generalized solution model."]; "burnman.classes.solutionmodel.IdealSolution" -> "burnman.classes.solutionmodel.FunctionSolution" [arrowsize=0.5,style="setlinewidth(0.5)"]; "burnman.classes.solutionmodel.IdealSolution" [URL="#burnman.classes.solutionmodel.IdealSolution",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A class representing an ideal solution model."]; "burnman.classes.solutionmodel.SolutionModel" -> "burnman.classes.solutionmodel.IdealSolution" [arrowsize=0.5,style="setlinewidth(0.5)"]; "burnman.classes.solutionmodel.MechanicalSolution" [URL="#burnman.classes.solutionmodel.MechanicalSolution",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="An extremely simple class representing a mechanical solution model."]; "burnman.classes.solutionmodel.SolutionModel" -> "burnman.classes.solutionmodel.MechanicalSolution" [arrowsize=0.5,style="setlinewidth(0.5)"]; "burnman.classes.solutionmodel.SolutionModel" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="This is the base class for a solution model, intended for use"]; "burnman.classes.solutionmodel.SubregularSolution" [URL="#burnman.classes.solutionmodel.SubregularSolution",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Solution model implementing the subregular solution model formulation"]; "burnman.classes.solutionmodel.IdealSolution" -> "burnman.classes.solutionmodel.SubregularSolution" [arrowsize=0.5,style="setlinewidth(0.5)"]; "burnman.classes.solutionmodel.SymmetricRegularSolution" [URL="#burnman.classes.solutionmodel.SymmetricRegularSolution",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Solution model implementing the symmetric regular solution model."]; "burnman.classes.solutionmodel.AsymmetricRegularSolution" -> "burnman.classes.solutionmodel.SymmetricRegularSolution" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Base classes#

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

Bases: Mineral

This is the base class for all solutions. Site occupancies, endmember activities and the constant and pressure 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().

This class is available as burnman.Solution. It uses an instance of burnman.SolutionModel 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 P derivatives in J/K/mol and m^3/mol.

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

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 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[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.

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: ‘bm2’, ‘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.

Return type:

list of OrderedDicts

site_formula(precision=2)[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

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[source]

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

property stoichiometric_array[source]

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

property reaction_basis[source]

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

property n_reactions[source]

The number of reactions in reaction_basis.

property compositional_basis[source]

_summary_

Returns:

_description_

Return type:

_type_

property independent_element_indices[source]

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[source]

The element indices not included in the independent list.

property compositional_null_basis[source]

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[source]

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

property endmember_names[source]

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

property n_endmembers[source]

The number of endmembers in the solution.

property elements[source]

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

property C_p

Alias for molar_heat_capacity_p()

property C_v

Alias for molar_heat_capacity_v()

property G

Alias for shear_modulus()

property H

Alias for molar_enthalpy()

property K_S

Alias for isentropic_bulk_modulus_reuss()

property K_T

Alias for isothermal_bulk_modulus_reuss()

property P

Alias for pressure()

property S

Alias for molar_entropy()

property T

Alias for temperature()

property V

Alias for molar_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 energy

Alias for molar_internal_energy()

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

Alias for molar_gibbs()

property gr

Alias for grueneisen_parameter()

property helmholtz

Alias for molar_helmholtz()

property isentropic_thermal_gradient
Returns:

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

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. 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 method.

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()

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[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.

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: ‘bm2’, ‘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[source]

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

property stoichiometric_array[source]

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

property reaction_basis[source]

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

property n_reactions[source]

The number of reactions in reaction_basis.

property independent_element_indices[source]

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[source]

The element indices not included in the independent list.

property compositional_null_basis[source]

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[source]

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

property endmember_names[source]

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

property n_endmembers[source]

The number of endmembers in the solution.

property elements[source]

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

property C_p

Alias for molar_heat_capacity_p()

property C_v

Alias for molar_heat_capacity_v()

property G

Alias for shear_modulus()

property H

Alias for molar_enthalpy()

property K_S

Alias for isentropic_bulk_modulus_reuss()

property K_T

Alias for isothermal_bulk_modulus_reuss()

property P

Alias for pressure()

property S

Alias for molar_entropy()

property T

Alias for temperature()

property V

Alias for molar_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 energy

Alias for molar_internal_energy()

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

Alias for molar_gibbs()

property gr

Alias for grueneisen_parameter()

property helmholtz

Alias for molar_helmholtz()

property isentropic_thermal_gradient
Returns:

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

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. 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 method.

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()

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_enthalpy(volume, 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:
  • 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 enthalpy 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

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_free_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_free_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()#

Returns the excess heat capacity of the solution model at its current state

VoverKT_excess()#

Returns the excess V/K_T of the solution model at its current state

alphaV_excess()#

Returns the excess alpha*V of the solution model at its current state

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

excess_enthalpy(volume, 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:
  • 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 enthalpy of the solution.

Return type:

float

Ideal solution#

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

Bases: SolutionModel

A class representing an ideal solution model. Calculates the excess gibbs free 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_gibbs_free_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]#
property ones[source]#

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

property eye[source]#

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

property eyeones[source]#

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()#

Returns the excess heat capacity of the solution model at its current state

VoverKT_excess()#

Returns the excess V/K_T of the solution model at its current state

alphaV_excess()#

Returns the excess alpha*V of the solution model at its current state

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_free_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]#
excess_enthalpy(volume, 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:
  • 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 enthalpy of the solution.

Return type:

float

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:

\[\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}\]
excess_partial_gibbs_free_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()#

Returns the excess heat capacity of the solution model at its current state

VoverKT_excess()#

Returns the excess V/K_T of the solution model at its current state

alphaV_excess()#

Returns the excess alpha*V of the solution model at its current state

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_free_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]#
excess_enthalpy(volume, 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:
  • 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 enthalpy of the solution.

Return type:

float

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.

Cp_excess()#

Returns the excess heat capacity of the solution model at its current state

VoverKT_excess()#

Returns the excess V/K_T of the solution model at its current state

activities(pressure, temperature, molar_fractions)#
activity_coefficients(pressure, temperature, molar_fractions)#
alphaV_excess()#

Returns the excess alpha*V of the solution model at its current state

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_free_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_free_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.

entropy_hessian(volume, temperature, molar_fractions)#
excess_enthalpy(volume, 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:
  • 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 enthalpy of the solution.

Return type:

float

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_free_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()#

Returns the excess heat capacity of the solution model at its current state

VoverKT_excess()#

Returns the excess V/K_T of the solution model at its current state

alphaV_excess()#

Returns the excess alpha*V of the solution model at its current state

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_free_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]#
excess_enthalpy(volume, 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:
  • 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 enthalpy of the solution.

Return type:

float

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

volume_hessian(pressure, temperature, molar_fractions)#
excess_partial_gibbs_free_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]#
Cp_excess()#

Returns the excess heat capacity of the solution model at its current state

VoverKT_excess()#

Returns the excess V/K_T of the solution model at its current state

alphaV_excess()#

Returns the excess alpha*V of the solution model at its current state

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_free_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

excess_enthalpy(volume, 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:
  • 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 enthalpy of the solution.

Return type:

float

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