Skip to content

Commit 4890112

Browse files
committed
readme: update example
1 parent d10fb46 commit 4890112

File tree

1 file changed

+41
-42
lines changed

1 file changed

+41
-42
lines changed

README.md

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -41,71 +41,69 @@ You can find the documentation under [geostat-framework.readthedocs.io][doc_link
4141

4242
In the following a simple transient pumping test is simulated on a radial symmetric mesh.
4343
The point output at the observation well is plotted afterwards.
44+
For more details on this example, see: [Tutorial 1][tut1_link]
4445

4546
```python
46-
from ogs5py import OGS
47+
from ogs5py import OGS, specialrange, generate_time
4748
from matplotlib import pyplot as plt
4849

50+
# discretization and parameters
51+
time = specialrange(0, 3600, 50, typ="cub")
52+
rad = specialrange(0, 1000, 100, typ="cub")
53+
obs = rad[21]
54+
angles = 32
55+
storage = 1e-3
56+
transmissivity = 1e-4
57+
rate = -1e-3
58+
# model setup
4959
model = OGS(task_root="pump_test", task_id="model")
50-
51-
# generate a radial mesh
52-
model.msh.generate("radial", dim=2, rad=range(51))
53-
# generate a radial outer boundary
54-
model.gli.generate("radial", dim=2, rad_out=50.)
55-
model.gli.add_points([0., 0., 0.], "pwell")
56-
model.gli.add_points([1., 0., 0.], "owell")
60+
# generate a radial mesh and geometry ("boundary" polyline)
61+
model.msh.generate("radial", dim=2, rad=rad, angles=angles)
62+
model.gli.generate("radial", dim=2, rad_out=rad[-1], angles=angles)
63+
model.gli.add_points([0.0, 0.0, 0.0], "pwell")
64+
model.gli.add_points([obs, 0.0, 0.0], "owell")
5765
model.bc.add_block( # boundary condition
58-
PCS_TYPE='GROUNDWATER_FLOW',
59-
PRIMARY_VARIABLE='HEAD',
60-
GEO_TYPE=['POLYLINE', "boundary"],
61-
DIS_TYPE=['CONSTANT', 0.0],
66+
PCS_TYPE="GROUNDWATER_FLOW",
67+
PRIMARY_VARIABLE="HEAD",
68+
GEO_TYPE=["POLYLINE", "boundary"],
69+
DIS_TYPE=["CONSTANT", 0.0],
6270
)
6371
model.st.add_block( # source term
64-
PCS_TYPE='GROUNDWATER_FLOW',
65-
PRIMARY_VARIABLE='HEAD',
66-
GEO_TYPE=['POINT', "pwell"],
67-
DIS_TYPE=['CONSTANT_NEUMANN', -1.0e-04],
72+
PCS_TYPE="GROUNDWATER_FLOW",
73+
PRIMARY_VARIABLE="HEAD",
74+
GEO_TYPE=["POINT", "pwell"],
75+
DIS_TYPE=["CONSTANT_NEUMANN", rate],
6876
)
6977
model.ic.add_block( # initial condition
70-
PCS_TYPE='GROUNDWATER_FLOW',
71-
PRIMARY_VARIABLE='HEAD',
72-
GEO_TYPE='DOMAIN',
73-
DIS_TYPE=['CONSTANT', 0.0],
78+
PCS_TYPE="GROUNDWATER_FLOW",
79+
PRIMARY_VARIABLE="HEAD",
80+
GEO_TYPE="DOMAIN",
81+
DIS_TYPE=["CONSTANT", 0.0],
7482
)
7583
model.mmp.add_block( # medium properties
7684
GEOMETRY_DIMENSION=2,
77-
STORAGE=[1, 1.0e-04],
78-
PERMEABILITY_TENSOR=['ISOTROPIC', 1.0e-4],
85+
STORAGE=[1, storage],
86+
PERMEABILITY_TENSOR=["ISOTROPIC", transmissivity],
7987
)
8088
model.num.add_block( # numerical solver
81-
PCS_TYPE='GROUNDWATER_FLOW',
82-
LINEAR_SOLVER=[2, 5, 1.0e-14, 1000, 1.0, 100, 4],
89+
PCS_TYPE="GROUNDWATER_FLOW",
90+
LINEAR_SOLVER=[2, 5, 1e-14, 1000, 1.0, 100, 4],
8391
)
8492
model.out.add_block( # point observation
85-
PCS_TYPE='GROUNDWATER_FLOW',
86-
NOD_VALUES='HEAD',
87-
GEO_TYPE=['POINT', "owell"],
88-
DAT_TYPE='TECPLOT',
89-
TIM_TYPE=['STEPS', 1],
93+
PCS_TYPE="GROUNDWATER_FLOW",
94+
NOD_VALUES="HEAD",
95+
GEO_TYPE=["POINT", "owell"],
96+
DAT_TYPE="TECPLOT",
9097
)
9198
model.pcs.add_block( # set the process type
92-
PCS_TYPE='GROUNDWATER_FLOW', NUM_TYPE='NEW'
99+
PCS_TYPE="GROUNDWATER_FLOW", NUM_TYPE="NEW"
93100
)
94101
model.tim.add_block( # set the timesteps
95-
PCS_TYPE='GROUNDWATER_FLOW',
96-
TIME_START=0,
97-
TIME_END=600,
98-
TIME_STEPS=[[10, 30], [5, 60]],
102+
PCS_TYPE="GROUNDWATER_FLOW",
103+
**generate_time(time)
99104
)
100105
model.write_input()
101-
success = model.run_model()
102-
103-
point = model.readtec_point(pcs='GROUNDWATER_FLOW')
104-
time = point['owell']["TIME"]
105-
head = point['owell']["HEAD"]
106-
107-
plt.plot(time, head)
108-
plt.show()
106+
model.run_model()
109107
```
110108

111109
<p align="center">
@@ -172,3 +170,4 @@ This project is based on [OGSPY][ogspy_link].
172170
[gpl_link]: https://github.com/GeoStat-Framework/ogs5py/blob/master/LICENSE
173171
[ogs5_link]: https://www.opengeosys.org/ogs-5/
174172
[doc_link]: https://geostat-framework.readthedocs.io/projects/ogs5py/en/latest/
173+
[tut1_link]: https://geostat-framework.readthedocs.io/projects/ogs5py/en/latest/tutorial_01_pump.html

0 commit comments

Comments
 (0)