{ "cells": [ { "cell_type": "markdown", "id": "edd8871e-c5c8-41c0-b21a-8cebc129b30e", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "# How-to: Make a cross-section model with `timflow`\n", " \n", "This HowTo describes how to make a transient cross-section model with `timflow`.\n", "\n", "We start by importing the required packages:" ] }, { "cell_type": "code", "execution_count": null, "id": "64c3b56a-ec12-4da3-ad88-64ae7fd4193d", "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", "import timflow.transient as tft\n", "\n", "#\n", "plt.rcParams[\"figure.figsize\"] = (4, 3) # set default figure size\n", "plt.rcParams[\"font.size\"] = 8 # set default font size" ] }, { "cell_type": "markdown", "id": "c8abce62-4971-441d-b45f-5a3dfb9486fa", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "We will create an xsection model for a two-aquifer system with a river with a leaky river bottom (see Figure).\n", "The model is divided in three sections: the left side of the river, the river, and the right side of the river.\n", "The resistance of the top semi-confining layer is different than the resistance of the leaky river bottom. \n", "The aquifer parameters are defined in the table and code cell below. \n", "\n" ] }, { "cell_type": "code", "execution_count": null, "id": "0278d562-ffdf-4495-a842-1eb9f9815329", "metadata": {}, "outputs": [], "source": [ "import matplotlib.colors as mcolors\n", "\n", "\n", "def gradient_fill(x, y, fill_color=\"C0\", ax=None, **kwargs):\n", " if ax is None:\n", " ax = plt.gca()\n", "\n", " z = np.empty((100, 1, 4), dtype=float)\n", " rgb = mcolors.colorConverter.to_rgb(fill_color)\n", " z[:, :, :3] = rgb\n", " z[:, :, -1] = np.linspace(0.1, 0.5, 100)[:, None]\n", "\n", " xmin, xmax, ymin, ymax = x[0], x[1], y[0], y[1]\n", " ax.imshow(\n", " z,\n", " aspect=\"auto\",\n", " extent=[xmin, xmax, ymin, ymax],\n", " origin=\"lower\",\n", " )\n", "\n", "\n", "def arrow(xystart, xyend, text=\"\", arrow=\"<-\", color=\"k\", **kwds):\n", " plt.annotate(\n", " text,\n", " xy=xystart,\n", " xytext=xyend,\n", " arrowprops={\"arrowstyle\": arrow, \"shrinkA\": 0, \"shrinkB\": 0, \"color\": color},\n", " color=color,\n", " **kwds,\n", " )\n", "\n", "\n", "def solution12():\n", " plt.figure(figsize=(8, 3))\n", "\n", " plt.fill(\n", " [-0.1, 0.3, 0.3, -0.1],\n", " [0.8, 0.8, 1.2, 1.2],\n", " color=\"grey\",\n", " fill=False,\n", " hatch=\"//\",\n", " )\n", " plt.fill(\n", " [0.3, 0.7, 0.7, 0.3], [0.8, 0.8, 1.0, 1.0], color=\"grey\", fill=False, hatch=\"//\"\n", " )\n", " plt.fill(\n", " [0.7, 1.1, 1.1, 0.7], [0.8, 0.8, 1.2, 1.2], color=\"grey\", fill=False, hatch=\"//\"\n", " )\n", "\n", " plt.fill(\n", " [-0.1, 1.1, 1.1, -0.1],\n", " [0, 0, -0.2, -0.2],\n", " color=\"grey\",\n", " fill=False,\n", " hatch=\"///\",\n", " )\n", " plt.fill(\n", " [-0.1, 1.1, 1.1, -0.1],\n", " [-1, -1, -0.8, -0.8],\n", " color=\"grey\",\n", " fill=False,\n", " hatch=\"xxx\",\n", " )\n", " plt.plot([-0.1, 0.3], [1.1, 1.1], \"C0\")\n", " plt.plot([0.3, 0.7], [1.4, 1.4], \"C0\")\n", " plt.plot([0.7, 1.1], [1.1, 1.1], \"C0\")\n", " gradient_fill([0.3, 0.7], [1, 1.4])\n", " plt.plot([0.3, 0.3], [0.8, 1.5], \"k\")\n", " plt.plot([0.7, 0.7], [0.8, 1.5], \"k\")\n", " plt.text(0.1, 1.35, \"$h_0$\", ha=\"center\")\n", " plt.text(0.5, 1.55, \"$h_r(t)$\", ha=\"center\")\n", " plt.text(0.9, 1.35, \"$h_0$\", ha=\"center\")\n", " plt.plot([0.5, 0.5], [-1.3, -1.1], \"k\")\n", " arrow((0.5, -1.2), (0.7, -1.2), \"$x$\", va=\"center\")\n", " plt.text(-0.1, 0.4, \"left\", va=\"center\")\n", " plt.text(0.5, 0.25, \"river\", va=\"center\", ha=\"center\")\n", " plt.text(1.1, 0.4, \"right\", ha=\"right\", va=\"center\")\n", " arrow((0.3, 0.45), (0.7, 0.45), arrow=\"<->\")\n", " plt.text(0.5, 0.55, \"$2L$\", ha=\"center\")\n", " plt.ylim(-1.3, 1.5)\n", " plt.axis(\"off\")\n", "\n", "\n", "solution12() # plt.savefig('riverxsection.svg')" ] }, { "cell_type": "markdown", "id": "d9c645d3-a790-42ea-be9b-509ac94aec48", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "| Parameter | left/right | river |\n", "| :------------: | :------: | ----: |\n", "| $c_0$ (d) | 500 | 200 |\n", "| $k_0$ (m/d) | 10 | 10 |\n", "| $S_{s0}$ (m$^{-1}$) | 1e-4 | 1e-4 |\n", "| $c_1$ (d) | 1000 | 1000 |\n", "| $k_1$ (m/d) | 20 | 20|\n", "| $S_{s1}$ (m$^{-1}$) | 1e-4 | 1e-4 |" ] }, { "cell_type": "code", "execution_count": null, "id": "675937ac-6786-4ffb-9c7d-bba705009055", "metadata": {}, "outputs": [], "source": [ "zside = [2, 0, -10, -12, -22] # elevation of top and bottoms of layers, m\n", "zriver = [1, 0, -10, -12, -22] # elevation of top and bottoms of layers, m\n", "cside0 = 500 # resistance of top semi-confining layer, d\n", "criver0 = 200 # resistance of leaky river bottom, d\n", "k0 = 10 # hydraulic conductivity of first aquifer, m/d\n", "Ss0 = 1e-4 # specific storage of first aquifer, m^(-1)\n", "c1 = 1000 # resistance of leaky layer between aquifers, d\n", "k1 = 20 # hydraulic conductivity of second aquifer, m/d\n", "Ss1 = 1e-4 # specific storage of second aquifer, m^(-1)\n", "L = 50 # half width of river, m" ] }, { "cell_type": "markdown", "id": "86d97286-0870-4cea-9b47-fae0be9284ab", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "An cross-sectional model is created with two aquifer layer, \n", "and is stored in the variable `ml`. Next, `XsectionMaq` sections are defined for the\n", "three sections of the model. Make sure that the entire cross-section (from $-\\infty$ to\n", "$+\\infty$) is covered by an `XsectionMaq` (see note below). The head above the semi-confining top is\n", "fixed on the left and right side, which means that the head change equals zero. The\n", "head in the river varies with time and is specified with the `tsandhstar` keyword.\n", "`tsandhstar` must be a list of 2-tuples, where each tuple consists of `(time, head in\n", "river starting at that time)`. Alternatively, `tsandhstar` can be an array with $N$\n", "rows and two columns, where $N$ is the number of times that a different water level in\n", "the river is specified." ] }, { "cell_type": "markdown", "id": "6753a957", "metadata": {}, "source": [ "