Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor TTim to compute per log t-interval #74

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
66cbb16
Merge pull request #67 from mbakker7/dev
dbrakenhoff Sep 26, 2024
46d3da0
refactor model.py
dbrakenhoff Oct 29, 2024
95ab8cd
add initialize_interval
dbrakenhoff Oct 29, 2024
66ed452
refactor functions:
dbrakenhoff Oct 29, 2024
3ccdb8b
refactor solve()
dbrakenhoff Oct 29, 2024
88eea89
npint -> nppar
dbrakenhoff Oct 29, 2024
c5b8aff
refactor AquiferData
dbrakenhoff Oct 29, 2024
0861ee2
refactor WellBase
dbrakenhoff Oct 29, 2024
a647941
rename potinf to potinfall
dbrakenhoff Oct 29, 2024
5197c51
refactor Well
dbrakenhoff Oct 29, 2024
0582d91
fix super call
dbrakenhoff Oct 29, 2024
cc14baf
refactor Element
dbrakenhoff Oct 29, 2024
b874f11
refactor WellBoreStorageEquation
dbrakenhoff Oct 29, 2024
d084c71
refactor invlapnumba
dbrakenhoff Oct 29, 2024
10ef23d
add test notebook for Theis problem with log t intervals
dbrakenhoff Oct 29, 2024
acd0b12
Update aquifer.py
mbakker7 Nov 1, 2024
9acaa2e
comment about lababs
mbakker7 Nov 1, 2024
3d44800
Added Hantush
mbakker7 Nov 1, 2024
cb60548
allow time on right boundary of last interval
dbrakenhoff Nov 1, 2024
8a6e59f
start modifying disvec in Model, Element and Well classes
dbrakenhoff Nov 1, 2024
2abe17c
initialize arrays with dtype=complex
dbrakenhoff Nov 1, 2024
999407d
rename old disvec to disvecall
dbrakenhoff Nov 1, 2024
aae4ce6
initialize arrays or astype using float instead of "d"
dbrakenhoff Nov 1, 2024
d16271b
initialize arrays with dtype=complex
dbrakenhoff Nov 1, 2024
1fea1ac
adjust array sizes in element docstring
dbrakenhoff Nov 1, 2024
630d9e7
working on multi-layers systems
mbakker7 Nov 1, 2024
dbfd157
Working on multi-layer solution
mbakker7 Nov 2, 2024
90f7770
testing headwell
mbakker7 Nov 2, 2024
197d764
still working on HeadWell
mbakker7 Nov 2, 2024
1c40eb3
working on potinflayers
mbakker7 Nov 2, 2024
cf69b67
fixed potential function
mbakker7 Nov 2, 2024
8da751e
ml.potential fixed
mbakker7 Nov 2, 2024
b582daa
multi-layer pumping well works
mbakker7 Nov 2, 2024
5b25335
Fixed HeadWell by fixing storing parameters in ml.solve
mbakker7 Nov 3, 2024
9e6f76a
Modified DischargeWell
mbakker7 Nov 4, 2024
25cef84
Added comments
mbakker7 Nov 4, 2024
4241925
fixed dtype from "D" to complex
mbakker7 Nov 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
413 changes: 413 additions & 0 deletions docs/03examples/test_t_intervals.ipynb

Large diffs are not rendered by default.

374 changes: 374 additions & 0 deletions docs/03examples/test_t_intervals2.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,374 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# TTim: compute per log time interval\n",
"\n",
"Import packages"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ttim: /Users/mark/git/ttim/docs/03examples/../../ttim/__init__.py\n"
]
}
],
"source": [
"import sys\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from scipy.special import exp1\n",
"\n",
"use_fork = True\n",
"if use_fork:\n",
" sys.path.insert(1, \"../..\")\n",
"import ttim\n",
"\n",
"# check which ttim\n",
"print(\"ttim:\", ttim.__file__)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"self.neq 1\n",
"solution complete\n"
]
}
],
"source": [
"k = 25\n",
"H = 20\n",
"Ss = 1e-4 / H\n",
"t = np.logspace(0, 1, 100)\n",
"Q = 500\n",
"rw = 0.2\n",
"#ml = ttim.ModelMaq(kaq=k, z=[H, 0], tmin=1e-3, tmax=10)\n",
"ml = ttim.Model3D(kaq=k, z=np.linspace(H, 0, 3), Saq=Ss, tmin=1, tmax=10, M=10)\n",
"w = ttim.Well(ml, tsandQ=[(0, Q)], rw=rw, layers=[0])\n",
"\n",
"ml.solve()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(1, 1, 21)"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"w.parameters[0].shape"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[-1.45490671],\n",
" [-0.83091413]])"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ml.head(2, 3, 2)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"self.neq 2\n",
"solution complete\n"
]
}
],
"source": [
"k = 25\n",
"H = 20\n",
"Ss = 1e-4 / H\n",
"t = np.logspace(0, 1, 100)\n",
"Q = 500\n",
"rw = 0.2\n",
"#ml = ttim.ModelMaq(kaq=k, z=[H, 0], tmin=1e-3, tmax=10)\n",
"ml = ttim.Model3D(kaq=k, z=np.linspace(H, 0, 3), Saq=Ss, tmin=1, tmax=10, M=10)\n",
"w = ttim.Well(ml, tsandQ=[(0, Q)], rw=rw, layers=[0, 1])\n",
"\n",
"ml.solve()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[-1.14291044],\n",
" [-1.14291044]])"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ml.head(2, 3, 2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Headwell"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"self.neq 2\n",
"solution complete\n"
]
}
],
"source": [
"k = 25\n",
"H = 20\n",
"Ss = 1e-4 / H\n",
"t = np.logspace(0, 1, 100)\n",
"Q = 500\n",
"rw = 0.2\n",
"hwell = -2\n",
"\n",
"ml = ttim.Model3D(kaq=k, z=np.linspace(H, 0, 3), Saq=Ss, tmin=0.1, tmax=10, M=10)\n",
"w = ttim.HeadWell(ml, tsandh=[(0, hwell)], rw=rw, layers=[0, 1])\n",
"ml.solve()"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[-1.99999997],\n",
" [-1.99999997]])"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ml.head(rw, 0, 0.2)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[-1.99999996],\n",
" [-1.99999998]])"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ml.head(rw, 0, 2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# TO DO: `w.discharge` and `w.headinside`"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"self.neq 3\n",
"solution complete\n"
]
}
],
"source": [
"k = 25\n",
"H = 20\n",
"Ss = 1e-4 / H\n",
"t = np.logspace(0, 1, 100)\n",
"Q = 500\n",
"rw = 0.2\n",
"hwell = -2\n",
"\n",
"ml = ttim.Model3D(kaq=k, z=np.linspace(H, 0, 3), Saq=Ss, tmin=0.1, tmax=10, M=10)\n",
"w1 = ttim.Well(ml, xw=0, yw=0, tsandQ=[(0, Q)], layers=0)\n",
"w2 = ttim.HeadWell(ml, xw=100, yw=50, tsandh=[(0, 2)], rw=rw, layers=[0, 1])\n",
"ml.solve()"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(array([[-1.40355951],\n",
" [ 0.13485716]]),\n",
" array([[1.99974041],\n",
" [1.9997507 ]]))"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ml.head(rw, 0, 2), ml.head(100, 50, 2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### `DischargeWell`"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"self.neq 0\n",
"No unknowns. Solution complete\n"
]
}
],
"source": [
"k = 25\n",
"H = 20\n",
"Ss = 1e-4 / H\n",
"t = np.logspace(0, 1, 100)\n",
"Q = 500\n",
"rw = 0.2\n",
"hwell = -2\n",
"\n",
"ml = ttim.Model3D(kaq=k, z=np.linspace(H, 0, 3), Saq=Ss, tmin=0.1, tmax=10, M=10)\n",
"w1 = ttim.DischargeWell(ml, xw=0, yw=0, tsandQ=[(0, Q)], layers=[0, 1])\n",
"#w2 = ttim.HeadWell(ml, xw=100, yw=50, tsandh=[(0, 2)], rw=rw, layers=[0, 1])\n",
"ml.solve()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[-2.28582088],\n",
" [-2.28582087]])"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ml.head(2, 3, 2)"
]
}
],
"metadata": {
"kernelspec": {
"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",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
2 changes: 1 addition & 1 deletion examples/test4.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def quadfunc(p0, p1, func):
M=20,
)
ml2.initialize()
fp = np.zeros(41, "D")
fp = np.zeros(41, dtype=complex)
p = ml2.p
for i in range(41):
p0 = p[i].real
Expand Down
2 changes: 1 addition & 1 deletion examples/test5.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def func(t):
M=20,
)
ml2.initialize()
fp = np.zeros(len(ml2.p), "D")
fp = np.zeros(len(ml2.p), dtype=complex)
p = ml2.p
for i in range(len(p)):
p0 = p[i].real
Expand Down
Loading
Loading