barite.py
Go to the documentation of this file.
1 from atomicdata import *
2 from util import *
3
4 # FD overburden
5
6 compositions = {
7  'BaSO4': { 'Ba' : 1, 'S' : 1, 'O': 4 },
8  'water': { 'H' : 2, 'O': 1 },
9 }
10
11 # Of perfect barite crystals, I think. Maybe higher than reasonable for
12 # the mean of real rocks?
13 matrix_density = 4.48
14
15 water_density = 1.00
16
17 # From doc-6092
18 void_volume_fraction = 0.269
19
20 rock_volume_fraction = 1 - void_volume_fraction
21
22 # Assume lower parts saturated, upper parts not, and we want the average
23 water_volume_fraction = void_volume_fraction * 0.75
24
25 air_volume_fraction = void_volume_fraction - water_volume_fraction
26
27 water_mass_fraction = water_volume_fraction * water_density /(
28 water_volume_fraction*water_density + rock_volume_fraction*matrix_density)
29
30 # Mass of air in the voids is neglected
31 rock_mass_fraction = 1 - water_mass_fraction
32
33 density = (matrix_density * rock_volume_fraction
34  + water_density * water_volume_fraction)
35
36 print('<D value="{0:.2f}" unit="g/cm3"/>'.format(density))
37
38
39 fractions = {
40  # Assume 30% void in the rock, filled by water.
41  'water': water_mass_fraction,
42  'BaSO4': rock_mass_fraction,
43 }
44
45
46 def tot_weight(compos):
47  weight = 0
48  for element, number in compos.items():
49  weight += number * atomic_weight[element]
50  return weight
51
53  tions = 0
54  for material, fraction in fractions.items():
55  tions += fraction
56  return tions
57
58 def elem_frac(compos, elem):
59  if elem in compos:
60  return compos[elem] * atomic_weight[elem] / tot_weight(compos)
61  else:
62  return 0
63
64 def elem_frac_total(elem):
65  frac = 0
66  for material, compos in compositions.items():
67  frac += elem_frac(compos, elem) * fractions[material]
68  return frac / tot_fractions()
69
71  return make_composition("barite", fractions, compositions)
def tot_fractions()
Definition: barite.py:52
def elem_frac(compos, elem)
Definition: barite.py:58
def tot_weight(compos)
Definition: barite.py:46
bool print
std::string format(const int32_t &value, const int &ndigits=8)
Definition: HexUtils.cpp:14
def elem_frac_total(elem)
Definition: barite.py:64
def barite_composition()
Definition: barite.py:70
def make_composition(name, fractions, compositions)
Definition: util.py:46