Skip to content

Commit 1f40bf1

Browse files
authored
Merge pull request #702 from bobmyhill/restrict_averaging
restrict use of averaging schemes
2 parents a7f68f5 + e7a2d64 commit 1f40bf1

File tree

11 files changed

+327
-228
lines changed

11 files changed

+327
-228
lines changed

burnman/classes/averaging_schemes.py

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit
22
# for the Earth and Planetary Sciences
3-
# Copyright (C) 2012 - 2017 by the BurnMan team, released under the GNU
3+
# Copyright (C) 2012 - 2025 by the BurnMan team, released under the GNU
44
# GPL v2 or later.
55

66

@@ -60,87 +60,6 @@ def average_shear_moduli(self, volumes, bulk_moduli, shear_moduli):
6060
"""
6161
raise NotImplementedError("")
6262

63-
def average_density(self, volumes, densities):
64-
"""
65-
Average the densities of a composite, given a list of volume
66-
fractions and densitites. This is implemented in the base class,
67-
as how to calculate it is not dependent on the geometry of the rock.
68-
The formula for density is given by
69-
70-
.. math::
71-
\\rho = \\frac{\\Sigma_i \\rho_i V_i }{\\Sigma_i V_i}
72-
73-
:param volumes: List of the volume of each phase in the composite
74-
:math:`[m^3]`.
75-
:type volumes: list of floats
76-
:param densities: List of densities of each phase in the composite
77-
:math:`[kg/m^3]`.
78-
:type densities: list of floats
79-
80-
:returns: Density :math:`\\rho` :math:`[kg/m^3]`.
81-
:rtype: float
82-
"""
83-
total_mass = np.sum(np.array(densities) * np.array(volumes))
84-
total_vol = np.sum(np.array(volumes)) # should sum to one
85-
density = total_mass / total_vol
86-
return density
87-
88-
def average_thermal_expansivity(self, volumes, alphas):
89-
"""
90-
Averages the thermal expansion coefficient of the mineral :math:`\\alpha`
91-
:math:`[1/K]`.
92-
93-
:param volumes: List of volume fractions of each phase
94-
in the composite (should sum to 1.0).
95-
:type volumes: list of floats
96-
:param alphas: List of thermal expansivities :math:`\\alpha`
97-
of each phase in the composite. :math:`[1/K]`
98-
:type alphas: list of floats
99-
100-
:returns: Thermal expansivity of the composite :math:`\\alpha`. :math:`[1/K]`
101-
:rtype: float
102-
"""
103-
total_vol = np.sum(np.array(volumes))
104-
return np.sum(np.array(alphas) * np.array(volumes)) / total_vol
105-
106-
def average_heat_capacity_v(self, fractions, c_v):
107-
# TODO: double-check that the formula we use is appropriate here.
108-
"""
109-
Averages the heat capacities at constant volume :math:`C_V` by molar fractions
110-
as in eqn. (16) in :cite:`Ita1992`.
111-
112-
:param fractions: List of molar fractions of each phase
113-
in the composite (should sum to 1.0).
114-
:type fractions: list of floats
115-
:param c_v: List of heat capacities at constant volume :math:`C_V`
116-
of each phase in the composite. :math:`[J/K/mol]`
117-
:type c_v: list of floats
118-
119-
:returns: Heat capacity at constant volume of the composite :math:`C_V`
120-
:math:`[J/K/mol]`.
121-
:rtype: float
122-
"""
123-
return np.sum(np.array(fractions) * np.array(c_v))
124-
125-
def average_heat_capacity_p(self, fractions, c_p):
126-
# TODO: double-check that the formula we use is correct.
127-
"""
128-
Averages the heat capacities at constant pressure :math:`C_P`
129-
by molar fractions.
130-
131-
:param fractions: List of molar fractions of each phase in the composite
132-
(should sum to 1.0).
133-
:type fractions: list of floats
134-
:param c_p: List of heat capacities at constant pressure :math:`C_P` of each
135-
phase in the composite :math:`[J/K/mol]`.
136-
:type c_p: list of floats
137-
138-
:returns: Heat capacity at constant pressure :math:`C_P` of the composite
139-
:math:`[J/K/mol]`.
140-
:rtype: float
141-
"""
142-
return np.sum(np.array(fractions) * np.array(c_p))
143-
14463

14564
class VoigtReussHill(AveragingScheme):
14665
"""

0 commit comments

Comments
 (0)