{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Visualizing models" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "\n", "import timflow.transient as tft" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ml = tft.ModelMaq(\n", " kaq=[1, 20, 2],\n", " z=[25, 20, 18, 10, 8, 0],\n", " c=[500, 1000],\n", " Saq=[0.1, 1e-4, 1e-4],\n", " Sll=[0, 0],\n", " phreatictop=True,\n", ")\n", "ls = tft.RiverString(ml, xy=[(-25, -30), (-15, 10), (10, 20)], tsandh=\"fixed\", layers=0)\n", "w = tft.Well(ml, xw=0, yw=0, rw=0.2, tsandQ=[(0, 1000)], layers=1)\n", "\n", "ml.initialize()\n", "ml.solve(silent=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Top-view of model\n", "\n", "Plot a top-view of the model and the locations of the elements." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fig, axes = plt.subplots(1, 3, figsize=(10, 4), sharex=True, sharey=True)\n", "\n", "ml.plots.topview(ax=axes[0])\n", "axes[0].set_title(\"All layers\")\n", "ml.plots.topview(ax=axes[1], layers=0)\n", "axes[1].set_title(\"Layer 0\")\n", "ml.plots.topview(ax=axes[2], layers=1)\n", "axes[2].set_title(\"Layer 1\");\n", "\n", "# OR\n", "# ml.plot()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Cross-section of model\n", "\n", "Plot a cross-section of the model along a line. Optionally add labels and\n", "parameter values.\n", "\n", "Note: Currently no elements are plotted in the cross-section." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ax = ml.plots.xsection(xy=[(-30, 0), (10, 0)], params=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Head contours\n", "\n", "Plot head contours at time $t$ in a given window in specified layers." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ax = ml.plots.contour(\n", " win=[-50, 50, -50, 50],\n", " ngr=50,\n", " levels=10,\n", " t=10,\n", " decimals=2,\n", " layers=[0, 1],\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Head along line\n", "\n", "Plot the heads along a given line at time $t$ in specified layers. " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ax = ml.plots.head_along_line(-30, 10, 0, 0, t=10, layers=[0, 1, 2])" ] } ], "metadata": { "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 4 }