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

Generalise stellar wrapper, dummy star module #220

Merged
merged 20 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion examples/default/init_coupler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
mass = 1.0 # M_sun
radius = 1.0 # R_sun
Teff = 5772.0 # K
Lbol = 1.0 # L_sun
lum_now = 1.0 # L_sun
omega = 50.0 # rotation percentile
age_now = 4.567 # Gyr, current age of star used for scaling
age_ini = 0.100 # Gyr, model initialisation/start age
Expand Down
2 changes: 1 addition & 1 deletion examples/hd63433d/init_coupler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ author = "Harrison Nicholls, Tim Lichtenberg"
mass = 0.99 # M_sun
radius = 0.912 # R_sun
Teff = 5640.0 # K
Lbol = 0.753 # L_sun
lum_now = 0.753 # L_sun
omega = 50.0 # rotation percentile
age_now = 4.140 # Gyr, current age of star used for scaling
age_ini = 0.100 # Gyr, model initialisation/start age
Expand Down
5 changes: 2 additions & 3 deletions input/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,14 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[star]

# Physical parameters
mass = 1.0 # M_sun
radius = 1.0 # R_sun
Teff = 5772.0 # K
Lbol = 1.0 # L_sun
mass = 1.0 # M_sun
lum_now = 1.0 # L_sun, Luminosity as observed today.
omega = 50.0 # rotation percentile
age_now = 4.567 # Gyr, current age of star used for scaling
age_ini = 0.100 # Gyr, model initialisation/start age


module = "mors"
[star.mors]
tracks = "spada" # evolution tracks: spada | baraffe
Expand Down
5 changes: 2 additions & 3 deletions input/dummy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,14 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[star]

# Physical parameters
mass = 1.0 # M_sun
radius = 1.0 # R_sun
Teff = 5772.0 # K
Lbol = 1.0 # L_sun
mass = 1.0 # M_sun
lum_now = 1.0 # L_sun, Luminosity as observed today.
omega = 50.0 # rotation percentile
age_now = 4.567 # Gyr, current age of star used for scaling
age_ini = 0.100 # Gyr, model initialisation/start age


module = "mors"
[star.mors]
tracks = "baraffe" # evolution tracks: spada | baraffe
Expand Down
233 changes: 233 additions & 0 deletions input/dummy_star.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
# PROTEUS configuration file (version 2.0)

# Root tables should be physical, with the exception of "params"
# Software related options should go within the appropriate physical table

# The general structure is:
# [root] metadata
# [params] parameters for code execution, output files, time-stepping, convergence
# [star] stellar parameters, model selection
# [orbit] planetary orbital parameters
# [struct] planetary structure (mass, radius)
# [atmos] atmosphere parameters, model selection
# [escape] escape parameters, model selection
# [interior] magma ocean model selection and parameters
# [outgas] outgassing parameters (fO2) and included volatiles
# [delivery] initial volatile inventory, and delivery model selection

# ----------------------------------------------------
# Metadata
version = "2.0"
author = "Harrison Nicholls, Tim Lichtenberg"

# ----------------------------------------------------
# Parameters
[params]
# output files
[params.out]
path = "dummy_star"
logging = "DEBUG"
plot_mod = 0 # Plotting frequency, 0: wait until completion | n: every n iterations
plot_fmt = "png" # Plotting image file format, "png" or "pdf" recommended

# time-stepping
[params.dt]
minimum = 1e2 # yr, minimum time-step
maximum = 3e7 # yr, maximum time-step
initial = 1e2 # yr, inital step size
starspec = 1e7 # yr, interval to re-calculate the stellar spectrum
starinst = 1e1 # yr, interval to re-calculate the instellation
method = "adaptive" # proportional | adaptive | maximum

[params.dt.proportional]
propconst = 52.0 # Proportionality constant

[params.dt.adaptive]
atol = 0.02 # Step size atol
rtol = 0.10 # Step size rtol

# termination criteria
[params.stop]

# required number of iterations
[params.stop.iters]
enabled = true
minimum = 3
maximum = 9000

# required time constraints
[params.stop.time]
enabled = true
minimum = 1.0e3 # yr, model will certainly run to t > minimum
maximum = 4.567e+9 # yr, model will terminate when t > maximum

# solidification
[params.stop.solid]
enabled = false
phi_crit = 0.005 # non-dim., model will terminate when global melt fraction < phi_crit

# radiative equilibrium
[params.stop.radeqm]
enabled = false
F_crit = 0.2 # W m-2, model will terminate when |F_atm| < F_crit

# steady state
[params.stop.steady]
enabled = false
F_crit = 0.8 # Maximum absolute value of F_atm allowed for convergence
dprel = 1.0e-9 # Percentage change in melt fraction over time (dp/p)/dt*100

[params.stop.escape]
enabled = true
mass_frac = 3e-4 # Stop when atm_mass < this frac of initial mass


# ----------------------------------------------------
# Star
[star]

# Physical parameters
radius = 1.0 # R_sun
Teff = 5772.0 # K
mass = 1.0 # M_sun
lum_now = 1.0 # L_sun, Luminosity as observed today.
omega = 50.0 # rotation percentile
age_now = 4.567 # Gyr, current age of star used for scaling
age_ini = 0.100 # Gyr, model initialisation/start age

module = "dummy"
[star.mors]
tracks = "baraffe" # evolution tracks: spada | baraffe
spec = "stellar_spectra/Named/sun.txt" # stellar spectrum

# Orbital system
[orbit]
semimajoraxis = 1.0 # AU
eccentricity = 0.0 # dimensionless
zenith_angle = 48.19 # degrees
s0_factor = 0.375 # dimensionless

# No module specifically for tides / orbital dynamics
module = "none"


# Planetary structure - physics table
[struct]
mass = 1.0 # M_earth
radius = 1.0 # R_earth
corefrac = 0.55 # non-dim., radius fraction

# No module for specifically for internal structure
module = "none"

# Atmosphere - physics table
[atmos_clim]
prevent_warming = true # do not allow the planet to heat up
surface_d = 0.01 # m, conductive skin thickness
surface_k = 2.0 # W m-1 K-1, conductive skin thermal conductivity
cloud_enabled = false # enable water cloud radiative effects
cloud_alpha = 0.0 # condensate retention fraction (1 -> fully retained)
surf_state = "fixed" # surface scheme: "mixed_layer" | "fixed" | "skin"
surf_albedo = 0.1 # path to file ("string") or grey quantity (float)
albedo_pl = 0.1 # Bond albedo (scattering)
rayleigh = true # enable rayleigh scattering
tmp_minimum = 0.5 # temperature floor on solver
tmp_maximum = 5000.0 # temperature ceiling on solver

module = "dummy" # Which atmosphere module to use

[atmos_clim.agni]
p_top = 1.0e-5 # bar, top of atmosphere grid pressure
spectral_group = "Frostflow" # which gas opacities to include
spectral_bands = "48" # how many spectral bands?
num_levels = 40 # Number of atmospheric grid levels
chemistry = "none" # "none" | "eq" | "kin"

[atmos_clim.janus]
p_top = 1.0e-6 # bar, top of atmosphere grid pressure
spectral_group = "Frostflow" # which gas opacities to include
spectral_bands = "48" # how many spectral bands?
F_atm_bc = 0 # measure outgoing flux at: (0) TOA | (1) Surface
num_levels = 40 # Number of atmospheric grid levels
tropopause = "none" # none | skin | dynamic

[atmos_clim.dummy]
gamma = 0.7 # atmosphere opacity between 0 and 1

# Volatile escape - physics table
[escape]

module = "dummy" # Which escape module to use

[escape.zephyrus]
some_parameter = "some_value"

[escape.dummy]
rate = 2.0e4 # Bulk unfractionated escape rate [kg s-1]

# Interior - physics table
[interior]
grain_size = 0.1 # crystal settling grain size [m]
F_initial = 1e6 # Initial heat flux guess [W m-2]

module = "dummy" # Which interior module to use

[interior.spider]
num_levels = 220 # Number of SPIDER grid levels
mixing_length = 2 # Mixing length parameterization
tolerance = 1.0e-10 # solver tolerance
tsurf_atol = 30.0 # tsurf_poststep_change
tsurf_rtol = 0.02 # tsurf_poststep_change_frac
ini_entropy = 2700.0 # Surface entropy conditions [J K-1 kg-1]
ini_dsdr = -4.698e-6 # Interior entropy gradient [J K-1 kg-1 m-1]

[interior.aragog]
some_parameter = "some_value"

# Outgassing - physics table
[outgas]
fO2_shift_IW = 2 # log10(ΔIW), atmosphere/interior boundary oxidation state

module = "calliope" # Which outgassing module to use

[outgas.calliope]
include_H2O = true # Include H2O compound
include_CO2 = true # Include CO2 compound
include_N2 = true # Include N2 compound
include_S2 = true # Include S2 compound
include_SO2 = true # Include SO2 compound
include_H2 = true # Include H2 compound
include_CH4 = true # Include CH4 compound
include_CO = true # Include CO compound

[outgas.atmodeller]
some_parameter = "some_value"

# Volatile delivery - physics table
[delivery]

# [Settings here for accretion rate, etc.]

# Which initial inventory to use?
initial = 'elements' # "elements" | "volatiles"

# No module for accretion as of yet
module = "none"

# 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

# Set initial volatile inventory by partial pressures in atmosphere
[delivery.volatiles]
H2O = 0.0 # partial pressure of H2O
CO2 = 0.0 # partial pressure of CO2
N2 = 0.0 # etc
S2 = 0.0
SO2 = 0.0
H2 = 0.0
CH4 = 0.0
CO = 0.0
5 changes: 2 additions & 3 deletions input/escape.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,14 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[star]

# Physical parameters
mass = 1.0 # M_sun
radius = 1.0 # R_sun
Teff = 5772.0 # K
Lbol = 1.0 # L_sun
mass = 1.0 # M_sun
lum_now = 1.0 # L_sun
omega = 50.0 # rotation percentile
age_now = 4.567 # Gyr, current age of star used for scaling
age_ini = 0.100 # Gyr, model initialisation/start age


module = "mors"
[star.mors]
tracks = "spada" # evolution tracks: spada | baraffe
Expand Down
5 changes: 2 additions & 3 deletions input/hd63433d.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,14 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[star]

# Physical parameters
mass = 0.99 # M_sun
radius = 0.912 # R_sun
Teff = 5640.0 # K
Lbol = 0.753 # L_sun
mass = 0.99 # M_sun
lum_now = 0.753 # L_sun
omega = 50.0 # rotation percentile
age_now = 4.140 # Gyr, current age of star used for scaling
age_ini = 0.100 # Gyr, model initialisation/start age


module = "mors"
[star.mors]
tracks = "baraffe" # evolution tracks: spada | baraffe
Expand Down
5 changes: 2 additions & 3 deletions input/jgr_grid.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,14 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[star]

# Physical parameters
mass = 1.0 # M_sun
radius = 1.0 # R_sun
Teff = 5772.0 # K
Lbol = 1.0 # L_sun
mass = 1.0 # M_sun
lum_now = 1.0 # L_sun
omega = 60.0 # rotation percentile
age_now = 4.567 # Gyr, current age of star used for scaling
age_ini = 0.100 # Gyr, model initialisation/start age


module = "mors"
[star.mors]
tracks = "spada" # evolution tracks: spada | baraffe
Expand Down
5 changes: 2 additions & 3 deletions input/ltt3780b.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,14 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[star]

# Physical parameters
mass = 0.401 # M_sun
radius = 0.374 # R_sun
Teff = 3331.0 # K
Lbol = 0.167 # L_sun
mass = 0.401 # M_sun
lum_now = 0.167 # L_sun
omega = 20.0 # rotation percentile
age_now = 3.100 # Gyr, current age of star used for scaling
age_ini = 0.100 # Gyr, model initialisation/start age


module = "mors"
[star.mors]
tracks = "spada" # evolution tracks: spada | baraffe
Expand Down
5 changes: 2 additions & 3 deletions input/t1c.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,14 @@ author = "Harrison Nicholls, Tim Lichtenberg"
[star]

# Physical parameters
mass = 0.1 # M_sun
radius = 0.1192 # R_sun
Teff = 2566.0 # K
Lbol = 0.000553 # L_sun
mass = 0.1 # M_sun
lum_now = 0.000553 # L_sun
omega = 50.0 # rotation percentile
age_now = 7.6 # Gyr, current age of star used for scaling
age_ini = 0.100 # Gyr, model initialisation/start age


module = "mors"
[star.mors]
tracks = "spada" # evolution tracks: spada | baraffe
Expand Down
2 changes: 1 addition & 1 deletion src/proteus/config/_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _phi_global(config: Config):
'star_mass': ('star', 'mass'),
'star_radius_modern': ('star', 'radius'),
'star_temperature_modern': ('star', 'Teff'),
'star_luminosity_modern': ('star', 'Lbol'),
'star_luminosity_modern': ('star', 'lum_now'),
'star_age_modern': ('star', 'age_now'),
'star_rot_pctle': ('star', 'omega'),
'star_spectrum': ('star', 'mors', 'spec'),
Expand Down
Loading
Loading