[cig-commits] [commit] add_thermodynamic_potentials: Remove already inherited methods (feb9540)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Dec 9 09:54:21 PST 2014
Repository : https://github.com/geodynamics/burnman
On branch : add_thermodynamic_potentials
Link : https://github.com/geodynamics/burnman/compare/2e5646d93cedbbf8eae54cc37cffc14e0aa85180...d5ddad03ff9f30f5a4efaddb4e3ec585ea1a7c51
>---------------------------------------------------------------
commit feb9540b701764a0c61aafd0b9937cf2e6c0620f
Author: ian-r-rose <ian.r.rose at gmail.com>
Date: Thu Aug 28 17:31:32 2014 -0700
Remove already inherited methods
>---------------------------------------------------------------
feb9540b701764a0c61aafd0b9937cf2e6c0620f
burnman/solidsolution.py | 139 -----------------------------------------------
1 file changed, 139 deletions(-)
diff --git a/burnman/solidsolution.py b/burnman/solidsolution.py
index c652b92..ebb75d2 100644
--- a/burnman/solidsolution.py
+++ b/burnman/solidsolution.py
@@ -89,142 +89,3 @@ class SolidSolution(Mineral):
self.params[prop] = self.base_materials[0].params[prop]
Mineral.set_state(self, pressure, temperature)
- # BELOW IS FROM THE MINERAL CLASS.
- def set_method(self, method):
- """
- 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',
- or 'slb3'. Alternatively, you can pass a user defined
- class which derives from the equation_of_state base class.
- """
- if( isinstance(method, basestring)):
- if (method == "slb2"):
- self.method = slb.SLB2()
- elif (method == "mgd2"):
- self.method = mgd.MGD2()
- elif (method == "mgd3"):
- self.method = mgd.MGD3()
- elif (method == "slb3"):
- self.method = slb.SLB3()
- elif (method == "bm2"):
- self.method = bm.BM2()
- elif (method == "bm3"):
- self.method = bm.BM3()
- else:
- raise Exception("unsupported material method " + method)
- elif ( issubclass(method, eos.EquationOfState) ):
- self.method = method()
- else:
- raise Exception("unsupported material method " + method.__class__.__name__ )
-
- def to_string(self):
- """
- Returns the name of the mineral class
- """
- return "'" + self.__class__.__module__.replace(".minlib_",".") + "." + self.__class__.__name__ + "'"
-
- def unroll(self):
- return ([1.0],[self])
-
- def set_state(self, pressure, temperature):
- """
- Update the material to the given pressure [Pa] and temperature [K].
-
- This updates the other properties of this class (v_s, v_p, ...).
- """
-
- #in an effort to avoid additional work, don't do all the calculations if nothing has changed
- try:
- if self.pressure == pressure and self.temperature == temperature and self.old_params == self.params:
- return
- except AttributeError:
- pass #do nothing
-
- self.pressure = pressure
- self.temperature = temperature
- self.old_params = self.params
-
- self.V = self.method.volume(self.pressure, self.temperature, self.params)
- self.gr = self.method.grueneisen_parameter(self.pressure, self.temperature, self.V, self.params)
- self.K_T = self.method.isothermal_bulk_modulus(self.pressure, self.temperature, self.V, self.params)
- self.K_S = self.method.adiabatic_bulk_modulus(self.pressure, self.temperature, self.V, self.params)
- self.C_v = self.method.heat_capacity_v(self.pressure, self.temperature, self.V, self.params)
- self.C_p = self.method.heat_capacity_p(self.pressure, self.temperature, self.V, self.params)
- self.alpha = self.method.thermal_expansivity(self.pressure, self.temperature, self.V, self.params)
-
- if (self.params.has_key('G_0') and self.params.has_key('Gprime_0')):
- self.G = self.method.shear_modulus(self.pressure, self.temperature, self.V, self.params)
- else:
- self.G = float('nan') #nan if there is no G, this should propagate through calculations to the end
- warnings.warn(('Warning: G_0 and or Gprime_0 are undefined for ' + self.to_string()))
-
- def molar_mass(self):
- """
- Returns molar mass of the mineral [kg/mol]
- """
- return self.params['molar_mass']
-
- def density(self):
- """
- Returns density of the mineral [kg/m^3]
- """
- return self.params['molar_mass'] / self.V
-
- def molar_volume(self):
- """
- Returns molar volume of the mineral [m^3/mol]
- """
- return self.V
- def grueneisen_parameter(self):
- """
- Returns grueneisen parameter of the mineral [unitless]
- """
- return self.gr
- def isothermal_bulk_modulus(self):
- """
- Returns isothermal bulk modulus of the mineral [Pa]
- """
- return self.K_T
- def adiabatic_bulk_modulus(self):
- """
- Returns adiabatic bulk modulus of the mineral [Pa]
- """
- return self.K_S
- def shear_modulus(self):
- """
- Returns shear modulus of the mineral [Pa]
- """
- return self.G
- def thermal_expansivity(self):
- """
- Returns thermal expansion coefficient of the mineral [1/K]
- """
- return self.alpha
- def heat_capacity_v(self):
- """
- Returns heat capacity at constant volume of the mineral [J/K/mol]
- """
- return self.C_v
- def heat_capacity_p(self):
- """
- Returns heat capacity at constant pressure of the mineral [J/K/mol]
- """
- return self.C_p
- def v_s(self):
- """
- Returns shear wave speed of the mineral [m/s]
- """
- return np.sqrt(self.shear_modulus() / \
- self.density())
- def v_p(self):
- """
- Returns P wave speed of the mineral [m/s]
- """
- return np.sqrt((self.adiabatic_bulk_modulus() + 4. / 3. * \
- self.shear_modulus()) / self.density())
- def v_phi(self):
- """
- Returns bulk sound speed of the mineral [m/s]
- """
- return np.sqrt(self.adiabatic_bulk_modulus() / self.density())
More information about the CIG-COMMITS
mailing list