forked from djbower/spider
-
Notifications
You must be signed in to change notification settings - Fork 0
Add installation scripts + update documentation with Zensical #8
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
Merged
Merged
Changes from all commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
37ea675
add get_petsc.sh script adapted from the script in PROTEUS (needs tes…
stuitje e7314da
Make petsc install script executable
stuitje 107c8b7
add proteus framework submodule page
stuitje b604ede
add zensical stylesheet to extra.css and move footnote css to footnot…
stuitje e925186
add spider installation script (needs testing)
stuitje 93f5f70
ignore petsc directory
stuitje 42e68c5
add PROTEUS schematic for docs
stuitje e9c6bb1
update mkdocs and add katex
stuitje a9c389b
ignore site/ directory
stuitje 6809340
add footer
stuitje b2387b3
extend model overview from notes and revise structure
stuitje b34af93
fix reference
stuitje 9d0baf1
Add simple getting started page
stuitje 2a61836
Go back to old proteus-version get_petsc as baseline. Do not use this…
stuitje 66055a4
add new get_spider.sh script to replace install_spider.sh, but from a…
stuitje f646dbb
add first new version of installation docs
stuitje aa8dad5
ignore petsc*, not petsc-*
stuitje f941eaa
update get_petsc to build from SPIDER repo and check whether SPIDER i…
stuitje 68a8033
fix syntax error with percentile sign
stuitje f402df2
add testing documentation
stuitje b6da68f
Update installation scripts to log output to log file, to keep the te…
stuitje e731f11
add small python script to generate citations in docs files that rend…
stuitje 9b7782a
plot all timesteps of test output to be compared to the expected outp…
stuitje 1107da3
add quadruple precision to installation guide
stuitje 30e50cc
Make separate page for quadruple precision installation
stuitje 6d8648a
place generated plots in plots/ directory; currently the plots are ha…
stuitje a95e2d3
add a very basic tutorial
stuitje 1ac7bda
add first run tutorial to navigation
stuitje 69152f6
update getting started with tutorial
stuitje a45a150
remove getting started from homepage
stuitje f2b235e
remoe install_spider, we use get_spider
stuitje cdb107f
update plots info
stuitje f6d146e
Translate all files in notes/ directory to markdown files as they are…
stuitje c59312c
make external mesh input part of README into how-to
stuitje 9a013db
update navigation
stuitje d626b5f
add link to external mesh input
stuitje d4704dd
update badges and logo README
stuitje 927eb5f
slightly reorder to avoid 'mixing length theory' twice
stuitje 61ddce0
update docs.yaml for zensical, copied from zalmoxis
stuitje bc48be4
update ci workflow to also test the new installer script
stuitje cd2eb4d
fix memory issue: Copy into a local scalar before restoring the PETS…
stuitje 9e91884
Update .github/workflows/docs.yaml with material and bibtex
stuitje 6439acb
Update README.md logo
stuitje ada0b50
Update mkdocs.ymlL remoe mathjax
stuitje 55ddb83
Update docs/How-to/test.md, fix code block
stuitje 3f20b67
Update py/citations.py: wrap in main()
stuitje e7c6f4b
add python version note
stuitje 2b590f6
restore mathjax and remove katex
stuitje 7ef8a6a
verify curl, unzip, make, python3 available in installer
stuitje 79bfe51
Add prerequisites check to get_spider.sh
stuitje 786f6fb
update explanation get_petsc
stuitje 5e97d9c
Update citations.py: bibtexparser in try except
stuitje 31dc028
Update proteus_framework.md: fix <br>
stuitje fe5f94d
Update test.md: fix plots path
stuitje 757121b
Update quadruple_installation.md: fix typo
stuitje 507f940
Update ci.yml: use actions v6
stuitje 275facc
Update docs/index.md: fix link
stuitje 1acb041
add same header to explanation file as the others
stuitje d6442c5
Merge remote-tracking branch 'refs/remotes/origin/ks/fix_installation…
stuitje fc29ef3
delete redundant file
stuitje d703563
fix numbering
stuitje 8867fee
remove bibliography line
stuitje db80cdd
fix citation issue
stuitje 0f7de59
fix citation 2
stuitje b1e9622
fix citation 3
stuitje 76b7559
fix note
stuitje bf2bdf5
add safety guard before removing old petsc directory
stuitje 60b0b16
remove 'too short path' safety guardrail for removing petsc
stuitje File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,3 +50,9 @@ verification/ | |
| *.lot | ||
| *.synctex.gz | ||
| *.toc | ||
|
|
||
| # petsc directory | ||
| petsc*/ | ||
|
|
||
| # site | ||
| site/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| --- | ||
| tags: | ||
| - phase separation | ||
| - magma ocean | ||
| - thermal evolution | ||
| --- | ||
|
|
||
| # SPIDER: model overview | ||
|
|
||
| Here you can find a detailed overview of the SPIDER formulation. | ||
|
|
||
| !!! note | ||
| This model overview is taken from the [notes](https://github.com/FormingWorlds/SPIDER/tree/main/notes/) and contains an extended description of the equations and derivations related to the SPIDER code. It is still **work in progress.** | ||
|
|
||
| Notes specific to derivations in [^cite-ABE93]. | ||
|
|
||
| ## Phase Separation | ||
|
|
||
| Under the assumption of no melting/solidification, melt-solid separation is treated as a mass-transfer process. Average density of mixture: | ||
|
|
||
| $$\frac{1}{\rho} = \frac{1}{\rho_s}(1-\phi)+\frac{1}{\rho_m}\phi$$ | ||
|
|
||
| where $\phi$ is mass fraction of melt. | ||
|
|
||
| The masses of solid and melt phases per unit volume are: | ||
|
|
||
| $$\rho_s^\ast \equiv (1-\phi) \rho = \frac{\rho_s \rho_m (1-\phi)}{\rho_s \phi + \rho_m(1-\phi)}$$ | ||
|
|
||
| $$\rho_m^\ast \equiv \phi \rho = \frac{\rho_s \rho_m \phi}{\rho_s \phi + \rho_m(1-\phi)}$$ | ||
|
|
||
| Define the velocity of the local barycenter: | ||
|
|
||
| $$v \equiv \phi v_m + (1-\phi) v_s$$ | ||
|
|
||
| And the vertical mass flux of melt relative to the barycenter: | ||
|
|
||
| $$J_m \equiv \rho \phi (1-\phi)(v_m-v_s)$$ | ||
|
|
||
| The phase separation equation becomes: | ||
|
|
||
| $$\frac{\partial \phi}{\partial t} + v \frac{\partial \phi}{\partial z} = \frac{\rho_m \rho_s}{\rho (\rho_s-\rho_m)} \frac{\partial v}{\partial z} = - \frac{1}{\rho} \frac{\partial J_m}{\partial z}$$ | ||
|
|
||
| ## Time Scale | ||
|
|
||
| Characteristic time scale $\tau$ of melt-solid separation for a partially molten layer of thickness $L$: | ||
|
|
||
| $$\tau = \frac{\rho L}{2 J_m} \min (\phi_0, 1-\phi_0 )$$ | ||
|
|
||
| ## Impact Stirring | ||
|
|
||
| During planetary accretion, planetesimal impacts stirred the mantle. Assuming a roughly linear accretion rate: | ||
|
|
||
| $$\frac{dm}{dt} \sim \frac{M_E}{\tau_{acc}}$$ | ||
|
|
||
| The impactor mass distribution is: | ||
|
|
||
| $$\frac{dN}{dm} = {K_{max}\left(\frac{m}{M_{max}}\right)^{-q}}$$ | ||
|
|
||
| with $q=1.5$ and $M_{max}=0.1 M_E$. | ||
|
|
||
| The depth-dependent impact stirring timescale is: | ||
|
|
||
| $$\tau_{s}(d) = \frac{\tau_{acc}}{N_{s}(d)}$$ | ||
|
|
||
| where $N_{s}$ is the effective number of complete stirring events at depth $d$. | ||
|
|
||
| ## Thermal Evolution of a Magma Ocean | ||
|
|
||
| The energy (enthalpy) balance equation: | ||
|
|
||
| $$\frac{\partial H}{\partial t} = - \frac{1}{\rho}\nabla \cdot \vec{J_{tot}} + \Delta V_m|g|\vec{J_m} \cdot \hat{r} + q_{heat}$$ | ||
|
|
||
| The total heat flux is a combination of sensible and latent heat: | ||
|
|
||
| $$J_{tot} = J_q + T\Delta S_m J_m$$ | ||
|
|
||
| The melt fraction can be approximated as: | ||
|
|
||
| $$\phi(H) = \frac{H - H_{sol}}{T\Delta S_m(P)}$$ | ||
|
|
||
| for $H_{sol} < H < H_{liq}$. | ||
|
|
||
| Key assumptions for single-component modeling: | ||
| - Use a single component melting curve roughly corresponding to the 50% solidus | ||
| - Entropy of melting adjusted to ensure bounds match realistic mantle | ||
| - Use realistic heat capacity and density values for both phases | ||
| - Chemical differentiation negligible (second order effect) | ||
| - Thermal range of partially molten region (~200 K) small compared to mantle temperature difference (~2500 K) | ||
|
|
||
| ## Gravitational potential energy | ||
|
|
||
| The gravitational potential energy per unit mass is: | ||
|
|
||
| $$E_{\rm grav} = - \frac{G M(r)}{r} = - |g(r)|r$$ | ||
|
|
||
| Melting influences gravitational potential energy through its effect on $g(r)$. However, since $g(r)$ is an integrated quantity it is not sensitive to small changes in density distribution. We therefore neglect changes in $E_{\mathrm{grav}}$ for silicate melting in a magma ocean. | ||
|
|
||
| [^cite-ABE93]: Yutaka Abe, *Thermal Evolution and Chemical Differentiation of the Terrestrial Magma Ocean*, Evolution of the Earth and Planets, 1993. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| --- | ||
| tags: | ||
| - volatiles | ||
| - outgassing | ||
| - atmospheric escape | ||
| --- | ||
|
|
||
| # SPIDER: model overview | ||
|
|
||
| Here you can find a detailed overview of the SPIDER formulation. | ||
|
|
||
| !!! note | ||
| This model overview is taken from the [notes](https://github.com/FormingWorlds/SPIDER/tree/main/notes/) and contains an extended description of the equations and derivations related to the SPIDER code. It is still **work in progress.** | ||
|
|
||
| ## Volatile Mass Balance | ||
|
|
||
| The mass balance of a given volatile in the interior [^cite-LMC13] is: | ||
|
|
||
| $$X_v^s M^s + X_v^l M^l + X_v^g M^g + m_v^e + m_v^o + m_v^r = X_v^{\rm init} M^m$$ | ||
|
|
||
| where superscripts $s$, $l$, $g$, $e$, $o$, $t$ denote solid, liquid (melt), gas, escaped, ocean, and total. **Only solid, liquid, and atmosphere are physical reservoirs.** | ||
|
|
||
| The partition coefficient relates volatile concentrations: | ||
|
|
||
| $$k_v = \frac{X_v^s}{X_v}$$ | ||
|
|
||
| ### Atmospheric mass | ||
|
|
||
| The total atmospheric mass of $q$ species composes as: | ||
|
|
||
| $$m_t^g = \frac{4 \pi R_p^2}{g} P_s$$ | ||
|
|
||
| where $R_p$ is planetary radius and $P_s$ is surface pressure. | ||
|
|
||
| The mass of a given volatile species is: | ||
|
|
||
| $$m_v^g = 4 \pi R_p^2 \left( \frac{\mu_v^g}{\bar{\mu}} \right) \frac{p_v}{g}$$ | ||
|
|
||
| Partial pressure follows a modified (power-law) Henry's law: | ||
|
|
||
| $$p_v ( X_v ) = \left( \frac{X_v}{\alpha_v} \right)^{\beta_v}$$ | ||
|
|
||
| In SPIDER we use scaled mass (omitting the $4 \pi$ factor): | ||
|
|
||
| $$X_v (k_v M^s + M^l) + \frac{R_p^2}{g} \left( \frac{\mu_v^g}{\bar{\mu}} \right) p_v + m_v^e + m_v^o + m_v^r = X_v^{\rm init} M^m$$ | ||
|
|
||
| We solve for volatile mass fraction in the liquid phase, from which we can compute volatile mass in solid and gas phases. | ||
|
|
||
| ## Non-dimensionalisation | ||
|
|
||
| ### Mass | ||
|
|
||
| Masses are non-dimensionalised as: | ||
|
|
||
| $$M = \rho_0 R_0^3 \hat{M}$$ | ||
|
|
||
| ### Volatile Concentration | ||
|
|
||
| Volatile concentration is expressed as scaled mass fraction: | ||
|
|
||
| $$X_v = V_0 \hat{X}_v$$ | ||
|
|
||
| where $V_0=10^{-6}$ gives parts-per-million (ppm), $V_0=10^{-2}$ gives weight percent (wt%), and $V_0=1$ gives mass fraction. | ||
|
|
||
| ### Power Law Solubility | ||
|
|
||
| Non-dimensional partial pressure: | ||
|
|
||
| $$\hat{p}_v ( \hat{X}_v ) = \left( \frac{\hat{X}_v}{\hat{\alpha}_v} \right)^{\beta_v}$$ | ||
|
|
||
| where: | ||
|
|
||
| $$\hat{\alpha}_v = \frac{\alpha_v^{{\rm ppm/Pa}^{1/\beta_v}}}{10^6} \frac{P_0^\frac{1}{\beta_v}}{V_0}$$ | ||
|
|
||
| ## Sossi Solubility | ||
|
|
||
| For H$_2$O [^cite-SF17]: | ||
|
|
||
| $$X_v = A{f_{H_2O}}^\frac{1}{2}+B G f_{H_2O}$$ | ||
|
|
||
| where fugacities are constrained by oxygen buffer, and $A=534$ ppm/bar$^{0.5}$ and $B=723$ ppm/bar. | ||
|
|
||
| ## Initial Volatile Concentration | ||
|
|
||
| For an initial condition, we prescribe the total volatile concentration and solve the mass balance to obtain initial partial pressure consistent with chemical equilibrium criteria. | ||
|
|
||
| ## Chemical Reactions | ||
|
|
||
| Reactions transfer mass between volatile species. For example: | ||
|
|
||
| $$[\rm{H}_2O]\leftrightarrow \frac{1}{2} [\rm{O}_2] + [\rm{H}_2]$$ | ||
|
|
||
| with equilibrium constant: | ||
|
|
||
| $$K=\frac{p_{\rm H_2} f_{\rm O_2}^{1/2}}{p_{\rm H_2\rm O}}$$ | ||
|
|
||
| Mass is conserved through stoichiometry: | ||
|
|
||
| $$m_{H_2O} = m_{O2} + m_{H_2}$$ | ||
|
|
||
| ## Atmospheric Escape | ||
|
|
||
| ### Jeans escape | ||
|
|
||
| $$\frac{d m_v^e}{dt} = \left( \frac{d m_{\rm v}^{\rm g}}{dt} \right) \mathcal{R} (1 + \lambda_s) \exp(-\lambda_s) + \frac{\Phi}{4 \pi}$$ | ||
|
|
||
| where Jeans parameter: | ||
|
|
||
| $$\lambda_s = \frac{g R_p \mu_{\rm v}}{k_b T_s N_A}$$ | ||
|
|
||
| ### Zahnle escape model | ||
|
|
||
| For H$_2$ [^cite-ZGC19]: | ||
|
|
||
| $$\phi_{H_2} \approx \Gamma \frac{(1 \times 10^{12}) f_{H_2} S}{\sqrt{1+0.006S^2}}$$ | ||
|
|
||
| where $S$ is non-dimensional and $\Gamma$ is a scaling constant. | ||
|
|
||
| ## Grey atmosphere model | ||
|
|
||
| ### Optical depth | ||
|
|
||
| $$\tau^\ast = \frac{3 \kappa^\prime p(\tau^\ast)}{2g}$$ | ||
|
|
||
| ### Effective emissivity | ||
|
|
||
| Optical depths for each volatile are combined: | ||
|
|
||
| $$\epsilon = \frac{2}{\sum_j \tau_j^\ast +2}$$ | ||
|
|
||
| ### Atmosphere temperature structure | ||
|
|
||
| Temperature as function of optical depth [^cite-AM85]: | ||
|
|
||
| $$T(\tau^\ast) = \left( T_0^4 \frac{(\tau^\ast+1)}{2} +T_\infty^4 \right)^\frac{1}{4}$$ | ||
|
|
||
| where: | ||
|
|
||
| $$T_0 = \left( \frac{F_{atm}}{\sigma} \right)^\frac{1}{4}$$ | ||
|
|
||
| ### Stellar flux | ||
|
|
||
| $$F_{sun} = \sigma T_{eqm}^4 = (1-\alpha) \frac{F_0^\prime}{D^2}$$ | ||
|
|
||
| where $\alpha$ is bolometric albedo, $F_0'$ is averaged solar constant, and $D$ is planet-star distance. | ||
|
|
||
| [^cite-LMC13]: Lebrun, T.; Massol, H.; Chassefi\`ere, E.; Davaille, A.; Marcq, E.; Sarda, P.; Leblanc, F.; Brandeis, G., *Thermal evolution of an early magma ocean in interaction with the atmosphere*, J. Geophys. Res.-Planet., 2013. | ||
| [^cite-SF17]: Laura Schaefer; Bruce Fegley, *Redox States of Initial Atmospheres Outgassed on Rocky Planets and Planetesimals*, Astrophys. J., 2017. | ||
| [^cite-ZGC19]: Kevin J. Zahnle; Marko Gacesa; David C. Catling, *Strange messenger: A new history of hydrogen on Earth, as told by Xenon*, Geochim. Cosmochim. Acta, 2019. | ||
| [^cite-AM85]: Abe, Yutaka; Matsui, Takafumi, *The formation of an impact-generated H2O atmosphere and its implications for the early thermal history of the Earth*, J. Geophys. Res. Solid Earth, 1985. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
installer-smokejob runs a full PETSc+SPIDER install from scratch on every PR, which is likely to be slow/flaky and duplicates the existing PETSc build/cached test job. Consider reusing the existing PETSc cache, running this job only on a schedule/manual trigger, or limiting it to a lightweight smoke (e.g.,./tools/get_petsc.shwith caching or a minimal configure) to keep CI times reasonable.