From 967cd26d82aa5c976dc18c570450b90e0aabd3a1 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Tue, 29 Mar 2022 10:19:33 +0200 Subject: [PATCH 1/3] Updated README with info on processing steps --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index bbf17eb..38c524d 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,23 @@ displacement at the Artha breakwater on February 28, 2017" [Report](https://kalliope.edgarpierre.fr/latex/m2cce/internship/report.pdf) +## Bathymetry + +* Insert database in `data/data` +* Run `processing.subdomain` to generate 2D data in a smaller domain +* Run `processing.projection` to generate a 1D bathymetry + +## Swash + +* Run `processing.swash` to run the Swash model +* Run `processing.sws_npz` to convert Swash output to Numpy files +* Run `processing.post` to plot wave height at a point, water level at an + instant, reflection coefficient at a point +* Run `processing.animate` to plot an animation of water level +* Run `processing.layers` to plot an animation of layers with flow velocity + +## OlaFlow + +* Run `processing.bathy` to generate stl input files +* Run `blockMesh`, `snappyHexMesh -overwrite`, copy `0.org` to `0`, `setFields` +* Run `processing.sws_ola` to convert Swash output to OlaFlow input From 0a5596fe63a856b36be0e0bd608f298913324ef9 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Tue, 29 Mar 2022 13:07:12 +0200 Subject: [PATCH 2/3] Updated README with help on running modules --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 38c524d..e299b6c 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,21 @@ displacement at the Artha breakwater on February 28, 2017" [Report](https://kalliope.edgarpierre.fr/latex/m2cce/internship/report.pdf) +## Configuration + +Each part can be run in their respective directories. +``` +$ python -m processing.swash -h +usage: swash.py [-h] [-v] [-c CONFIG] + +Run swash model + +options: + -h, --help show this help message and exit + -v, --verbose + -c CONFIG, --config CONFIG +``` + ## Bathymetry * Insert database in `data/data` From 35ab13bea4456f0c6fba9542c1b9fa2f46a58361 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Tue, 29 Mar 2022 15:24:17 +0200 Subject: [PATCH 3/3] Added margin option to subdomain config --- data/config.ini | 1 + data/processing/subdomain.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/data/config.ini b/data/config.ini index 6fd5983..b9b2d50 100644 --- a/data/config.ini +++ b/data/config.ini @@ -8,6 +8,7 @@ psize=Psize.dat hires_step=0.5 [out] +margin=0.005 #no_breakwater=True root=out sub=bathy_sub.npy diff --git a/data/processing/subdomain.py b/data/processing/subdomain.py index 06e3c16..8ccc6a4 100644 --- a/data/processing/subdomain.py +++ b/data/processing/subdomain.py @@ -26,8 +26,9 @@ domain = np.stack((artha, buoy)) domain.sort(axis=0) log.debug(f"domain: {domain}") -domain[0] -= 0.002 -domain[1] += 0.002 +margin = config.getfloat("out", "margin", default=0.002) +domain[0] -= margin +domain[1] += margin log.debug(f"domain: {domain}") inp_root = pathlib.Path(config.get("inp", "root"))