Postprocessing free-surface + velocity correctly
This commit is contained in:
parent
0c4bc8a69f
commit
e2b495c5a9
3 changed files with 14 additions and 14 deletions
|
@ -15,4 +15,4 @@ root=cache
|
||||||
[swash]
|
[swash]
|
||||||
input=sws/INPUT.sws
|
input=sws/INPUT.sws
|
||||||
swashrun=/opt/swash/swash/swashrun
|
swashrun=/opt/swash/swash/swashrun
|
||||||
out=out.long
|
out=out
|
||||||
|
|
|
@ -20,17 +20,17 @@ n = bathy.index.size
|
||||||
# xp = read_nohead_scalar(root.joinpath("xp.dat"), n)
|
# xp = read_nohead_scalar(root.joinpath("xp.dat"), n)
|
||||||
botl = read_nohead_scalar(root.joinpath("botl.dat"), n)
|
botl = read_nohead_scalar(root.joinpath("botl.dat"), n)
|
||||||
dep = np.maximum(0, read_nohead_scalar(root.joinpath("dep.dat"), n))
|
dep = np.maximum(0, read_nohead_scalar(root.joinpath("dep.dat"), n))
|
||||||
|
vel = read_nohead_vect(root.joinpath("vel.dat"), n)
|
||||||
# watl = read_nohead_scalar(root.joinpath("watl.dat"), n)
|
# watl = read_nohead_scalar(root.joinpath("watl.dat"), n)
|
||||||
|
|
||||||
plt.plot((dep.T - botl.T)[:, 4000], label="dep", color="#0066ff")
|
fig, (ax_dep, ax_vel) = plt.subplots(2)
|
||||||
plt.plot(-botl.T[:, 0], label="botl", color="k")
|
|
||||||
plt.fill_between(
|
ax_dep.plot((dep - botl)[:, n//2], label="dep", color="#0066ff")
|
||||||
np.arange(n),
|
ax_dep.set(xlabel="t (s)", ylabel="z (m)")
|
||||||
-botl.T[:, 0],
|
|
||||||
bathy.hstru.values - botl.T[:, 0],
|
ax_vel.plot(vel[:, 0, n//2], label="vel")
|
||||||
label="hstru",
|
ax_vel.set(xlabel="t (s)", ylabel="U (m/s)")
|
||||||
color="k",
|
|
||||||
alpha=0.1,
|
fig.tight_layout()
|
||||||
)
|
#fig.legend()
|
||||||
plt.legend()
|
|
||||||
plt.show(block=True)
|
plt.show(block=True)
|
||||||
|
|
|
@ -21,8 +21,8 @@ def read_nohead_k(path, n, k):
|
||||||
|
|
||||||
|
|
||||||
def read_nohead_vect(path, n):
|
def read_nohead_vect(path, n):
|
||||||
return read_reshape(path, (-1, n, 2))
|
return read_reshape(path, (-1, 2, n))
|
||||||
|
|
||||||
|
|
||||||
def read_nohead_vect_k(path, n):
|
def read_nohead_vect_k(path, n):
|
||||||
return read_reshape(path, (-1, n, 2, k))
|
return read_reshape(path, (-1, 2, n, k))
|
||||||
|
|
Loading…
Reference in a new issue