Skip to content

Commit

Permalink
update example 1: better time stepping, comparisson with analytical s…
Browse files Browse the repository at this point in the history
…olution
  • Loading branch information
MuellerSeb committed Oct 22, 2019
1 parent 9c420dd commit d7aaa08
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions examples/01_pump_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from ogs5py import OGS
import anaflow as ana
from matplotlib import pyplot as plt

model = OGS(task_root="pump_test", task_id="model")
Expand Down Expand Up @@ -53,16 +54,23 @@
PCS_TYPE="GROUNDWATER_FLOW",
TIME_START=0,
TIME_END=600,
TIME_STEPS=[[10, 30], [5, 60]],
TIME_STEPS=[[12, 5], [18, 30]],
)
model.write_input()
success = model.run_model()
print("success", success)

# observation
point = model.readtec_point(pcs="GROUNDWATER_FLOW")
time = point["owell"]["TIME"]
head = point["owell"]["HEAD"]

plt.plot(time, head)
# analytical solution
head_ana = ana.theis(time, 1.0, 1e-4, 1e-4, rate=-1e-4)
# comparisson plot
plt.plot(time, head, label="observations at r=1")
plt.plot(time, head_ana, label="analytical solution")
plt.xlabel("time in s")
plt.ylabel("head in m")
plt.legend()
plt.show()
# show mesh
model.msh.show()

0 comments on commit d7aaa08

Please sign in to comment.