Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass tidal heating to Aragog and SPIDER #282

Merged
merged 23 commits into from
Nov 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Pass tidal heating to Aragog, SPIDER, Dummy
nichollsh committed Nov 21, 2024
commit 0bdb7aaa83a46b90265affe6b675c77e4183ca05
1 change: 1 addition & 0 deletions src/proteus/config/_interior.py
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ class Interior:
grain_size: float = field(validator=gt(0))
F_initial: float = field(validator=gt(0))
radiogenic_heat: bool = field(validator=no_radio_if_dummy)
tidal_heat: bool

module: str = field(validator=in_(('spider', 'aragog', 'dummy')))

12 changes: 10 additions & 2 deletions src/proteus/interior/aragog.py
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ def SetupAragogSolver(config:Config, hf_row:dict):
gravitational_separation = False,
mixing = False,
radionuclides = config.interior.radiogenic_heat,
tidal = False,
tidal = config.interior.tidal_heat,
)

initial_condition = _InitialConditionParameters(
@@ -200,7 +200,7 @@ def _append_radnuc(_iso, _cnc):

aragog_solver = Solver(param)

def UpdateAragogSolver(dt:float, hf_row:dict, output_dir:str = None):
def UpdateAragogSolver(dt:float, hf_row:dict, config:Config, output_dir:str = None):

# Set solver time
# hf_row["Time"] is in yr so do not need to scale as long as scaling time is secs_per_year
@@ -221,6 +221,14 @@ def UpdateAragogSolver(dt:float, hf_row:dict, output_dir:str = None):
# Update boundary conditions
aragog_solver.parameters.boundary_conditions.outer_boundary_value = hf_row["F_atm"]

# Update tidal heating
tidal_value= 0.0
if config.interior.tidal_heat:
if config.orbit.dummy:
tidal_value = config.orbit.dummy.H_tide
tidal_value /= aragog_solver.parameters.scalings.power_per_mass
aragog_solver.parameters.energy.tidal_value = tidal_value

return

def WriteAragogOutput(output_dir:str, time:float):
6 changes: 5 additions & 1 deletion src/proteus/interior/dummy.py
Original file line number Diff line number Diff line change
@@ -94,7 +94,11 @@ def _calc_phi(tmp:float):

# Subtract tidal contribution to the total heat flux.
# This heat energy is generated only in the mantle, not in the core.
output["F_tidal"] = config.orbit.dummy.H_tide * output["M_mantle"] / area
tidal_flux = 0.0
if config.interior.tidal_heat:
if config.orbit.dummy:
tidal_flux = config.orbit.dummy.H_tide * output["M_mantle"] / area
output["F_tidal"] = tidal_flux

# Radiogenic heating not included
output["F_radio"] = 0.0
9 changes: 9 additions & 0 deletions src/proteus/interior/spider.py
Original file line number Diff line number Diff line change
@@ -270,6 +270,15 @@ def _try_spider( dirs:dict, config:Config,
call_sequence.extend(["-MIXING ", "1"]) # mixing (latent heat transport)
call_sequence.extend(["-SEPARATION", "1"]) # gravitational separation of solid/melt

# Tidal heating
tidal_value = 0.0
if config.interior.tidal_heat:
if config.orbit.dummy:
tidal_value = config.orbit.dummy.H_tide

call_sequence.extend(["-HTIDAL", "1"])
call_sequence.extend(["-htidal_value", "%.5e"%tidal_value])

# Properties lookup data (folder relative to SPIDER src)
folder = "lookup_data/1TPa-dK09-elec-free/"
call_sequence.extend(["-phase_names", "melt,solid"])