diff --git a/input/aragog.toml b/input/aragog.toml index 560f2477..15e1eeb5 100644 --- a/input/aragog.toml +++ b/input/aragog.toml @@ -239,9 +239,10 @@ author = "Harrison Nicholls, Tim Lichtenberg" # Set initial volatile inventory by planetary element abundances [delivery.elements] CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system - H_oceans = 6.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass - N_ppmw = 2.0 # Nitrogen inventory in ppmw relative to mantle mass, by mass - S_ppmw = 200.0 # Sulfur inventory in ppmw relative to mass of melt + H_oceans = 6.0 # Hydrogen inventory in units of equivalent Earth oceans + H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass + N_ppmw = 2.0 # Nitrogen inventory in ppmw relative to mantle mass + S_ppmw = 200.0 # Sulfur inventory in ppmw relative to mantle mass # Set initial volatile inventory by partial pressures in atmosphere [delivery.volatiles] diff --git a/input/default.toml b/input/default.toml index b18727fa..63252184 100644 --- a/input/default.toml +++ b/input/default.toml @@ -239,9 +239,10 @@ author = "Harrison Nicholls, Tim Lichtenberg" # Set initial volatile inventory by planetary element abundances [delivery.elements] CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system - H_oceans = 6.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass - N_ppmw = 2.0 # Nitrogen inventory in ppmw relative to mantle mass, by mass - S_ppmw = 200.0 # Sulfur inventory in ppmw relative to mass of melt + H_oceans = 6.0 # Hydrogen inventory in units of equivalent Earth oceans + H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass + N_ppmw = 2.0 # Nitrogen inventory in ppmw relative to mantle mass + S_ppmw = 200.0 # Sulfur inventory in ppmw relative to mantle mass # Set initial volatile inventory by partial pressures in atmosphere [delivery.volatiles] diff --git a/input/hd63433d.toml b/input/hd63433d.toml index c34075a9..115c62d9 100644 --- a/input/hd63433d.toml +++ b/input/hd63433d.toml @@ -240,6 +240,7 @@ author = "Harrison Nicholls, Tim Lichtenberg" [delivery.elements] CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system H_oceans = 8.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass + H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass N_ppmw = 2.01 # Nitrogen inventory in ppmw relative to mantle mass, by mass S_ppmw = 235.0 # Sulfur inventory in ppmw relative to mass of melt diff --git a/input/k218b.toml b/input/k218b.toml index 01216957..9657a16d 100644 --- a/input/k218b.toml +++ b/input/k218b.toml @@ -240,6 +240,7 @@ author = "Harrison Nicholls, Tim Lichtenberg" [delivery.elements] CH_ratio = 0.1 # C/H ratio in mantle/atmosphere system H_oceans = 60.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass + H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass N_ppmw = 2.01 # Nitrogen inventory in ppmw relative to mantle mass, by mass S_ppmw = 235.0 # Sulfur inventory in ppmw relative to mass of melt diff --git a/input/l9859d.toml b/input/l9859d.toml index 57de7b37..62519912 100644 --- a/input/l9859d.toml +++ b/input/l9859d.toml @@ -239,6 +239,7 @@ author = "Harrison Nicholls, Tim Lichtenberg" [delivery.elements] CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system H_oceans = 8.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass + H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass N_ppmw = 2.01 # Nitrogen inventory in ppmw relative to mantle mass, by mass S_ppmw = 235.0 # Sulfur inventory in ppmw relative to mass of melt diff --git a/input/trappist1c.toml b/input/trappist1c.toml index 3ccb75e0..53900f53 100644 --- a/input/trappist1c.toml +++ b/input/trappist1c.toml @@ -240,6 +240,7 @@ author = "Harrison Nicholls, Tim Lichtenberg" [delivery.elements] CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system H_oceans = 8.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass + H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass N_ppmw = 2.01 # Nitrogen inventory in ppmw relative to mantle mass, by mass S_ppmw = 235.0 # Sulfur inventory in ppmw relative to mass of melt diff --git a/src/proteus/config/_delivery.py b/src/proteus/config/_delivery.py index 7db9d7a2..1cc4a3f1 100644 --- a/src/proteus/config/_delivery.py +++ b/src/proteus/config/_delivery.py @@ -15,14 +15,17 @@ class Elements: CH_ratio: float Volatile C/H nass ratio in combined mantle+atmosphere system. H_oceans: float - Bulk hydrogen inventory in units of equivalent Earth oceans. + Absolute hydrogen inventory, units of equivalent Earth oceans. + H_ppmw: float + Relative hydrogen inventory, ppmw relative to mantle mass. N_ppmw: float - Bulk nitrogen inventory in ppmw relative to mantle mass. + Relative nitrogen inventory, ppmw relative to mantle mass. S_ppmw: float - Bulk sulfur inventory in ppmw relative to mantle mass. + Absolute sulfur inventory, ppmw relative to mantle mass. """ CH_ratio: float = field(validator=gt(0)) - H_oceans: float = field(validator=gt(0)) + H_oceans: float = field(validator=ge(0)) + H_ppmw: float = field(validator=ge(0)) N_ppmw: float = field(validator=ge(0)) S_ppmw: float = field(validator=ge(0)) diff --git a/src/proteus/outgas/calliope.py b/src/proteus/outgas/calliope.py index 8d06789e..188f44b4 100644 --- a/src/proteus/outgas/calliope.py +++ b/src/proteus/outgas/calliope.py @@ -12,6 +12,7 @@ get_target_from_params, get_target_from_pressures, ) +from calliope.constants import ocean_moles, molar_mass from proteus.utils.constants import element_list, vol_list from proteus.utils.helper import UpdateStatusfile @@ -35,8 +36,21 @@ def construct_options(dirs:dict, config:Config, hf_row:dict): solvevol_inp["T_magma"] = hf_row["T_magma"] solvevol_inp['fO2_shift_IW'] = config.outgas.fO2_shift_IW + # Sum hydrogen absolute and relative amounts... + + # absolute part + # internally, calliope will convert this to mass in kg as: + # H_kg = H_oceans * number_ocean_moles * molar_mass['H2'] + H_abs = float(config.delivery.elements.H_oceans) + + # relative part + # H_kg = H_rel * 1e-6 * M_mantle + # then converted to units of earth oceans, and summed with absolute part + H_rel = config.delivery.elements.H_ppmw * 1e-6 * hf_row["M_mantle"] + H_rel /= ocean_moles * molar_mass['H2'] + # Elemental inventory - solvevol_inp['hydrogen_earth_oceans'] = config.delivery.elements.H_oceans + solvevol_inp['hydrogen_earth_oceans'] = H_abs + H_rel solvevol_inp['CH_ratio'] = config.delivery.elements.CH_ratio solvevol_inp['nitrogen_ppmw'] = config.delivery.elements.N_ppmw solvevol_inp['sulfur_ppmw'] = config.delivery.elements.S_ppmw diff --git a/src/proteus/utils/constants.py b/src/proteus/utils/constants.py index d1e752b7..ff96d503 100644 --- a/src/proteus/utils/constants.py +++ b/src/proteus/utils/constants.py @@ -17,7 +17,6 @@ R_core_earth = 3485000.0 # m M_core_earth = 1.94E24 # kg mol = 6.02214076e+23 # mol definition -ocean_moles = 7.68894973907177e+22 # moles of H2 (or H2O) in one present-day Earth ocean # Earth heat flux, globally averaged [W m-2] # https://se.copernicus.org/articles/1/5/2010/ diff --git a/tests/integration/dummy.toml b/tests/integration/dummy.toml index 7af78dac..b6df5a9b 100644 --- a/tests/integration/dummy.toml +++ b/tests/integration/dummy.toml @@ -238,6 +238,7 @@ author = "Harrison Nicholls, Tim Lichtenberg" [delivery.elements] CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system H_oceans = 6.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass + H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass N_ppmw = 2.0 # Nitrogen inventory in ppmw relative to mantle mass, by mass S_ppmw = 200.0 # Sulfur inventory in ppmw relative to mass of melt diff --git a/tests/integration/physical.toml b/tests/integration/physical.toml index a7f6db67..c87d8336 100644 --- a/tests/integration/physical.toml +++ b/tests/integration/physical.toml @@ -239,6 +239,7 @@ author = "Harrison Nicholls, Tim Lichtenberg" [delivery.elements] CH_ratio = 1.0 # C/H ratio in mantle/atmosphere system H_oceans = 6.0 # Hydrogen inventory in units of equivalent Earth oceans, by mass + H_ppmw = 0.0 # Hydrogen inventory in ppmw relative to mantle mass N_ppmw = 2.0 # Nitrogen inventory in ppmw relative to mantle mass, by mass S_ppmw = 200.0 # Sulfur inventory in ppmw relative to mass of melt