{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 1D given Linesink1D\n", "\n", "Test for implementation of given elements." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", "import timflow.transient as tft" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "z = [0.0, -5.0, -6.0, -15.0]\n", "Saq = [0.2, 1e-4]\n", "c = [10.0]\n", "k = [5.0, 10.0]\n", "delh = 1.0\n", "res = 10.0" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mlconf = tft.ModelMaq(\n", " kaq=k,\n", " z=z,\n", " Saq=Saq,\n", " c=c,\n", " topboundary=\"conf\",\n", " phreatictop=True,\n", " tmin=1e-2,\n", " tmax=1e2,\n", ")\n", "\n", "inhom_left = tft.XsectionMaq(\n", " mlconf,\n", " x1=-np.inf,\n", " x2=10.0,\n", " kaq=k,\n", " z=z,\n", " Saq=Saq,\n", " c=c,\n", " topboundary=\"conf\",\n", " phreatictop=True,\n", ")\n", "inhom_right = tft.XsectionMaq(\n", " mlconf,\n", " x1=10.0,\n", " x2=np.inf,\n", " kaq=k,\n", " z=z,\n", " Saq=Saq,\n", " c=c,\n", " topboundary=\"conf\",\n", " phreatictop=True,\n", ")\n", "\n", "qls = tft.DischargeLineSink1D(\n", " mlconf,\n", " xls=0.0,\n", " tsandq=[(0, 1.0), (10.0, 2.0)],\n", " layers=[0, 1],\n", ")\n", "mlconf.solve()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "x = np.array([10.0])\n", "y = np.zeros_like(x)\n", "t = np.concatenate([np.logspace(-2, 1, 51), np.logspace(1, 1.5, 51)])\n", "\n", "fig, ax = plt.subplots(1, 1, figsize=(10, 3))\n", "\n", "h = mlconf.headalongline(x, y, t)\n", "ax.plot(t, h[0].squeeze(), label=\"layer 0\")\n", "ax.plot(t, h[1].squeeze(), label=\"layer 1\", ls=\"dashed\")\n", "\n", "ax.legend(loc=(0, 1), frameon=False, ncol=3)\n", "ax.set_title(f\"head at x = {x[0]:.0f} m\")\n", "ax.set_xlabel(\"t [d]\")\n", "ax.set_ylabel(\"head [m]\")\n", "ax.grid()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "x = np.linspace(-50, 50, 101)\n", "y = np.zeros_like(x)\n", "t = [1, 10, 100]\n", "\n", "fig, ax = plt.subplots(1, 1, figsize=(10, 3))\n", "\n", "h = mlconf.headalongline(x, y, t)\n", "for i in range(len(t)):\n", " ax.plot(x, h[0, i].squeeze(), label=f\"layer 0, t={t[i]} d\")\n", "# ax.plot(t, h[1, i].squeeze(), label=\"layer 1\", ls=\"dashed\")\n", "\n", "ax.legend(loc=(0, 1), frameon=False, ncol=3)\n", "ax.set_xlabel(\"x [m]\")\n", "ax.set_ylabel(\"head [m]\")\n", "ax.grid()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "qx, _ = mlconf.disvec(1e-6, 0.0, t)\n", "\n", "plt.figure(figsize=(10, 3))\n", "plt.plot(t, qx[0], label=\"layer 0\")\n", "plt.plot(t, qx[1], ls=\"dashed\", label=\"layer 1\")\n", "plt.grid(True)\n", "plt.ylabel(\"q [m/d]\")\n", "plt.xlabel(\"t [d]\")\n", "plt.legend();" ] } ], "metadata": { "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 4 }