Skip to content

Commit

Permalink
Merge pull request #55 from nichollsh/chem_storage
Browse files Browse the repository at this point in the history
Updated syntax for composition stuff
  • Loading branch information
nichollsh authored Jul 2, 2024
2 parents cc15e84 + ac75146 commit 34e2e63
Show file tree
Hide file tree
Showing 22 changed files with 1,236 additions and 1,439 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors:
given-names: "Harrison"
orcid: "https://orcid.org/0000-0002-8368-4641"
title: "AGNI"
version: 0.5.2
version: 0.5.3
doi: 10.xx/xx.xx
date-released: 2024-06-25
date-released: 2024-07-02
url: "https://github.com/nichollsh/AGNI"
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AGNI"
uuid = "ede838c1-9ec3-4ebe-8ae8-da4091b3f21c"
authors = ["Harrison Nicholls <[email protected]>"]
version = "0.5.2"
version = "0.5.3"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down
21 changes: 11 additions & 10 deletions docs/src/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,25 @@ but the model will return an error naming any parameters which are both
necessary and absent.

Broadly, the configuration files are broken up into four sections:
* `[planet]` describes general characteristics of the planet and its atmosphere
* `[files]` lists input/output files
* `[execution]` describes what the model should do
* `[plots]` describes which kind of plot to produce
* `[planet]` - general characteristics of the planet
* `[files]` - input/output files and other paths
* `[composition]` - atmospheric composition and chemistry
* `[execution]` - what the model should do
* `[plots]` - which plots should be produced

Some `execution` parameters:
* `solution_type` tells the model which state to solve for. The allowed values (integers) are...
Some parameters:
* `execution.solution_type` tells the model which state to solve for. The allowed values (integers) are...
- 1 : zero flux divergence at fixed `tmp_surf`
- 2 : zero flux divergence, with `tmp_surf` set such that the conductive skin (CBL) conserves energy flux
- 3 : the net upward flux at each layer is equal to `flux_int = sigma * tmp_int^4`

* `solvers` tells the model which solvers to use. This is a list of strings, so multiple solvers can be applied sequentially. An empty string is always appended to the end of this list. Allowed solvers are...
* `execution.solvers` tells the model which solvers to use. This is a list of strings, so multiple solvers can be applied sequentially. An empty string is always appended to the end of this list. Allowed solvers are...
- [empty string] : no solving takes place, so the model just calculates fluxes using the initial state
- `newton` : the Newton-Raphson algorithm is used
- `gauss` : the Gauss-Newton algorithm is used
- `levenberg` : the Levenberg–Marquardt algorithm is used

* `initial_state` describes the initial temperature profile applied to the atmosphere. This is a list of strings which are applied in the given order, which allows the user to describe a specific state as required. The descriptors are listed below, some of which take a single argument that needs to immediately follow the descriptor in the list order.
* `execution.initial_state` describes the initial temperature profile applied to the atmosphere. This is a list of strings which are applied in the given order, which allows the user to describe a specific state as required. The descriptors are listed below, some of which take a single argument that needs to immediately follow the descriptor in the list order.
- `dry` : integrate the dry adiabatic lapse rate from the surface upwards
- `str`, `arg` : apply an isothermal stratosphere at `arg` kelvin
- `iso`, `arg` : set the whole atmosphere to be isothermal at `arg` kelvin
Expand All @@ -51,8 +52,8 @@ Some `execution` parameters:
- `sat` : ensure that no supersaturation occurs at the surface by removing gases as required

For example, setting `initial_state = ["dry", "sat", "H2O", "str", "180"]` will set T(p) to follow the dry adiabat from the surface, the water condensation curve above that, and then to be isothermal at 180 K until the top of the model.
* `chem_type` describes the type of chemistry to implement within the model. This is handled externally by FastChem. You must also provide the path to the FastChem installation directory `fastchem_path` in the `[files]` section. The allowed values (integers) are...

* `composition.chem_type` describes the type of chemistry to implement within the model. This is handled externally by FastChem. You must also provide the path to the FastChem installation directory `fastchem_path` in the `[files]` section. The allowed values (integers) are...
- 0 : Disabled
- 1 : Equilibrium, gas phase only
- 2 : Equilibrium, with condensation (condensates retained)
Expand Down
26 changes: 10 additions & 16 deletions res/config/55cnce_chem.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,25 @@ title = "Roughly 55 Cancri e @ fO2=IW-4"
albedo_s = 0.0
radius = 1.1959e7
gravity = 22.304
p_surf = 854.894
p_top = 1e-6

# Set surface abundances
# First 6 are set by outgassing code
# SO2, FeO2 set to 0.01 to "sprinkle in" some S and Fe
# Others set to zero but allowed to be modelled
vmr = { H2O=0.0017, CO2=0.0, N2=0.0001, H2=0.5837, CO=0.4095, CH4=0.005, SO2=0.01, FeO2=0.01, O2=0.00, OH=0.0, H=0.0, SO=0.0, NH3=0.0, NH2=0.0, H2S=0.0, H2SO4=0.0}
condensates = []
tmp_int = 0.0
turb_coeff = 0.001
wind_speed = 2.0

wind_speed = 2.0
[files]
clean_output = true
input_sf = "res/spectral_files/nogit/Dayspring/48/Dayspring.sf"
input_star = "res/stellar_spectra/sun.txt"
input_vmr = ""
output_dir = "out/"
fastchem_path = "/Users/nichollsh/Projects/fastchem/"


[composition]
p_top = 1e-6
p_dict = {H2O=1.435, CO2=0.11, N2=0.043, H2=499.004, CO=350.044, CH4=4.258, SO2=0.01, FeO2=0.01}
include_all = true
chemistry = 1
condensates = []

[execution]
clean_output = true
verbosity = 1
max_steps = 20000
max_runtime = 400
Expand All @@ -46,8 +42,6 @@ title = "Roughly 55 Cancri e @ fO2=IW-4"
sensible_heat = true
latent_heat = true
convection_type = "mlt"
condensates = []
chemistry = 1
solution_type = 3
solvers = ["newton"]
dx_max = 200.0
Expand Down
58 changes: 0 additions & 58 deletions res/config/H2_demo.toml

This file was deleted.

58 changes: 0 additions & 58 deletions res/config/cloud.toml

This file was deleted.

18 changes: 11 additions & 7 deletions res/config/condense.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AGNI configuration file
title = "Condensation test" # Name for this configuration file
title = "Condensation test"

[planet]
tmp_surf = 2000.0
Expand All @@ -10,10 +10,6 @@ title = "Condensation test" # Name for this configuration fil
albedo_s = 0.2
radius = 6.37e6
gravity = 9.81
p_surf = 7000.0
p_top = 1e-5
vmr = { H2O=0.8, CO2=0.1, CH4=0.08, H2=0.02}
condensates = ["H2O", "CO2"]
tmp_int = 0.0
turb_coeff = 1.0e-4
wind_speed = 10.0
Expand All @@ -27,8 +23,17 @@ title = "Condensation test" # Name for this configuration fil
input_star = "res/stellar_spectra/sun.txt"
output_dir = "out/"

[composition]
p_surf = 7000.0
p_top = 1e-5
vmr_dict = { H2O=0.8, CO2=0.1, CH4=0.08, H2=0.02}
include_all = false
chemistry = 0
condensates = ["H2O", "CO2"]

[execution]
verbosity = 1
clean_output = true
verbosity = 1
max_steps = 300
max_runtime = 200
num_levels = 35
Expand All @@ -41,7 +46,6 @@ title = "Condensation test" # Name for this configuration fil
sensible_heat = true
latent_heat = true
convection_type = "mlt"
chemistry = 0
solution_type = 1
solvers = ["newton"]
dx_max = 600.0
Expand Down
26 changes: 15 additions & 11 deletions res/config/default.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# AGNI configuration file
# This is the default configuration file - it does not solve for RCE
# The variables are explained below. If you want to model your own conditions,
# try making a copy of this file and then modifying it.

title = "Default" # Name for this configuration file

[planet]
tmp_surf = 2000.0 # Surface temperature [kelvin]
instellation = 44000.0 # Stellar flux at planet's orbital distance [W m-2]
albedo_b = 0.18 # Pseudo bond-albedo which downscales the stellar flux by 1-this_value
albedo_b = 0.18 # Pseudo bond-albedo which downscales the stellar flux by 1-this_value
s0_fact = 0.6652 # Stellar flux scale factor which accounts for planetary rotation (c.f. Cronin+13)
zenith_angle = 60.0 # Characteristic zenith angle for incoming stellar radiation [degrees]
albedo_s = 0.0 # Surface albedo
radius = 6.37e6 # Planet radius at the surface [m]
gravity = 9.81 # Gravitational acceleration at the surface [m s-2]
p_surf = 270.0 # Total surface pressure [bar]
p_top = 1e-5 # Total top-of-atmosphere pressure [bar]
vmr = { H2O = 1.0 } # Volatile volume mixing ratios
condensates = [] # List of condensable gases
skin_d = 0.01 # Conductive skin thickness [m]. Used when sol_type=2.
skin_k = 2.0 # Conductive skin conductivity [W m-1 K-1]. Used when sol_type=2.
tmp_magma = 3000.0 # Magma temperature [K]. Used when sol_type=2.
Expand All @@ -23,13 +21,21 @@ title = "Default" # Name for this configuration file
wind_speed = 2.0 # Effective wind speed for sensible heat [m s-1].

[files]
clean_output = true
input_sf = "res/spectral_files/Frostflow/256/Frostflow.sf" # Path to SOCRATES spectral file.
input_sf = "res/spectral_files/Frostflow/256/Frostflow.sf" # Path to SOCRATES spectral file.
input_star = "res/stellar_spectra/sun.txt" # Path to stellar spectrum.
input_vmr = "" # Path to input volume mixing ratios. Not required if planet.vmr is passed.
output_dir = "out/" # Path to output directory.

[composition]
p_surf = 270.0 # Total surface pressure [bar]
p_top = 1e-5 # Total top-of-atmosphere pressure [bar]
vmr_dict = { H2O = 1.0} # Volatile volume mixing ratios (=mole fractions)
vmr_path = "" # Path to input volume mixing ratios. Not required if planet.vmr is passed.
include_all = false # Track extra gases, even when their mixing ratio is zero
chemistry = 0 # Chemistry type (see wiki)
condensates = [] # List of volatiles which are allowed to condense.

[execution]
clean_output = true # Clean the output folder at model startup
verbosity = 1 # Log level (0: none, 1: normal, 2: debug)
max_steps = 20000 # Maximum number of solver steps.
max_runtime = 400 # Maximum wall-clock solver runtime [s].
Expand All @@ -43,8 +49,6 @@ title = "Default" # Name for this configuration file
sensible_heat = false # Include sensible heat transport at the surface?
latent_heat = false # Include heat release from phase change
convection_type = "" # Convection type (mlt = use mixing length theory).
condensates = [] # List of volatiles which are allowed to condense.
chemistry = 0 # Chemistry type (see wiki
solution_type = 0 # Solution type (see wiki).
solvers = [] # Ordered list of solvers to apply (see wiki).
dx_max = 200.0 # Maximum step size [Kelvin], when using nonlinear solvers
Expand Down
Loading

0 comments on commit 34e2e63

Please sign in to comment.