From 06c29fc139207091ea6fb44098506408714806c5 Mon Sep 17 00:00:00 2001 From: Bob Myhill Date: Wed, 29 May 2024 10:42:11 -0600 Subject: [PATCH] added HP basic and pelitic solutions --- .../hpx_eos_to_burnman.py | 616 +++++++-------- burnman/minerals/__init__.py | 4 + burnman/minerals/mb50NCKFMASHTO.py | 708 ++++++++++++++++++ burnman/minerals/mp50KFMASH.py | 226 ++++++ burnman/minerals/mp50MnNCKFMASHTO.py | 660 ++++++++++++++++ burnman/minerals/mp50NCKFMASHTO.py | 639 ++++++++++++++++ tests/test_hp_solutions.py | 78 +- 7 files changed, 2627 insertions(+), 304 deletions(-) create mode 100644 burnman/minerals/mb50NCKFMASHTO.py create mode 100644 burnman/minerals/mp50KFMASH.py create mode 100644 burnman/minerals/mp50MnNCKFMASHTO.py create mode 100644 burnman/minerals/mp50NCKFMASHTO.py diff --git a/burnman/data/input_raw_endmember_datasets/hpx_eos_to_burnman.py b/burnman/data/input_raw_endmember_datasets/hpx_eos_to_burnman.py index d4aa46e2..2357f6f6 100644 --- a/burnman/data/input_raw_endmember_datasets/hpx_eos_to_burnman.py +++ b/burnman/data/input_raw_endmember_datasets/hpx_eos_to_burnman.py @@ -17,27 +17,25 @@ from sympy import Symbol, prod, sympify from sympy.parsing.sympy_parser import parse_expr from burnman.constants import gas_constant -from burnman.minerals import HGP_2018_ds633 +from burnman.minerals import HGP_2018_ds633, HP_2011_ds62 from datetime import date -# Change the following lines to process a different dataset -dataset = HGP_2018_ds633 -mbr_dataset = "HGP_2018_ds633" -solution_file = "tc-thermoinput-igneous-2022-01-23/tc-ig50NCKFMASHTOCr.txt" -solution_file = "tc-thermoinput-igneous-2022-01-23/tc-ig50NCKFMASTOCr.txt" -first_model = "pl4tr" # melt and fl are (currently unreadable) Temkin models +ds = [ + ["tc-thermoinput-igneous-2022-01-23/tc-ig50NCKFMASHTOCr.txt", "HGP_2018_ds633"], + ["tc-thermoinput-igneous-2022-01-23/tc-ig50NCKFMASTOCr.txt", "HGP_2018_ds633"], + ["tc-thermoinput-metabasite-2022-01-30/tc-mb50NCKFMASHTO.txt", "HP_2011_ds62"], + ["tc-thermoinput-metapelite-2022-01-23/tc-mp50KFMASH.txt", "HP_2011_ds62"], + ["tc-thermoinput-metapelite-2022-01-23/tc-mp50MnNCKFMASHTO.txt", "HP_2011_ds62"], + ["tc-thermoinput-metapelite-2022-01-23/tc-mp50NCKFMASHTO.txt", "HP_2011_ds62"], +] + +ignore_solutions = ["liq", "L", "fl"] # currently unreadable Temkin models # logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) logging.basicConfig(stream=sys.stderr, level=logging.ERROR) - - current_year = str(date.today())[:4] -out_ss = "" -out_make = "" - - def reverse_polish(lines): # get symbols syms = [] @@ -122,297 +120,309 @@ def ordering_modifier(property_modifier, ordered): return np.array([E_disord, S_disord, V_disord]) -increment_i = True -i = 0 -data = [] -with open(solution_file, "r") as file: - # Read each line in the file one by one - process = True - for line in file: - # Process the line (for example, print it) - ln = line.strip().split() - if len(ln) > 0: - if ln[0] == "verbatim": - process = not process - if ( - ln[0][0] != "%" - and ln[0][0] != "*" - and ln[0] != "header" - and ln[0] != "verbatim" - and process - ): - data.append(ln) - if ln[0] == first_model: - increment_i = False - if increment_i: - i += 1 - -n_data = len(data) - -noods = [] -while True: - if i > n_data - 3: - break - name = data[i][0] - n_mbrs = int(data[i][1]) - logging.debug(f"Solution: {name}") - logging.debug(f"Number of endmembers: {n_mbrs}") - - vars = data[i + 1 : i + n_mbrs] - logging.debug(vars) - i += n_mbrs - - mbr_proportions = [] - mbr_names = [] - for j in range(n_mbrs): - n_lines = int(data[i][1]) - mbr_names.append(data[i][0].split("(")[1][:-1]) - mbr_proportions.append(data[i : i + n_lines]) - i += n_lines - logging.debug(mbr_proportions) - - formulation = data[i][0] - logging.debug(f"formulation: {formulation}") - i += 1 - n_ints = int((n_mbrs * (n_mbrs - 1.0)) / 2.0) - interactions = data[i : i + n_ints] - logging.debug(interactions) - - nonideal_entropies = False - nonideal_volumes = False - - We = [[0.0 for j in mbr_names[:-i]] for i in range(1, n_mbrs)] - Ws = [[0.0 for j in mbr_names[:-i]] for i in range(1, n_mbrs)] - Wv = [[0.0 for j in mbr_names[:-i]] for i in range(1, n_mbrs)] - for ints in interactions: - m = ints[0].split("(")[1].replace(")", "").split(",") - m0 = mbr_names.index(m[0]) - m1 = mbr_names.index(m[1]) - We[m0][m1 - m0 - 1] = float(ints[1]) * 1.0e3 - Ws[m0][m1 - m0 - 1] = -float(ints[2]) - Wv[m0][m1 - m0 - 1] = float(ints[3]) * 1.0e-5 - - if np.abs(Ws[m0][m1 - m0 - 1]) > 1.0e-10: - nonideal_entropies = True - if np.abs(Wv[m0][m1 - m0 - 1]) > 1.0e-10: - nonideal_volumes = True - - i += n_ints - - if formulation == "asf": - text_alphas = data[i : i + n_mbrs] - logging.debug(text_alphas) +for solution_file, mbr_dataset in ds: + logging.debug(f"{solution_file}, {mbr_dataset}") + dataset = eval(mbr_dataset) + out_ss = "" + out_make = "" + + i = 0 + data = [] + with open(solution_file, "r") as file: + # Read each line in the file one by one + process = True + for line in file: + # Process the line (for example, print it) + ln = line.strip().split() + if len(ln) > 0: + if ln[0] == "verbatim" or ln[0] == "header": + process = not process + if ( + ln[0][0] != "%" + and ln[0][0] != "*" + and ln[0] != "header" + and ln[0] != "verbatim" + and process + ): + data.append(ln) + + start_indices = [] + for i_d, d in enumerate(data): + if len(d) == 3: + if d[0] != "check" and d[0] != "%" and d[0] not in ignore_solutions: + if int(d[1]) > 1.1: + start_indices.append(i_d) + + n_data = len(data) + + noods = [] + for ind in start_indices: + i = ind + name = data[i][0] + n_mbrs = int(data[i][1]) + logging.debug(f"Solution: {name}") + logging.debug(f"Number of endmembers: {n_mbrs}") + + vars = data[i + 1 : i + n_mbrs] + logging.debug(vars) i += n_mbrs - Ae = [0.0 for i in range(n_mbrs)] - As = [0.0 for i in range(n_mbrs)] - Av = [0.0 for i in range(n_mbrs)] - for alpha in text_alphas: - try: - m = alpha[0].split("(")[1].replace(")", "").split(",")[0] - except IndexError: - m = alpha[0] - m0 = mbr_names.index(m) - Ae[m0] = float(alpha[1]) - As[m0] = -float(alpha[2]) - Av[m0] = float(alpha[3]) * 1.0e6 - - n_site_species = int(data[i][0]) - - logging.debug(f"Number of site species: {n_site_species}") - i += 1 - - site_fractions = [] - for j in range(n_site_species): - n_lines = int(data[i][1]) - site_fractions.append(data[i : i + n_lines]) - i += n_lines - - summed = 0.0 - sites = [[]] - for site_species_and_expression in site_fractions: - site_species = site_species_and_expression[0][0] - expression = site_species_and_expression - expression[0] = expression[0][2:] - expression = reverse_polish(expression) - summed += expression - summed = sympify(summed) - sites[-1].append(site_species) - if summed == 1: - summed = 0 - sites.append([]) - sites = sites[:-1] - site_species = {} - for n_site, site in enumerate(sites): - for species in site: - site_species[species] = n_site - n_sites = len(sites) - - endmember_site_fractions_and_checks = [] - for j in range(n_mbrs): - n_lines = 1 - while True: - if ( - data[i + n_lines][0] == "make" - or data[i + n_lines][0] == "delG(tran)" - or data[i + n_lines][0] == "check" - or data[i + n_lines][0] == "delG(od)" - or data[i + n_lines][0] == "delG(make)" - or data[i + n_lines][0] == "delG(mod)" - ): - n_lines += 1 + mbr_proportions = [] + mbr_names = [] + for j in range(n_mbrs): + n_lines = int(data[i][1]) + mbr_names.append(data[i][0].split("(")[1][:-1]) + mbr_proportions.append(data[i : i + n_lines]) + i += n_lines + logging.debug(mbr_proportions) + + formulation = data[i][0] + logging.debug(f"formulation: {formulation}") + i += 1 + n_ints = int((n_mbrs * (n_mbrs - 1.0)) / 2.0) + interactions = data[i : i + n_ints] + logging.debug(interactions) + + nonideal_entropies = False + nonideal_volumes = False + + We = [[0.0 for j in mbr_names[:-i]] for i in range(1, n_mbrs)] + Ws = [[0.0 for j in mbr_names[:-i]] for i in range(1, n_mbrs)] + Wv = [[0.0 for j in mbr_names[:-i]] for i in range(1, n_mbrs)] + for ints in interactions: + m = ints[0].split("(")[1].replace(")", "").split(",") + m0 = mbr_names.index(m[0]) + m1 = mbr_names.index(m[1]) + We[m0][m1 - m0 - 1] = float(ints[1]) * 1.0e3 + Ws[m0][m1 - m0 - 1] = -float(ints[2]) + Wv[m0][m1 - m0 - 1] = float(ints[3]) * 1.0e-5 + + if np.abs(Ws[m0][m1 - m0 - 1]) > 1.0e-10: + nonideal_entropies = True + if np.abs(Wv[m0][m1 - m0 - 1]) > 1.0e-10: + nonideal_volumes = True + + i += n_ints + + if formulation == "asf": + text_alphas = data[i : i + n_mbrs] + logging.debug(text_alphas) + i += n_mbrs + + Ae = [0.0 for i in range(n_mbrs)] + As = [0.0 for i in range(n_mbrs)] + Av = [0.0 for i in range(n_mbrs)] + for alpha in text_alphas: + try: + m = alpha[0].split("(")[1].replace(")", "").split(",")[0] + except IndexError: + m = alpha[0] + m0 = mbr_names.index(m) + Ae[m0] = float(alpha[1]) + As[m0] = -float(alpha[2]) + Av[m0] = float(alpha[3]) * 1.0e6 + + n_site_species = int(data[i][0]) + + logging.debug(f"Number of site species: {n_site_species}") + i += 1 + + site_fractions = [] + for j in range(n_site_species): + n_lines = int(data[i][1]) + site_fractions.append(data[i : i + n_lines]) + i += n_lines + + summed = 0.0 + sites = [[]] + for site_species_and_expression in site_fractions: + site_species = site_species_and_expression[0][0] + expression = site_species_and_expression + expression[0] = expression[0][2:] + expression = reverse_polish(expression) + summed += expression + summed = sympify(summed) + sites[-1].append(site_species) + if summed == 1: + summed = 0 + sites.append([]) + sites = sites[:-1] + site_species = {} + for n_site, site in enumerate(sites): + for species in site: + site_species[species] = n_site + n_sites = len(sites) + + endmember_site_fractions_and_checks = [] + for j in range(n_mbrs): + n_lines = 1 + while True: + if ( + data[i + n_lines][0] == "make" + or data[i + n_lines][0] == "delG(tran)" + or data[i + n_lines][0] == "check" + or data[i + n_lines][0] == "delG(od)" + or data[i + n_lines][0] == "delG(make)" + or data[i + n_lines][0] == "delG(mod)" + or data[i + n_lines][0] == "delG(rcal)" + or data[i + n_lines][0] == "DQF" + ): + n_lines += 1 + else: + break + endmember_site_fractions_and_checks.append(data[i : i + n_lines]) + i += n_lines + + mbr_initializations = [] + for f in endmember_site_fractions_and_checks: + mbr = f[0][0] + if len(f) == 1: + mbr = f"{mbr_dataset}.{mbr}()" + elif len(f) == 2: + mbr = f"{mbr_dataset}.{mbr}()" + assert f[1][0] == "check" else: - break - endmember_site_fractions_and_checks.append(data[i : i + n_lines]) - i += n_lines - - mbr_initializations = [] - for f in endmember_site_fractions_and_checks: - mbr = f[0][0] - if len(f) == 1: - mbr = f"{mbr_dataset}.{mbr}()" - elif len(f) == 2: - mbr = f"{mbr_dataset}.{mbr}()" - assert f[1][0] == "check" + make_idx = [g[0] for g in f].index("make") + make = f[make_idx][1:] + delG = [np.array(g[1:4], dtype=float) for g in f if "delG" in g[0]] + delG = np.array([0.0, 0.0, 0.0]) if len(delG) == 0 else delG[0] + delG *= [1.0e3, -1.0e3, 1.0e-5] + n_make = int(make[0]) + el = 1 + combined_mbrs = "[" + combined_amounts = "[" + for j in range(n_make): + if make[el] == "ordered": + el += 1 + m_string = make[el] + m_amount = float(parse_expr(make[el + 1])) + mineral = getattr(dataset, m_string)() + property_modifier = mineral.property_modifiers[0] + delG += ordering_modifier(property_modifier, True) * m_amount + combined_mbrs += f"{make[el]}_nood, " + noods.append(make[el]) + elif make[el] == "disordered": + el += 1 + m_string = make[el] + m_amount = float(parse_expr(make[el + 1])) + mineral = getattr(dataset, m_string)() + property_modifier = mineral.property_modifiers[0] + delG += ordering_modifier(property_modifier, False) * m_amount + combined_mbrs += f"{make[el]}_nood, " + noods.append(make[el]) + elif make[el] == "equilibrium": + el += 1 + combined_mbrs += f"{mbr_dataset}.{make[el]}(), " + else: + combined_mbrs += f"{mbr_dataset}.{make[el]}(), " + combined_amounts += f"{float(parse_expr(make[el+1]))}, " + el += 2 + combined_mbrs = combined_mbrs[:-2] + combined_amounts = combined_amounts[:-2] + combined_mbrs += "]" + combined_amounts += "]" + out_make += f'{mbr} = CombinedMineral({combined_mbrs}, {combined_amounts}, {list(delG)}, "{mbr}")\n' + n_occs = int(f[0][2]) + site_occ = [[] for ln in range(n_sites)] + site_occ_list = f[0][3:] + ss = [[] for idx in range(n_sites)] + site_amounts = [[] for idx in range(n_sites)] + for j in range(n_occs): + site_sp = site_occ_list[2 * j] + i_site = site_species[site_sp] + # rename for insertion into string + if site_sp[0] == "x": + site_sp = site_sp[1:] + site_sp = "".join(filter(str.isalpha, site_sp)).title() + + ss[i_site].append(site_sp) + site_amounts[i_site].append(parse_expr(site_occ_list[2 * j + 1])) + total_site_amounts = [sum(amounts) for amounts in site_amounts] + site_fractions = [ + [amount / total_site_amounts[j] for amount in amounts] + for j, amounts in enumerate(site_amounts) + ] + + site_formula = "" + for m, site in enumerate(ss): + site_formula += "[" + for n, species in enumerate(site): + site_formula += species + if site_fractions[m][n] != 1: + site_formula += str(site_fractions[m][n]) + site_formula += "]" + if str(total_site_amounts[m]) != "1": + site_formula += str(total_site_amounts[m]) + + mbr_initializations.append(f'[{mbr}, "{site_formula}"]') + + out_ss += f"class {name}(Solution):\n" + out_ss += " def __init__(self, molar_fractions=None):\n" + out_ss += f' self.name = "{name}"\n' + if formulation == "asf": + out_ss += " self.solution_model = AsymmetricRegularSolution(\n" else: - make_idx = [g[0] for g in f].index("make") - make = f[make_idx][1:] - delG = [np.array(g[1:4], dtype=float) for g in f if "delG" in g[0]] - delG = np.array([0.0, 0.0, 0.0]) if len(delG) == 0 else delG[0] - delG *= [1.0e3, -1.0e3, 1.0e-5] - n_make = int(make[0]) - el = 1 - combined_mbrs = "[" - combined_amounts = "[" - for j in range(n_make): - if make[el] == "ordered": - el += 1 - m_string = make[el] - m_amount = float(parse_expr(make[el + 1])) - mineral = getattr(dataset, m_string)() - property_modifier = mineral.property_modifiers[0] - delG += ordering_modifier(property_modifier, True) * m_amount - combined_mbrs += f"{make[el]}_nood, " - noods.append(make[el]) - elif make[el] == "disordered": - el += 1 - m_string = make[el] - m_amount = float(parse_expr(make[el + 1])) - mineral = getattr(dataset, m_string)() - property_modifier = mineral.property_modifiers[0] - delG += ordering_modifier(property_modifier, False) * m_amount - combined_mbrs += f"{make[el]}_nood, " - noods.append(make[el]) - elif make[el] == "equilibrium": - el += 1 - combined_mbrs += f"{mbr_dataset}.{make[el]}(), " - else: - combined_mbrs += f"{mbr_dataset}.{make[el]}(), " - combined_amounts += f"{float(parse_expr(make[el+1]))}, " - el += 2 - combined_mbrs = combined_mbrs[:-2] - combined_amounts = combined_amounts[:-2] - combined_mbrs += "]" - combined_amounts += "]" - out_make += f'{mbr} = CombinedMineral({combined_mbrs}, {combined_amounts}, {list(delG)}, "{mbr}")\n' - n_occs = int(f[0][2]) - site_occ = [[] for ln in range(n_sites)] - site_occ_list = f[0][3:] - ss = [[] for idx in range(n_sites)] - site_amounts = [[] for idx in range(n_sites)] - for j in range(n_occs): - site_sp = site_occ_list[2 * j] - i_site = site_species[site_sp] - # rename for insertion into string - if site_sp[0] == "x": - site_sp = site_sp[1:] - site_sp = "".join(filter(str.isalpha, site_sp)).title() - - ss[i_site].append(site_sp) - site_amounts[i_site].append(parse_expr(site_occ_list[2 * j + 1])) - total_site_amounts = [sum(amounts) for amounts in site_amounts] - site_fractions = [ - [amount / total_site_amounts[j] for amount in amounts] - for j, amounts in enumerate(site_amounts) - ] - - site_formula = "" - for m, site in enumerate(ss): - site_formula += "[" - for n, species in enumerate(site): - site_formula += species - if site_fractions[m][n] != 1: - site_formula += str(site_fractions[m][n]) - site_formula += "]" - if str(total_site_amounts[m]) != "1": - site_formula += str(total_site_amounts[m]) - - mbr_initializations.append(f'[{mbr}, "{site_formula}"]') - - out_ss += f"class {name}(Solution):\n" - out_ss += " def __init__(self, molar_fractions=None):\n" - out_ss += f' self.name = "{name}"\n' - if formulation == "asf": - out_ss += " self.solution_model = AsymmetricRegularSolution(\n" - else: - out_ss += " self.solution_model = SymmetricRegularSolution(\n" - out_ss += " endmembers=[\n" - for mbr_initialization in mbr_initializations: - out_ss += f" {mbr_initialization},\n" - out_ss += " ],\n" - if formulation == "asf": - out_ss += f" alphas={Ae},\n" - out_ss += f" energy_interaction={We},\n" - if nonideal_entropies: - out_ss += f" entropy_interaction={Ws},\n" - if nonideal_volumes: - out_ss += f" volume_interaction={Wv},\n" - - out_ss += " )\n" - out_ss += " Solution.__init__(self, molar_fractions=molar_fractions)\n\n" - - logging.debug(site_fractions) - logging.debug(endmember_site_fractions_and_checks) - logging.debug("") - - -out_noods = "" -noods = np.unique(sorted(noods)) -for nood in noods: - mineral = getattr(dataset, nood)() - params = mineral.params - out_noods += f"{nood}_nood = Mineral({params})\n\n" - -# Preamble -solution_dataset = solution_file.split("-")[-1].split(".")[0] -underline = "^" * len(solution_dataset) -preamble = ( - "# This file is part of BurnMan - a thermoelastic\n" - "# and thermodynamic toolkit for the Earth and Planetary Sciences\n" - f"# Copyright (C) 2012 - {current_year} by the BurnMan team, released under the GNU\n" - "# GPL v2 or later.\n" - "\n" - '"""\n' - f"{solution_dataset}\n" - f"{underline}\n" - "\n" - "HPx-eos solutions using endmembers from\n" - f"dataset {mbr_dataset}.\n" - "The values in this document are all in S.I. units,\n" - "unlike those in the original THERMOCALC file.\n" - "This file is autogenerated using process_HPX_eos.py\n" - '"""\n\n' - f"from numpy import array, nan\n" - f"from . import {mbr_dataset}\n" - "from ..classes.mineral import Mineral\n" - "from ..classes.solution import Solution\n" - "from ..classes.solutionmodel import SymmetricRegularSolution\n" - "from ..classes.solutionmodel import AsymmetricRegularSolution\n" - "from ..classes.combinedmineral import CombinedMineral\n\n" -) - - -print(preamble) -print(out_noods) -print(out_make) -print(out_ss) + out_ss += " self.solution_model = SymmetricRegularSolution(\n" + out_ss += " endmembers=[\n" + for mbr_initialization in mbr_initializations: + out_ss += f" {mbr_initialization},\n" + out_ss += " ],\n" + if formulation == "asf": + out_ss += f" alphas={Ae},\n" + out_ss += f" energy_interaction={We},\n" + if nonideal_entropies: + out_ss += f" entropy_interaction={Ws},\n" + if nonideal_volumes: + out_ss += f" volume_interaction={Wv},\n" + + out_ss += " )\n" + out_ss += " Solution.__init__(self, molar_fractions=molar_fractions)\n\n" + + logging.debug(site_fractions) + logging.debug(endmember_site_fractions_and_checks) + logging.debug("") + + out_noods = "" + noods = np.unique(sorted(noods)) + for nood in noods: + mineral = getattr(dataset, nood)() + params = mineral.params + out_noods += f"{nood}_nood = Mineral({params})\n\n" + + # Preamble + solution_dataset = solution_file.split("-")[-1].split(".")[0] + underline = "^" * len(solution_dataset) + preamble = ( + "# This file is part of BurnMan - a thermoelastic\n" + "# and thermodynamic toolkit for the Earth and Planetary Sciences\n" + f"# Copyright (C) 2012 - {current_year} by the BurnMan team, released under the GNU\n" + "# GPL v2 or later.\n" + "\n" + '"""\n' + f"{solution_dataset}\n" + f"{underline}\n" + "\n" + "HPx-eos solutions using endmembers from\n" + f"dataset {mbr_dataset}.\n" + "The values in this document are all in S.I. units,\n" + "unlike those in the original THERMOCALC file.\n" + "This file is autogenerated using process_HPX_eos.py\n" + '"""\n\n' + f"from numpy import array, nan\n" + f"from . import {mbr_dataset}\n" + "from ..classes.mineral import Mineral\n" + "from ..classes.solution import Solution\n" + "from ..classes.solutionmodel import SymmetricRegularSolution\n" + "from ..classes.solutionmodel import AsymmetricRegularSolution\n" + "from ..classes.combinedmineral import CombinedMineral\n\n" + ) + + output_string = f"{preamble}\n{out_noods}\n{out_make}\n{out_ss}" + + output_file = f"../../minerals/{solution_dataset}.py" + + with open(output_file, "w") as text_file: + print(f"from . import {solution_dataset}") + text_file.write(output_string) + +print("Copy the above to ../../minerals/__init__.py:") diff --git a/burnman/minerals/__init__.py b/burnman/minerals/__init__.py index 767c920c..0bb34632 100644 --- a/burnman/minerals/__init__.py +++ b/burnman/minerals/__init__.py @@ -54,6 +54,10 @@ from . import HGP_2018_ds633 from . import ig50NCKFMASHTOCr from . import ig50NCKFMASTOCr +from . import mb50NCKFMASHTO +from . import mp50KFMASH +from . import mp50MnNCKFMASHTO +from . import mp50NCKFMASHTO # Kurnosov et al. 2017 from . import KMFBZ_2017 diff --git a/burnman/minerals/mb50NCKFMASHTO.py b/burnman/minerals/mb50NCKFMASHTO.py new file mode 100644 index 00000000..38cd48f9 --- /dev/null +++ b/burnman/minerals/mb50NCKFMASHTO.py @@ -0,0 +1,708 @@ +# This file is part of BurnMan - a thermoelastic +# and thermodynamic toolkit for the Earth and Planetary Sciences +# Copyright (C) 2012 - 2024 by the BurnMan team, released under the GNU +# GPL v2 or later. + +""" +mb50NCKFMASHTO +^^^^^^^^^^^^^^ + +HPx-eos solutions using endmembers from +dataset HP_2011_ds62. +The values in this document are all in S.I. units, +unlike those in the original THERMOCALC file. +This file is autogenerated using process_HPX_eos.py +""" + +from numpy import array, nan +from . import HP_2011_ds62 +from ..classes.mineral import Mineral +from ..classes.solution import Solution +from ..classes.solutionmodel import SymmetricRegularSolution +from ..classes.solutionmodel import AsymmetricRegularSolution +from ..classes.combinedmineral import CombinedMineral + + +cats_nood = Mineral( + { + "name": "cats", + "formula": {"Al": 2.0, "Ca": 1.0, "O": 6.0, "Si": 1.0}, + "equation_of_state": "hp_tmt", + "H_0": -3310110.0, + "S_0": 135.0, + "V_0": 6.356e-05, + "Cp": [347.6, -0.006974, -1781600.0, -2757.5], + "a_0": 2.08e-05, + "K_0": 119200000000.0, + "Kprime_0": 5.19, + "Kdprime_0": -4.4e-11, + "n": 10.0, + "molar_mass": 0.2181229, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 533.4002006018054, + } +) + +hem_nood = Mineral( + { + "name": "hem", + "formula": {"Fe": 2.0, "O": 3.0}, + "equation_of_state": "hp_tmt", + "H_0": -825610.0, + "S_0": 87.4, + "V_0": 3.027e-05, + "Cp": [163.9, 0.0, -2257200.0, -657.6], + "a_0": 2.79e-05, + "K_0": 223000000000.0, + "Kprime_0": 4.04, + "Kdprime_0": -1.8e-11, + "n": 5.0, + "molar_mass": 0.1596882, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 444.6488294314381, + } +) + +ilm_nood = Mineral( + { + "name": "ilm", + "formula": {"Fe": 1.0, "O": 3.0, "Ti": 1.0}, + "equation_of_state": "hp_tmt", + "H_0": -1230450.0, + "S_0": 109.5, + "V_0": 3.169e-05, + "Cp": [138.9, 0.005081, -1288800.0, -463.7], + "a_0": 2.4e-05, + "K_0": 170000000000.0, + "Kprime_0": 8.3, + "Kdprime_0": -4.9e-11, + "n": 5.0, + "molar_mass": 0.1517102, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 375.2999294283698, + } +) + + +tsm = CombinedMineral([HP_2011_ds62.ts()], [1.0], [10000.0, -0.0, 0.0], "tsm") +prgm = CombinedMineral([HP_2011_ds62.parg()], [1.0], [-10000.0, -0.0, 0.0], "prgm") +glm = CombinedMineral([HP_2011_ds62.gl()], [1.0], [-3000.0, -0.0, 0.0], "glm") +grnm = CombinedMineral([HP_2011_ds62.grun()], [1.0], [-3000.0, -0.0, 0.0], "grnm") +a = CombinedMineral( + [HP_2011_ds62.cumm(), HP_2011_ds62.grun()], + [0.42857142857142855, 0.5714285714285714], + [-11200.0, -0.0, 0.0], + "a", +) +b = CombinedMineral( + [HP_2011_ds62.cumm(), HP_2011_ds62.grun()], + [0.2857142857142857, 0.7142857142857143], + [-13800.0, -0.0, 0.0], + "b", +) +mrb = CombinedMineral( + [HP_2011_ds62.gl(), HP_2011_ds62.gr(), HP_2011_ds62.andr()], + [1.0, -1.0, 1.0], + [0.0, -0.0, 0.0], + "mrb", +) +kprg = CombinedMineral( + [HP_2011_ds62.mu(), HP_2011_ds62.pa(), HP_2011_ds62.parg()], + [1.0, -1.0, 1.0], + [-7060.0, -20.0, 0.0], + "kprg", +) +tts = CombinedMineral( + [HP_2011_ds62.dsp(), HP_2011_ds62.ru(), HP_2011_ds62.ts()], + [-2.0, 2.0, 1.0], + [95000.0, -0.0, 0.0], + "tts", +) +cenh = CombinedMineral( + [HP_2011_ds62.en()], [1.0], [3500.0, 2.0, 4.800000000000001e-07], "cenh" +) +cfs = CombinedMineral( + [HP_2011_ds62.fs()], [1.0], [2100.0, 2.0, 4.5000000000000003e-07], "cfs" +) +jdm = CombinedMineral([HP_2011_ds62.jd()], [1.0], [2000.0, -0.0, 0.0], "jdm") +acmm = CombinedMineral([HP_2011_ds62.acm()], [1.0], [-5000.0, -0.0, 0.0], "acmm") +ocats = CombinedMineral([cats_nood], [1.0], [0.0, 0.0, 0.0], "ocats") +dcats = CombinedMineral( + [cats_nood], [1.0], [3800.0, 2.8815999999999997, 1.0000000000000001e-07], "dcats" +) +fmc = CombinedMineral( + [HP_2011_ds62.fs(), HP_2011_ds62.en()], + [0.5, 0.5], + [-1600.0, 2.0, 4.6500000000000005e-07], + "fmc", +) +acmm = CombinedMineral([HP_2011_ds62.acm()], [1.0], [-7000.0, -0.0, 0.0], "acmm") +om = CombinedMineral( + [HP_2011_ds62.jd(), HP_2011_ds62.di()], [0.5, 0.5], [-2900.0, -0.0, 0.0], "om" +) +cfm = CombinedMineral( + [HP_2011_ds62.di(), HP_2011_ds62.hed()], [0.5, 0.5], [-1500.0, -0.0, 0.0], "cfm" +) +jac = CombinedMineral( + [HP_2011_ds62.jd(), HP_2011_ds62.acm()], [0.5, 0.5], [-4500.0, -0.0, 0.0], "jac" +) +fm = CombinedMineral( + [HP_2011_ds62.en(), HP_2011_ds62.fs()], [0.5, 0.5], [-6600.0, -0.0, 0.0], "fm" +) +fopx = CombinedMineral( + [HP_2011_ds62.mgts(), HP_2011_ds62.gr(), HP_2011_ds62.andr()], + [1.0, -0.5, 0.5], + [2000.0, -0.0, 0.0], + "fopx", +) +odi = CombinedMineral( + [HP_2011_ds62.di()], [1.0], [-100.0, -0.211, 5.0000000000000004e-08], "odi" +) +kho = CombinedMineral( + [HP_2011_ds62.py(), HP_2011_ds62.gr(), HP_2011_ds62.andr()], + [1.0, -1.0, 1.0], + [27000.0, -0.0, 0.0], + "kho", +) +abm = CombinedMineral([HP_2011_ds62.ab()], [1.0], [-1746.0, -2.0, 0.0], "abm") +anm = CombinedMineral([HP_2011_ds62.an()], [1.0], [10000.0, -0.0, 0.0], "anm") +anC = CombinedMineral([HP_2011_ds62.an()], [1.0], [7030.0, 4.66, 0.0], "anC") +anC = CombinedMineral([HP_2011_ds62.an()], [1.0], [7030.0, 4.66, 0.0], "anC") +abhI = CombinedMineral([HP_2011_ds62.abh()], [1.0], [570.0, 4.12, 0.0], "abhI") +oilm = CombinedMineral( + [ilm_nood], + [1.0], + [1444.0572257227777, 1.5923196732102785, 1.836386612201713e-07], + "oilm", +) +dilm = CombinedMineral( + [ilm_nood], + [1.0], + [17044.35722572278, 13.118319673210278, 1.836386612201713e-07], + "dilm", +) +dhem = CombinedMineral( + [hem_nood], [1.0], [9522.770803030953, 12.937668369038724, 0.0], "dhem" +) +oilm = CombinedMineral( + [ilm_nood], + [1.0], + [1444.0572257227777, 1.5923196732102785, 1.836386612201713e-07], + "oilm", +) +dilm = CombinedMineral( + [ilm_nood], + [1.0], + [17044.35722572278, 13.118319673210278, 1.836386612201713e-07], + "dilm", +) +dhem = CombinedMineral( + [hem_nood], [1.0], [9522.770803030953, 12.937668369038724, 0.0], "dhem" +) +annm = CombinedMineral([HP_2011_ds62.ann()], [1.0], [-3000.0, -0.0, 0.0], "annm") +obi = CombinedMineral( + [HP_2011_ds62.ann(), HP_2011_ds62.phl()], + [0.3333333333333333, 0.6666666666666666], + [-3000.0, -0.0, 0.0], + "obi", +) +tbi = CombinedMineral( + [HP_2011_ds62.phl(), HP_2011_ds62.br(), HP_2011_ds62.ru()], + [1.0, -1.0, 1.0], + [55000.0, -0.0, 0.0], + "tbi", +) +fbi = CombinedMineral( + [HP_2011_ds62.east(), HP_2011_ds62.gr(), HP_2011_ds62.andr()], + [1.0, -0.5, 0.5], + [-3000.0, -0.0, 0.0], + "fbi", +) +mam = CombinedMineral([HP_2011_ds62.ma()], [1.0], [5000.0, -0.0, 0.0], "mam") +fmu = CombinedMineral( + [HP_2011_ds62.andr(), HP_2011_ds62.gr(), HP_2011_ds62.mu()], + [0.5, -0.5, 1.0], + [25000.0, -0.0, 0.0], + "fmu", +) +ochl1 = CombinedMineral( + [HP_2011_ds62.afchl(), HP_2011_ds62.clin(), HP_2011_ds62.daph()], + [1.0, -1.0, 1.0], + [3000.0, -0.0, 0.0], + "ochl1", +) +ochl4 = CombinedMineral( + [HP_2011_ds62.afchl(), HP_2011_ds62.clin(), HP_2011_ds62.daph()], + [1.0, -0.2, 0.2], + [2400.0, -0.0, 0.0], + "ochl4", +) +f3clin = CombinedMineral( + [HP_2011_ds62.clin(), HP_2011_ds62.gr(), HP_2011_ds62.andr()], + [1.0, -0.5, 0.5], + [2000.0, -0.0, 0.0], + "f3clin", +) + + +class hb(Solution): + def __init__(self, molar_fractions=None): + self.name = "hb" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.tr(), "[Va][Mgm]3[Mgm]2[Cam]2[Sit][Ohv]2"], + [tsm, "[Va][Mgm]3[Alm]2[Cam]2[Sit1/2Alt1/2][Ohv]2"], + [prgm, "[Naa][Mgm]3[Mgm1/2Alm1/2]2[Cam]2[Sit1/2Alt1/2][Ohv]2"], + [glm, "[Va][Mgm]3[Alm]2[Nam]2[Sit][Ohv]2"], + [HP_2011_ds62.cumm(), "[Va][Mgm]3[Mgm]2[Mgm]2[Sit][Ohv]2"], + [grnm, "[Va][Fem]3[Fem]2[Fem]2[Sit][Ohv]2"], + [a, "[Va][Mgm]3[Fem]2[Fem]2[Sit][Ohv]2"], + [b, "[Va][Fem]3[Mgm]2[Fem]2[Sit][Ohv]2"], + [mrb, "[Va][Mgm]3[Fem]2[Nam]2[Sit][Ohv]2"], + [kprg, "[Ka][Mgm]3[Mgm1/2Alm1/2]2[Cam]2[Sit1/2Alt1/2][Ohv]2"], + [tts, "[Va][Mgm]3[Tim]2[Cam]2[Sit1/2Alt1/2][Ov]2"], + ], + alphas=[1.0, 1.5, 1.7, 0.8, 1.0, 1.0, 1.0, 1.0, 0.8, 1.7, 1.5], + energy_interaction=[ + [ + 20000.0, + 25000.0, + 65000.0, + 45000.0, + 75000.0, + 57000.0, + 63000.0, + 52000.0, + 30000.0, + 85000.0, + ], + [ + -40000.0, + 25000.0, + 70000.0, + 80000.0, + 70000.0, + 72500.0, + 20000.0, + -40000.0, + 35000.0, + ], + [ + 50000.0, + 90000.0, + 106700.0, + 94800.0, + 94800.0, + 40000.0, + 8000.0, + 15000.0, + ], + [100000.0, 113500.0, 100000.0, 111200.0, 0.0, 54000.0, 75000.0], + [33000.0, 18000.0, 23000.0, 80000.0, 87000.0, 100000.0], + [12000.0, 8000.0, 91000.0, 96000.0, 65000.0], + [20000.0, 80000.0, 94000.0, 95000.0], + [90000.0, 94000.0, 95000.0], + [50000.0, 50000.0], + [35000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class aug(Solution): + def __init__(self, molar_fractions=None): + self.name = "aug" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.di(), "[Mgm][Cam][Sit]1/4[Sit]1/4"], + [cenh, "[Mgm][Mgm][Sit]1/4[Sit]1/4"], + [cfs, "[Fem][Fem][Sit]1/4[Sit]1/4"], + [jdm, "[Alm][Nam][Sit]1/4[Sit]1/4"], + [acmm, "[Fem][Nam][Sit]1/4[Sit]1/4"], + [ocats, "[Alm][Cam][Sit]1/4[Alt]1/4"], + [dcats, "[Alm][Cam][Sit1/2Alt1/2]1/4[Sit1/2Alt1/2]1/4"], + [fmc, "[Mgm][Fem][Sit]1/4[Sit]1/4"], + ], + alphas=[1.2, 1.0, 1.0, 1.2, 1.2, 1.9, 1.9, 1.0], + energy_interaction=[ + [29800.0, 25800.0, 26000.0, 21000.0, 12300.0, 12300.0, 20600.0], + [2300.0, 50000.0, 62000.0, 45700.0, 45700.0, 4000.0], + [60000.0, 58000.0, 48000.0, 48000.0, 3500.0], + [5000.0, 40000.0, 40000.0, 40000.0], + [35000.0, 35000.0, 60000.0], + [3800.0, 50000.0], + [50000.0], + ], + volume_interaction=[ + [ + -3.0000000000000004e-07, + -3.0000000000000004e-07, + 0.0, + 0.0, + -1.0000000000000001e-07, + -1.0000000000000001e-07, + -3.0000000000000004e-07, + ], + [0.0, 0.0, 0.0, -2.9e-06, -2.9e-06, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0], + [1.0000000000000001e-07, 0.0], + [0.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class dio(Solution): + def __init__(self, molar_fractions=None): + self.name = "dio" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.jd(), "[Almm]1/2[Alma]1/2[Namc]1/2[Namn]1/2"], + [HP_2011_ds62.di(), "[Mgmm]1/2[Mgma]1/2[Camc]1/2[Camn]1/2"], + [HP_2011_ds62.hed(), "[Femm]1/2[Fema]1/2[Camc]1/2[Camn]1/2"], + [acmm, "[Femm]1/2[Fema]1/2[Namc]1/2[Namn]1/2"], + [om, "[Mgmm]1/2[Alma]1/2[Camc]1/2[Namn]1/2"], + [cfm, "[Femm]1/2[Mgma]1/2[Camc]1/2[Camn]1/2"], + [jac, "[Almm]1/2[Fema]1/2[Namc]1/2[Namn]1/2"], + ], + energy_interaction=[ + [26000.0, 24000.0, 5000.0, 15500.0, 25200.0, 3000.0], + [4000.0, 21000.0, 15750.0, 2000.0, 24650.0], + [20800.0, 17200.0, 2000.0, 24600.0], + [16400.0, 22200.0, 3000.0], + [18450.0, 19500.0], + [24550.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class opx(Solution): + def __init__(self, molar_fractions=None): + self.name = "opx" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.en(), "[Mgm][Mgm][Sit]1/2"], + [HP_2011_ds62.fs(), "[Fem][Fem][Sit]1/2"], + [fm, "[Mgm][Fem][Sit]1/2"], + [HP_2011_ds62.mgts(), "[Alm][Mgm][Sit1/2Alt1/2]1/2"], + [fopx, "[Fem][Mgm][Sit1/2Alt1/2]1/2"], + [odi, "[Mgm][Cam][Sit]1/2"], + ], + alphas=[1.0, 1.0, 1.0, 1.0, 1.0, 1.2], + energy_interaction=[ + [7000.0, 4000.0, 13000.0, 11000.0, 32200.000000000004], + [4000.0, 13000.0, 11600.0, 25540.0], + [17000.0, 15000.0, 22540.0], + [1000.0, 75400.0], + [73400.0], + ], + volume_interaction=[ + [0.0, 0.0, -1.5e-06, -1.5e-06, 1.2000000000000002e-06], + [0.0, -1.5e-06, -1.5e-06, 8.400000000000001e-07], + [-1.5e-06, -1.5e-06, 8.400000000000001e-07], + [0.0, -9.4e-06], + [-9.4e-06], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class g(Solution): + def __init__(self, molar_fractions=None): + self.name = "g" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.py(), "[Mgx]3[Aly]2"], + [HP_2011_ds62.alm(), "[Fex]3[Aly]2"], + [HP_2011_ds62.gr(), "[Cax]3[Aly]2"], + [kho, "[Mgx]3[Fey]2"], + ], + alphas=[1.0, 1.0, 2.7, 1.0], + energy_interaction=[ + [2500.0, 31000.0, 5400.0], + [5000.0, 22600.0], + [-15300.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ol(Solution): + def __init__(self, molar_fractions=None): + self.name = "ol" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.fo(), "[Mgm]2"], + [HP_2011_ds62.fa(), "[Fem]2"], + ], + energy_interaction=[[9000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class pl4tr(Solution): + def __init__(self, molar_fractions=None): + self.name = "pl4tr" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.ab(), "[Naa][Altb1/4Sitb3/4]"], + [HP_2011_ds62.an(), "[Caa][Altb1/2Sitb1/2]"], + [HP_2011_ds62.san(), "[Ka][Altb1/4Sitb3/4]"], + ], + alphas=[0.674, 0.55, 1.0], + energy_interaction=[[14600.0, 24100.0], [48500.0]], + entropy_interaction=[[0.00935, 0.00957], [-0.0]], + volume_interaction=[ + [-4.0000000000000003e-07, 3.3800000000000007e-06], + [-1.3e-06], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class abc(Solution): + def __init__(self, molar_fractions=None): + self.name = "abc" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [abm, "[Naa]"], + [anm, "[Caa]"], + ], + alphas=[0.64, 1.0], + energy_interaction=[[3400.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class k4tr(Solution): + def __init__(self, molar_fractions=None): + self.name = "k4tr" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.ab(), "[Naa][Altb1/4Sitb3/4]"], + [HP_2011_ds62.an(), "[Caa][Altb1/2Sitb1/2]"], + [HP_2011_ds62.san(), "[Ka][Altb1/4Sitb3/4]"], + ], + alphas=[0.674, 0.55, 1.0], + energy_interaction=[[14600.0, 24100.0], [48500.0]], + entropy_interaction=[[0.00935, 0.00957], [-0.0]], + volume_interaction=[ + [-4.0000000000000003e-07, 3.3800000000000007e-06], + [-1.3e-06], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ksp(Solution): + def __init__(self, molar_fractions=None): + self.name = "ksp" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.san(), "[K]"], + [HP_2011_ds62.abh(), "[Na]"], + [anC, "[Ca]"], + ], + alphas=[1.0, 0.643, 1.0], + energy_interaction=[[25100.0, 40000.0], [3100.0]], + entropy_interaction=[[0.0108, -0.0], [-0.0]], + volume_interaction=[[3.3800000000000007e-06, 0.0], [0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class plc(Solution): + def __init__(self, molar_fractions=None): + self.name = "plc" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.abh(), "[Na]"], + [anC, "[Ca]"], + [HP_2011_ds62.san(), "[K]"], + ], + alphas=[0.643, 1.0, 1.0], + energy_interaction=[[3100.0, 25100.0], [40000.0]], + entropy_interaction=[[-0.0, 0.0108], [-0.0]], + volume_interaction=[[0.0, 3.3800000000000007e-06], [0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class pli(Solution): + def __init__(self, molar_fractions=None): + self.name = "pli" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [abhI, "[Na]"], + [HP_2011_ds62.an(), "[Ca]"], + [HP_2011_ds62.san(), "[K]"], + ], + alphas=[0.643, 1.0, 1.0], + energy_interaction=[[15000.0, 25100.0], [40000.0]], + entropy_interaction=[[-0.0, 0.0108], [-0.0]], + volume_interaction=[[0.0, 3.3800000000000007e-06], [0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class sp(Solution): + def __init__(self, molar_fractions=None): + self.name = "sp" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.herc(), "[Al][Fe]"], + [HP_2011_ds62.sp(), "[Al][Mg]"], + [HP_2011_ds62.mt(), "[Fe][Fe]"], + [HP_2011_ds62.usp(), "[Ti][Fe]"], + ], + energy_interaction=[[0.0, 18500.0, 27000.0], [40000.0, 30000.0], [0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ilm(Solution): + def __init__(self, molar_fractions=None): + self.name = "ilm" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [oilm, "[Fea][Tib]"], + [dilm, "[Fea1/2Tia1/2][Feb1/2Tib1/2]"], + [dhem, "[Fea][Feb]"], + ], + energy_interaction=[[15600.0, 26600.0], [11000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ilmm(Solution): + def __init__(self, molar_fractions=None): + self.name = "ilmm" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [oilm, "[Fea][Tib]"], + [dilm, "[Fea1/2Tia1/2][Feb1/2Tib1/2]"], + [dhem, "[Fea][Feb]"], + [HP_2011_ds62.geik(), "[Mga][Tib]"], + ], + energy_interaction=[ + [15600.0, 26600.0, 4000.0], + [11000.0, 4000.0], + [36000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ep(Solution): + def __init__(self, molar_fractions=None): + self.name = "ep" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.cz(), "[Alm][Alm]"], + [HP_2011_ds62.ep(), "[Alm][Fem]"], + [HP_2011_ds62.fep(), "[Fem][Fem]"], + ], + energy_interaction=[[1000.0, 3000.0], [1000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class bi(Solution): + def __init__(self, molar_fractions=None): + self.name = "bi" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.phl(), "[Mgm][Mgm]2[Sit1/2Alt1/2]2[Ohv]2"], + [annm, "[Fem][Fem]2[Sit1/2Alt1/2]2[Ohv]2"], + [obi, "[Fem][Mgm]2[Sit1/2Alt1/2]2[Ohv]2"], + [HP_2011_ds62.east(), "[Alm][Mgm]2[Alt]2[Ohv]2"], + [tbi, "[Tim][Mgm]2[Sit1/2Alt1/2]2[Ov]2"], + [fbi, "[Fem][Mgm]2[Alt]2[Ohv]2"], + ], + energy_interaction=[ + [12000.0, 4000.0, 10000.0, 30000.0, 8000.0], + [8000.0, 15000.0, 32000.0, 13600.0], + [7000.0, 24000.0, 5600.0], + [40000.0, 1000.0], + [40000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class mu(Solution): + def __init__(self, molar_fractions=None): + self.name = "mu" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.mu(), "[Ka][Alma][Almb][Sit1/2Alt1/2]2"], + [HP_2011_ds62.cel(), "[Ka][Mgma][Almb][Sit]2"], + [HP_2011_ds62.fcel(), "[Ka][Fema][Almb][Sit]2"], + [HP_2011_ds62.pa(), "[Naa][Alma][Almb][Sit1/2Alt1/2]2"], + [mam, "[Caa][Alma][Almb][Alt]2"], + [fmu, "[Ka][Alma][Femb][Sit1/2Alt1/2]2"], + ], + alphas=[0.63, 0.63, 0.63, 0.37, 0.63, 0.63], + energy_interaction=[ + [0.0, 0.0, 10120.0, 35000.0, 0.0], + [0.0, 45000.0, 50000.0, 0.0], + [45000.0, 50000.0, 0.0], + [15000.0, 30000.0], + [35000.0], + ], + entropy_interaction=[ + [-0.0, -0.0, -0.0034, -0.0, -0.0], + [-0.0, -0.0, -0.0, -0.0], + [-0.0, -0.0, -0.0], + [-0.0, -0.0], + [-0.0], + ], + volume_interaction=[ + [2.0000000000000003e-06, 2.0000000000000003e-06, 3.53e-06, 0.0, 0.0], + [0.0, 2.5e-06, 0.0, 0.0], + [2.5e-06, 0.0, 0.0], + [0.0, 0.0], + [0.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class chl(Solution): + def __init__(self, molar_fractions=None): + self.name = "chl" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.clin(), "[Mgm][Mgm]4[Alm][Sit1/2Alt1/2]2"], + [HP_2011_ds62.afchl(), "[Mgm][Mgm]4[Mgm][Sit]2"], + [HP_2011_ds62.ames(), "[Alm][Mgm]4[Alm][Alt]2"], + [HP_2011_ds62.daph(), "[Fem][Fem]4[Alm][Sit1/2Alt1/2]2"], + [ochl1, "[Mgm][Fem]4[Fem][Sit]2"], + [ochl4, "[Fem][Mgm]4[Mgm][Sit]2"], + [f3clin, "[Mgm][Mgm]4[Fem][Sit1/2Alt1/2]2"], + ], + energy_interaction=[ + [17000.0, 17000.0, 20000.0, 30000.0, 21000.0, 2000.0], + [16000.0, 37000.0, 20000.0, 4000.0, 15000.0], + [30000.0, 29000.0, 13000.0, 19000.0], + [18000.0, 33000.0, 22000.0], + [24000.0, 28600.0], + [19000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) diff --git a/burnman/minerals/mp50KFMASH.py b/burnman/minerals/mp50KFMASH.py new file mode 100644 index 00000000..11b49bc4 --- /dev/null +++ b/burnman/minerals/mp50KFMASH.py @@ -0,0 +1,226 @@ +# This file is part of BurnMan - a thermoelastic +# and thermodynamic toolkit for the Earth and Planetary Sciences +# Copyright (C) 2012 - 2024 by the BurnMan team, released under the GNU +# GPL v2 or later. + +""" +mp50KFMASH +^^^^^^^^^^ + +HPx-eos solutions using endmembers from +dataset HP_2011_ds62. +The values in this document are all in S.I. units, +unlike those in the original THERMOCALC file. +This file is autogenerated using process_HPX_eos.py +""" + +from numpy import array, nan +from . import HP_2011_ds62 +from ..classes.mineral import Mineral +from ..classes.solution import Solution +from ..classes.solutionmodel import SymmetricRegularSolution +from ..classes.solutionmodel import AsymmetricRegularSolution +from ..classes.combinedmineral import CombinedMineral + + +annm = CombinedMineral([HP_2011_ds62.ann()], [1.0], [-3000.0, -0.0, 0.0], "annm") +obi = CombinedMineral( + [HP_2011_ds62.ann(), HP_2011_ds62.phl()], + [0.3333333333333333, 0.6666666666666666], + [-3000.0, -0.0, 0.0], + "obi", +) +fm = CombinedMineral( + [HP_2011_ds62.en(), HP_2011_ds62.fs()], [0.5, 0.5], [-6600.0, -0.0, 0.0], "fm" +) +fspm = CombinedMineral([HP_2011_ds62.fspr()], [1.0], [-2000.0, -0.0, 0.0], "fspm") +spro = CombinedMineral( + [HP_2011_ds62.fspr(), HP_2011_ds62.spr4()], + [0.75, 0.25], + [-3500.0, -0.0, 0.0], + "spro", +) +mstm = CombinedMineral([HP_2011_ds62.mst()], [1.0], [0.0, -0.0, 0.0], "mstm") +ochl1 = CombinedMineral( + [HP_2011_ds62.afchl(), HP_2011_ds62.clin(), HP_2011_ds62.daph()], + [1.0, -1.0, 1.0], + [3000.0, -0.0, 0.0], + "ochl1", +) +ochl4 = CombinedMineral( + [HP_2011_ds62.afchl(), HP_2011_ds62.clin(), HP_2011_ds62.daph()], + [1.0, -0.2, 0.2], + [2400.0, -0.0, 0.0], + "ochl4", +) + + +class g(Solution): + def __init__(self, molar_fractions=None): + self.name = "g" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.py(), "[Mgx]3"], + [HP_2011_ds62.alm(), "[Fex]3"], + ], + energy_interaction=[[2500.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class mu(Solution): + def __init__(self, molar_fractions=None): + self.name = "mu" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.mu(), "[Alma][Sit1/2Alt1/2]2"], + [HP_2011_ds62.cel(), "[Mgma][Sit]2"], + [HP_2011_ds62.fcel(), "[Fema][Sit]2"], + ], + alphas=[0.63, 0.63, 0.63], + energy_interaction=[[0.0, 0.0], [0.0]], + volume_interaction=[ + [2.0000000000000003e-06, 2.0000000000000003e-06], + [0.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class bi(Solution): + def __init__(self, molar_fractions=None): + self.name = "bi" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.phl(), "[Mgm][Mgm]2[Sit1/2Alt1/2]2"], + [annm, "[Fem][Fem]2[Sit1/2Alt1/2]2"], + [obi, "[Fem][Mgm]2[Sit1/2Alt1/2]2"], + [HP_2011_ds62.east(), "[Alm][Mgm]2[Alt]2"], + ], + energy_interaction=[ + [12000.0, 4000.0, 10000.0], + [8000.0, 15000.0], + [7000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class opx(Solution): + def __init__(self, molar_fractions=None): + self.name = "opx" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.en(), "[Mgm][Mgm][Sit]1/2"], + [HP_2011_ds62.fs(), "[Fem][Fem][Sit]1/2"], + [fm, "[Mgm][Fem][Sit]1/2"], + [HP_2011_ds62.mgts(), "[Alm][Mgm][Alt1/2Sit1/2]1/2"], + ], + energy_interaction=[ + [7000.0, 4000.0, 13000.0], + [4000.0, 13000.0], + [17000.0], + ], + volume_interaction=[[0.0, 0.0, -1.5e-06], [0.0, -1.5e-06], [-1.5e-06]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class sa(Solution): + def __init__(self, molar_fractions=None): + self.name = "sa" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.spr4(), "[Mgm][Mgm]3[Sit]"], + [HP_2011_ds62.spr5(), "[Alm][Mgm]3[Alt]"], + [fspm, "[Fem][Fem]3[Sit]"], + [spro, "[Mgm][Fem]3[Sit]"], + ], + energy_interaction=[ + [10000.0, 16000.0, 12000.0], + [19000.0, 22000.0], + [4000.0], + ], + volume_interaction=[ + [-2.0000000000000002e-07, 0.0, 0.0], + [-2.0000000000000002e-07, -2.0000000000000002e-07], + [0.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class cd(Solution): + def __init__(self, molar_fractions=None): + self.name = "cd" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.crd(), "[Mgx]2[Vh]"], + [HP_2011_ds62.fcrd(), "[Fex]2[Vh]"], + [HP_2011_ds62.hcrd(), "[Mgx]2[Hoh]"], + ], + energy_interaction=[[8000.0, 0.0], [9000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class st(Solution): + def __init__(self, molar_fractions=None): + self.name = "st" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [mstm, "[Mgx]4"], + [HP_2011_ds62.fst(), "[Fex]4"], + ], + energy_interaction=[[16000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class chl(Solution): + def __init__(self, molar_fractions=None): + self.name = "chl" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.clin(), "[Mgm][Mgm]4[Alm][Sit1/2Alt1/2]2"], + [HP_2011_ds62.afchl(), "[Mgm][Mgm]4[Mgm][Sit]2"], + [HP_2011_ds62.ames(), "[Alm][Mgm]4[Alm][Alt]2"], + [HP_2011_ds62.daph(), "[Fem][Fem]4[Alm][Sit1/2Alt1/2]2"], + [ochl1, "[Mgm][Fem]4[Fem][Sit]2"], + [ochl4, "[Fem][Mgm]4[Mgm][Sit]2"], + ], + energy_interaction=[ + [17000.0, 17000.0, 20000.0, 30000.0, 21000.0], + [16000.0, 37000.0, 20000.0, 4000.0], + [30000.0, 29000.0, 13000.0], + [18000.0, 33000.0], + [24000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ctd(Solution): + def __init__(self, molar_fractions=None): + self.name = "ctd" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.mctd(), "[Mgmb]"], + [HP_2011_ds62.fctd(), "[Femb]"], + ], + energy_interaction=[[4000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class sp1(Solution): + def __init__(self, molar_fractions=None): + self.name = "sp1" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.herc(), "[Fea]"], + [HP_2011_ds62.sp(), "[Mga]"], + ], + energy_interaction=[[0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) diff --git a/burnman/minerals/mp50MnNCKFMASHTO.py b/burnman/minerals/mp50MnNCKFMASHTO.py new file mode 100644 index 00000000..91bee52f --- /dev/null +++ b/burnman/minerals/mp50MnNCKFMASHTO.py @@ -0,0 +1,660 @@ +# This file is part of BurnMan - a thermoelastic +# and thermodynamic toolkit for the Earth and Planetary Sciences +# Copyright (C) 2012 - 2024 by the BurnMan team, released under the GNU +# GPL v2 or later. + +""" +mp50MnNCKFMASHTO +^^^^^^^^^^^^^^^^ + +HPx-eos solutions using endmembers from +dataset HP_2011_ds62. +The values in this document are all in S.I. units, +unlike those in the original THERMOCALC file. +This file is autogenerated using process_HPX_eos.py +""" + +from numpy import array, nan +from . import HP_2011_ds62 +from ..classes.mineral import Mineral +from ..classes.solution import Solution +from ..classes.solutionmodel import SymmetricRegularSolution +from ..classes.solutionmodel import AsymmetricRegularSolution +from ..classes.combinedmineral import CombinedMineral + + +hem_nood = Mineral( + { + "name": "hem", + "formula": {"Fe": 2.0, "O": 3.0}, + "equation_of_state": "hp_tmt", + "H_0": -825610.0, + "S_0": 87.4, + "V_0": 3.027e-05, + "Cp": [163.9, 0.0, -2257200.0, -657.6], + "a_0": 2.79e-05, + "K_0": 223000000000.0, + "Kprime_0": 4.04, + "Kdprime_0": -1.8e-11, + "n": 5.0, + "molar_mass": 0.1596882, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 444.6488294314381, + } +) + +ilm_nood = Mineral( + { + "name": "ilm", + "formula": {"Fe": 1.0, "O": 3.0, "Ti": 1.0}, + "equation_of_state": "hp_tmt", + "H_0": -1230450.0, + "S_0": 109.5, + "V_0": 3.169e-05, + "Cp": [138.9, 0.005081, -1288800.0, -463.7], + "a_0": 2.4e-05, + "K_0": 170000000000.0, + "Kprime_0": 8.3, + "Kdprime_0": -4.9e-11, + "n": 5.0, + "molar_mass": 0.1517102, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 375.2999294283698, + } +) + +mt_nood = Mineral( + { + "name": "mt", + "formula": {"Fe": 3.0, "O": 4.0}, + "equation_of_state": "hp_tmt", + "H_0": -1114500.0, + "S_0": 146.9, + "V_0": 4.452e-05, + "Cp": [262.5, -0.007205, -1926200.0, -1655.7], + "a_0": 3.71e-05, + "K_0": 185700000000.0, + "Kprime_0": 4.05, + "Kdprime_0": -2.2e-11, + "n": 7.0, + "molar_mass": 0.2315326, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 387.81123033649334, + } +) + + +kho = CombinedMineral( + [HP_2011_ds62.py(), HP_2011_ds62.gr(), HP_2011_ds62.andr()], + [1.0, -1.0, 1.0], + [27000.0, -0.0, 0.0], + "kho", +) +anC = CombinedMineral([HP_2011_ds62.an()], [1.0], [7030.0, 4.66, 0.0], "anC") +anC = CombinedMineral([HP_2011_ds62.an()], [1.0], [7030.0, 4.66, 0.0], "anC") +mut = CombinedMineral([HP_2011_ds62.mu()], [1.0], [1000.0, -0.0, 0.0], "mut") +celt = CombinedMineral([HP_2011_ds62.cel()], [1.0], [5000.0, -0.0, 0.0], "celt") +fcelt = CombinedMineral([HP_2011_ds62.fcel()], [1.0], [5000.0, -0.0, 0.0], "fcelt") +pat = CombinedMineral([HP_2011_ds62.pa()], [1.0], [4000.0, -0.0, 0.0], "pat") +fmu = CombinedMineral( + [HP_2011_ds62.mu(), HP_2011_ds62.gr(), HP_2011_ds62.andr()], + [1.0, -0.5, 0.5], + [25000.0, -0.0, 0.0], + "fmu", +) +mat = CombinedMineral([HP_2011_ds62.ma()], [1.0], [5000.0, -0.0, 0.0], "mat") +fmu = CombinedMineral( + [HP_2011_ds62.andr(), HP_2011_ds62.gr(), HP_2011_ds62.mu()], + [0.5, -0.5, 1.0], + [25000.0, -0.0, 0.0], + "fmu", +) +annm = CombinedMineral([HP_2011_ds62.ann()], [1.0], [-3000.0, -0.0, 0.0], "annm") +obi = CombinedMineral( + [HP_2011_ds62.ann(), HP_2011_ds62.phl()], + [0.3333333333333333, 0.6666666666666666], + [-3000.0, -0.0, 0.0], + "obi", +) +tbi = CombinedMineral( + [HP_2011_ds62.phl(), HP_2011_ds62.br(), HP_2011_ds62.ru()], + [1.0, -1.0, 1.0], + [55000.0, -0.0, 0.0], + "tbi", +) +fbi = CombinedMineral( + [HP_2011_ds62.east(), HP_2011_ds62.gr(), HP_2011_ds62.andr()], + [1.0, -0.5, 0.5], + [-3000.0, -0.0, 0.0], + "fbi", +) +mmbi = CombinedMineral([HP_2011_ds62.mnbi()], [1.0], [-7890.0, -0.0, 0.0], "mmbi") +fm = CombinedMineral( + [HP_2011_ds62.en(), HP_2011_ds62.fs()], [0.5, 0.5], [-6600.0, -0.0, 0.0], "fm" +) +fopx = CombinedMineral( + [HP_2011_ds62.mgts(), HP_2011_ds62.gr(), HP_2011_ds62.andr()], + [1.0, -0.5, 0.5], + [2000.0, -0.0, 0.0], + "fopx", +) +mnopx = CombinedMineral([HP_2011_ds62.pxmn()], [2.0], [6680.0, -0.0, 0.0], "mnopx") +odi = CombinedMineral( + [HP_2011_ds62.di()], [1.0], [-100.0, -0.211, 5.0000000000000004e-08], "odi" +) +fspm = CombinedMineral([HP_2011_ds62.fspr()], [1.0], [-2000.0, -0.0, 0.0], "fspm") +spro = CombinedMineral( + [HP_2011_ds62.fspr(), HP_2011_ds62.spr4()], + [0.75, 0.25], + [-3500.0, -0.0, 0.0], + "spro", +) +ospr = CombinedMineral( + [HP_2011_ds62.andr(), HP_2011_ds62.gr(), HP_2011_ds62.spr5()], + [0.5, -0.5, 1.0], + [-16000.0, -0.0, 0.0], + "ospr", +) +mncd = CombinedMineral([HP_2011_ds62.mncrd()], [1.0], [-4210.0, -0.0, 0.0], "mncd") +mstm = CombinedMineral([HP_2011_ds62.mst()], [1.0], [-8000.0, -0.0, 0.0], "mstm") +mnstm = CombinedMineral([HP_2011_ds62.mnst()], [1.0], [-190.0, -0.0, 0.0], "mnstm") +msto = CombinedMineral( + [HP_2011_ds62.mst(), HP_2011_ds62.gr(), HP_2011_ds62.andr()], + [1.0, -1.0, 1.0], + [9000.0, -0.0, 0.0], + "msto", +) +mstt = CombinedMineral( + [HP_2011_ds62.mst(), HP_2011_ds62.cor(), HP_2011_ds62.ru()], + [1.0, -1.0, 1.5], + [13000.0, -0.0, 0.0], + "mstt", +) +ochl1 = CombinedMineral( + [HP_2011_ds62.afchl(), HP_2011_ds62.clin(), HP_2011_ds62.daph()], + [1.0, -1.0, 1.0], + [3000.0, -0.0, 0.0], + "ochl1", +) +ochl4 = CombinedMineral( + [HP_2011_ds62.afchl(), HP_2011_ds62.clin(), HP_2011_ds62.daph()], + [1.0, -0.2, 0.2], + [2400.0, -0.0, 0.0], + "ochl4", +) +f3clin = CombinedMineral( + [HP_2011_ds62.clin(), HP_2011_ds62.gr(), HP_2011_ds62.andr()], + [1.0, -0.5, 0.5], + [2000.0, -0.0, 0.0], + "f3clin", +) +mmchl = CombinedMineral([HP_2011_ds62.mnchl()], [1.0], [-5670.0, -0.0, 0.0], "mmchl") +mnct = CombinedMineral([HP_2011_ds62.mnctd()], [1.0], [660.0, -0.0, 0.0], "mnct") +ctdo = CombinedMineral( + [HP_2011_ds62.mctd(), HP_2011_ds62.andr(), HP_2011_ds62.gr()], + [1.0, 0.25, -0.25], + [13500.0, -0.0, 0.0], + "ctdo", +) +oilm = CombinedMineral( + [ilm_nood], + [1.0], + [1444.0572257227777, 1.5923196732102785, 1.836386612201713e-07], + "oilm", +) +dilm = CombinedMineral( + [ilm_nood], + [1.0], + [17044.35722572278, 13.118319673210278, 1.836386612201713e-07], + "dilm", +) +dhem = CombinedMineral( + [hem_nood], [1.0], [9522.770803030953, 12.937668369038724, 0.0], "dhem" +) +oilm = CombinedMineral( + [ilm_nood], + [1.0], + [1444.0572257227777, 1.5923196732102785, 1.836386612201713e-07], + "oilm", +) +dilm = CombinedMineral( + [ilm_nood], + [1.0], + [17044.35722572278, 13.118319673210278, 1.836386612201713e-07], + "dilm", +) +dhem = CombinedMineral( + [hem_nood], [1.0], [9522.770803030953, 12.937668369038724, 0.0], "dhem" +) +imt = CombinedMineral( + [mt_nood], [1.0], [16874.42602715333, 25.01732526713637, 0.0], "imt" +) +dmt = CombinedMineral( + [mt_nood], [1.0], [20064.42602715333, 29.36782526713637, 0.0], "dmt" +) + + +class g(Solution): + def __init__(self, molar_fractions=None): + self.name = "g" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.py(), "[Mgx]3[Aly]2"], + [HP_2011_ds62.alm(), "[Fex]3[Aly]2"], + [HP_2011_ds62.spss(), "[Mnx]3[Aly]2"], + [HP_2011_ds62.gr(), "[Cax]3[Aly]2"], + [kho, "[Mgx]3[Fey]2"], + ], + alphas=[1.0, 1.0, 1.0, 2.7, 1.0], + energy_interaction=[ + [2500.0, 2000.0, 31000.0, 5400.0], + [2000.0, 5000.0, 22600.0], + [0.0, 29400.0], + [-15300.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class pl4tr(Solution): + def __init__(self, molar_fractions=None): + self.name = "pl4tr" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.ab(), "[Naa][Altb1/4Sitb3/4]"], + [HP_2011_ds62.an(), "[Caa][Altb1/2Sitb1/2]"], + [HP_2011_ds62.san(), "[Ka][Altb1/4Sitb3/4]"], + ], + alphas=[0.674, 0.55, 1.0], + energy_interaction=[[14600.0, 24100.0], [48500.0]], + entropy_interaction=[[0.00935, 0.00957], [-0.0]], + volume_interaction=[ + [-4.0000000000000003e-07, 3.3800000000000007e-06], + [-1.3e-06], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class k4tr(Solution): + def __init__(self, molar_fractions=None): + self.name = "k4tr" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.ab(), "[Naa][Altb1/4Sitb3/4]"], + [HP_2011_ds62.an(), "[Caa][Altb1/2Sitb1/2]"], + [HP_2011_ds62.san(), "[Ka][Altb1/4Sitb3/4]"], + ], + alphas=[0.674, 0.55, 1.0], + energy_interaction=[[14600.0, 24100.0], [48500.0]], + entropy_interaction=[[0.00935, 0.00957], [-0.0]], + volume_interaction=[ + [-4.0000000000000003e-07, 3.3800000000000007e-06], + [-1.3e-06], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class plc(Solution): + def __init__(self, molar_fractions=None): + self.name = "plc" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.abh(), "[Na]"], + [anC, "[Ca]"], + [HP_2011_ds62.san(), "[K]"], + ], + alphas=[0.643, 1.0, 1.0], + energy_interaction=[[3100.0, 25100.0], [40000.0]], + entropy_interaction=[[-0.0, 0.0108], [-0.0]], + volume_interaction=[[0.0, 3.3800000000000007e-06], [0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ksp(Solution): + def __init__(self, molar_fractions=None): + self.name = "ksp" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.san(), "[K]"], + [HP_2011_ds62.abh(), "[Na]"], + [anC, "[Ca]"], + ], + alphas=[1.0, 0.643, 1.0], + energy_interaction=[[25100.0, 40000.0], [3100.0]], + entropy_interaction=[[0.0108, -0.0], [-0.0]], + volume_interaction=[[3.3800000000000007e-06, 0.0], [0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ep(Solution): + def __init__(self, molar_fractions=None): + self.name = "ep" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.cz(), "[Alm][Alm]"], + [HP_2011_ds62.ep(), "[Alm][Fem]"], + [HP_2011_ds62.fep(), "[Fem][Fem]"], + ], + energy_interaction=[[1000.0, 3000.0], [1000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ma(Solution): + def __init__(self, molar_fractions=None): + self.name = "ma" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [mut, "[Ka][Alma][Almb][Sit1/2Alt1/2]2"], + [celt, "[Ka][Mgma][Almb][Sit]2"], + [fcelt, "[Ka][Fema][Almb][Sit]2"], + [pat, "[Naa][Alma][Almb][Sit1/2Alt1/2]2"], + [HP_2011_ds62.ma(), "[Caa][Alma][Almb][Alt]2"], + [fmu, "[Ka][Alma][Femb][Sit1/2Alt1/2]2"], + ], + alphas=[0.63, 0.63, 0.63, 0.37, 0.63, 0.63], + energy_interaction=[ + [0.0, 0.0, 10120.0, 34000.0, 0.0], + [0.0, 45000.0, 50000.0, 0.0], + [45000.0, 50000.0, 0.0], + [18000.0, 30000.0], + [35000.0], + ], + entropy_interaction=[ + [-0.0, -0.0, -0.0034, -0.0, -0.0], + [-0.0, -0.0, -0.0, -0.0], + [-0.0, -0.0, -0.0], + [-0.0, -0.0], + [-0.0], + ], + volume_interaction=[ + [2.0000000000000003e-06, 2.0000000000000003e-06, 3.53e-06, 0.0, 0.0], + [0.0, 2.5e-06, 0.0, 0.0], + [2.5e-06, 0.0, 0.0], + [0.0, 0.0], + [0.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class mu(Solution): + def __init__(self, molar_fractions=None): + self.name = "mu" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.mu(), "[Ka][Alma][Almb][Sit1/2Alt1/2]2"], + [HP_2011_ds62.cel(), "[Ka][Mgma][Almb][Sit]2"], + [HP_2011_ds62.fcel(), "[Ka][Fema][Almb][Sit]2"], + [HP_2011_ds62.pa(), "[Naa][Alma][Almb][Sit1/2Alt1/2]2"], + [mat, "[Caa][Alma][Almb][Alt]2"], + [fmu, "[Ka][Alma][Femb][Sit1/2Alt1/2]2"], + ], + alphas=[0.63, 0.63, 0.63, 0.37, 0.63, 0.63], + energy_interaction=[ + [0.0, 0.0, 10120.0, 35000.0, 0.0], + [0.0, 45000.0, 50000.0, 0.0], + [45000.0, 50000.0, 0.0], + [15000.0, 30000.0], + [35000.0], + ], + entropy_interaction=[ + [-0.0, -0.0, -0.0034, -0.0, -0.0], + [-0.0, -0.0, -0.0, -0.0], + [-0.0, -0.0, -0.0], + [-0.0, -0.0], + [-0.0], + ], + volume_interaction=[ + [2.0000000000000003e-06, 2.0000000000000003e-06, 3.53e-06, 0.0, 0.0], + [0.0, 2.5e-06, 0.0, 0.0], + [2.5e-06, 0.0, 0.0], + [0.0, 0.0], + [0.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class bi(Solution): + def __init__(self, molar_fractions=None): + self.name = "bi" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.phl(), "[Mgm][Mgm]2[Sit1/2Alt1/2]2[Ohv]2"], + [annm, "[Fem][Fem]2[Sit1/2Alt1/2]2[Ohv]2"], + [obi, "[Fem][Mgm]2[Sit1/2Alt1/2]2[Ohv]2"], + [HP_2011_ds62.east(), "[Alm][Mgm]2[Alt]2[Ohv]2"], + [tbi, "[Tim][Mgm]2[Sit1/2Alt1/2]2[Ov]2"], + [fbi, "[Fem][Mgm]2[Alt]2[Ohv]2"], + [mmbi, "[Mnm][Mnm]2[Sit1/2Alt1/2]2[Ohv]2"], + ], + energy_interaction=[ + [12000.0, 4000.0, 10000.0, 30000.0, 8000.0, 9000.0], + [8000.0, 15000.0, 32000.0, 13600.0, 6300.0], + [7000.0, 24000.0, 5600.0, 8100.0], + [40000.0, 1000.0, 13000.0], + [40000.0, 30000.0], + [11600.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class opx(Solution): + def __init__(self, molar_fractions=None): + self.name = "opx" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.en(), "[Mgm][Mgm][Sit]1/2"], + [HP_2011_ds62.fs(), "[Fem][Fem][Sit]1/2"], + [fm, "[Mgm][Fem][Sit]1/2"], + [HP_2011_ds62.mgts(), "[Alm][Mgm][Sit1/2Alt1/2]1/2"], + [fopx, "[Fem][Mgm][Sit1/2Alt1/2]1/2"], + [mnopx, "[Mnm][Mnm][Sit]1/2"], + [odi, "[Mgm][Cam][Sit]1/2"], + ], + alphas=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.2], + energy_interaction=[ + [7000.0, 4000.0, 13000.0, 11000.0, 5000.0, 32200.000000000004], + [4000.0, 13000.0, 11600.0, 4200.0, 25540.0], + [17000.0, 15000.0, 5100.0, 22540.0], + [1000.0, 12000.0, 75400.0], + [10600.0, 73400.0], + [24540.0], + ], + volume_interaction=[ + [0.0, 0.0, -1.5e-06, -1.5e-06, 0.0, 1.2000000000000002e-06], + [0.0, -1.5e-06, -1.5e-06, 0.0, 8.400000000000001e-07], + [-1.5e-06, -1.5e-06, 0.0, 8.400000000000001e-07], + [0.0, -1.5e-06, -9.4e-06], + [-1.5e-06, -9.4e-06], + [8.400000000000001e-07], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class sa(Solution): + def __init__(self, molar_fractions=None): + self.name = "sa" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.spr4(), "[Mgm][Mgm]3[Sit]"], + [HP_2011_ds62.spr5(), "[Alm][Mgm]3[Alt]"], + [fspm, "[Fem][Fem]3[Sit]"], + [spro, "[Mgm][Fem]3[Sit]"], + [ospr, "[Fem][Mgm]3[Alt]"], + ], + energy_interaction=[ + [10000.0, 16000.0, 12000.0, 8000.0], + [19000.0, 22000.0, 1000.0], + [4000.0, 17600.0], + [20000.0], + ], + volume_interaction=[ + [-2.0000000000000002e-07, 0.0, 0.0, -2.0000000000000002e-07], + [-2.0000000000000002e-07, -2.0000000000000002e-07, 0.0], + [0.0, -2.0000000000000002e-07], + [-2.0000000000000002e-07], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class cd(Solution): + def __init__(self, molar_fractions=None): + self.name = "cd" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.crd(), "[Mgx]2[Vh]"], + [HP_2011_ds62.fcrd(), "[Fex]2[Vh]"], + [HP_2011_ds62.hcrd(), "[Mgx]2[Hoh]"], + [mncd, "[Mnx]2[Vh]"], + ], + energy_interaction=[[8000.0, 0.0, 6000.0], [9000.0, 4000.0], [6000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class st(Solution): + def __init__(self, molar_fractions=None): + self.name = "st" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [mstm, "[Mgx]4[Aly]2"], + [HP_2011_ds62.fst(), "[Fex]4[Aly]2"], + [mnstm, "[Mnx]4[Aly]2"], + [msto, "[Mgx]4[Fey]2"], + [mstt, "[Mgx]4[Tiy3/4Vy1/4]2"], + ], + energy_interaction=[ + [16000.0, 12000.0, 2000.0, 20000.0], + [8000.0, 18000.0, 36000.0], + [14000.0, 32000.0], + [30000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class chl(Solution): + def __init__(self, molar_fractions=None): + self.name = "chl" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.clin(), "[Mgm][Mgm]4[Alm][Sit1/2Alt1/2]2"], + [HP_2011_ds62.afchl(), "[Mgm][Mgm]4[Mgm][Sit]2"], + [HP_2011_ds62.ames(), "[Alm][Mgm]4[Alm][Alt]2"], + [HP_2011_ds62.daph(), "[Fem][Fem]4[Alm][Sit1/2Alt1/2]2"], + [ochl1, "[Mgm][Fem]4[Fem][Sit]2"], + [ochl4, "[Fem][Mgm]4[Mgm][Sit]2"], + [f3clin, "[Mgm][Mgm]4[Fem][Sit1/2Alt1/2]2"], + [mmchl, "[Mnm][Mnm]4[Alm][Sit1/2Alt1/2]2"], + ], + energy_interaction=[ + [17000.0, 17000.0, 20000.0, 30000.0, 21000.0, 2000.0, 6000.0], + [16000.0, 37000.0, 20000.0, 4000.0, 15000.0, 23000.0], + [30000.0, 29000.0, 13000.0, 19000.0, 17000.0], + [18000.0, 33000.0, 22000.0, 4000.0], + [24000.0, 28600.0, 19000.0], + [19000.0, 22000.0], + [8000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ctd(Solution): + def __init__(self, molar_fractions=None): + self.name = "ctd" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.mctd(), "[Alma]1/2[Mgmb]"], + [HP_2011_ds62.fctd(), "[Alma]1/2[Femb]"], + [mnct, "[Alma]1/2[Mnmb]"], + [ctdo, "[Fema]1/2[Mgmb]"], + ], + energy_interaction=[[4000.0, 3000.0, 1000.0], [3000.0, 5000.0], [4000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class sp(Solution): + def __init__(self, molar_fractions=None): + self.name = "sp" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.herc(), "[Al][Fe]"], + [HP_2011_ds62.sp(), "[Al][Mg]"], + [HP_2011_ds62.mt(), "[Fe][Fe]"], + [HP_2011_ds62.usp(), "[Ti][Fe]"], + ], + energy_interaction=[[0.0, 18500.0, 27000.0], [40000.0, 30000.0], [0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ilmm(Solution): + def __init__(self, molar_fractions=None): + self.name = "ilmm" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [oilm, "[Fea][Tib]"], + [dilm, "[Fea1/2Tia1/2][Feb1/2Tib1/2]"], + [dhem, "[Fea][Feb]"], + [HP_2011_ds62.geik(), "[Mga][Tib]"], + [HP_2011_ds62.pnt(), "[Mna][Tib]"], + ], + energy_interaction=[ + [15600.0, 26600.0, 4000.0, 2000.0], + [11000.0, 4000.0, 2000.0], + [36000.0, 25000.0], + [4000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ilm(Solution): + def __init__(self, molar_fractions=None): + self.name = "ilm" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [oilm, "[Fea][Tib]"], + [dilm, "[Fea1/2Tia1/2][Feb1/2Tib1/2]"], + [dhem, "[Fea][Feb]"], + ], + energy_interaction=[[15600.0, 26600.0], [11000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class mt1(Solution): + def __init__(self, molar_fractions=None): + self.name = "mt1" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [imt, "[Fem1/2Fem1/2]2[Fet]"], + [dmt, "[Fem2/3Fem1/3]2[Fet2/3Fet1/3]"], + [HP_2011_ds62.usp(), "[Tim1/2Fem1/2]2[Fet]"], + ], + energy_interaction=[[2400.0, 1000.0], [-5000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) diff --git a/burnman/minerals/mp50NCKFMASHTO.py b/burnman/minerals/mp50NCKFMASHTO.py new file mode 100644 index 00000000..93480124 --- /dev/null +++ b/burnman/minerals/mp50NCKFMASHTO.py @@ -0,0 +1,639 @@ +# This file is part of BurnMan - a thermoelastic +# and thermodynamic toolkit for the Earth and Planetary Sciences +# Copyright (C) 2012 - 2024 by the BurnMan team, released under the GNU +# GPL v2 or later. + +""" +mp50NCKFMASHTO +^^^^^^^^^^^^^^ + +HPx-eos solutions using endmembers from +dataset HP_2011_ds62. +The values in this document are all in S.I. units, +unlike those in the original THERMOCALC file. +This file is autogenerated using process_HPX_eos.py +""" + +from numpy import array, nan +from . import HP_2011_ds62 +from ..classes.mineral import Mineral +from ..classes.solution import Solution +from ..classes.solutionmodel import SymmetricRegularSolution +from ..classes.solutionmodel import AsymmetricRegularSolution +from ..classes.combinedmineral import CombinedMineral + + +hem_nood = Mineral( + { + "name": "hem", + "formula": {"Fe": 2.0, "O": 3.0}, + "equation_of_state": "hp_tmt", + "H_0": -825610.0, + "S_0": 87.4, + "V_0": 3.027e-05, + "Cp": [163.9, 0.0, -2257200.0, -657.6], + "a_0": 2.79e-05, + "K_0": 223000000000.0, + "Kprime_0": 4.04, + "Kdprime_0": -1.8e-11, + "n": 5.0, + "molar_mass": 0.1596882, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 444.6488294314381, + } +) + +ilm_nood = Mineral( + { + "name": "ilm", + "formula": {"Fe": 1.0, "O": 3.0, "Ti": 1.0}, + "equation_of_state": "hp_tmt", + "H_0": -1230450.0, + "S_0": 109.5, + "V_0": 3.169e-05, + "Cp": [138.9, 0.005081, -1288800.0, -463.7], + "a_0": 2.4e-05, + "K_0": 170000000000.0, + "Kprime_0": 8.3, + "Kdprime_0": -4.9e-11, + "n": 5.0, + "molar_mass": 0.1517102, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 375.2999294283698, + } +) + +mt_nood = Mineral( + { + "name": "mt", + "formula": {"Fe": 3.0, "O": 4.0}, + "equation_of_state": "hp_tmt", + "H_0": -1114500.0, + "S_0": 146.9, + "V_0": 4.452e-05, + "Cp": [262.5, -0.007205, -1926200.0, -1655.7], + "a_0": 3.71e-05, + "K_0": 185700000000.0, + "Kprime_0": 4.05, + "Kdprime_0": -2.2e-11, + "n": 7.0, + "molar_mass": 0.2315326, + "T_0": 298.15, + "E_0": 0.0, + "P_0": 100000.0, + "G_0": nan, + "Gprime_0": nan, + "T_einstein": 387.81123033649334, + } +) + + +kho = CombinedMineral( + [HP_2011_ds62.andr(), HP_2011_ds62.gr(), HP_2011_ds62.py()], + [1.0, -1.0, 1.0], + [27000.0, -0.0, 0.0], + "kho", +) +anC = CombinedMineral([HP_2011_ds62.an()], [1.0], [7030.0, 4.66, 0.0], "anC") +anC = CombinedMineral([HP_2011_ds62.an()], [1.0], [7030.0, 4.66, 0.0], "anC") +mut = CombinedMineral([HP_2011_ds62.mu()], [1.0], [1000.0, -0.0, 0.0], "mut") +celt = CombinedMineral([HP_2011_ds62.cel()], [1.0], [5000.0, -0.0, 0.0], "celt") +fcelt = CombinedMineral([HP_2011_ds62.fcel()], [1.0], [5000.0, -0.0, 0.0], "fcelt") +pat = CombinedMineral([HP_2011_ds62.pa()], [1.0], [4000.0, -0.0, 0.0], "pat") +fmu = CombinedMineral( + [HP_2011_ds62.mu(), HP_2011_ds62.gr(), HP_2011_ds62.andr()], + [1.0, -0.5, 0.5], + [25000.0, -0.0, 0.0], + "fmu", +) +mat = CombinedMineral([HP_2011_ds62.ma()], [1.0], [5000.0, -0.0, 0.0], "mat") +fmu = CombinedMineral( + [HP_2011_ds62.andr(), HP_2011_ds62.gr(), HP_2011_ds62.mu()], + [0.5, -0.5, 1.0], + [25000.0, -0.0, 0.0], + "fmu", +) +annm = CombinedMineral([HP_2011_ds62.ann()], [1.0], [-3000.0, -0.0, 0.0], "annm") +obi = CombinedMineral( + [HP_2011_ds62.ann(), HP_2011_ds62.phl()], + [0.3333333333333333, 0.6666666666666666], + [-3000.0, -0.0, 0.0], + "obi", +) +tbi = CombinedMineral( + [HP_2011_ds62.br(), HP_2011_ds62.phl(), HP_2011_ds62.ru()], + [-1.0, 1.0, 1.0], + [55000.0, -0.0, 0.0], + "tbi", +) +fbi = CombinedMineral( + [HP_2011_ds62.andr(), HP_2011_ds62.east(), HP_2011_ds62.gr()], + [0.5, 1.0, -0.5], + [-3000.0, -0.0, 0.0], + "fbi", +) +fm = CombinedMineral( + [HP_2011_ds62.en(), HP_2011_ds62.fs()], [0.5, 0.5], [-6600.0, -0.0, 0.0], "fm" +) +fopx = CombinedMineral( + [HP_2011_ds62.andr(), HP_2011_ds62.gr(), HP_2011_ds62.mgts()], + [0.5, -0.5, 1.0], + [2000.0, -0.0, 0.0], + "fopx", +) +odi = CombinedMineral( + [HP_2011_ds62.di()], [1.0], [-100.0, -0.211, 5.0000000000000004e-08], "odi" +) +fspm = CombinedMineral([HP_2011_ds62.fspr()], [1.0], [-2000.0, -0.0, 0.0], "fspm") +spro = CombinedMineral( + [HP_2011_ds62.fspr(), HP_2011_ds62.spr4()], + [0.75, 0.25], + [-3500.0, -0.0, 0.0], + "spro", +) +ospr = CombinedMineral( + [HP_2011_ds62.andr(), HP_2011_ds62.gr(), HP_2011_ds62.spr5()], + [0.5, -0.5, 1.0], + [-16000.0, -0.0, 0.0], + "ospr", +) +mstm = CombinedMineral([HP_2011_ds62.mst()], [1.0], [0.0, -0.0, 0.0], "mstm") +msto = CombinedMineral( + [HP_2011_ds62.andr(), HP_2011_ds62.gr(), HP_2011_ds62.mst()], + [1.0, -1.0, 1.0], + [9000.0, -0.0, 0.0], + "msto", +) +mstt = CombinedMineral( + [HP_2011_ds62.cor(), HP_2011_ds62.mst(), HP_2011_ds62.ru()], + [-1.0, 1.0, 1.5], + [13000.0, -0.0, 0.0], + "mstt", +) +ochl1 = CombinedMineral( + [HP_2011_ds62.afchl(), HP_2011_ds62.clin(), HP_2011_ds62.daph()], + [1.0, -1.0, 1.0], + [3000.0, -0.0, 0.0], + "ochl1", +) +ochl4 = CombinedMineral( + [HP_2011_ds62.afchl(), HP_2011_ds62.clin(), HP_2011_ds62.daph()], + [1.0, -0.2, 0.2], + [2400.0, -0.0, 0.0], + "ochl4", +) +f3clin = CombinedMineral( + [HP_2011_ds62.andr(), HP_2011_ds62.clin(), HP_2011_ds62.gr()], + [0.5, 1.0, -0.5], + [2000.0, -0.0, 0.0], + "f3clin", +) +ctdo = CombinedMineral( + [HP_2011_ds62.andr(), HP_2011_ds62.gr(), HP_2011_ds62.mctd()], + [0.25, -0.25, 1.0], + [13500.0, -0.0, 0.0], + "ctdo", +) +oilm = CombinedMineral( + [ilm_nood], + [1.0], + [1444.0572257227777, 1.5923196732102785, 1.836386612201713e-07], + "oilm", +) +dilm = CombinedMineral( + [ilm_nood], + [1.0], + [17044.35722572278, 13.118319673210278, 1.836386612201713e-07], + "dilm", +) +dhem = CombinedMineral( + [hem_nood], [1.0], [9522.770803030953, 12.937668369038724, 0.0], "dhem" +) +oilm = CombinedMineral( + [ilm_nood], + [1.0], + [1444.0572257227777, 1.5923196732102785, 1.836386612201713e-07], + "oilm", +) +dilm = CombinedMineral( + [ilm_nood], + [1.0], + [17044.35722572278, 13.118319673210278, 1.836386612201713e-07], + "dilm", +) +dhem = CombinedMineral( + [hem_nood], [1.0], [9522.770803030953, 12.937668369038724, 0.0], "dhem" +) +imt = CombinedMineral( + [mt_nood], [1.0], [16874.42602715333, 25.01732526713637, 0.0], "imt" +) +dmt = CombinedMineral( + [mt_nood], [1.0], [20064.42602715333, 29.36782526713637, 0.0], "dmt" +) + + +class g(Solution): + def __init__(self, molar_fractions=None): + self.name = "g" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.py(), "[Mgx]3[Aly]2"], + [HP_2011_ds62.alm(), "[Fex]3[Aly]2"], + [HP_2011_ds62.gr(), "[Cax]3[Aly]2"], + [kho, "[Mgx]3[Fey]2"], + ], + alphas=[1.0, 1.0, 2.7, 1.0], + energy_interaction=[ + [2500.0, 31000.0, 5400.0], + [5000.0, 22600.0], + [-15300.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class pl4tr(Solution): + def __init__(self, molar_fractions=None): + self.name = "pl4tr" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.ab(), "[Naa][Altb1/4Sitb3/4]"], + [HP_2011_ds62.an(), "[Caa][Altb1/2Sitb1/2]"], + [HP_2011_ds62.san(), "[Ka][Altb1/4Sitb3/4]"], + ], + alphas=[0.674, 0.55, 1.0], + energy_interaction=[[14600.0, 24100.0], [48500.0]], + entropy_interaction=[[0.00935, 0.00957], [-0.0]], + volume_interaction=[ + [-4.0000000000000003e-07, 3.3800000000000007e-06], + [-1.3e-06], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class k4tr(Solution): + def __init__(self, molar_fractions=None): + self.name = "k4tr" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.ab(), "[Naa][Altb1/4Sitb3/4]"], + [HP_2011_ds62.an(), "[Caa][Altb1/2Sitb1/2]"], + [HP_2011_ds62.san(), "[Ka][Altb1/4Sitb3/4]"], + ], + alphas=[0.674, 0.55, 1.0], + energy_interaction=[[14600.0, 24100.0], [48500.0]], + entropy_interaction=[[0.00935, 0.00957], [-0.0]], + volume_interaction=[ + [-4.0000000000000003e-07, 3.3800000000000007e-06], + [-1.3e-06], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class plc(Solution): + def __init__(self, molar_fractions=None): + self.name = "plc" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.abh(), "[Na]"], + [anC, "[Ca]"], + [HP_2011_ds62.san(), "[K]"], + ], + alphas=[0.643, 1.0, 1.0], + energy_interaction=[[3100.0, 25100.0], [40000.0]], + entropy_interaction=[[-0.0, 0.0108], [-0.0]], + volume_interaction=[[0.0, 3.3800000000000007e-06], [0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ksp(Solution): + def __init__(self, molar_fractions=None): + self.name = "ksp" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.san(), "[K]"], + [HP_2011_ds62.abh(), "[Na]"], + [anC, "[Ca]"], + ], + alphas=[1.0, 0.643, 1.0], + energy_interaction=[[25100.0, 40000.0], [3100.0]], + entropy_interaction=[[0.0108, -0.0], [-0.0]], + volume_interaction=[[3.3800000000000007e-06, 0.0], [0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ep(Solution): + def __init__(self, molar_fractions=None): + self.name = "ep" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.cz(), "[Alm][Alm]"], + [HP_2011_ds62.ep(), "[Alm][Fem]"], + [HP_2011_ds62.fep(), "[Fem][Fem]"], + ], + energy_interaction=[[1000.0, 3000.0], [1000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ma(Solution): + def __init__(self, molar_fractions=None): + self.name = "ma" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [mut, "[Ka][Alma][Almb][Sit1/2Alt1/2]2"], + [celt, "[Ka][Mgma][Almb][Sit]2"], + [fcelt, "[Ka][Fema][Almb][Sit]2"], + [pat, "[Naa][Alma][Almb][Sit1/2Alt1/2]2"], + [HP_2011_ds62.ma(), "[Caa][Alma][Almb][Alt]2"], + [fmu, "[Ka][Alma][Femb][Sit1/2Alt1/2]2"], + ], + alphas=[0.63, 0.63, 0.63, 0.37, 0.63, 0.63], + energy_interaction=[ + [0.0, 0.0, 10120.0, 34000.0, 0.0], + [0.0, 45000.0, 50000.0, 0.0], + [45000.0, 50000.0, 0.0], + [18000.0, 30000.0], + [35000.0], + ], + entropy_interaction=[ + [-0.0, -0.0, -0.0034, -0.0, -0.0], + [-0.0, -0.0, -0.0, -0.0], + [-0.0, -0.0, -0.0], + [-0.0, -0.0], + [-0.0], + ], + volume_interaction=[ + [2.0000000000000003e-06, 2.0000000000000003e-06, 3.53e-06, 0.0, 0.0], + [0.0, 2.5e-06, 0.0, 0.0], + [2.5e-06, 0.0, 0.0], + [0.0, 0.0], + [0.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class mu(Solution): + def __init__(self, molar_fractions=None): + self.name = "mu" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.mu(), "[Ka][Alma][Almb][Sit1/2Alt1/2]2"], + [HP_2011_ds62.cel(), "[Ka][Mgma][Almb][Sit]2"], + [HP_2011_ds62.fcel(), "[Ka][Fema][Almb][Sit]2"], + [HP_2011_ds62.pa(), "[Naa][Alma][Almb][Sit1/2Alt1/2]2"], + [mat, "[Caa][Alma][Almb][Alt]2"], + [fmu, "[Ka][Alma][Femb][Sit1/2Alt1/2]2"], + ], + alphas=[0.63, 0.63, 0.63, 0.37, 0.63, 0.63], + energy_interaction=[ + [0.0, 0.0, 10120.0, 35000.0, 0.0], + [0.0, 45000.0, 50000.0, 0.0], + [45000.0, 50000.0, 0.0], + [15000.0, 30000.0], + [35000.0], + ], + entropy_interaction=[ + [-0.0, -0.0, -0.0034, -0.0, -0.0], + [-0.0, -0.0, -0.0, -0.0], + [-0.0, -0.0, -0.0], + [-0.0, -0.0], + [-0.0], + ], + volume_interaction=[ + [2.0000000000000003e-06, 2.0000000000000003e-06, 3.53e-06, 0.0, 0.0], + [0.0, 2.5e-06, 0.0, 0.0], + [2.5e-06, 0.0, 0.0], + [0.0, 0.0], + [0.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class bi(Solution): + def __init__(self, molar_fractions=None): + self.name = "bi" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.phl(), "[Mgm][Mgm]2[Sit1/2Alt1/2]2[Ohv]2"], + [annm, "[Fem][Fem]2[Sit1/2Alt1/2]2[Ohv]2"], + [obi, "[Fem][Mgm]2[Sit1/2Alt1/2]2[Ohv]2"], + [HP_2011_ds62.east(), "[Alm][Mgm]2[Alt]2[Ohv]2"], + [tbi, "[Tim][Mgm]2[Sit1/2Alt1/2]2[Ov]2"], + [fbi, "[Fem][Mgm]2[Alt]2[Ohv]2"], + ], + energy_interaction=[ + [12000.0, 4000.0, 10000.0, 30000.0, 8000.0], + [8000.0, 15000.0, 32000.0, 13600.0], + [7000.0, 24000.0, 5600.0], + [40000.0, 1000.0], + [40000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class opx(Solution): + def __init__(self, molar_fractions=None): + self.name = "opx" + self.solution_model = AsymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.en(), "[Mgm][Mgm][Sit]1/2"], + [HP_2011_ds62.fs(), "[Fem][Fem][Sit]1/2"], + [fm, "[Mgm][Fem][Sit]1/2"], + [HP_2011_ds62.mgts(), "[Alm][Mgm][Alt1/2Sit1/2]1/2"], + [fopx, "[Fem][Mgm][Alt1/2Sit1/2]1/2"], + [odi, "[Mgm][Cam][Sit]1/2"], + ], + alphas=[1.0, 1.0, 1.0, 1.0, 1.0, 1.2], + energy_interaction=[ + [7000.0, 4000.0, 13000.0, 11000.0, 32200.000000000004], + [4000.0, 13000.0, 11600.0, 25540.0], + [17000.0, 15000.0, 22540.0], + [1000.0, 75400.0], + [73400.0], + ], + volume_interaction=[ + [0.0, 0.0, -1.5e-06, -1.5e-06, 1.2000000000000002e-06], + [0.0, -1.5e-06, -1.5e-06, 8.400000000000001e-07], + [-1.5e-06, -1.5e-06, 8.400000000000001e-07], + [0.0, -9.4e-06], + [-9.4e-06], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class sa(Solution): + def __init__(self, molar_fractions=None): + self.name = "sa" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.spr4(), "[Mgm][Mgm]3[Sit]"], + [HP_2011_ds62.spr5(), "[Alm][Mgm]3[Alt]"], + [fspm, "[Fem][Fem]3[Sit]"], + [spro, "[Mgm][Fem]3[Sit]"], + [ospr, "[Fem][Mgm]3[Alt]"], + ], + energy_interaction=[ + [10000.0, 16000.0, 12000.0, 8000.0], + [19000.0, 22000.0, 1000.0], + [4000.0, 17600.0], + [20000.0], + ], + volume_interaction=[ + [-2.0000000000000002e-07, 0.0, 0.0, -2.0000000000000002e-07], + [-2.0000000000000002e-07, -2.0000000000000002e-07, 0.0], + [0.0, -2.0000000000000002e-07], + [-2.0000000000000002e-07], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class cd(Solution): + def __init__(self, molar_fractions=None): + self.name = "cd" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.crd(), "[Mgx]2[Vh]"], + [HP_2011_ds62.fcrd(), "[Fex]2[Vh]"], + [HP_2011_ds62.hcrd(), "[Mgx]2[Hoh]"], + ], + energy_interaction=[[8000.0, 0.0], [9000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class st(Solution): + def __init__(self, molar_fractions=None): + self.name = "st" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [mstm, "[Mgx]4[Aly]2"], + [HP_2011_ds62.fst(), "[Fex]4[Aly]2"], + [msto, "[Mgx]4[Fey]2"], + [mstt, "[Mgx]4[Tiy3/4Vy1/4]2"], + ], + energy_interaction=[ + [16000.0, 2000.0, 20000.0], + [18000.0, 36000.0], + [30000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class chl(Solution): + def __init__(self, molar_fractions=None): + self.name = "chl" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.clin(), "[Mgm][Mgm]4[Alm][Sit1/2Alt1/2]2"], + [HP_2011_ds62.afchl(), "[Mgm][Mgm]4[Mgm][Sit]2"], + [HP_2011_ds62.ames(), "[Alm][Mgm]4[Alm][Alt]2"], + [HP_2011_ds62.daph(), "[Fem][Fem]4[Alm][Sit1/2Alt1/2]2"], + [ochl1, "[Mgm][Fem]4[Fem][Sit]2"], + [ochl4, "[Fem][Mgm]4[Mgm][Sit]2"], + [f3clin, "[Mgm][Mgm]4[Fem][Sit1/2Alt1/2]2"], + ], + energy_interaction=[ + [17000.0, 17000.0, 20000.0, 30000.0, 21000.0, 2000.0], + [16000.0, 37000.0, 20000.0, 4000.0, 15000.0], + [30000.0, 29000.0, 13000.0, 19000.0], + [18000.0, 33000.0, 22000.0], + [24000.0, 28600.0], + [19000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ctd(Solution): + def __init__(self, molar_fractions=None): + self.name = "ctd" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.mctd(), "[Alma]1/2[Mgmb]"], + [HP_2011_ds62.fctd(), "[Alma]1/2[Femb]"], + [ctdo, "[Fema]1/2[Mgmb]"], + ], + energy_interaction=[[4000.0, 1000.0], [5000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class sp(Solution): + def __init__(self, molar_fractions=None): + self.name = "sp" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [HP_2011_ds62.herc(), "[Al][Fe]"], + [HP_2011_ds62.sp(), "[Al][Mg]"], + [HP_2011_ds62.mt(), "[Fe][Fe]"], + [HP_2011_ds62.usp(), "[Ti][Fe]"], + ], + energy_interaction=[[0.0, 18500.0, 27000.0], [40000.0, 30000.0], [0.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ilmm(Solution): + def __init__(self, molar_fractions=None): + self.name = "ilmm" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [oilm, "[Fea][Tib]"], + [dilm, "[Fea1/2Tia1/2][Feb1/2Tib1/2]"], + [dhem, "[Fea][Feb]"], + [HP_2011_ds62.geik(), "[Mga][Tib]"], + ], + energy_interaction=[ + [15600.0, 26600.0, 4000.0], + [11000.0, 4000.0], + [36000.0], + ], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class ilm(Solution): + def __init__(self, molar_fractions=None): + self.name = "ilm" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [oilm, "[Fea][Tib]"], + [dilm, "[Fea1/2Tia1/2][Feb1/2Tib1/2]"], + [dhem, "[Fea][Feb]"], + ], + energy_interaction=[[15600.0, 26600.0], [11000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) + + +class mt1(Solution): + def __init__(self, molar_fractions=None): + self.name = "mt1" + self.solution_model = SymmetricRegularSolution( + endmembers=[ + [imt, "[Fem1/2Fem1/2]2[Fet]"], + [dmt, "[Fem2/3Fem1/3]2[Fet2/3Fet1/3]"], + [HP_2011_ds62.usp(), "[Tim1/2Fem1/2]2[Fet]"], + ], + energy_interaction=[[2400.0, 1000.0], [-5000.0]], + ) + Solution.__init__(self, molar_fractions=molar_fractions) diff --git a/tests/test_hp_solutions.py b/tests/test_hp_solutions.py index a6274208..0f1eb870 100644 --- a/tests/test_hp_solutions.py +++ b/tests/test_hp_solutions.py @@ -3,7 +3,15 @@ import unittest from util import BurnManTest from burnman import Mineral, CombinedMineral, Solution -from burnman.minerals import ig50NCKFMASHTOCr, ig50NCKFMASTOCr +from burnman.minerals import ( + ig50NCKFMASHTOCr, + ig50NCKFMASTOCr, + mb50NCKFMASHTO, + mp50KFMASH, + mp50MnNCKFMASHTO, + mp50NCKFMASHTO, +) + import inspect import numpy as np from collections import Counter @@ -44,6 +52,74 @@ def test_ig50NCKFMASTOCr(self): m.set_composition(molar_fractions) self.assertTrue(type(m.formula) is Counter) + def test_mb50NCKFMASHTO(self): + for m in dir(mb50NCKFMASHTO): + mineral = getattr(mb50NCKFMASHTO, m) + if ( + inspect.isclass(mineral) + and mineral != Mineral + and mineral != CombinedMineral + and issubclass(mineral, Mineral) + ): + if issubclass(mineral, Solution) and mineral is not Solution: + mbr_names = mineral().endmember_names + n_mbrs = len(mbr_names) + molar_fractions = np.ones(n_mbrs) / n_mbrs + m = mineral() + m.set_composition(molar_fractions) + self.assertTrue(type(m.formula) is Counter) + + def test_mp50KFMASH(self): + for m in dir(mp50KFMASH): + mineral = getattr(mp50KFMASH, m) + if ( + inspect.isclass(mineral) + and mineral != Mineral + and mineral != CombinedMineral + and issubclass(mineral, Mineral) + ): + if issubclass(mineral, Solution) and mineral is not Solution: + mbr_names = mineral().endmember_names + n_mbrs = len(mbr_names) + molar_fractions = np.ones(n_mbrs) / n_mbrs + m = mineral() + m.set_composition(molar_fractions) + self.assertTrue(type(m.formula) is Counter) + + def test_mp50MnNCKFMASHTO(self): + for m in dir(mp50MnNCKFMASHTO): + mineral = getattr(mp50MnNCKFMASHTO, m) + if ( + inspect.isclass(mineral) + and mineral != Mineral + and mineral != CombinedMineral + and issubclass(mineral, Mineral) + ): + if issubclass(mineral, Solution) and mineral is not Solution: + mbr_names = mineral().endmember_names + n_mbrs = len(mbr_names) + molar_fractions = np.ones(n_mbrs) / n_mbrs + m = mineral() + m.set_composition(molar_fractions) + self.assertTrue(type(m.formula) is Counter) + + def test_mp50NCKFMASHTO(self): + for m in dir(mp50NCKFMASHTO): + mineral = getattr(mp50NCKFMASHTO, m) + if ( + inspect.isclass(mineral) + and mineral != Mineral + and mineral != CombinedMineral + and issubclass(mineral, Mineral) + ): + if issubclass(mineral, Solution) and mineral is not Solution: + mbr_names = mineral().endmember_names + n_mbrs = len(mbr_names) + molar_fractions = np.ones(n_mbrs) / n_mbrs + m = mineral() + m.set_composition(molar_fractions) + self.assertTrue(type(m.formula) is Counter) + if __name__ == "__main__": unittest.main()