From 3388a14c9c9962e7fb1957d88ceab2680f686013 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Tue, 29 Mar 2022 11:22:09 +0200 Subject: [PATCH 1/3] Water on both sides of breakwater, wlev=4.5 --- data/config.ini | 2 +- swash/sws/SPEC_buoy.sws | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/config.ini b/data/config.ini index bc4cbb2..2953772 100644 --- a/data/config.ini +++ b/data/config.ini @@ -13,7 +13,7 @@ root=out sub=bathy_sub.npy out=bathy.npy step=1 -left=0 +left=-150 right=150 #plot=True diff --git a/swash/sws/SPEC_buoy.sws b/swash/sws/SPEC_buoy.sws index 0d0db11..3ec0add 100644 --- a/swash/sws/SPEC_buoy.sws +++ b/swash/sws/SPEC_buoy.sws @@ -1,7 +1,7 @@ $************************* GENERAL *************************************** PROJ 'GW' 'T1' SET NAUT -SET LEVEL 0.5 +SET LEVEL 4.5 SET MAXERR 1 SET DEPMIN 0.001 MODE DYN ONED From cf86f96c233ed01e66f5c4747f8f6db0cb2fe6f8 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Tue, 29 Mar 2022 11:39:02 +0200 Subject: [PATCH 2/3] Update swash input --- data/processing/projection.py | 1 + swash/config.ini | 4 ++-- swash/sws/SPEC_buoy.sws | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data/processing/projection.py b/data/processing/projection.py index 7112d32..8e4f3ca 100644 --- a/data/processing/projection.py +++ b/data/processing/projection.py @@ -133,4 +133,5 @@ np.savetxt(out_root.joinpath("psize.dat"), psize[::-1], newline=" ") fig, ax = plt.subplots() ax.plot(-x, z, color="k") ax.fill_between(-x, z + hstru, z, color="k", alpha=0.2) +ax.set_title(f"N={z.size-1}, x=[{-x.max()};{-x.min()}]") fig.savefig(out_root.joinpath("bathy.pdf")) diff --git a/swash/config.ini b/swash/config.ini index 1a58cea..e4b8d3c 100644 --- a/swash/config.ini +++ b/swash/config.ini @@ -4,11 +4,11 @@ out=../data/out [swash] input=sws/SPEC_buoy.sws path=/data/code/swash -out=out/spec +out=out/spec_ot mpi=8 [post] -inp=inp_post/spec +inp=inp_post/spec_ot compare=inp_post_nb out=out_post #nperseg=1024 diff --git a/swash/sws/SPEC_buoy.sws b/swash/sws/SPEC_buoy.sws index 3ec0add..a127ccb 100644 --- a/swash/sws/SPEC_buoy.sws +++ b/swash/sws/SPEC_buoy.sws @@ -6,8 +6,8 @@ SET MAXERR 1 SET DEPMIN 0.001 MODE DYN ONED $************************ GRIDS *************************************** -CGRID REG -1450 0 0 1450 0 1450 0 -INPGRID BOT REG -1450 0 0 1450 0 1 0 $x0 y0 theta nx-1 ny-1 dx dy +CGRID REG -1450 0 0 1600 0 1600 0 +INPGRID BOT REG -1450 0 0 1600 0 1 0 $x0 y0 theta nx-1 ny-1 dx dy VERT 10 $nb couches READ BOTTOM -1 'bathy.dat' 3 0 FREE From e97138ced3e13ee1b5bd543bb9de9e0e6f1f5f5f Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Wed, 30 Mar 2022 11:07:25 +0200 Subject: [PATCH 3/3] 2 layer config --- swash/config.ini | 10 ++++------ swash/processing/post.py | 12 ++++++------ swash/processing/sws_npz.py | 15 ++++++++------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/swash/config.ini b/swash/config.ini index e4b8d3c..dfe967d 100644 --- a/swash/config.ini +++ b/swash/config.ini @@ -4,14 +4,12 @@ out=../data/out [swash] input=sws/SPEC_buoy.sws path=/data/code/swash -out=out/spec_ot +out=out/spec_ot_2lay mpi=8 [post] -inp=inp_post/spec_ot -compare=inp_post_nb -out=out_post -#nperseg=1024 -dt=0.25 +inp=inp_post/spec_ot_2lay +compare=inp_post/spec_ot_2lay +out=out_post/spec_ot_2lay x0=-1250 t0=180 diff --git a/swash/processing/post.py b/swash/processing/post.py index ca6a785..8ca2e94 100644 --- a/swash/processing/post.py +++ b/swash/processing/post.py @@ -88,14 +88,14 @@ if config.has_option("post", "compare"): G_ = H_ / U_ th_eta_u_ = np.angle(phi_eta_u_[1]) + #R_ = np.sqrt( + # (np.abs(phi_eta_[1]) + np.abs(phi_u_[1]) - 2 * np.abs(phi_eta_u_[1])) + # / (np.abs(phi_eta_[1]) + np.abs(phi_u_[1]) + 2 * np.abs(phi_eta_u_[1])) + #) R_ = np.sqrt( - (np.abs(phi_eta_[1]) + np.abs(phi_u_[1]) - 2 * np.abs(phi_eta_u_[1])) - / (np.abs(phi_eta_[1]) + np.abs(phi_u_[1]) + 2 * np.abs(phi_eta_u_[1])) + (1 + G_**2 - 2 * G_ * np.cos(th_eta_u_)) + / (1 + G_**2 + 2 * G_ * np.cos(th_eta_u_)) ) - # R_ = np.sqrt( - # (1 + G_**2 - 2 * G_ * np.cos(th_eta_u_)) - # / (1 + G_**2 + 2 * G_ * np.cos(th_eta_u_)) - # ) # Plotting diff --git a/swash/processing/sws_npz.py b/swash/processing/sws_npz.py index 607066b..4030156 100644 --- a/swash/processing/sws_npz.py +++ b/swash/processing/sws_npz.py @@ -30,14 +30,15 @@ np.save(inp.joinpath("tsec"), rsws.read_time(sws_out.joinpath("tsec.dat"))) np.save(inp.joinpath("xp"), rsws.read_x(sws_out.joinpath("xp.dat"))) var = { - "dep": rsws.read_scalar, - "botl": rsws.read_const, - "watl": rsws.read_scalar, - "pressk": rsws.read_scalar_lay, - "nhprsk": rsws.read_scalar_lay, + #"dep": rsws.read_scalar, + #"botl": rsws.read_const, + #"watl": rsws.read_scalar, + #"pressk": rsws.read_scalar_lay, + #"nhprsk": rsws.read_scalar_lay, "zk": rsws.read_scalar_lay, - "velk": rsws.read_vector_lay, - "vz": rsws.read_scalar_lay, + #"velk": rsws.read_vector_lay, + #"vz": rsws.read_scalar_lay, + #"vel": rsws.read_vector, } with ThreadPool() as pool: