Skip to content

Commit

Permalink
fixed magnetic contributions, added more benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmyhill committed May 25, 2024
1 parent f2d61f0 commit 644512c
Show file tree
Hide file tree
Showing 7 changed files with 299 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@ def rfloat(x, m=1.0):
"lppv": "[Fefls][Fefls]",
}

magnetic_structural_parameters = {"fea": 0.4, "mag": 0.4, "wu": 0.6}
magnetic_structural_parameters = {
"fea": {"p": 0.4},
"mag": {"p": 0.4},
"smag": {"p": 0.4},
"hmag": {"p": 0.4},
"wu": {"p": 0.6},
}

hefesto_path = "HeFESTo_parameters_010123"
mbrdir = pathlib.Path(hefesto_path)
Expand Down Expand Up @@ -358,7 +364,7 @@ def rfloat(x, m=1.0):
# but with the zero Gibbs energy and entropy
# assigned to the fully ordered form,
# not the disordered form,.
p = magnetic_structural_parameters[name]
p = magnetic_structural_parameters[name]["p"]
Scrit = float(idict["S_crit"])
magnetic_moment = np.exp(Scrit / gas_constant) - 1.0
A = (518.0 / 1125.0) + (11692.0 / 15975.0) * ((1.0 / p) - 1.0)
Expand Down Expand Up @@ -390,7 +396,7 @@ def rfloat(x, m=1.0):
{
"Tc_0": float(idict["T_crit"]),
"S_D": float(idict["S_crit"]),
"V_D": float(idict["V_crit"]),
"V_D": float(idict["V_crit"]) / 1.0e6,
},
]
]
Expand Down Expand Up @@ -471,6 +477,33 @@ def rfloat(x, m=1.0):
" RelaxedSolution.__init__(self, solution, vrel, vunrel)\n"
)

bdg_relaxed_class = (
"class bridgmanite_relaxed(RelaxedSolution):\n"
" def __init__(self):\n"
' """RelaxedSolution model for bridgmanite (pv).\n'
" Only the spin transition is relaxed.\n"
" Endmembers (and site species distributions) are given in the order:\n"
" - mgpv ([Mg][Si])\n"
" - fepv ([Fe][Si])\n"
" - alpv ([Al][Al])\n"
" - hepv + hlpv ([Fef][Fef,Fels])\n"
" - fapv ([Fef][Al])\n"
" - crpv ([Cr][Cr])\n"
" The equilibrium spin state is calculated automatically.\n"
' """\n'
" solution = bridgmanite()\n"
" vrel = [[0.0, 0., 0., 0.5, -0.5, 0.0, 0.0]]\n"
" vunrel = [\n"
" [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],\n"
" [0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0],\n"
" [0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0],\n"
" [0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0],\n"
" [0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0],\n"
" [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],\n"
" ]\n"
" RelaxedSolution.__init__(self, solution, vrel, vunrel)\n"
)

print('"""\n' "ENDMEMBERS\n" '"""\n')
for key, mbr_prm in sorted(mbr_params.items()):
if key == "st":
Expand Down Expand Up @@ -533,6 +566,8 @@ def rfloat(x, m=1.0):

if key == "mw":
print(fper_relaxed_class)
if key == "pv":
print(bdg_relaxed_class)


print('\n"""\n' "ENDMEMBER ALIASES\n" '"""\n')
Expand Down
62 changes: 58 additions & 4 deletions burnman/minerals/SLB_2024.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,18 @@ def __init__(self):
}

self.property_modifiers = [
["landau_slb_2022", {"Tc_0": 845.5, "S_D": 43.1758, "V_D": 0.0}]
[
"magnetic_chs",
{
"structural_parameter": 0.4,
"curie_temperature": [845.5, 0.0],
"magnetic_moment": [178.9816942215617, 0.0],
},
],
[
"linear",
{"delta_E": 33048.07971316818, "delta_S": 43.1758, "delta_V": 0.0},
],
]

Mineral.__init__(self)
Expand Down Expand Up @@ -1634,7 +1645,10 @@ def __init__(self):
}

self.property_modifiers = [
["landau_slb_2022", {"Tc_0": 467.0, "S_D": 10.0, "V_D": 0.8}]
[
"landau_slb_2022",
{"Tc_0": 467.0, "S_D": 10.0, "V_D": 8.000000000000001e-07},
]
]

Mineral.__init__(self)
Expand Down Expand Up @@ -1810,7 +1824,10 @@ def __init__(self):
}

self.property_modifiers = [
["landau_slb_2022", {"Tc_0": 847.0, "S_D": 5.76, "V_D": 1.35936}]
[
"landau_slb_2022",
{"Tc_0": 847.0, "S_D": 5.76, "V_D": 1.3593599999999998e-06},
]
]

Mineral.__init__(self)
Expand Down Expand Up @@ -1838,7 +1855,18 @@ def __init__(self):
}

self.property_modifiers = [
["landau_slb_2022", {"Tc_0": 845.5, "S_D": 43.1758, "V_D": 0.0}]
[
"magnetic_chs",
{
"structural_parameter": 0.4,
"curie_temperature": [845.5, 0.0],
"magnetic_moment": [178.9816942215617, 0.0],
},
],
[
"linear",
{"delta_E": 33048.07971316818, "delta_S": 43.1758, "delta_V": 0.0},
],
]

Mineral.__init__(self)
Expand Down Expand Up @@ -2372,6 +2400,32 @@ def __init__(self, molar_fractions=None):
Solution.__init__(self, molar_fractions=molar_fractions)


class bridgmanite_relaxed(RelaxedSolution):
def __init__(self):
"""RelaxedSolution model for bridgmanite (pv).
Only the spin transition is relaxed.
Endmembers (and site species distributions) are given in the order:
- mgpv ([Mg][Si])
- fepv ([Fe][Si])
- alpv ([Al][Al])
- hepv + hlpv ([Fef][Fef,Fels])
- fapv ([Fef][Al])
- crpv ([Cr][Cr])
The equilibrium spin state is calculated automatically.
"""
solution = bridgmanite()
vrel = [[0.0, 0.0, 0.0, 0.5, -0.5, 0.0, 0.0]]
vunrel = [
[1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0],
]
RelaxedSolution.__init__(self, solution, vrel, vunrel)


class ringwoodite(Solution):
def __init__(self, molar_fractions=None):
"""SymmetricRegularSolution model for ringwoodite (ri).
Expand Down
Binary file added misc/benchmarks/figures/SLB_2024_Fe2O3_V.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/benchmarks/figures/SLB_2024_Fe_O_fO2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added misc/benchmarks/figures/SLB_2024_Fe_O_fO2_T.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 644512c

Please sign in to comment.