<jupyter_start><jupyter_text>TimML Notebook 4 Horizontal well A horizontal well is located in a 20 m thick aquifer; the hydraulic conductivity is $k = 10$ m/d and the verticalanisotropy factor is 0.1. The horizontal well is placed 5 m above the bottom of the aquifer. The well hasa discharge of 10,000 m$^3$/d and radius of $r=0.2$ m. The well is 200 m long and runs from $(x, y) = (−100, 0)$to $(x, y) = (100, 0)$. A long straight river with a head of 40 m runs to the right of the horizontal well along the line$x = 200$. The head is fixed to 42 m at $(x, y) = (−1000, 0)$.Three-dimensional flow to the horizontal well is modeled by dividing the aquifer up in 11 layers; theelevations are: `[20, 15, 10, 8, 6, 5.5, 5.2, 4.8, 4.4, 4, 2, 0]`. At the depth of the well, the layer thickness is equal tothe diameter of the well, and it increases in the layers above and below the well. A TimML model is created with the Model3Dcommand. The horizontal well is located in layer 6 and is modeled with the `LineSinkDitch` element. Initially, the entry resistance of the well is set to zero.<jupyter_code>%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from timml import *
figsize = (6, 6)
z = [20, 15, 10, 8, 6, 5.5, 5.2, 4.8, 4.4, 4, 2, 0]
ml = Model3D(kaq=10, z=z, kzoverkh=0.1)
ls1 = LineSinkDitch(ml, x1=-100, y1=0, x2=100, y2=0, Qls=10000, order=5, layers=6)
ls2 = HeadLineSinkString(ml, [(200, -1000), (200, -200), (200, 0), (200, 200), (200, 1000)], hls=40, order=5, layers=0)
rf = Constant(ml, xr=-1000, yr=0, hr=42, layer=0)<jupyter_output><empty_output><jupyter_text>Questions: Exercise 4aSolve the model.<jupyter_code>ml.solve()<jupyter_output>Number of elements, Number of equations: 3 , 31
...
solution complete<jupyter_text>Exercise 4bCreate contour plots of layers 0 and 6 and note the difference between the layers. Also,compute the head at $(x, y) = (0, 0.2)$ (on the edge of the well) and notice that there is a very large headdifference between the top of the aquifer and the well.<jupyter_code>ml.contour(win=[-150, 150, -150, 150], ngr=[50, 100], layers = [0, 6],
           figsize=figsize)
print('The head at the top and in layer 6 are:')
print(ml.head(0, 0.2, [0, 6]))<jupyter_output>The head at the top and in layer 6 are:
[24.75875345 13.05844222]<jupyter_text>Exercise 4cDraw a number of pathlines from different elevations using the `tracelines` command. First make a plot with a cross section below it.<jupyter_code>ml.plot(win=[-1000, 1000, -1000, 1000], orientation='both', figsize=figsize)
ml.tracelines(xstart=[-500, -500, -500], ystart=[-500, -500, -500], zstart=[5, 9, 15], 
              hstepmax=20, tmax=10 * 365.25, orientation='both', color='C0')
ml.tracelines(xstart=[250, 250, 250], ystart=[50, 50, 50], zstart=[5, 9, 15], 
              hstepmax=20, tmax=10 * 365.25, orientation='both', color='C1')<jupyter_output>...
...<jupyter_text>Exercise 4dMake a contour plot of the heads in a vertical cross-section using the `vcontour` command. Use a cross-section along the well.<jupyter_code>ml.vcontour(win=[-200, 300, 0, 0], n=50, levels=20, figsize=(6,6))<jupyter_output><empty_output><jupyter_text>Exercise 4eChange the entry resistance of the horizontal well to 0.01 days and set the width to 0.4 m and resolve the model. Notice the difference in the head inside the horizontal well with the `headinside` function of the horizontal well. Use a<jupyter_code>print('head inside w/o resistance:')
print(ls1.headinside())
ml = Model3D(kaq=10, z=z, kzoverkh=0.1)
ls = LineSinkDitch(ml, x1=-100, y1=0, x2=100, y2=0, Qls=10000, order=5, layers=6, wh=0.4, res=0.01)
HeadLineSinkString(ml, [(200, -1000), (200, -200), (200, 0), (200, 200), (200, 1000)], 
                   hls=40, order=5, layers=0)
rf = Constant(ml, xr=-1000, yr=0, hr=42, layer=0)
ml.solve()
print('head inside horizontal well:', ls.headinside())
ml.vcontour(win=[-200, 300, 0, 0], n=50, levels=20, vinterp=False)<jupyter_output><empty_output><jupyter_text>Slanted wellA slanted well may be simulated by putting different sections in different layers<jupyter_code>z = [20, 15, 10, 8, 6, 5.5, 5.2, 4.8, 4.4, 4, 2, 0]
ml = Model3D(kaq=10, z=np.linspace(20, 0, 21), kzoverkh=0.1)
rf = Constant(ml, 0, 1000, 20)
x = np.linspace(-200, 200, 21)
y = np.zeros(21)
ls = HeadLineSinkString(ml, xy=list(zip(x, y)), hls=10, layers=np.arange(0, 20, 1), order=0)
ml.solve()
ml.vcontour(win=[-400, 400, 0, 0], n=200, levels=20, vinterp=False, figsize=(16, 4))<jupyter_output><empty_output><jupyter_text>Note that the head is not exactly constant along the line-sink segments when using order 0<jupyter_code>h = ml.headalongline(np.linspace(-201, -170, 100), 0)
plt.plot(np.linspace(-201, -170, 100), h[0])
Qtot = np.sum(ls.discharge())
print('Discharge of slanted well when modeled with fixed head hls=10:', Qtot)
z = [20, 15, 10, 8, 6, 5.5, 5.2, 4.8, 4.4, 4, 2, 0]
ml = Model3D(kaq=10, z=np.linspace(20, 0, 21), kzoverkh=0.1)
rf = Constant(ml, 0, 1000, 20)
x = np.linspace(-200, 200, 21)
y = np.zeros(21)
ls = LineSinkDitchString(ml, xy=list(zip(x, y)), Qls=Qtot, layers=np.arange(0, 20, 1), order=0)
ml.solve()
ml.vcontour(win=[-400, 400, 0, 0], n=200, levels=20, vinterp=False, figsize=(16, 4))
print('Head in slanted well when modeled with fixed discharge:')
[print(lspart.headinside()) for lspart in ls.lslist];<jupyter_output>Head in slanted well when modeled with fixed discharge:
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
[10.]
{'fraction_non_alphanumeric': 0.1562329885683179, 'fraction_numerical': 0.10687715478134639, 'mean_word_length': 4.741666666666666, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '399962', 'license': 'MIT', 'n_tokens_mistral': 2527, 'n_tokens_neox': 2097, 'n_words': 716, 'path': 'notebooks/timml_notebook4_sol.ipynb', 'repo_name': 'Huite/timml', 'size': '5511'}