Skip to content

Commit

Permalink
update example; reading with OGS method
Browse files Browse the repository at this point in the history
  • Loading branch information
MuellerSeb committed Jul 9, 2019
1 parent b1c9f9f commit e3428ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ The point output at the observation well is plotted afterwards.

```python
from ogs5py import OGS
from ogs5py.reader import readtec_point
from matplotlib import pyplot as plt

model = OGS(task_root="pump_test", task_id="model")
Expand Down Expand Up @@ -106,11 +105,7 @@ model.tim.add_block( # set the timesteps
model.write_input()
success = model.run_model()

point = readtec_point(
task_root="pump_test",
task_id="model",
pcs='GROUNDWATER_FLOW',
)
point = model.readtec_point(pcs='GROUNDWATER_FLOW')
time = point['owell']["TIME"]
head = point['owell']["HEAD"]

Expand Down
18 changes: 10 additions & 8 deletions examples/01_pump_test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
from ogs5py import OGS
from ogs5py.reader import readtec_point
from matplotlib import pyplot as plt

model = OGS(task_root="pump_test", task_id="model")
model = OGS(task_root="pump_test1", task_id="model")

# generate a radial mesh
model.msh.generate("radial", dim=2, rad=range(51))
Expand Down Expand Up @@ -47,6 +46,13 @@
DAT_TYPE='TECPLOT',
TIM_TYPE=['STEPS', 1],
)
model.out.add_block( # domain observation
PCS_TYPE='GROUNDWATER_FLOW',
NOD_VALUES='HEAD',
GEO_TYPE=['DOMAIN'],
DAT_TYPE='PVD',
TIM_TYPE=['STEPS', 1],
)
model.pcs.add_block( # set the process type
PCS_TYPE='GROUNDWATER_FLOW',
NUM_TYPE='NEW',
Expand All @@ -63,13 +69,9 @@
model.write_input()
success = model.run_model()

point = readtec_point(
task_root="pump_test",
task_id="model",
pcs='GROUNDWATER_FLOW',
)
point = model.readtec_point(pcs='GROUNDWATER_FLOW')
time = point['owell']["TIME"]
head = point['owell']["HEAD"]

plt.plot(time, head)
plt.show()
plt.show()

0 comments on commit e3428ed

Please sign in to comment.