{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Chemical kinetics for mineral reactions using custom surface area models\n", "\n", "
Written by Allan Leal (ETH Zurich) on Nov 30th, 2022
\n", "\n", "```{attention}\n", "Always make sure you are using the [latest version of Reaktoro](https://anaconda.org/conda-forge/reaktoro). Otherwise, some new features documented on this website will not work on your machine and you may receive unintuitive errors. Follow these [update instructions](updating_reaktoro_via_conda) to get the latest version of Reaktoro!\n", "```\n", "\n", "This tutorial is unfinished. We will show you here how to define your own surface area model to be used together with heterogeneous reactions (such as mineral dissolution/precipitation reactions). For example, we'll show how to define the following surface area model below commonly used by geochemical modeling software (e.g., PHREEQC {cite}`Parkhurst2013`):\n", "\n", "~~~py\n", "def areafn(props: ChemicalProps):\n", " q0 = 1.0 # the initial amount of calcite (in mol)\n", " A0 = 0.1 # the initial surface area of calcite (in m2)\n", " q = props.speciesAmount(\"Calcite\") # current amount of calcite during the simulation\n", " return A0 * pow(q / q0, p)\n", "\n", "system = ChemicalSystem(db, \n", " ...\n", " MineralSurface(\"Calcite\").setAreaModel(areafn)\n", " ...\n", ") \n", "~~~\n", "\n", "Stay tuned!" ] } ], "metadata": { "interpreter": { "hash": "e4e8b2f3ae27709963f14fd23a6560d362beea55eaec742263828e04d814e23c" }, "kernelspec": { "display_name": "Python 3.9.7 64-bit ('reaktoro-jupyter-book': conda)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.9" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }