{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Test line-sink comparison with row of wells" ] }, { "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\n", "\n", "plt.rcParams[\"font.size\"] = 8.0" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ml = tft.ModelMaq(tmin=0.01, tmax=10)\n", "ls1 = tft.LineSink(ml, -1, 0, 1, 0, tsandQ=[(0, 10)])\n", "ml.solve()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ml2 = tft.ModelMaq(tmin=0.01, tmax=10)\n", "x = np.arange(-0.9, 1, 0.2)\n", "nwells = len(x)\n", "Qtot = 10\n", "for i in range(nwells):\n", " tft.Well(ml2, x[i], 0, tsandQ=[(0, Qtot / nwells)])\n", "ml2.solve()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "t = np.logspace(-2, 1, 100)\n", "h1a = ml.head(0.5, 1, t)\n", "h1b = ml.head(0.5, 10, t)\n", "h2a = ml2.head(0.5, 1, t)\n", "h2b = ml2.head(0.5, 10, t)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.figure(figsize=(4, 3))\n", "plt.semilogx(t, h1a[0], \"b\", label=\"line-sink\")\n", "plt.semilogx(t, h2a[0], \"r--\", label=\"wells\")\n", "plt.semilogx(t, h1b[0], \"b\")\n", "plt.semilogx(t, h2b[0], \"r--\")\n", "plt.xlabel(\"time\")\n", "plt.ylabel(\"head\")\n", "plt.legend()\n", "plt.grid()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ml.plots.contour([-2, 2, -2, 2], [40, 40], t=5, figsize=(4, 4), labels=False)\n", "ml2.plots.contour([-2, 2, -2, 2], [40, 40], t=5, figsize=(4, 4), labels=False);" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "xg1 = np.linspace(-2, 2, 100)\n", "ygtop = np.linspace(1e-6, 2, 50)\n", "ygbot = np.linspace(-2, -1e-6, 50)\n", "htop = ml.headgrid(xg1, ygtop, t=5)\n", "hbot = ml2.headgrid(xg1, ygbot, t=5)\n", "print(f\"min and max head: {np.min(htop)}, {np.max(htop)}\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.figure(figsize=(4, 4))\n", "plt.subplot(aspect=1)\n", "plt.contour(xg1, ygtop, htop[0, 0], np.arange(-10, 0, 0.5), colors=\"C0\", linestyles=\"-\")\n", "plt.contour(xg1, ygbot, hbot[0, 0], np.arange(-10, 0, 0.5), colors=\"C0\", linestyles=\"-\")\n", "plt.title(\"Top half: line-sink, bottom-half: row of wells\");" ] } ], "metadata": { "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 4 }