integrating-diagenetic-equations-using-python

Reactive-transport model simulating formation of limestone-marl alternations

https://github.com/astro-turing/integrating-diagenetic-equations-using-python

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.0%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Reactive-transport model simulating formation of limestone-marl alternations

Basic Info
  • Host: GitHub
  • Owner: astro-turing
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 2.03 MB
Statistics
  • Stars: 0
  • Watchers: 3
  • Forks: 1
  • Open Issues: 11
  • Releases: 0
Created over 3 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

README.md

Python implementation of the reactive-transport diagenetic model by L'Heureux (2018)

This repo was created in an attempt to reproduce the plots shown at the kickoff of the AstroTOM ("Turing or Milankovitch") project by Niklas Hohmann, from his Matlab scripts (available at github.com/MindTheGap-ERC/LMA-Matlab).

AstroTOM is an OpenSSI 2021b project from the Netherlands eScience Center and Utrecht University (UU).

Dr. Emilia Jarochowska (UU) is the lead applicant of this project.

After replacing central differencing for the gradients in the five diagenetic equations 40-43 from L'Heureux (2018) by forward and backward differencing depending on the sign of U and W as a first step and a Fiadeiro-Veronis spatial difference scheme as a second step, it turns out that these equations can be integrated for more than 13.190 years (the full T*) with an implicit or explicit (in time) solver, but not with a simple Eulerian scheme. A Runge-Kutta solver, with an adaptive timestep will, however, suffice. After correcting the value of b (5-->5e-4) it turned out that a stable integration is also possible without a Fiadeiro-Veronis scheme. We currently make use of a constant porosity diffusion coefficient.

The implicit (in time) solvers that solve_ivp offers can be deployed with its numerically approximated Jacobians and a Jacobian sparsity matrix.

Wide use is made of the py-pde package, especially CartesianGrid and ScalarField.

Installing and using

To run this code, you need git and conda or pip to install . git clone git@github.com:astro-turing/Integrating-diagenetic-equations-using-Python.git or git clone https://github.com/astro-turing/Integrating-diagenetic-equations-using-Python.git Next, cd Integrating-diagenetic-equations-using-Python pipenv install

For the latter command you need pipenv which you can install using either pip install pipenv or conda install -c conda-forge pipenv.

Now you may be running into certain Python version requirements, i.e. the Pipfile requires a Python version that you do not have installed. For this conda can help, e.g.: conda create -n py311 python=3.11 anaconda to create a Conda Python 3.11 environment.

You can use that freshly installed Python version and possibly any additionally installed libraries - using the --site-packages argument - by executing pipenv install --python=$(conda run -n py311 which python) --site-packages --skip-lock. The latter argument - --skip-lock - may be redundant, but if your previous pipenv install failed, pipenv --rm may be needed.

After a succesful pipenv installation you should be able to execute

pipenv run python marlpde/Evolve_scenario.py or

pipenv shell python marlpde/Evolve_scenario.py Results in the form of an .hdf5 file will be stored in a subdirectory of a Results directory, which will be in the root folder of the cloned repo.

Alternative: poetry

If you prefer poetry over pipenv, you may install all the dependencies and activate the environment using the command poetry install. Next, either:

poetry run python marlpde/Evolve_scenario.py or

poetry shell python marlpde/Evolve_scenario.py

Running tests

From the root folder, i.e. the folder you enter after cd Integrating-diagenetic-equations-using-Python, either run pipenv run python -m pytest or

poetry run python -m pytest

Copyright

Copyright 2023 Netherlands eScience Center and Utrecht University

Funding information

Funded by the European Union (ERC, MindTheGap, StG project no 101041077). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council. Neither the European Union nor the granting authority can be held responsible for them. European Union and European Research Council logos

Owner

  • Name: astro-turing
  • Login: astro-turing
  • Kind: organization

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: Reactive transport model for limestone-marl sequences
message: >-
  If you use this software, please cite it using the
  metadata from this file, in addition to the paper by
  L'Heureux 2018.
type: software
authors:
  - given-names: Hanno
    family-names: Spreeuw
    email: h.spreeuw@esciencecenter.nl
    affiliation: The Netherlands eScience Center
    orcid: 'https://orcid.org/0000-0002-5057-0322'
  - given-names: Emilia
    family-names: Jarochowska
    email: e.b.jarochowska@uu.nl
    affiliation: Utrecht University
    orcid: 'https://orcid.org/0000-0001-8937-9405'
  - given-names: Niklas
    family-names: Hohmann
    email: n.h.hohmann@uu.nl
    affiliation: Utrecht University
    orcid: 'https://orcid.org/0000-0003-1559-1838'
  - given-names: Johan
    family-names: Hidding
    email: j.hidding@esciencecenter.nl
    affiliation: Netherlands eScience Center
    orcid: 'https://orcid.org/0000-0002-7550-1796'
identifiers:
  - type: doi
    value: 10.1155/2018/4968315
    description: >-
      Original paper by L'Heureux presenting the diagenetic
      model and results.
repository-code: >-
  https://github.com/MindTheGap-ERC/reactive-transport-model-for-limestone-marl-sequences
url: 'https://github.com/MindTheGap-ERC/'
repository: >-
  https://github.com/astro-turing/Integrating-diagenetic-equations-using-Python
abstract: >-
  This work was first triggered by research from Ivan
  L'Heureux described in his 2018 paper
  (https://doi.org/10.1155/2018/4968315). Figures and other
  results from this paper have been derived from Fortran
  code published here:
  https://github.com/astro-turing/lheureux. Niklas Hohmann
  tried to reproduce the figures based on the directions
  given in the L'Heureux 2018 paper, by programming this
  Matlab code: https://github.com/MindTheGap-ERC/LMA-Matlab.
  The Matlab solver suffered from numerical instabilities,
  which initiated the current work.
keywords:
  - Diagenetic models
  - Numerical instabilities
  - Fiadeiro-Veronis scheme for gradient computation
  - Python
  - Coupled partial differential equations
  - Aragonite dissolution
  - py-pde
license: Apache-2.0

GitHub Events

Total
  • Delete event: 1
  • Issue comment event: 1
  • Push event: 2
  • Pull request event: 3
  • Create event: 1
Last Year
  • Delete event: 1
  • Issue comment event: 1
  • Push event: 2
  • Pull request event: 3
  • Create event: 1

Dependencies

Pipfile pypi
  • future *
  • h5py *
  • matplotlib *
  • networkx *
  • numpy *
  • ply *
  • py-pde *
  • pytest *
  • scipy *
  • smop *
  • tqdm *
Pipfile.lock pypi
  • attrs ==22.1.0
  • contourpy ==1.0.6
  • cycler ==0.11.0
  • exceptiongroup ==1.0.4
  • fonttools ==4.38.0
  • future ==0.18.2
  • h5py ==3.7.0
  • iniconfig ==1.1.1
  • kiwisolver ==1.4.4
  • llvmlite ==0.39.1
  • matplotlib ==3.6.2
  • mpmath ==1.2.1
  • networkx ==2.8.8
  • numba ==0.56.4
  • numpy ==1.23.5
  • packaging ==21.3
  • pillow ==9.3.0
  • pluggy ==1.0.0
  • ply ==3.11
  • py-pde ==0.23.0
  • pyparsing ==3.0.9
  • pytest ==7.2.0
  • python-dateutil ==2.8.2
  • scipy ==1.9.3
  • setuptools ==65.6.0
  • six ==1.16.0
  • smop ==0.41
  • sympy ==1.11.1
  • tomli ==2.0.1
  • tqdm ==4.64.1
poetry.lock pypi
  • colorama 0.4.6
  • contourpy 1.0.6
  • cycler 0.11.0
  • fonttools 4.38.0
  • h5py 3.7.0
  • kiwisolver 1.4.4
  • llvmlite 0.39.1
  • matplotlib 3.6.2
  • mpmath 1.2.1
  • numba 0.56.4
  • numpy 1.23.5
  • packaging 21.3
  • pillow 9.3.0
  • py-pde 0.23.0
  • pyparsing 3.0.9
  • python-dateutil 2.8.2
  • scipy 1.9.3
  • setuptools-scm 7.0.5
  • six 1.16.0
  • sympy 1.11.1
  • tomli 2.0.1
  • tqdm 4.64.1
  • typing-extensions 4.4.0
pyproject.toml pypi
  • h5py ^3.7.0
  • numba ^0.56.4
  • numpy ^1.23.5
  • py-pde ^0.23.0
  • python >=3.10,<3.12
  • tqdm ^4.64.1
.github/workflows/python-app.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite