diff --git a/README.md b/README.md index bbf17eb..e299b6c 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,38 @@ 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` +* 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 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"))