From 9858c21dc36acf506c98cf050dc024c7ec4dd93e Mon Sep 17 00:00:00 2001 From: "Langevin, Christian D" Date: Mon, 18 Mar 2024 09:43:33 -0500 Subject: [PATCH] Update Langevin notebooks based on reviewer comments --- .../04_files_and_strings.ipynb | 14 ++++-- .../part1_flopy/05-unstructured-grids.ipynb | 19 ++++++-- .../part1_flopy/09-gwt-voronoi-demo.ipynb | 47 ++++++++++++++++--- 3 files changed, 67 insertions(+), 13 deletions(-) diff --git a/notebooks/part0_python_intro/04_files_and_strings.ipynb b/notebooks/part0_python_intro/04_files_and_strings.ipynb index 5c20e43..9687459 100644 --- a/notebooks/part0_python_intro/04_files_and_strings.ipynb +++ b/notebooks/part0_python_intro/04_files_and_strings.ipynb @@ -97,7 +97,7 @@ "source": [ "### A better way to write a file, with `with`.\n", "\n", - "The python `with` statement allows us to create a file handle that automatically closes after the code exits the with statement. This not only reduces the amount of code that exists, it also ensures that file handles are not not left open as the code progresses." + "The python `with` statement allows us to create a file handle that automatically closes after the code exits the with statement. The use of `with` invokes a Python context manager, which ensures that the file is closed as soon as the program exits the `with` context block. This not only reduces the amount of code that exists, it also ensures that file handles are not not left open as the code progresses." ] }, { @@ -840,13 +840,21 @@ ], "metadata": { "kernelspec": { - "display_name": "pyclass", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", "name": "python", - "version": "3.11.7" + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.1" } }, "nbformat": 4, diff --git a/notebooks/part1_flopy/05-unstructured-grids.ipynb b/notebooks/part1_flopy/05-unstructured-grids.ipynb index 07b5654..7bc3547 100644 --- a/notebooks/part1_flopy/05-unstructured-grids.ipynb +++ b/notebooks/part1_flopy/05-unstructured-grids.ipynb @@ -4,7 +4,18 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# 05: FloPy Model Grids" + "# Unstructred Grids\n", + "\n", + "This notebook demonstrates FloPy functionality for creating different types of model grids. Six different model grids are constructed for the same domain. The domain is defined by a polygon intended to represent a hydrologic basin.\n", + "\n", + "The grids generated in this notebook include the following:\n", + "\n", + "* Regular MODFLOW grid\n", + "* Irregular MODFLOW grid with variable row and column spacings\n", + "* Nested grid, consisting of parent and child grids\n", + "* Quadtree grid created using the FloPy wrapper for the [USGS Gridgen program](https://www.usgs.gov/software/gridgen-program-generating-unstructured-finite-volume-grids)\n", + "* Triangular grid created using the FloPy wrapper for the [Triangle program](https://www.cs.cmu.edu/~quake/triangle.html).\n", + "* Voronoi grid created using the [Triangle program](https://www.cs.cmu.edu/~quake/triangle.html) and the [Scipy voronoi class](https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.Voronoi.html#scipy.spatial.Voronoi) " ] }, { @@ -437,7 +448,7 @@ "tri.add_polygon(poly)\n", "tri.build(verbose=False)\n", "\n", - "# Create the flopy Voronoi grid oboject and the flopy VertexGrid\n", + "# Create the flopy Voronoi grid object and the flopy VertexGrid\n", "vor = VoronoiGrid(tri)\n", "gridprops = vor.get_gridprops_vertexgrid()\n", "idomain = np.ones((1, vor.ncpl), dtype=int)\n", @@ -459,7 +470,7 @@ ], "metadata": { "kernelspec": { - "display_name": "pyclass", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -473,7 +484,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.7" + "version": "3.12.1" } }, "nbformat": 4, diff --git a/notebooks/part1_flopy/09-gwt-voronoi-demo.ipynb b/notebooks/part1_flopy/09-gwt-voronoi-demo.ipynb index 5a028e4..6db863b 100644 --- a/notebooks/part1_flopy/09-gwt-voronoi-demo.ipynb +++ b/notebooks/part1_flopy/09-gwt-voronoi-demo.ipynb @@ -5,7 +5,26 @@ "id": "afad5282", "metadata": {}, "source": [ - "# 09: Demonstration of MODFLOW 6 Groundwater Transport" + "# Demonstration of MODFLOW 6 Groundwater Transport with a Voronoi Grid\n", + "\n", + "MODFLOW 6 includes a Groundwater Transport (GWT) Model for simulation of solute transport through the subsurface. The GWT Model can be used with structured or unstructured model grids. The purpose of this example is to demonstrate the construction, running, and post-processing of a simple solute transport model.\n", + "\n", + "The solute transport model is based on an existing flow model of the Freyberg example. The flow model usesd a voronoi model grid to simulate steady-state conditions. In this notebook, we create a transient solute transport model using the same voronoi grid that was used for flow.\n", + "\n", + "The following steps are used in this notebook.\n", + "* Load the existing flow model into FloPy\n", + "* Plot the model grid\n", + "* Create the solute transport model\n", + "* Run the solute transport model with MODFLOW 6\n", + "* Create animations of the model results" + ] + }, + { + "cell_type": "markdown", + "id": "88945275-63d6-4c07-8189-45e2911bc5cc", + "metadata": {}, + "source": [ + "### Imports" ] }, { @@ -24,6 +43,14 @@ "from flopy.utils.triangle import Triangle as Triangle" ] }, + { + "cell_type": "markdown", + "id": "01909c79-e3d5-45c9-b058-ffb1d8216f51", + "metadata": {}, + "source": [ + "### Load and Plot the Existing Flow Model" + ] + }, { "cell_type": "code", "execution_count": null, @@ -100,7 +127,7 @@ "id": "24a69ac7-9fd0-4dbb-940e-138f7a7493e5", "metadata": {}, "source": [ - "Determine the cell number of the constant concentration" + "Assign a constant concentration condition to the x, y location of 550, 7900. Use the `modelgrid.intersect` method to determine the cell number for the constant concentration condition." ] }, { @@ -138,7 +165,7 @@ "id": "e664ff92-50bf-444b-b78d-86d85e2497e8", "metadata": {}, "source": [ - "### Create the GWT Model" + "### Create the Groundwater Transport Model" ] }, { @@ -282,6 +309,14 @@ "sim_gwt.write_simulation()" ] }, + { + "cell_type": "markdown", + "id": "cc7c4f0c-1dc6-4a1b-b933-caa6ba5c360f", + "metadata": {}, + "source": [ + "### Run the Solute Transport Model" + ] + }, { "cell_type": "code", "execution_count": null, @@ -297,7 +332,7 @@ "id": "dab370b7-c023-402a-bf3d-792cc82ad4de", "metadata": {}, "source": [ - "#### Post-process the results" + "### Post-process the results" ] }, { @@ -422,7 +457,7 @@ ], "metadata": { "kernelspec": { - "display_name": "pyclass", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -436,7 +471,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.7" + "version": "3.12.1" } }, "nbformat": 4,