Skip to content

Commit

Permalink
improved docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmyhill committed May 15, 2024
1 parent f324db5 commit ebf9a63
Show file tree
Hide file tree
Showing 3 changed files with 261 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ def rfloat(x, m=1.0):
mbr_params[name]["bel_0"] = rfloat(idict["bel_0"])
mbr_params[name]["gel"] = rfloat(idict["gel"])

if idict["T_crit"] != "0.00000":
# The positivity constraint for T_crit below
# is hardcoded into HeFESTo.
if idict["T_crit"] != "0.00000" and float(idict["T_crit"]) > 0.0:
if name in magnetic_structural_parameters:
# The magnetic model in SLB2024 is identical
# to the chs model already coded in BurnMan
Expand Down Expand Up @@ -404,9 +406,17 @@ def rfloat(x, m=1.0):


for key, prm in sorted(sol_params.items()):
docstring = '"""'
docstring += f'{prm["solution_type"]} model for {solution_aliases[key]} ({key}).\n'
docstring += "Endmembers (and site species distributions) are given in the order:\n"
for i in range(prm["n_mbrs"]):
docstring += f'- {prm["mbr_names"][i]} ({prm["mbr_site_formulae"][i]})\n'
docstring += '"""'

print(
f"\nclass {solution_aliases[key]}(Solution):\n"
" def __init__(self, molar_fractions=None):\n"
f" {docstring}\n"
f' self.name = "{solution_aliases[key]}"\n'
f" self.solution_model = {prm['solution_type']}(\n"
" endmembers=["
Expand Down
110 changes: 106 additions & 4 deletions burnman/minerals/SLB_2024.py
Original file line number Diff line number Diff line change
Expand Up @@ -1888,10 +1888,6 @@ def __init__(self):
"molar_mass": 0.060085,
}

self.property_modifiers = [
["landau_slb_2022", {"Tc_0": -4350.0, "S_D": 0.0111, "V_D": 0.001}]
]

Mineral.__init__(self)


Expand Down Expand Up @@ -1989,6 +1985,11 @@ def __init__(self):

class c2c_pyroxene(Solution):
def __init__(self, molar_fractions=None):
"""IdealSolution model for c2c_pyroxene (c2c).
Endmembers (and site species distributions) are given in the order:
- mgc2 ([Mg]2)
- fec2 ([Fe]2)
"""
self.name = "c2c_pyroxene"
self.solution_model = IdealSolution(
endmembers=[
Expand All @@ -2002,6 +2003,14 @@ def __init__(self, molar_fractions=None):

class calcium_ferrite_structured_phase(Solution):
def __init__(self, molar_fractions=None):
"""AsymmetricRegularSolution model for calcium_ferrite_structured_phase (cf).
Endmembers (and site species distributions) are given in the order:
- mgcf ([Mg][Al][Al])
- fecf ([Fe][Al][Al])
- nacf ([Na][Al][Si])
- hmag ([Fe][Fe][Fe])
- crcf ([Mg][Cr][Cr])
"""
self.name = "calcium_ferrite_structured_phase"
self.solution_model = AsymmetricRegularSolution(
endmembers=[
Expand All @@ -2025,6 +2034,15 @@ def __init__(self, molar_fractions=None):

class clinopyroxene(Solution):
def __init__(self, molar_fractions=None):
"""AsymmetricRegularSolution model for clinopyroxene (cpx).
Endmembers (and site species distributions) are given in the order:
- di ([Ca][Mg][Si]2)
- he ([Ca][Fe][Si]2)
- cen ([Mg][Mg][Si]2)
- cats ([Ca][Al][Si1/2Al1/2]2)
- jd ([Na][Al][Si]2)
- acm ([Na][Fe][Si]2)
"""
self.name = "clinopyroxene"
self.solution_model = AsymmetricRegularSolution(
endmembers=[
Expand All @@ -2050,6 +2068,16 @@ def __init__(self, molar_fractions=None):

class garnet(Solution):
def __init__(self, molar_fractions=None):
"""SymmetricRegularSolution model for garnet (gt).
Endmembers (and site species distributions) are given in the order:
- py ([Mg]3[Al][Al])
- al ([Fe]3[Al][Al])
- gr ([Ca]3[Al][Al])
- mgmj ([Mg]3[Mg][Si])
- namj ([Na2/3Mg1/3]3[Si][Si])
- andr ([Ca]3[Fe][Fe])
- knor ([Mg]3[Cr][Cr])
"""
self.name = "garnet"
self.solution_model = SymmetricRegularSolution(
endmembers=[
Expand Down Expand Up @@ -2084,6 +2112,14 @@ def __init__(self, molar_fractions=None):

class ilmenite(Solution):
def __init__(self, molar_fractions=None):
"""AsymmetricRegularSolution model for ilmenite (il).
Endmembers (and site species distributions) are given in the order:
- mgil ([Mg][Si])
- feil ([Fe][Si])
- co ([Al][Al])
- hem ([Fe][Fe])
- esk ([Cr][Cr])
"""
self.name = "ilmenite"
self.solution_model = AsymmetricRegularSolution(
endmembers=[
Expand All @@ -2107,6 +2143,14 @@ def __init__(self, molar_fractions=None):

class ferropericlase(Solution):
def __init__(self, molar_fractions=None):
"""AsymmetricRegularSolution model for ferropericlase (mw).
Endmembers (and site species distributions) are given in the order:
- pe ([Mg]2[Mg]2)
- wu ([Fe]2[Fe]2)
- wuls ([Fe]2[Fe]2)
- anao ([Na]2[Al]2)
- mag ([Vac1/2Fe1/2]2[Fe]2)
"""
self.name = "ferropericlase"
self.solution_model = AsymmetricRegularSolution(
endmembers=[
Expand Down Expand Up @@ -2136,6 +2180,12 @@ def __init__(self, molar_fractions=None):

class new_aluminous_phase(Solution):
def __init__(self, molar_fractions=None):
"""SymmetricRegularSolution model for new_aluminous_phase (nal).
Endmembers (and site species distributions) are given in the order:
- mnal ([Mg]2[Al5/6Si1/6]6)
- fnal ([Fe]2[Al5/6Si1/6]6)
- nnal ([Na]2[Al3/6Si3/6]6)
"""
self.name = "new_aluminous_phase"
self.solution_model = SymmetricRegularSolution(
endmembers=[
Expand All @@ -2151,6 +2201,11 @@ def __init__(self, molar_fractions=None):

class olivine(Solution):
def __init__(self, molar_fractions=None):
"""SymmetricRegularSolution model for olivine (ol).
Endmembers (and site species distributions) are given in the order:
- fo ([Mg]2)
- fa ([Fe]2)
"""
self.name = "olivine"
self.solution_model = SymmetricRegularSolution(
endmembers=[
Expand All @@ -2165,6 +2220,13 @@ def __init__(self, molar_fractions=None):

class orthopyroxene(Solution):
def __init__(self, molar_fractions=None):
"""SymmetricRegularSolution model for orthopyroxene (opx).
Endmembers (and site species distributions) are given in the order:
- en ([Mg][Mg])
- fs ([Fe][Fe])
- mgts ([Mg][Al])
- odi ([Ca][Mg])
"""
self.name = "orthopyroxene"
self.solution_model = SymmetricRegularSolution(
endmembers=[
Expand All @@ -2181,6 +2243,11 @@ def __init__(self, molar_fractions=None):

class plagioclase(Solution):
def __init__(self, molar_fractions=None):
"""SymmetricRegularSolution model for plagioclase (plg).
Endmembers (and site species distributions) are given in the order:
- an ([Ca])
- ab ([Na])
"""
self.name = "plagioclase"
self.solution_model = SymmetricRegularSolution(
endmembers=[
Expand All @@ -2195,6 +2262,14 @@ def __init__(self, molar_fractions=None):

class post_perovskite(Solution):
def __init__(self, molar_fractions=None):
"""SymmetricRegularSolution model for post_perovskite (ppv).
Endmembers (and site species distributions) are given in the order:
- mppv ([Mg][Si])
- fppv ([Fe][Si])
- appv ([Al][Al])
- hppv ([Fe][Fe])
- cppv ([Cr][Cr])
"""
self.name = "post_perovskite"
self.solution_model = SymmetricRegularSolution(
endmembers=[
Expand All @@ -2217,6 +2292,16 @@ def __init__(self, molar_fractions=None):

class bridgmanite(Solution):
def __init__(self, molar_fractions=None):
"""SymmetricRegularSolution model for bridgmanite (pv).
Endmembers (and site species distributions) are given in the order:
- mgpv ([Mg][Si])
- fepv ([Fe][Si])
- alpv ([Al][Al])
- hepv ([Fe][Fe])
- hlpv ([Fe][Fe])
- fapv ([Fe][Al])
- crpv ([Cr][Cr])
"""
self.name = "bridgmanite"
self.solution_model = SymmetricRegularSolution(
endmembers=[
Expand All @@ -2243,6 +2328,11 @@ def __init__(self, molar_fractions=None):

class ringwoodite(Solution):
def __init__(self, molar_fractions=None):
"""SymmetricRegularSolution model for ringwoodite (ri).
Endmembers (and site species distributions) are given in the order:
- mgri ([Mg]2)
- feri ([Fe]2)
"""
self.name = "ringwoodite"
self.solution_model = SymmetricRegularSolution(
endmembers=[
Expand All @@ -2257,6 +2347,13 @@ def __init__(self, molar_fractions=None):

class mg_fe_aluminous_spinel(Solution):
def __init__(self, molar_fractions=None):
"""SymmetricRegularSolution model for mg_fe_aluminous_spinel (sp).
Endmembers (and site species distributions) are given in the order:
- sp ([Mg][Al][Al])
- hc ([Fe][Al][Al])
- smag ([Fe][Fe][Fe])
- picr ([Mg][Cr][Cr])
"""
self.name = "mg_fe_aluminous_spinel"
self.solution_model = SymmetricRegularSolution(
endmembers=[
Expand All @@ -2277,6 +2374,11 @@ def __init__(self, molar_fractions=None):

class wadsleyite(Solution):
def __init__(self, molar_fractions=None):
"""SymmetricRegularSolution model for wadsleyite (wa).
Endmembers (and site species distributions) are given in the order:
- mgwa ([Mg]2)
- fewa ([Fe]2)
"""
self.name = "wadsleyite"
self.solution_model = SymmetricRegularSolution(
endmembers=[
Expand Down
Loading

0 comments on commit ebf9a63

Please sign in to comment.