The Solution ClassΒΆ
- class burnman.Solution(name=None, solution_model=None, molar_fractions=None)[source]
Bases:
MineralThe Solution class has overall responsibility for calculating thermodynamically self-consistent properties of a solution phase.
In this class, solutions are treated as a collection of independent endmember phases (components), plus a model that describes the excess properties of the solution. It stores the current state (pressure, temperature and molar fractions of all the endmembers) of the solution, and interrogates a SolutionModel object to calculate the excess properties of the solution. It then combines these with the properties of the individual endmember phases (also stored in the SolutionModel) to calculate the overall properties of the solution. This is done using standard thermodynamic relations:
\[\begin{split}G = \sum_i X_i G_i + G^{\text{excess}} \\ V = \sum_i X_i V_i + V^{\text{excess}} \\ S = \sum_i X_i S_i + S^{\text{excess}} \\ C_p = \sum_i X_i C_{p,i} + C_p^{\text{excess}} \\ \alpha V = \sum_i X_i \alpha_i V_i + (\alpha V)^{\text{excess}} \\ \frac{V}{K_T} = \sum_i X_i \frac{V_i}{K_{T,i}} + \left(\frac{V}{K_T}\right)^{\text{excess}}\end{split}\]After instantiation, the user can set the composition of the solution using the set_composition() method, and the pressure and temperature using the set_state() method.
Instantiation of a Solution object can be achieved in just a few lines:
from burnman import Solution, SolutionModel # Create a SolutionModel object (explained in the documentation for that class) solution_model = SolutionModel(...) # Create a Solution object solution = Solution(name="MySolution", solution_model=solution_model, molar_fractions=...)
where the arguments are as follows:
- Parameters:
name (string) β Name of the solution.
solution_model (
burnman.SolutionModel) β The SolutionModel object defining the properties of the solution.molar_fractions (numpy.array) β The initial molar fractions of each endmember in the solution. Can be reset using the set_composition() method.