1
Fork 0

Switched to new storage convention for swash output in sws_ola

This commit is contained in:
Edgar P. Burkhart 2022-03-28 09:44:35 +02:00
parent b557712372
commit 71049d49ea
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
63 changed files with 174 additions and 5717 deletions

433
.gitignore vendored
View File

@ -1,430 +1,3 @@
# ---> Python version https://git-lfs.github.com/spec/v1
# Byte-compiled / optimized / DLL files oid sha256:6f1f708298df65b3ffcd304c283fcb17994fe9bffe139cdd5069ab6b490cce4a
__pycache__/ size 5056
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# ---> TeX
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
.*.lb
## Intermediate documents:
*.dvi
*.xdv
*-converted-to.*
# these rules might exclude image files for figures etc.
# *.ps
# *.eps
# *.pdf
## Generated if empty string is given at "Please type another file name for output:"
.pdf
## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.run.xml
## Build tool auxiliary files:
*.fdb_latexmk
*.synctex
*.synctex(busy)
*.synctex.gz
*.synctex.gz(busy)
*.pdfsync
## Build tool directories for auxiliary files
# latexrun
latex.out/
## Auxiliary and intermediate files from other packages:
# algorithms
*.alg
*.loa
# achemso
acs-*.bib
# amsthm
*.thm
# beamer
*.nav
*.pre
*.snm
*.vrb
# changes
*.soc
# comment
*.cut
# cprotect
*.cpt
# elsarticle (documentclass of Elsevier journals)
*.spl
# endnotes
*.ent
# fixme
*.lox
# feynmf/feynmp
*.mf
*.mp
*.t[1-9]
*.t[1-9][0-9]
*.tfm
#(r)(e)ledmac/(r)(e)ledpar
*.end
*.?end
*.[1-9]
*.[1-9][0-9]
*.[1-9][0-9][0-9]
*.[1-9]R
*.[1-9][0-9]R
*.[1-9][0-9][0-9]R
*.eledsec[1-9]
*.eledsec[1-9]R
*.eledsec[1-9][0-9]
*.eledsec[1-9][0-9]R
*.eledsec[1-9][0-9][0-9]
*.eledsec[1-9][0-9][0-9]R
# glossaries
*.acn
*.acr
*.glg
*.glo
*.gls
*.glsdefs
*.lzo
*.lzs
# uncomment this for glossaries-extra (will ignore makeindex's style files!)
# *.ist
# gnuplottex
*-gnuplottex-*
# gregoriotex
*.gaux
*.glog
*.gtex
# htlatex
*.4ct
*.4tc
*.idv
*.lg
*.trc
*.xref
# hyperref
*.brf
# knitr
*-concordance.tex
# TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files
# *.tikz
*-tikzDictionary
# listings
*.lol
# luatexja-ruby
*.ltjruby
# makeidx
*.idx
*.ilg
*.ind
# minitoc
*.maf
*.mlf
*.mlt
*.mtc[0-9]*
*.slf[0-9]*
*.slt[0-9]*
*.stc[0-9]*
# minted
_minted*
*.pyg
# morewrites
*.mw
# newpax
*.newpax
# nomencl
*.nlg
*.nlo
*.nls
# pax
*.pax
# pdfpcnotes
*.pdfpc
# sagetex
*.sagetex.sage
*.sagetex.py
*.sagetex.scmd
# scrwfile
*.wrt
# sympy
*.sout
*.sympy
sympy-plots-for-*.tex/
# pdfcomment
*.upa
*.upb
# pythontex
*.pytxcode
pythontex-files-*/
# tcolorbox
*.listing
# thmtools
*.loe
# TikZ & PGF
*.dpth
*.md5
*.auxlock
# todonotes
*.tdo
# vhistory
*.hst
*.ver
# easy-todo
*.lod
# xcolor
*.xcp
# xmpincl
*.xmpi
# xindy
*.xdy
# xypic precompiled matrices and outlines
*.xyc
*.xyd
# endfloat
*.ttt
*.fff
# Latexian
TSWLatexianTemp*
## Editors:
# WinEdt
*.bak
*.sav
# Texpad
.texpadtmp
# LyX
*.lyx~
# Kile
*.backup
# gummi
.*.swp
# KBibTeX
*~[0-9]*
# TeXnicCenter
*.tps
# auto folder when using emacs and auctex
./auto/*
*.el
# expex forward references with \gathertags
*-tags.tex
# standalone packages
*.sta
# Makeindex log files
*.lpz
# xwatermark package
*.xwm
# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib
# option is specified. Footnotes are the stored in a file with suffix Notes.bib.
# Uncomment the next line to have this generated file ignored.
#*Notes.bib

View File

@ -1,7 +1,3 @@
# M2 Internship version https://git-lfs.github.com/spec/v1
oid sha256:a7c1ed11b3cadc1a6dc0034d60898e8d0962e45b4aa2c50f9769b43d3f2b4099
"Simulation of the breaking wave flow which generated the 50T concrete block size 231
displacement at the Artha breakwater on February 28, 2017"
[Report](https://kalliope.edgarpierre.fr/latex/m2cce/internship/report.pdf)

4
data/.gitignore vendored
View File

@ -1 +1,3 @@
/out version https://git-lfs.github.com/spec/v1
oid sha256:17bc194f27793ae12ccd604a1f667d03cc6f9b07222f4e67d633b7296cc97e24
size 5

View File

@ -1,26 +1,3 @@
[inp] version https://git-lfs.github.com/spec/v1
root=data oid sha256:13605228ca2c48f7bc869db92b329f5395122662ced9a7ce930241b821a11f7a
base=Database_20220224.xyz size 300
hires=bathyhires.dat
hstru=Hstru.dat
poro=Poro.dat
psize=Psize.dat
hires_step=0.5
[out]
no_breakwater=True
root=out
sub=bathy_sub.npy
out=bathy.npy
step=1
left=0
right=150
#plot=True
[artha]
lat=43.398450
lon=-1.673097
[buoy]
lat=43.408333
lon=-1.681667

View File

@ -1,100 +1,3 @@
import numpy as np version https://git-lfs.github.com/spec/v1
oid sha256:418acad81c40d8d5dcde803335a86309b51121bab736b553a60c0735ff98cc19
size 2601
class Lambert:
def __init__(
self,
X0=1.7e6,
Y0=2.2e6,
lambda0=3,
phi0=43,
phi1=42.25,
phi2=43.75,
a=6378137,
e=0.081819190842622,
):
self._X0 = X0
self._Y0 = Y0
self._lambda0 = np.radians(lambda0)
self._phi0 = np.radians(phi0)
self._phi1 = np.radians(phi1)
self._phi2 = np.radians(phi2)
self._a = a
self._e = e
self._set_n()
self._set_rho0()
def cartesian(self, lam, phi):
lam = np.radians(lam)
phi = np.radians(phi)
theta = self._n * (lam - self._lambda0)
rho = self._rho(phi)
rho0 = self._rho(self._phi0)
X = self._X0 + rho * np.sin(theta)
Y = self._Y0 + rho0 - rho * np.cos(theta)
return X, Y
def _set_n(self):
self._n = (
np.log(np.cos(self._phi2) / np.cos(self._phi1))
+ (
np.log(
(1 - (self._e * np.sin(self._phi1) ** 2))
/ (1 - (self._e * np.sin(self._phi2) ** 2))
)
/ 2
)
) / (
np.log(
(
np.tan(self._phi1 / 2 + np.pi / 4)
* (
(1 - self._e * np.sin(self._phi2))
* (1 + self._e * np.sin(self._phi1))
)
** (self._e / 2)
)
/ (
np.tan(self._phi2 / 2 + np.pi / 4)
* (
(1 + self._e * np.sin(self._phi2))
* (1 - self._e * np.sin(self._phi1))
)
** (self._e / 2)
)
)
)
def _set_rho0(self):
self._rho0 = (
self._a
* np.cos(self._phi1)
/ (self._n * np.sqrt(1 - self._e**2 * np.sin(self._phi1) ** 2))
* (
np.tan(self._phi1 / 2 + np.pi / 4)
* (
(1 - self._e * np.sin(self._phi1))
/ (1 + self._e * np.sin(self._phi1))
)
** (self._e / 2)
)
** self._n
)
def _rho(self, phi):
return (
self._rho0
* (
1
/ np.tan(phi / 2 + np.pi / 4)
* ((1 + self._e * np.sin(phi)) / (1 - self._e * np.sin(phi)))
** (self._e / 2)
)
** self._n
)

View File

@ -1,144 +1,3 @@
import argparse version https://git-lfs.github.com/spec/v1
import configparser oid sha256:45448faf5475a6aac61efe9b3f69e20a7e44bdcb7e493d7e8d7c8d1cb7eac5fd
import logging size 4370
import pathlib
import numpy as np
from scipy import interpolate
try:
import matplotlib.pyplot as plt
except ImportError:
plt = None
from .lambert import Lambert
parser = argparse.ArgumentParser(description="Pre-process bathymetry")
parser.add_argument("-v", "--verbose", action="count", default=0)
args = parser.parse_args()
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
log = logging.getLogger("bathy")
log.info("Starting bathymetry pre-processing")
config = configparser.ConfigParser()
config.read("config.ini")
inp_root = pathlib.Path(config.get("inp", "root"))
out_root = pathlib.Path(config.get("out", "root"))
bathy_inp = out_root.joinpath(config.get("out", "sub"))
hires_inp = inp_root.joinpath(config.get("inp", "hires"))
hstru_inp = inp_root.joinpath(config.get("inp", "hstru"))
poro_inp = inp_root.joinpath(config.get("inp", "poro"))
psize_inp = inp_root.joinpath(config.get("inp", "psize"))
bathy_out = inp_root.joinpath(config.get("out", "out"))
log.info(f"Loading bathymetry from {bathy_inp}")
bathy_curvi = np.load(bathy_inp)
projection = Lambert()
bathy = np.stack(
(
*projection.cartesian(bathy_curvi[:, 0], bathy_curvi[:, 1]),
bathy_curvi[:, 2],
),
axis=1,
)
log.debug(f"Cartesian bathy: {bathy}")
artha_curvi = np.array(
(config.getfloat("artha", "lon"), config.getfloat("artha", "lat"))
)
buoy_curvi = np.array(
(config.getfloat("buoy", "lon"), config.getfloat("buoy", "lat"))
)
artha = np.asarray(projection.cartesian(*artha_curvi))
buoy = np.asarray(projection.cartesian(*buoy_curvi))
D = np.diff(np.stack((artha, buoy)), axis=0)
x = np.arange(
config.getfloat("out", "left", fallback=0),
np.sqrt((D**2).sum()) + config.getfloat("out", "right", fallback=0),
config.getfloat("out", "step", fallback=1),
)
theta = np.angle(D.dot((1, 1j)))
coords = artha + (x * np.stack((np.cos(theta), np.sin(theta)))).T
log.info("Interpolating bathymetry in 1D")
z = interpolate.griddata(bathy[:, :2], bathy[:, 2], coords)
log.debug(f"z: {z}")
_hires = np.loadtxt(hires_inp)[::-1]
bathy_hires = np.stack(
(
np.linspace(
0,
(_hires.size - 1) * config.getfloat("inp", "hires_step"),
_hires.size,
),
_hires,
),
axis=1,
)
del _hires
log.debug(f"Bathy hires: {bathy_hires}")
z_cr = 5
hires_crossing = np.diff(np.signbit(bathy_hires[:, 1] - z_cr)).nonzero()[0][-1]
log.debug(f"Hires crossing: {hires_crossing}")
z_crossing = np.diff(np.signbit(z - z_cr)).nonzero()[0][-1]
log.debug(f"Z crossing: {z_crossing}")
x_min_hires = x[z_crossing] + (
bathy_hires[:, 0].min() - bathy_hires[hires_crossing, 0]
)
x_max_hires = x[z_crossing] + (
bathy_hires[:, 0].max() - bathy_hires[hires_crossing, 0]
)
log.debug(f"Replacing range: [{x_min_hires},{x_max_hires}]")
flt_x = (x > x_min_hires) & (x < x_max_hires)
hstru = np.zeros(z.shape)
poro = np.zeros(z.shape)
psize = np.zeros(z.shape)
if config.getboolean("out", "no_breakwater", fallback=False):
z[flt_x] = z[flt_x][-1]
else:
z[flt_x] = interpolate.griddata(
(bathy_hires[:, 0],),
bathy_hires[:, 1],
(x[flt_x] - x[z_crossing] + bathy_hires[hires_crossing, 0]),
)
hstru_in = np.loadtxt(hstru_inp)[::-1]
hstru[flt_x] = interpolate.griddata(
(bathy_hires[:,0],),
hstru_in,
(x[flt_x] - x[z_crossing] + bathy_hires[hires_crossing, 0]),
)
poro_in = np.loadtxt(poro_inp)[::-1]
poro[flt_x] = interpolate.griddata(
(bathy_hires[:,0],),
poro_in,
(x[flt_x] - x[z_crossing] + bathy_hires[hires_crossing, 0]),
)
psize_in = np.loadtxt(psize_inp)[::-1]
psize[flt_x] = interpolate.griddata(
(bathy_hires[:,0],),
psize_in,
(x[flt_x] - x[z_crossing] + bathy_hires[hires_crossing, 0]),
)
np.savetxt(out_root.joinpath("bathy.dat"), z[::-1], newline=" ")
np.savetxt(out_root.joinpath("hstru.dat"), hstru[::-1], newline=" ")
np.savetxt(out_root.joinpath("poro.dat"), poro[::-1], newline=" ")
np.savetxt(out_root.joinpath("psize.dat"), psize[::-1], newline=" ")
if plt is not None and config.getboolean("out", "plot", fallback=False):
fig, ax = plt.subplots()
ax.plot(-x, z, color="k")
ax.fill_between(-x, z+hstru, z, color="k", alpha=.2)
plt.show(block=True)

View File

@ -1,53 +1,3 @@
import argparse version https://git-lfs.github.com/spec/v1
import configparser oid sha256:cee15595a8dac4e684da41c7b1cb9b80bd091a6879407ad516114d46addd0af0
import logging size 1435
import pathlib
import numpy as np
parser = argparse.ArgumentParser(description="Pre-process bathymetry")
parser.add_argument("-v", "--verbose", action="count", default=0)
args = parser.parse_args()
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
log = logging.getLogger("bathy")
log.info("Starting bathymetry pre-processing")
config = configparser.ConfigParser()
config.read("config.ini")
artha = np.array(
(config.getfloat("artha", "lon"), config.getfloat("artha", "lat"))
)
buoy = np.array(
(config.getfloat("buoy", "lon"), config.getfloat("buoy", "lat"))
)
log.debug(f"artha: {artha}")
log.debug(f"buoy: {buoy}")
domain = np.stack((artha, buoy))
domain.sort(axis=0)
log.debug(f"domain: {domain}")
domain[0] -= 0.002
domain[1] += 0.002
log.debug(f"domain: {domain}")
inp_root = pathlib.Path(config.get("inp", "root"))
out_root = pathlib.Path(config.get("out", "root"))
bathy_inp = inp_root.joinpath(config.get("inp", "base"))
bathy_out = out_root.joinpath(config.get("out", "sub"))
log.info(f"Reading bathymetry from '{bathy_inp}'")
raw_bathy = np.loadtxt(bathy_inp)
log.debug(f"Initial size: {raw_bathy.shape}")
bathy = raw_bathy[
((raw_bathy[:, :2] > domain[0]) & (raw_bathy[:, :2] < domain[1])).all(
axis=1
)
]
del raw_bathy
log.debug(f"Final size: {bathy.shape}")
log.info(f"Saving subdomain to 'bathy'")
np.save(bathy_out, bathy)

5
olaflow/.gitignore vendored
View File

@ -1,2 +1,3 @@
/inp* version https://git-lfs.github.com/spec/v1
/out* oid sha256:cf4ca7f0b967de32ac39d5114affc278588a6e19ee759de9787b1b027d85ca93
size 12

View File

@ -1,12 +1,3 @@
[swash] version https://git-lfs.github.com/spec/v1
npz_out=../swash/inp_post oid sha256:4cca67e7132cdb83b3539560426db3ff1ef47501b08aab6e70c20058999b709b
size 181
[bathy]
bathy=../swash/data/bathyhires.dat
hstru=../swash/data/Hstru.dat
scale=[0.5,1,1]
translate=[-149,0,0]
out=out_bathy
[olaflow]
root=inp_of

View File

@ -1,67 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:02a49b6841af79ff0298086c070b14a5cba96ddc2e3d4a6e47ec893a41ffcabc
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1763
| \\ / O peration | Version: 1.7.x |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type waveVelocity;
waveDictName waveDict;
value uniform (0 0 0);
}
atmosphere
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
"wall."
{
type fixedValue;
value uniform (0 0 0);
}
bathy
{
type fixedValue;
value uniform (0 0 0);
}
bloc0
{
type fixedValue;
value uniform (0 0 0);
}
bloc1
{
type fixedValue;
value uniform (0 0 0);
}
defaultFaces
{
type empty;
}
outlet
{
type waveAbsorption2DVelocity;
value uniform (0 0 0);
}
}
// ************************************************************************* //

View File

@ -1,61 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:f5815c4d0fe173050d279c74f01a350fdb5762f6c0c7744b6f59da2d9366750c
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1543
| \\ / O peration | Version: 1.5-dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type waveAlpha;
waveDictName waveDict;
value uniform 0;
}
outlet
{
type zeroGradient;
}
"wall."
{
type zeroGradient;
}
bathy
{
type zeroGradient;
}
bloc0
{
type zeroGradient;
}
bloc1
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -1,61 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:f5815c4d0fe173050d279c74f01a350fdb5762f6c0c7744b6f59da2d9366750c
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1543
| \\ / O peration | Version: 1.5-dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type waveAlpha;
waveDictName waveDict;
value uniform 0;
}
outlet
{
type zeroGradient;
}
"wall."
{
type zeroGradient;
}
bathy
{
type zeroGradient;
}
bloc0
{
type zeroGradient;
}
bloc1
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -1,68 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:cb8b90a6e3bf668cf9f0394601eeea1ec4ad1ded3d5cb5f7e2cedaaa08a4ed6e
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1836
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 0.0001;
boundaryField
{
inlet
{
type inletOutlet;
inletValue uniform 0.0001;
value uniform 0.0001;
}
outlet
{
type inletOutlet;
inletValue uniform 0.0001;
value uniform 0.0001;
}
"wall."
{
type epsilonWallFunction;
value uniform 0.0001;
}
bathy
{
type epsilonWallFunction;
value uniform 0.0001;
}
bloc0
{
type epsilonWallFunction;
value uniform 0.0001;
}
bloc1
{
type epsilonWallFunction;
value uniform 0.0001;
}
defaultFaces
{
type empty;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0.0001;
value uniform 0.0001;
}
}
// ************************************************************************* //

View File

@ -1,69 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:3a05abdcb6113cffadd6a238f6a7a8dca034cbd0d2ea4c06f714fdf0cddf0d24
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1879
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0.00000001;
boundaryField
{
inlet
{
type inletOutlet;
inletValue uniform 0.00000001;
value uniform 0.00000001;
}
outlet
{
type inletOutlet;
inletValue uniform 0.00000001;
value uniform 0.00000001;
}
"wall."
{
type kqRWallFunction;
value uniform 0.00000001;
}
bathy
{
type kqRWallFunction;
value uniform 0.00000001;
}
bloc0
{
type kqRWallFunction;
value uniform 0.00000001;
}
bloc1
{
type kqRWallFunction;
value uniform 0.00000001;
}
defaultFaces
{
type empty;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0.00000001;
value uniform 0.00000001;
}
}
// ************************************************************************* //

View File

@ -1,78 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:49fb3dca6cb0039e6a2290ee1cf416ffd8f724e47f43f3c81d86545fa4ef0529
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 2034
| \\ / O peration | Version: 3.0.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value uniform 0;
}
outlet
{
type calculated;
value uniform 0;
}
"wall."
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
atmosphere
{
type calculated;
value uniform 0;
}
defaultFaces
{
type empty;
}
bathy
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
bloc0
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
bloc1
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -1,68 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:27f00229cb842a16851724de3ff0c4444e578950745e000b1f7478f03eda6a2d
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1812
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 -1 0 0 0 0];
internalField uniform 0.001;
boundaryField
{
inlet
{
type inletOutlet;
inletValue uniform 0.001;
value uniform 0.001;
}
outlet
{
type inletOutlet;
inletValue uniform 0.001;
value uniform 0.001;
}
"wall."
{
type omegaWallFunction;
value uniform 0.001;
}
bathy
{
type omegaWallFunction;
value uniform 0.001;
}
bloc0
{
type omegaWallFunction;
value uniform 0.001;
}
bloc1
{
type omegaWallFunction;
value uniform 0.001;
}
defaultFaces
{
type empty;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0.001;
value uniform 0.001;
}
}
// ************************************************************************* //

View File

@ -1,71 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:c2896667d7304d2edd00eb1e04b7e627d3213d4a15ed666abcbe0b42573298b9
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1861
| \\ / O peration | Version: 1.5-dev |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
"wall."
{
type fixedFluxPressure;
value uniform 0;
}
bathy
{
type fixedFluxPressure;
value uniform 0;
}
bloc0
{
type fixedFluxPressure;
value uniform 0;
}
bloc1
{
type fixedFluxPressure;
value uniform 0;
}
defaultFaces
{
type empty;
}
outlet
{
type fixedFluxPressure;
value uniform 0;
}
inlet
{
type fixedFluxPressure;
value uniform 0;
}
atmosphere
{
type totalPressure;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
p0 uniform 0;
value uniform 0;
}
}
// ************************************************************************* //

View File

@ -1,59 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:03affa8787f68693c98769149a76374690e7f36b80583f2681ec34f24ea47286
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1432
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object porosityIndex;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
"wall."
{
type zeroGradient;
}
bathy
{
type zeroGradient;
}
bloc0
{
type zeroGradient;
}
bloc1
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
atmosphere
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -1,59 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:03affa8787f68693c98769149a76374690e7f36b80583f2681ec34f24ea47286
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1432
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object porosityIndex;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
"wall."
{
type zeroGradient;
}
bathy
{
type zeroGradient;
}
bloc0
{
type zeroGradient;
}
bloc1
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
atmosphere
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -1,22 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:8a11f81533737d6e1f1a477323b9f8b4a2ae2de5bcb746517a9f9e9f5cdeb337
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 939
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value ( 0 0 -9.81 );
// ************************************************************************* //

View File

@ -1,29 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:5e1095d33bb97b00d5189edfe97f4269412bb1d200820e5eb8a41116d34b119f
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1149
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object porosityDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Materials: clear region, core, secondary armour layer, primary armour layer
// a,b,c: tuning parameters
a 2(0 50);
b 2(0 1.2);
c 2(0 0.34);
// D50: mean nominal diameter
D50 2(1 4);
// porosity (phi)
porosity 2(1 0.5);
// ************************************************************************* //

View File

@ -1,37 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:f4561c01839ffcda3d0fd7821c09353dcd2702767a6e7a5f2bbbd0f3326f9a32
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1189
| \\ / O peration | Version: 3.0.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
phases (water air);
water
{
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1e-06;
rho [1 -3 0 0 0 0 0] 1000;
}
air
{
transportModel Newtonian;
nu [0 2 -1 0 0 0 0] 1.48e-05;
rho [1 -3 0 0 0 0 0] 1;
}
sigma [1 0 -2 0 0 0 0] 0.07;
// ************************************************************************* //

View File

@ -1,29 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:f182a4876e5e432ecc3076764d476ebbc69e71c4ea96a580dbf2aea719cc8504
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 983
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
RAS
{
RASModel kEpsilon;
turbulence on;
printCoeffs on;
}
// ************************************************************************* //

View File

@ -1,29 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:f182a4876e5e432ecc3076764d476ebbc69e71c4ea96a580dbf2aea719cc8504
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 983
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
RAS
{
RASModel kEpsilon;
turbulence on;
printCoeffs on;
}
// ************************************************************************* //

View File

@ -1,29 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:16bfe34d3f75df510cd7ee6f83704f42f2adf1c67fcb19193c0f5a3c2b782928
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 984
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
RAS
{
RASModel kOmegaSST;
turbulence on;
printCoeffs on;
}
// ************************************************************************* //

View File

@ -1,37 +1,3 @@
/*---------------------------------------------------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:f9a10f9231f198dac0137b50d4260486bd98a595827a5a73cab0bde679645892
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1202
| \\ / O peration | Version: 1.3 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object waveDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//waveType regular;
//waveTheory cnoidal;
//genAbs 1;
//absDir 0.0;
//nPaddles 1;
//wavePeriod 20.0;
//waveHeight 15.0;
//waveDir 0.0;
//wavePhase 0.;
//tSmooth 0.0;
waveType solitary;
waveTheory Boussinesq;
genAbs 0;
absDir 0.0;
nPaddles 1;
waveHeight 7.5;
waveDir 0.0;
// ************************************************************************* //

View File

@ -1,81 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:f80bbe1742a2cb4f424a5cf3d9534e8ccf1dd01d9ce30b559de0519b1a56f182
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1550
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;
vertices
(
(0 0 -30)
(150 0 -30)
(150 0 20)
(0 0 20)
(0 1 -30)
(150 1 -30)
(150 1 20)
(0 1 20)
);
blocks
(
hex (0 1 5 4 3 2 6 7) (300 1 100) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
inlet
{
type patch;
faces
(
(0 4 7 3)
);
}
outlet
{
type patch;
faces
(
(1 5 6 2)
);
}
wall1
{
type wall;
faces
(
(0 1 5 4)
);
}
atmosphere
{
type patch;
faces
(
(3 2 6 7)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -1,138 +1,3 @@
/*---------------------------------------------------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:fde2446149b2142dfe72f615b0398e46609064847d10cb081567faa1dffaa3c0
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 3519
| \\ / O peration | Version: 1.3 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
location "system";
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application olaFlow;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 60;
deltaT 0.1;
writeControl adjustableRunTime;
writeInterval 0.5;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
compression off;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 0.45;
maxAlphaCo 0.45;
maxDeltaT 0.5;
/*
functions
{
gaugesVOF
{
type sets;
libs ("libsampling.so");
writeControl outputTime;
writeInterval 1;
setFormat raw;
surfaceFormat raw;
interpolationScheme cell;
fields ( alpha.water );
sets
(
GaugeVOF01
{
type lineCellFace;
axis xyz;
start ( 0.5 0.001 0 );
end ( 0.5 0.001 1.2 );
}
GaugeVOF02
{
type lineCellFace;
axis xyz;
start ( 9.25 0.001 0 );
end ( 9.25 0.001 1.2 );
}
GaugeVOF03
{
type lineCellFace;
axis xyz;
start ( 15.75 0.001 0 );
end ( 15.75 0.001 1.2 );
}
GaugeVOF04
{
type lineCellFace;
axis xyz;
start ( 17.75 0.001 0 );
end ( 17.75 0.001 1.2 );
}
GaugeVOF05
{
type lineCellFace;
axis xyz;
start ( 21.1 0.001 0 );
end ( 21.1 0.001 1.2 );
}
);
}
gaugesP
{
type sets;
libs ("libsampling.so");
writeControl outputTime;
writeInterval 1;
setFormat raw;
surfaceFormat raw;
interpolationScheme cellPointFace;
fields ( p );
sets
(
GaugesP
{
type boundaryPoints;
axis xyz;
patches 1(caisson);
points ((18.0 0.01 0.75)
(18.00 0.01 0.80)
(18.00 0.01 0.85)
(18.00 0.01 0.95)
(18.01 0.01 0.70)
(18.25 0.01 0.70)
(18.50 0.01 0.70)
(18.75 0.01 0.70));
maxDistance 0.01;
}
);
}
}
*/
// ************************************************************************* //

View File

@ -1,50 +1,3 @@
/*---------------------------------------------------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:ee25e2be0f0a2f9716af18db406d00c528a38741b943ce61e517db655e07f895
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1247
| \\ / O peration | Version: 1.3 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
location "system";
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method simple;
simpleCoeffs
{
n ( 2 2 1 );
delta 0.001;
}
hierarchicalCoeffs
{
n ( 1 1 1 );
delta 0.001;
order xyz;
}
metisCoeffs
{
processorWeights ( 1 1 1 1 );
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots ();
// ************************************************************************* //

View File

@ -1,79 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:7fa4d5a860648baa40a54c3f4e9f8913e4e45c7d9276a009edcff4e5d24d9552
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 2101
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
div(rhoPhi,U) Gauss limitedLinearV 1;
div(U) Gauss linear;
div((rhoPhi|interpolate(porosity)),U) Gauss limitedLinearV 1;
div(rhoPhiPor,UPor) Gauss limitedLinearV 1;
div(rhoPhi,UPor) Gauss limitedLinearV 1;
div(rhoPhiPor,U) Gauss limitedLinearV 1;
div(phi,alpha) Gauss vanLeer;
div(phirb,alpha) Gauss interfaceCompression;
div((muEff*dev(T(grad(U))))) Gauss linear;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div((phi|interpolate(porosity)),k) Gauss upwind;
div((phi*interpolate(rho)),k) Gauss upwind;
div((phi|interpolate(porosity)),epsilon) Gauss upwind;
div(phi,omega) Gauss upwind;
div((phi|interpolate(porosity)),omega) Gauss upwind;
div((phi*interpolate(rho)),omega) Gauss upwind;
div((phi*interpolate(rho)),epsilon) Gauss upwind;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p_rgh;
pcorr;
alpha.water;
}
wallDist
{
method meshWave;
}
// ************************************************************************* //

View File

@ -1,95 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:43c8a02d083d05bca2e2822ad7c99bb242bd6ccde563e3c6fc95f523c69dae14
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 2122
| \\ / O peration | Version: 2.3.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"alpha.water.*"
{
nAlphaCorr 1;
nAlphaSubCycles 2;
alphaOuterCorrectors yes;
cAlpha 1;
MULESCorr no;
nLimiterIter 3;
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-8;
relTol 0;
}
"pcorr.*"
{
solver PCG;
preconditioner DIC;
tolerance 1e-5;
relTol 0;
}
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-07;
relTol 0.05;
}
p_rghFinal
{
$p_rgh;
relTol 0;
}
U
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-06;
relTol 0;
}
"(k|epsilon|omega|B|nuTilda).*"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-08;
relTol 0;
}
}
PIMPLE
{
momentumPredictor no;
nOuterCorrectors 1;
nCorrectors 3;
nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
fields
{
}
equations
{
".*" 1;
}
}
// ************************************************************************* //

View File

@ -1,53 +1,3 @@
/*---------------------------------------------------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:991d47c8947d27dcebd777d6da8c1812bfdeac103edb36bf9b7410b04dba84dc
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 1873
| \\ / O peration | Version: 1.3 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
volScalarFieldValue alpha.water 0
volScalarFieldValue porosityIndex 0
);
regions
(
boxToCell
{
box (-10 -10 -100) (500 10 5);
fieldValues
(
volScalarFieldValue alpha.water 1
);
}
surfaceToCell
{
file "./constant/triSurface/rubble.stl";
outsidePoints ((0 0 0)); // definition of outside
includeCut true; // cells cut by surface
includeInside true; // cells not on outside of surf
includeOutside false; // cells on outside of surf
nearDistance -1; // cells with centre near surf
// (set to -1 if not used)
curvature -100; // cells within nearDistance
// and near surf curvature
// (set to -100 if not used)
fieldValues
(
volScalarFieldValue porosityIndex 1
);
}
);

View File

@ -1,359 +1,3 @@
/*--------------------------------*- C++ -*----------------------------------*\ version https://git-lfs.github.com/spec/v1
| ========= | | oid sha256:ad5676a91a20dda1cde9062f5f91090bc1cb740390381802f7222b681d81b74b
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | size 10275
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Which of the steps to run
castellatedMesh true;
snap false;
addLayers false;
// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
bloc0.stl
{
type triSurfaceMesh;
name bloc0;
}
bloc1.stl
{
type triSurfaceMesh;
name bloc1;
}
bathy.stl
{
type triSurfaceMesh;
name bathy;
}
};
// Settings for the castellatedMesh generation.
castellatedMeshControls
{
// Refinement parameters
// ~~~~~~~~~~~~~~~~~~~~~
// If local number of cells is >= maxLocalCells on any processor
// switches from from refinement followed by balancing
// (current method) to (weighted) balancing before refinement.
maxLocalCells 10000000;
// Overall cell limit (approximately). Refinement will stop immediately
// upon reaching this number so a refinement level might not complete.
// Note that this is the number of cells before removing the part which
// is not 'visible' from the keepPoint. The final number of cells might
// actually be a lot less.
maxGlobalCells 10000000;
// The surface refinement loop might spend lots of iterations refining just a
// few cells. This setting will cause refinement to stop if <= minimumRefine
// are selected for refinement. Note: it will at least do one iteration
// (unless the number of cells to refine is 0)
minRefinementCells 10;
// Allow a certain level of imbalance during refining
// (since balancing is quite expensive)
// Expressed as fraction of perfect balance (= overall number of cells /
// nProcs). 0=balance always.
maxLoadUnbalance 0.10;
// Number of buffer layers between different levels.
// 1 means normal 2:1 refinement restriction, larger means slower
// refinement.
nCellsBetweenLevels 3;
// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies a level for any cell intersected by its edges.
// This is a featureEdgeMesh, read from constant/triSurface for now.
features
(
//{
// file "tanque.stl";
// level 2;
//}
);
// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies two levels for every surface. The first is the minimum level,
// every cell intersecting a surface gets refined up to the minimum level.
// The second level is the maximum level. Cells that 'see' multiple
// intersections where the intersections make an
// angle > resolveFeatureAngle get refined up to the maximum level.
refinementSurfaces
{
//caisson
//{
// // Surface-wise min and max refinement level
// level ( 1 1 );
//}
bathy
{
level ( 0 0 );
}
bloc0
{
level ( 0 0 );
}
bloc1
{
level ( 0 0 );
}
}
// Resolve sharp angles
resolveFeatureAngle 65;
// Region-wise refinement
// ~~~~~~~~~~~~~~~~~~~~~~
// Specifies refinement level for cells in relation to a surface. One of
// three modes
// - distance. 'levels' specifies per distance to the surface the
// wanted refinement level. The distances need to be specified in
// descending order.
// - inside. 'levels' is only one entry and only the level is used. All
// cells inside the surface get refined up to the level. The surface
// needs to be closed for this to be possible.
// - outside. Same but cells outside.
refinementRegions
{
//mode distance;
//levels
//(
// (1.0 4)
// (2.0 3)
//);
}
// Mesh selection
// ~~~~~~~~~~~~~~
// After refinement patches get added for all refinementSurfaces and
// all cells intersecting the surfaces get put into these patches. The
// section reachable from the locationInMesh is kept.
// NOTE: This point should never be on a face, always inside a cell, even
// after refinement.
locationInMesh (0.25 0.01 0.25);
// Whether any faceZones (as specified in the refinementSurfaces)
// are only on the boundary of corresponding cellZones or also allow
// free-standing zone faces. Not used if there are no faceZones.
allowFreeStandingZoneFaces true;
}
// Settings for the snapping.
snapControls
{
//- Number of patch smoothing iterations before finding correspondence
// to surface
nSmoothPatch 3;
//- Relative distance for points to be attracted by surface feature point
// or edge. True distance is this factor times local
// maximum edge length.
tolerance 4.0;
//- Number of mesh displacement relaxation iterations.
nSolveIter 30;
//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
}
// Settings for the layer addition.
addLayersControls
{
// Are the thickness parameters below relative to the undistorted
// size of the refined cell outside layer (true) or absolute sizes (false).
relativeSizes true;
// Per final patch (so not geometry!) the layer information
layers
{
//batimetria_patch0
//{
// nSurfaceLayers 2; //was 1 //was 4
//}
}
// Expansion factor for layer mesh
expansionRatio 1.0;
//- Wanted thickness of final added cell layer. If multiple layers
// is the thickness of the layer furthest away from the wall.
// See relativeSizes parameter.
finalLayerThickness 0.3;
//- Minimum thickness of cell layer. If for any reason layer
// cannot be above minThickness do not add layer.
// Relative to undistorted size of cell outside layer.
minThickness 0.1;
//- If points get not extruded do nGrow layers of connected faces that are
// also not grown. This helps convergence of the layer addition process
// close to features.
nGrow 1;
// Advanced settings
//- When not to extrude surface. 0 is flat surface, 90 is when two faces
// make straight angle.
featureAngle 30;
//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 3;
// Number of smoothing iterations of surface normals
nSmoothSurfaceNormals 1;
// Number of smoothing iterations of interior mesh movement direction
nSmoothNormals 3;
// Smooth layer thickness over surface patches
nSmoothThickness 10;
// Stop layer growth on highly warped cells
maxFaceThicknessRatio 0.5;
// Reduce layer growth where ratio thickness to medial
// distance is large
maxThicknessToMedialRatio 0.3;
// Angle used to pick up medial axis points
minMedianAxisAngle 130;
// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;
// Overall max number of layer addition iterations
nLayerIter 50;
}
// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
//- Maximum non-orthogonality allowed. Set to 180 to disable.
maxNonOrtho 65;
//- Max skewness allowed. Set to <0 to disable.
maxBoundarySkewness 20;
maxInternalSkewness 4;
//- Max concaveness allowed. Is angle (in degrees) below which concavity
// is allowed. 0 is straight face, <0 would be convex face.
// Set to 180 to disable.
maxConcave 80;
//- Minimum projected area v.s. actual area. Set to -1 to disable.
minFlatness 0.5;
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to a sensible fraction of the smallest cell volume expected.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-13;
//- Minimum quality of the tet formed by the face-centre
// and variable base point minimum decomposition triangles and
// the cell centre. This has to be a positive number for tracking
// to work. Set to very negative number (e.g. -1E30) to
// disable.
// <0 = inside out tet,
// 0 = flat tet
// 1 = regular tet
minTetQuality 1e-30;
//- Minimum face area. Set to <0 to disable.
minArea -1;
//- Minimum face twist. Set to <-1 to disable. dot product of face normal
//- and face centre triangles normal
minTwist 0.02;
//- minimum normalised cell determinant
//- 1 = hex, <= 0 = folded or flattened illegal cell
minDeterminant 0.001;
//- minFaceWeight (0 -> 0.5)
minFaceWeight 0.02;
//- minVolRatio (0 -> 1)
minVolRatio 0.01;
//must be >0 for Fluent compatibility
minTriangleTwist -1;
// Advanced
//- Number of error distribution iterations
nSmoothScale 4;
//- amount to scale back displacement at error points
errorReduction 0.75;
}
// Advanced
// Flags for optional output
// 0 : only write final meshes
// 1 : write intermediate meshes
// 2 : write volScalarField with cellLevel for postprocessing
// 4 : write current intersections as .obj files
debug 0;
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6;
// ************************************************************************* //

View File

@ -1,39 +1,3 @@
import argparse version https://git-lfs.github.com/spec/v1
import configparser oid sha256:3f12d83a60bae2c19ae50e105a1b2176d5d35cb17d9e9d73f10aefdf225a4003
import logging size 1024
import pathlib
import numpy as np
from .stl import stl_from_1d
parser = argparse.ArgumentParser(
description="Convert swash output to olaFlow input"
)
parser.add_argument("-v", "--verbose", action="count", default=0)
args = parser.parse_args()
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
log = logging.getLogger("sws_ola")
log.info("Starting sws -> olaFlow converter")
config = configparser.ConfigParser()
config.read("config.ini")
bathy = np.loadtxt(config.get("bathy", "bathy"))
poro = bathy + np.loadtxt(config.get("bathy", "hstru"))
out = pathlib.Path(config.get("bathy", "out"))
out.mkdir(exist_ok=True)
stl_from_1d(
bathy,
out.joinpath("bathy.stl"),
config.get("bathy", "scale", fallback=[1, 1, 1]),
config.get("bathy", "translate", fallback=[0, 0, 0]),
)
stl_from_1d(
poro,
out.joinpath("poro.stl"),
config.get("bathy", "scale", fallback=[1, 1, 1]),
config.get("bathy", "translate", fallback=[0, 0, 0]),
)

View File

@ -1,38 +1,3 @@
import re version https://git-lfs.github.com/spec/v1
oid sha256:2ec88dc3c20627b5f6d383e748ac7876415cacd4aff2cce3cb39bfdeb713b858
from fluidfoam import readof size 857
class OFModel:
def __init__(self, root):
self._root = root
def read_mesh(self):
self._x, self._y, self._z = readof.readmesh(str(self._root))
def write_field(self, field, values):
with open(self._root.joinpath("0", field), "r") as aw_file:
aw_raw = aw_file.read()
with open(self._root.joinpath("0", field), "w") as aw_file:
aw_file.write(
re.sub(
r"(?<=\(\n).*?(?=\n\))",
"\n".join(values.astype(str)),
aw_raw,
count=1,
flags=re.S,
)
)
@property
def x(self):
return self._x
@property
def y(self):
return self._y
@property
def z(self):
return self._z

View File

@ -1,22 +1,3 @@
import pathlib version https://git-lfs.github.com/spec/v1
import shutil oid sha256:673dcc99b9926720c32ee396b49a6599a28b9066812c7b651f2289d1527fe089
import subprocess size 667
import tempfile
import numpy as np
def stl_from_1d(data, output, scale=[1, 1, 1], translate=[0, 0, 0]):
with tempfile.TemporaryDirectory() as tmppath:
tmpdir = pathlib.Path(tmppath)
np.savetxt(tmpdir.joinpath("data.dat"), np.stack((data, data)))
with open(tmpdir.joinpath("scad"), "wt") as scad:
scad.write(
f"translate({translate})"
f"scale({scale})"
f"""surface("data.dat");"""
)
subprocess.run(("openscad", "scad", "-o", "data.stl"), cwd=tmpdir)
shutil.copy2(tmpdir.joinpath("data.stl"), output)

View File

@ -1,36 +1,3 @@
import argparse version https://git-lfs.github.com/spec/v1
import configparser oid sha256:f12e993be338666db237374bcef3d50b16fe8c8f24f96425bdffb8d0adb47917
import logging size 977
import pathlib
import numpy as np
from scipy import interpolate
from .olaflow import OFModel
parser = argparse.ArgumentParser(
description="Convert swash output to olaFlow input"
)
parser.add_argument("-v", "--verbose", action="count", default=0)
args = parser.parse_args()
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
log = logging.getLogger("sws_ola")
log.info("Starting sws -> olaFlow converter")
config = configparser.ConfigParser()
config.read("config.ini")
sws_out = pathlib.Path(config.get("swash", "npz_out"))
sws = np.load(sws_out.joinpath("sws.npz"))
x, t = sws["x"], sws["t"]
olaflow_root = pathlib.Path(config.get("olaflow", "root"))
model = OFModel(olaflow_root)
model.read_mesh()
watl = interpolate.interp1d(x, sws["watl"][680])
alpha_water = np.where(model.z < watl(model.x), 1, 0)
model.write_field("alpha.water", alpha_water)

View File

@ -1,21 +1,3 @@
\chapter{Introduction} version https://git-lfs.github.com/spec/v1
In February 2017, a \SI{50}{\tonne} concrete block was displaced by a wave onto oid sha256:956f0d07bcf91641f8397fda0a5620d6f32c4b12d2493bf161193d0d761b0335
the Artha breakwater in Saint-Jean-de-Luz. This event was captured by a size 1267
photographer, and earlier work from \textcite{amir} allowed to extract the
conditions under which this event happened using field data along with
numerical modeling.
The goal of the present study is to establish a numerical model representing
the conditions under which this block displacement event happened at the scale
of the breakwater. The simulation will be performed using the olaFlow
\parencite{olaFlow} model in a three-dimensionnal setting.
This study presents several aspects that are crucial to consider in order to
obtain accurate results. The seastate that led to the studied event is known
thanks to a wave buoy located in front of the breakwater \parencite{amir}.
However, in order to input an accurate incident wave into the numerical model,
it will be necessary to extract the incident and reflected waves from the raw
buoy data. Then, it will be necessary to accurately model the Artha breakwater,
especially regarding its porous character. Finally, the results of this
simulation will need to be compared to the literature on block displacement by
waves for validation.

View File

@ -1,612 +1,3 @@
\chapter{Literature Review} version https://git-lfs.github.com/spec/v1
oid sha256:d763f71644972bc7eb773eab17b84a25e94ece715cd5f2646071f2dadbdfaddd
In this chapter, literature relevant to the present study will be reviewed. size 29718
Three sections will be detailled: the separation of incident and reflected
components from wave measurements, the modelisation of wave impacts on a
rubble-mound breakwater, and the modelisation of block displacement by wave
impacts.
\section{Separating incident and reflected components from wave buoy data}
\subsection{Introduction}
The separation of incident and reflected waves is a crucial step in numerically
modeling a sea state. Using the raw data from a buoy as the input of a wave
model will lead to incorrect results in the domain as the flow velocity at the
boundary will not be correctly generated.
Several methods exist to extract incident and reflected components in measured
sea states, and they can generally be categorised in two types of methods:
array methods and PUV methods \parencite{inch2016accurate}. Array methods rely
on the use of multiple measurement points of water level to extracted the
incident and reflected waves, while PUV methods use co-located pressure and
velocity measurements to separate incident and reflected components of the
signal.
\subsection{Array methods}
\subsubsection{2-point methods}
Array methods were developped as a way to isolate incident and reflected wave
components using multiple wave records.
\textcite{goda1977estimation,morden1977decomposition} used two wave gauges
located along the wave direction, along with spectral analysis, in order to
extract the incident and reflected wave spectra. Their work is based on the
earlier work of \textcite{thornton1972spectral}. \textcite{goda1977estimation}
analyzed the wave spectrum components using the Fast Fourier Transform, and
suggest that this method is adequate for studies in wave flumes. They noted
that this method provides diverging results for gauge spacings that are
multiples of half of the wave length. \textcite{morden1977decomposition}
applies this technique to a field study, where the sea state is wind generated.
\textcite{morden1977decomposition} showed that, using appropriate spectral
analysis methods along with linear wave theory, the decomposition of the sea
state into incident and reflected waves is accurate. A relationship between the
maximum obtainable frequency and the distance between the sensors is provided.
According to \textcite{morden1977decomposition}, the only needed knowledge on
the wave environment is that wave frequencies are not modified by the
reflection process.
\subsubsection{3-point methods}
In order to alleviate the limitations from the 2-point methods,
\textcite{mansard1980measurement} introduced a 3-point method. The addition of
a supplementary measurement point along with the use of a least-squares method
most importantly provided less sensitivity to noise, non-linear interactions,
and probe spacing. The admissible frequency range could also be widened. A
similar method was proposed by \textcite{gaillard1980}. The accuracy of the
method for the estimation of incident and reflected wave components was once
again highlighted, while the importance of adequate positioning of the gauges
was still noted.
\subsubsection{Time-domain method}
\textcite{frigaard1995time} presented a time-domain method for reflected and
incident wave separation. This method, called SIRW method, used discrete
filters to extract the incident component of an irregular wave field. The
results were as accurate as with the method proposed by
\cite{goda1977estimation}, while singularity points are better accounted for.
The main advantage of the SIRW method is that it works in the time-domain,
meaning that real time computations can be performed.
\textcite{frigaard1995time} also mentions the possibility of replacing one of
the wave gauges by a velocity meters to prevent singularities.
This method was improved by \textcite{baldock1999separation} in order to
account for arbitrary bathymetry. Linear theory is used to compute shoaling on
the varying bathymetry. Resulting errors in the computed reflection coefficient
are low for large reflection coefficients, but increase with lower
coefficients. The neglect of shoaling can lead to important error in many
cases. The presented method could also be extended to three-dimensionnal waves
and bathymetry by considering the influence of refraction.
\subsubsection{Further improvements}
Further additions were made to array methods. \textcite{suh2001separation}
developped a method taking constant current into account to separate incident
and reflected waves. This method relies on two or more gauges, using a least
squares method. Results are very accurate in the absence of noise, but a small
amount of error appears when noise is added.
\textcite{inch2016accurate} confirmed that the presence of noise led to
overestimation of the reflection coefficient. The creation of bias lookup
tables is proposed in order to account for noise-induced error in reflection
coefficient estimations.
\textcite{andersen2017estimation,roge2019estimation} later proposed
improvements to account for highly non-linear regular and irregular waves
respectively. The improved method provides very accurate results for highly
non-linear waves, but are expected to be unreliable in the case of steep
seabeds, as shoaling is not part of the underlying model.
\subsubsection{Conclusion}
Array methods have been developped enough to provide accurate results in a wide
range of situations. Sensibility to noise has been reduced, and the influence
of shoaling has been considered. Those methods can also be applied to irregular
non-linear waves.
However, they require at least two wave gauges to be used. That means that in
some situations such as the Saint-Jean-de-Luz event of 2017, other methods are
needed since only one field measurement location is available.
\subsection{PUV methods}
The goal of PUV methods is to decompose the wave field into incident and
reflected waves using co-located wave elevation and flow velocity measurements
\parencite{tatavarti1989incoming}. \textcite{tatavarti1989incoming} presented a
detailled analysis of separation of incoming and outging waves using co-located
velocity and wave height sensors. Their method allows to obtain the reflection
coefficient relative to frequency, as well as to separate incident and
reflected wave components. Compared to array methods, this method also strongly
reduces the influence of noise.
\textcite{kubota1990} studied the influence of the considered wave theory on
incident and reflected wave separation. Three methods, based on linear
long-wave theory, small-amplitude wave theory and quasi-nonlinear long-wave
theory respectiveley were developped and compared. The results show that the
quasi-nonlinear approach gave the most accurate results.
%\textcite{walton1992} applied a separation method based on co-located pressure
%and velocity measurements on field, studying two natural beaches. This study
%showed that reflection is not significant on natural beaches. Additionnaly,
%the method that is used allowed for larger reflected energy than incident
%energy.
Research by \textcite{hughes1993} showed how co-located horizontal velocity and
vertical velocity (or pressure) sensors can be used to extract incident and
reflected wave spectra. Their method is based on frequency domain linear
theory, and provided accurate results for full reflection of irregular
non-breaking waves. Low-reflection scenarii were evaluated against the results
from \textcite{goda1977estimation}, and showed good agreement between both
methods. \textcite{hughes1993} also highlights that reflection estimates are
unreliable for higher frequencies, where coherency between the two measured
series is lower.
Following the work of \textcite{tatavarti1989incoming},
\textcite{huntley1999use} showed how principal component analysis can alleviate
noise-induced bias in reflection coefficient calculations compared to
time-domain analysis. They also stuied the influence of imperfect collocation
of the sensors, showing that the time delay between sensors leads to a peak in
the reflection coefficient at a frequency related to this time delta.
% \cite{sheremet2002observations}
\subsection{Conclusion}
Numerous methods have been developped in order to separate incident and
reflected components from wave measurements. Array methods rely on the use of
multiple, generally aligned, wave gauges, while PUV methods rely on the use of
co-located sensors, generally a wave height sensor and a horizontal velocity
sensor. Array methods generally have the advantage of being more cost-effective
to implement, as the cost of reliable velocity measurement devices can be
important \parencite{hughes1993}. Nevertheless, PUV methods are generally more
accurate regarding noise, varying bathymetry, and can be setup closer to
reflective surfaces \parencite{hughes1993,inch2016accurate}.
In the case of the 2017 event on the Artha breakwater, the results from a
single wave gauge are available, which means that the array methods are not
applicable. A PUV method \parencite{tatavarti1989incoming,huntley1999use}
should then be used to evaluate the reflection coefficient of the Artha
breakwater and to separate the incident and reflected wave components from the
measured data.
\section{Modelling wave impact on a breakwater}
\subsection{Introduction}
Modelling rubble-mound breakwaters such as the Artha breakwater requires
complex considerations on several aspects. First of all, an accurate of the
fluid's behavior in the porous armour of the breakwater is necessary. Then,
adequate turbulence models are needed in order to obtain accurate results.
Several types of models have been developped that can be used to study breaking
wave flow on a porous breakwater.
\subsection{SPH models}
\subsubsection{Introduction}
Smoothed-Particle Hydrodynamics (SPH) models rely on a Lagrangian
representation of the fluid \parencite{violeau2012fluid}. These models are
meshless, and work by considering fluids as a collection of particles.
SPH models have been shown to provide satisfactory results for the modeling of
turbulent free surface flows \parencite{violeau2007numerical}. Additionnaly,
\textcite{dalrymple2006numerical} showed that SPH models can be used in small
scale models of water waves. In this part, literature on modeling flow in
porous media and the adequate boundary conditions for wave modeling will be
reviewed.
\subsubsection{Porosity modelling}
Multiple approaches can be used when modeling porous media using SPH models.
The most obvious approach relies on the use of discrete elements in the porous
domain. For instance, \textcite{altomare2014numerical} showed that an SPH model
along with discrete modeling of the blocks composing a breakwater could yield
satisfactory results. The meshless character of SPH models allows for modeling
the large scale outside the porous media and the small scale of the space
between blocks effectively.
Nevertheless, the more common approach is to use a macro-scale model in porous
media, in which the porous domain is considered to have a set of homogeneous
properties.
\textcite{jiang2007mesoscale} used randomly placed fixed particles in the
porous media in order to model porosity at a microscopic scale from mesoscopic
porosity properties. The resulting model showed reliable results in studying
the flow through porous media.
By contrast, \textcite{shao2010} used volume-averaged Navier-Stokes equations
along with an averaged porosity model
\parencite{huang2003structural,burcharth1995one} in an incompressible SPH
(ISPH) model in order to model wave flow in porous media, accounting for a
linear and quadratic term in porosity induced friction. Turbulence was modeled
with a $k-\varepsilon$ volume averaged model. Good agreement was highlighted
between the results from this model and other models, analytical results and
experimental measurements for solitary and regular waves interacting with a
porous breakwater.
Similarly, \textcite{ren2016improved} presents a weakly-compressible SPH
(WCSPH) model using the volume averaged Favre averaged Navier-Stokes (VAFANS)
equations along with a large Eddy simulation (LES, \cite{ren2014numerical})
turbulence model. Interaction between turbulent flows and porous media is
studied and good agreement is shown between model results and experimental
data. Additionnaly, it is highlighted that the addition of the turbulence model
does increase the accuracy of the model. Similar results are found by
\textcite{wen2016sph} when studying wave impact on non-porous structures using
the same model.
That model was then extended to a three-dimensional model by
\textcite{wen20183d}. The computed free surface and forces on a structure were
shown to be accurately predicted by the 3D model.
%\paragraph{Notes}
%
%\cite{jiang2007mesoscale}: Meso-scale SPH model of flow in isotropic porous
%media; randomly placed particles with repulsive force; reasonable results.
%
%\cite{shao2010}: incompressible flow with porous media; Navier-Stokes,
%Volume-Averaged $k-\varepsilon$; porosity model is same as
%\cite{troch1999development} but without inertia term
%\parencite{huang2003structural}
%
%\cite{altomare2014numerical} "microscopic" model of breakwater
%
%\cite{kunz2016study} comparison of sph model with micro-model experiments; not
%quite applicable
%
%\textbf{\cite{ren2016improved}} VAFANS equations to solve incompressible
%turbulent flow with porous media. Same porosity model as \cite{shao2010}
%
%\cite{wen2016sph}
%
%\cite{pahar2016modeling}
%\cite{peng2017multiphase}
%\cite{wen20183d}: 3D VAFANS
%\cite{kazemi2020sph}
\subsubsection{Wave generation}
One of the more recent research subject with SPH models has been wave
generation. Wave paddles were initially used as a way to generate waves in
numerical basins \parencite{zheng2010numerical}, with the major drawback of
such wave makers begin their high reflectivity.
\textcite{liu2015isph} proposed an improved wave generator using a momentum
source in an ISPH model. The use of a momentum source was a major improvement
as it enabled the use of non-reflective wave generators. The proposed solution
was developed for two-dimensional linear waves, but the same algorithm could be
used for three-dimensional models.
\textcite{altomare2017long} presented a wave generation method for long-crested
(second order) waves in a WCSPH model using a piston wave maker. Although this
method leads to high reflection, the possibility of generating irregular
waves was highlighted.
Similarly to \textcite{liu2015isph}, \textcite{wen2018non} proposed a wave
generation method using a momentum source to create a non reflective wave
maker. The proposed method was used for generating regular as well as random
waves in a flume, and could be extended to three-dimensional simulations.
Nevertheless, the method proposed was limited to linear wave theory.
%\cite{zheng2010numerical}
%
%\cite{liu2015isph}: 2D non-reflective linear wave generator using a momentum
%source in ISPH
%
%\cite{altomare2017long}: Wave generation and absorption of long-crested waves
%(2nd order) in WCSPH. Generation of monochromatic as well as irregular waves.
%
%\cite{wen2018non}: Non reflective spectral wave maker, using momentum source
\subsubsection{Conclusion}
SPH models have been showed to be extremely powerful tools in modelling
wave-structure interaction, due to their ability to model complex interfaces
and highly dynamic situations \parencite{altomare2017long}.
Modeling wave interaction with porous structures using SPH models has been
widely studied, and generally adequate results are obtained
\parencite{wen20183d}. Nonetheless, SPH models still face some limitations
regarding their ability to represent incompressible flows, leading to high
diffusivity \parencite{higuera2015application}.
Moreover, wave-generation techniques, especially for long simulations, are
still at an early stage of developement \parencite{wen2018non}, limiting the
applicability to such models in studying real cases using in-situ data.
\subsection{VOF models}
\subsubsection{Introduction}
Contrary to SPH models, the volume of fluid (VOF) method relies on a Eulerian
representation of the fluid \parencite{hirt1981volume}. This method uses a
marker function, the value of which represents the fraction of fluid in a mesh
cell.
\subsubsection{2D models}
Using the VOF method along with Navier-Stokes equations, several models have
been developed in order to model fluid dynamics around porous structures.
\textcite{van1995wave} first implemented 2D-V incompressible Navier-Stokes
equations using the VOF method while accounting for porous media. The results
of the numerical model were validated with analytical solutions for simple
cases, as well as physical model tests. The model yielded acceptable results,
but the representation of turbulence and air-extrusion still required
improvement.
\textcite{troch1999development} developed the VOFbreak\textsuperscript{2} model
in order to provide improvements to earlier models. The Forchheimer theory
\parencite{burcharth1995one} is used in order to model the behavior of the flow
inside porous media. The hydraulic gradient generated in porous media is
decomposed as a linear term, a quadratic term, and an inertia term. Those terms
are ponderated by three coefficients that need to be calibrated. Several
attempts have been made to obtain analytical formulas for those
\parencite{burcharth1995one,van1995wave}, but no universal result has been
provided for the inertia term in particular. \textcite{vieira2021novel}
additionnaly proposed using artificial neural networks in order to calibrate
those values, which are generally calibrated using experimental results.
Parallely, \textcite{liu1999numerical} created a new model (COBRAS) that used
the VOF method. The model is based on the combination of Reynolds averaged
Navier-Stokes (RANS) equations and a $k-\varepsilon$ turbulence model. The
porous media is modelled similarly to \textcite{troch1999development}. The
offered results were improved compared to earlier models as more a more
accurate consideration of turbulence outside porous media was added. This model
was further improved by \textcite{hsu2002numerical} in order to account for
small scale turbulence inside the porous media thanks to volume averaged RANS
(VARANS) equations.
The COBRAS model was then reworked by
\textcite{losada2008numerical,lara2008wave} to add improvements to wave
generation and usability. The main difference between this new code (COBRAS-UC)
and COBRAS is the addition of irregular waves generation. The code was also
optimized to reduce the number of iterations. The improvements allowed for
longer simulations to be computed. The predictions for free surface elevation
and pressure in front of a porous breakwater were accurate, but improvements
were still needed, in particular considering computation time.
\subsubsection{3D models}
The combination of VARANS equations and the VOF method was then brought to 3D
domains by \textcite{del2011three} in IH3VOF. Specific boundary conditions were
also added for several wave theories. Additionnaly, an improved turbulence
model was used ($\omega$-SST model, \cite{menter1994two}), which provides
strongly improved results in zones where strong pressure gradients appear.
Strong agreement between IH3VOF and experimental results was obtained, but the
need for accurate boundary conditions limited the applicability of the model.
\textcite{higuera2015application} reworked the equations from
\textcite{del2011three} as discrepancies were observed with earlier literature
and added several improvements to the model. Notably, time-varying porosity was
added in order to account for eventual sediment displacement. New boundary
conditions were added, with static and dynamic boundary wave generators as well
as passive and acive wave absorption being implemented. The resulting model
(IHFOAM/olaFlow, \cite{olaFlow}) was implemented in the OpenFOAM toolbox.
\subsubsection{Conclusion}
VOF models have been developped to provide accurate results for the study of
wave impact on porous structures. The validation results from
\textcite{higuera2015application} show the capabilities of such models in
accurately representing rubble-mound breakwaters subject to irregular
three-dimensional wave fields.
Nonetheless, the representation of porosity in those models is still mainly
based on experimental calibration, particularly for the inertia term of
porosity induced friction.
%\subsection{Conclusion}
%\paragraph{Notes}
%
%\cite{van1995wave,troch1999development}
%
%COBRAS \parencite{liu1999numerical}: spatially averaged RANS
%with $k-\varepsilon$ turbulence model. Drag forces modeled by empirical linear
%and non-linear friction terms; \cite{hsu2002numerical}: introduced VARANS in
%order to account for small scale turbulence inside the porous media.
%->
%COBRAS-UC/IH2VOF \parencite{losada2008numerical,lara2008wave}: VOF VARANS (2D);
%refactor of COBRAS code, with improved wave generation, improvement of input
%and output data.
%->
%IH3VOF \parencite{del2011three}: 3D VOF VARANS, updated porous media equations,
%optimization of accuracy vs computation requirements, specific boundary
%conditions, validation. Adding SST model.
%->
%IHFOAM/olaFlow \parencite{higuera2015application}: Rederivation of
%\cite{del2011three}, add time-varying porosity; Improvement to wave generation
%and absorption; implementation in OpenFOAM; extensive validation; application
%to real coastal structures.
%
%\cite{vieira2021novel}: Use of artificial neural networks to determine porosity
%parameter for VOF VARANS model.
%\subsection{Other}
%
%BEM: \cite{hall1994boundary,koley2020numerical}
\section{Block displacement by waves}
\subsection{Introduction}
Displacement of blocks or boulders by waves has been a major topic in
understanding the influence of storm and tsunami waves in coastal regions.
Several approaches have been taken to study this phenomenon.
% In a first part, we will discuss in-situ studies on displaced boulders. In a
% second part, we will review models of block displacements.
\subsection{Block displacement models}
The main goal of studying boulder displacement is generally to establish the
cause of boulder deposits in coastal areas. \textcite{nott1997extremely} was
among the first to propose hydrondynamic equations that aimed to calculate the
wave height that would lead to the displacement of a boulder for storm and
tsunami waves. The main difference between storm and tsunami waves in those
equations was the flow velocity relative to wave height. The calculation of the
minimum flow velocity for boulder transport is obtained by calculating an
equilibrium between drag, lift and restraining forces.
Those equations were refined by \textcite{nott2003waves} in order to account
for the pre-transport environment of the boulder. \citeauthor{nott2003waves}
derived equations for submerged, sub-aerial and joint bounder boulders. A new
parameter ($\delta$) was introduced to differentiate between tsunami and storm
waves. This study highlights the importance of the initial environment of a
boulder for wave transport conditions. Compared to the equations from
\textcite{nott1997extremely}, an aditionnal inertia term is added to the
equilibrium equation for sub-aerial boulders, while the drag force is removed
for joint-bounded blocks.
\textcite{nandasena2011reassessment} noted that \citeauthor{nott2003waves}'s
equations could be improved, and proposed a new set of equations correcting
the lift and inertia terms in \citeauthor{nott2003waves}'s equations.
\textcite{nandasena2011reassessment} found that the new equations produced up
to a \SI{65}{\percent} difference with \citeauthor{nott2003waves}'s equations.
\textcite{buckley2012inverse} proposed alternative equations for sliding and
overturning of submerged boulders. An equation for block sliding was introduced
by considering friction on the bed. \textcite{weiss2012mystery} investigated
the influence of bed roughness on block displacement. A new stability criteria
was established, and bed roughness was found to be a major factor in boulder
displacement. In contrast with the findings from \textcite{nott2003waves}, the
threshold wave amplitude for block displacement was found to be similar between
tsunami and storm waves.
\textcite{nandasena2013boulder,liu2014experimental} performed experimental
studies of block displacement using dam break scenarios in a flume. The results
from both studies indicate that the primary mode of boulder motion for large
boulders is sliding, rather than rolling or saltation.
\textcite{weiss2015untangling} highlights inadequacies in the criteria that are
generally used \parencite{nott2003waves,nandasena2011reassessment}. According
to \textcite{weiss2015untangling}, the use of a minimum threshold on block
movement does not account for the possibility of a block returning to its
initial position after being slightly disloged. A new threshold is proposed on
the minimal movement of a block, while considering the time-dependent nature of
wave-induced flow. \textcite{weiss2015untangling} also shows the importance of
the pre-transport conditions on block displacement.
\textcite{kennedy2017extreme} derived new equations following the approach from
\textcite{nandasena2011reassessment} accounting for non-parallelepipedic
blocks. The revised equations led to a lower velocity threshold for block
movement. This highlights the importance of boulder shape in displacement
considerations.
\textcite{lodhi2020role} highlighted the importance of hydrodynamic pressure in
block displacement. A new equation was given for the threshold flow velocity
for block movement. An experimental validation of the models was performed, and
showed the overestimation of the threshold velocity by previous models.
\textcite{oetjen2021experiments} performed a review of boulder displacement
experiments. They found that the initial position of boulders relative to the
wave impact has a major influence on block displacement. Conversely, the
influence of bed roughness seems to have been overestimated in the past.
Similarly to \textcite{lodhi2020role}, \textcite{oetjen2021experiments}
highlights an overestimation of minimum wave height for block displacement by
earlier equations \parencite{nott1997extremely,nandasena2011reassessment}.
\subsection{Breakwater stability}
Breakwater stability has been a central issue in breakwater design.
\textcite{hudson1959laboratory} showed that Iribarren's formula could be used
to design breakwater when combined with an experimental parameter depending on
the shape of armour blocks and the geometry of the armour layer. A no-damage
and no-overtopping criteria is provided and validate using experimental
results. \textcite{losada1979joint} noted that Iribarren's criterion was fairly
accurate, but the results from \textcite{hudson1959laboratory} are found to be
too conservative.
\textcite{van1987stability} proposed an new criterion regarding breakwater
stability under random wave action. Extensive experimental validation using
both small-scale and large-scale models was conducted, and seem to provide
coherent results. Similarly to earlier work, the criterion is provided as an
dimensionless form.
\textcite{galland1995rubble} observed that armour stability relative to oblique
waves was increased. \textcite{van2014oblique} confirmed the influence of wave
direction on stability, and provided a way of estimating breakwater stability
depending on wave orientation.
%\cite{hudson1959laboratory}
%
%%\cite{hudson1975reliability}
%
%\cite{losada1979joint}
%
%\cite{van1987stability}
%
%\cite{van1995conceptual}
%
%\cite{galland1995rubble}
%
%\cite{iglesias2008virtual}
%
%\cite{etemad2012stability}
%
%\cite{van2014oblique}
\subsection{Conclusion}
Block displacement by waves has been widely studied in the literature.
Nevertheless, most validation has been conducted using laboratory experiments,
and reliable real-world data on that subject is scarce. This highlights the
opportunity provided by the 2017 Saint-Jean-de-Luz event, as the availability
of in-situ data allows for real-world validation of the results from earlier
research.
%\subsection{In-situ studies}
%
%\cite{barbano2010large}: boulders deposity in Sicily -> probably tsunamis
%
%\cite{paris2011}:
%
%\cite{nandasena2011numerical}
%\cite{may2015block}
%\cite{biolchi2016}
%\cite{kennedy2016observations}
%\cite{erdmann2018boulder}
%\cite{cox2018extraordinary}
%
%\subsection{Models}
%
%\cite{nott1997extremely}
%
%\cite{nott2003waves} Submerged boulder:
%\begin{equation}
%u^2 \ge \frac{2\left(\frac{\rho_s}{\rho_w}-1\right)ag}
%{C_d\left(\frac{ac}{b^2}\right)+C_l}
%\end{equation}
%
%\cite{imamura2008numerical}
%\cite{barbano2010large}
%\cite{nandasena2011numerical}
%
%\cite{nandasena2011reassessment}
%\begin{equation}
%u^2 \ge \frac{2\left(\frac{\rho_s}{\rho_w}-1\right) gc
%\left(\cos\theta+\frac{c}{b}\sin\theta\right)}
%{C_d\frac{c^2}{b^2}+C_l}
%\end{equation}
%
%\cite{buckley2012inverse}
%\cite{weiss2012mystery}
%\cite{nandasena2013boulder}
%\cite{liu2014experimental}
%\cite{weiss2015untangling}
%
%
%\cite{kennedy2016observations}
%\cite{kennedy2017extreme}
%\cite{weiss2017toward}
%
%\cite{bressan2018laboratory} Partially submerged boulders
%\begin{equation}
%u^2 \ge \frac{2b_wW}{\rho_w\left(b_DC_DA_{wfs}+b_LC_LA_{wbs}\right)}
%\end{equation}
%
%\cite{lodhi2020role}
%\cite{oetjen2020significance}
%
%\cite{oetjen2021experiments}: Review
%
%---
%\cite{zainali2015boulder}: Numerical model of block displacement

View File

@ -1,265 +1,3 @@
\ProvidesPackage{cours} version https://git-lfs.github.com/spec/v1
%%% XeLaTeX ONLY oid sha256:73211df2f3a9bf09595b0ab0101bd366f42e8bc8c98d678fea19d5bab9953e26
size 7708
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\@ifclassloaded{beamer}{}{
\RequirePackage[xetex]{geometry}
\RequirePackage[pdfusetitle]{hyperref}
\RequirePackage{enumitem}
}
\RequirePackage{fontspec}
\RequirePackage{polyglossia}
\RequirePackage{csquotes}
\RequirePackage{amsmath, amssymb, amsbsy}
%\RequirePackage{mathtools}
\RequirePackage{siunitx}
\RequirePackage{stmaryrd}
\RequirePackage{dsfont}
\RequirePackage{array}
\RequirePackage{esvect}
\RequirePackage{tikz}
\RequirePackage{pgfplots}
\RequirePackage{amsthm}
\RequirePackage{pgfpages}
\RequirePackage[version=4]{mhchem}
%\RequirePackage{breqn}
\RequirePackage{listings}
\RequirePackage{esint}
\RequirePackage{tabularx}
\RequirePackage{multirow}
\RequirePackage{booktabs}
%\RequirePackage{multicol}
\RequirePackage{setspace}
%\RequirePackage{ulem}
\RequirePackage{cancel}
\RequirePackage{xcolor}
\RequirePackage{unicode-math}
%\RequirePackage[backend=biber,sorting=ynt]{biblatex}
\RequirePackage[notransparent]{svg}
\RequirePackage{authblk}
\@ifclassloaded{beamer}{}{
\RequirePackage[list=true]{subcaption}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Langue
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setdefaultlanguage{french}
\MakeOuterQuote{"}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Macros
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Dérivées / Intégrales
\renewcommand\d{\mathrm d}
\newcommand\dd{\mathop{}\,\mathrm d}
\newcommand\deriv[2]{\frac{\d#1}{\d#2}}
\newcommand\dderiv[2]{\frac{\d^2#1}{\d#2^2}}
\newcommand\der[2]{\frac{\d#1}{\d#2}}
\newcommand\dder[2]{\frac{\d^2#1}{\d#2^2}}
\newcommand\dpar[2]{\frac{\partial#1}{\partial#2}}
\newcommand\ddpar[2]{\frac{\partial^2#1}{\partial#2^2}}
\newcommand\derp[2]{\frac{\partial#1}{\partial#2}}
\newcommand\dderp[2]{\frac{\partial^2#1}{\partial#2^2}}
\newcommand\dint{\int\displaylimits}
\newcommand\doint{\oint\displaylimits}
%%% Symboles
\newcommand\bOmega{\boldsymbol\Omega}
\newcommand\bepsilon{\boldsymbol\epsilon}
\newcommand\btheta{\boldsymbol\theta}
\newcommand\bsigma{\boldsymbol\sigma}
\renewcommand\epsilon{\varepsilon}
%\renewcommand\C{\coulomb}
\newcommand\e{\mathrm e}
\newcommand\RR{\mathbb R}
\newcommand\CC{\mathbb C}
\newcommand\KK{\mathbb K}
\newcommand\NN{\mathbb N}
\newcommand\FF{\mathbb F}
\newcommand\EE{\mathbb E}
\newcommand\DD{\mathbb D}
\newcommand\fF{\mathcal F}
\newcommand\dD{\mathcal D}
\newcommand\lL{\mathcal L}
\newcommand\cC{\mathcal C}
\newcommand\id{\mathbf 1}
\newcommand\Id{\mathrm Id}
%%% Exposant / Indice à gauche
\newcommand\trans[1]{\vphantom{#1}^t#1}
\newcommand\eul[1]{\vphantom{#1}^E#1}
\newcommand\lag[1]{\vphantom{#1}^L#1}
\newcommand\indL[2]{\vphantom{#2}_{#1}#2}
\newcommand\expL[2]{\vphantom{#2}^{#1}#2}
%%% Opérateurs mathématiques
\newcommand\abs[1]{\left|#1\right|}
\newcommand\nor[1]{\left\lVert#1\right\lVert}
\newcommand\peigne{\mathbin{\rotatebox[origin=c]{-90}{$\exists$}}}
\newcommand\moy[1]{\left<#1\right>}
\newcommand\tor[2]{\vphantom{\begin{array}c#2\end{array}}_{#1}\left|\begin{array}c#2\end{array}\right.}
\DeclareMathOperator\grad{\u{grad}}
\DeclareMathOperator\ggrad{\uu{grad}}
\let\div\relax
\DeclareMathOperator\diverg{\u{div}}
\DeclareMathOperator\rot{\u{rot}}
\DeclareMathOperator\Ker{Ker}
\DeclareMathOperator\sign{sign}
\DeclareMathOperator\tr{tr}
\DeclareMathOperator\cotan{cotan}
\DeclareMathOperator\cond{cond}
\DeclareMathOperator\erf{erf}
\DeclareMathOperator\erfc{erfc}
%%% Vecteurs et Matrices
\renewcommand\u[1]{\underline{#1}}
\newcommand\uu[1]{\underline{\underline{#1}}}
\newcommand\ov[1]{\overline{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Paramétrage des packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Styles de théorèmes
\theoremstyle{remark}
\newtheorem{rem}{Remarque}
\newtheorem*{rem*}{Remarque}
\theoremstyle{definition}
\newtheorem*{defi}{Définition}
\newtheorem{ex}{Exemple}
\newtheorem*{theo}{Théorème}
%%% Listings (code)
\lstset{numbers=left,
numberstyle=\tiny\color{gray}\ttfamily,
language=Python,
basicstyle=\linespread{1.2}\ttfamily,
columns = flexible,
keywordstyle=\color{blue},
commentstyle=\itshape\color{gray},
stringstyle=\color{ForestGreen},
frame=single,
stepnumber=5,
showstringspaces=true,
backgroundcolor=\color{ultralightgray},
morekeywords={>>>, np, array, zeros, shape},
%breaklines=true,
%prebreak=\textbackslash,
alsoletter=>
}
%%% Tikz / PGF
\usetikzlibrary{shapes}
\pgfplotsset{compat=1.14}
%%% SIUnitX
\sisetup{
mode = text,
%locale = FR,
%list-final-separator = {\text{~et~}},
%list-pair-separator = {\text{~et~}},
%range-phrase = {\text{~à~}},
retain-explicit-plus,
forbid-literal-units,
sticky-per,
%inter-unit-product = {.},
per-mode = power-positive-first,
uncertainty-mode = separate,
}
\SendSettingsToPgf
\DeclareSIUnit\met{met}
\DeclareSIUnit\gon{gon}
\DeclareSIUnit\bar{bar}
\DeclareSIUnit\psi{psi}
\DeclareSIUnit\deg{deg}
%%% Arcs
\DeclareFontFamily{OMX}{yhex}{}
\DeclareFontShape{OMX}{yhex}{m}{n}{<->yhcmex10}{}
\DeclareSymbolFont{yhlargesymbols}{OMX}{yhex}{m}{n}
\DeclareMathAccent{\wideparen}{\mathord}{yhlargesymbols}{"F3}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Mise en forme
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\@ifclassloaded{beamer}{}{
\geometry{
a4paper,
total={16cm, 24cm}
}
}
%%%% FONTS
\RequirePackage[sfdefault]{inter}
%\setmainfont{Inter}
%\setsansfont{Inter}
\setmathfont[mathrm=sym]{Fira Math}
\setmonofont[Ligatures=TeX]{Fira Code}
% Title fonts
\RequirePackage{titlesec}
\titleformat*{\subparagraph}{\intersemibold}
\titleformat*{\paragraph}{\intersemibold}
\titleformat*{\subsubsection}{\large}
\titleformat*{\subsection}{\Large}
\titleformat*{\section}{\LARGE}
\titleformat{\chapter}[display]{\interlight\LARGE}
{\chaptertitlename~\thechapter}{12pt}{\interlight\Huge}
\newcommand\email[1]{\href{mailto:#1}{#1}}
\definecolor{ENSblue}{RGB}{0,119,139}
\definecolor{ultralightgray}{gray}{.95}
\definecolor{customblue}{RGB}{0,102,204}
%\@ifclassloaded{letter}{}{
% \renewcommand\thesection{\Roman{section}}
% \renewcommand\thesubsection{\thesection.\arabic{subsection}}
% \renewcommand\thesubsubsection{\thesubsection.\arabic{subsubsection}}
%}
\@ifclassloaded{beamer}{}{
\hypersetup{
citecolor=customblue,
filecolor=customblue,
colorlinks=true,
linkcolor=customblue,
urlcolor=customblue
}
\setlist[itemize]{nosep}
}
\setcounter{secnumdepth}{3}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Fonctions pgfplots
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\pgfmathdeclarefunction{erf}{1}{%
\begingroup
\pgfmathparse{#1 > 0 ? 1 : -1}%
\edef\sign{\pgfmathresult}%
\pgfmathparse{abs(#1)}%
\edef\x{\pgfmathresult}%
\pgfmathparse{1/(1+0.3275911*\x)}%
\edef\t{\pgfmathresult}%
\pgfmathparse{%
1 - (((((1.061405429*\t -1.453152027)*\t) + 1.421413741)*\t
-0.284496736)*\t + 0.254829592)*\t*exp(-(\x*\x))}%
\edef\y{\pgfmathresult}%
\pgfmathparse{(\sign)*\y}%
\pgfmath@smuggleone\pgfmathresult%
\endgroup
}
\makeatother

View File

@ -1,4 +1,3 @@
[latex] version https://git-lfs.github.com/spec/v1
engine=xelatex oid sha256:3047470c95f5c13dbcff0657817424cc60b912754ad0fcfe3ae969be252d3c01
main=main.tex size 52
out=report.pdf

File diff suppressed because it is too large Load Diff

View File

@ -1,44 +1,3 @@
\documentclass[english, a4paper]{book} version https://git-lfs.github.com/spec/v1
\usepackage{cours} oid sha256:d62ab7176f583acebf417bafe0a2733caae19e5b986161188f3c0ba124abff36
\setmainlanguage{english} size 1084
\usepackage[
backend=biber,
style=iso-authoryear,
sorting=nyt,
]{biblatex}
\bibliography{library}
\hypersetup{
pdftitle = {M2 Internship},
pdfauthor = {Edgar P. Burkhart},
}
\title{\interlight\huge M2 Internship\\{\Huge Bibliography review}\\
\vspace{1em} Simulation of the breaking wave flow which generated the 50T
concrete block displacement at the Artha breakwater on February 28, 2017}
\author{\Large Edgar P.
Burkhart\thanks{\email{edgar-pierre.burkhart@etud.univ-pau.fr},
\email{edgar.burkhart@ens-paris-saclay.fr}.}}
\affil{Université de Pau et des Pays de l'Adour}
\affil{École Normale Supérieure Paris-Saclay}
\date{February 2022}
\setcounter{tocdepth}{3}
\begin{document}
\frontmatter
\maketitle
\tableofcontents
\mainmatter
%\include{notes/bibliography_research}
\include{chapters/introduction}
\include{chapters/literature}
\backmatter
%\nocite{*}
\defbibnote{bibstyle}{\emph{Bibliographic style: ISO690 Author-Year.}}
\printbibliography[prenote=bibstyle]
\end{document}

View File

@ -1,69 +1,3 @@
\chapter{Bibliography research} version https://git-lfs.github.com/spec/v1
\section{Extracting components from buoy data} oid sha256:d2758378f678604e9cd2f59edeeed3d1a67d4b03ef711f2bf081909b57454901
\paragraph{incident and reflected wave separation} size 2606
\cite{mansard1980measurement}: extract incident and reflected spectra from
spectrum measurements at three different points.
\cite{suh2001separation,frigaard1995time,baldock1999separation,
roge2019estimation,andersen2017estimation}
\paragraph{incident and reflected wave separation single gauge}
\paragraph{incident and reflected wave separation puv method}
Probablement très intéressant: \cite{inch2016accurate}:
\cite{sheremet2002observations,guza1977resonant}
Très bien: \cite{huntley1999use,tatavarti1989incoming}
\cite{pedersen2007resolving}
\paragraph{puv method}
\cite{sobey1999locally}
\paragraph{artha breakwater reflection}
\cite{poncet2020wave,larroque2018situ}
\section{Reflection}
\paragraph{wave reflection analysis}
\cite{davidson1996new}
\section{Modeling wave impact on porous media}
\paragraph{olaFlow}
\cite{olaFlow,higuera2015application}: \cite{bogdanov2011direct,del2011three}
\section{Breakwater modeling}
\paragraph{modelling breakwater} sph: \cite{altomare2014numerical} (SPH);
\paragraph{rubble-mound breakwater model} \cite{vanneste20152d} (RANS)
\cite{sumer2000experimental} (experimental)
\cite{kim2005neural} (neural networks for breakwater design)
\cite{troch1999development} (VOFbreak, NS)
\cite{koley2020numerical}
\cite{losada1979joint}
\cite{lara2008wave} (COBRAS-UC, VARANS)
\cite{losada2008numerical} (COBRAS-UC, VARANS)
\paragraph{breakwater model} \cite{hsu2002} (VARANS)
\section{Modeling}
\paragraph{using wave buoy data in numerical models} \cite{thomas2015,
mentaschi2013,rusu2011}
\section{Block displacement}
\paragraph{boulder transport by waves} \cite{erdmann2018boulder,may2015block,
weiss2012mystery,weiss2015untangling,zainali2015boulder,zainali2016high}
\paragraph{boulder transport flow} \cite{nandasena2011reassessment,
nandasena2013boulder,martinez2011quasi,kennedy2016observations,lodhi2020role,
oetjen2021experiments,oetjen2020significance}
\paragraph{storm waves boulder interaction} \cite{nandasena2011numerical}
Très intéressant: \cite{weiss2017toward},
\cite{sheremet2002observations,sheremet2016triads}
\paragraph{block transport by waves} \cite{imamura2008numerical,
barbano2010large,paris2011,biolchi2016}
\section{GPS buoys}
\paragraph{Datawell DWR-G reflected wave} \cite{herbers2012observing}
\paragraph{gps wave buoy reflected wave} \cite{doong2011wave}
\section{Other}
\cite{miche1951}
\cite{isobe1985method}
\section{Flow in porous media}
\paragraph{wave flow porous media} \cite{shao2010}

6
swash/.gitignore vendored
View File

@ -1,3 +1,3 @@
/inp* version https://git-lfs.github.com/spec/v1
/out* oid sha256:483eba7c2aaf6013155873bc675ab40e96c433a9c31b8dd056af8049c1f7d3c7
/swash_buoytoartha size 31

View File

@ -1,28 +1,3 @@
[proc] version https://git-lfs.github.com/spec/v1
#plot=True oid sha256:81e07a16f52e1a07ab145ebb68357d54d37656432009e40e5a88eb0439bccbae
size 323
[data]
root=data
hires=bathyhires.dat
bathy=buoyarthabathy.dat
hstru=Hstru.dat
poro=Poro.dat
psize=Psize.dat
out=out_data
out_nb=out_data_nb
[swash]
nb=True
input=sws/INPUT.sws
path=/opt/swash
out=out_sws
mpi=4
[post]
inp=inp_post
compare=inp_post_nb
out=out_post
#nperseg=1024
dt=0.25
x0=-1250
t0=180

0
swash/data/Hstru.dat Executable file → Normal file
View File

0
swash/data/Poro.dat Executable file → Normal file
View File

0
swash/data/Psize.dat Executable file → Normal file
View File

0
swash/data/bathyhires.dat Executable file → Normal file
View File

0
swash/data/buoyarthabathy.dat Executable file → Normal file
View File

View File

@ -1,60 +1,3 @@
import argparse version https://git-lfs.github.com/spec/v1
import configparser oid sha256:4ab57e0a813e6ea3086045717e251b2c44e00891a858d9f6365e3e604fefee03
import logging size 1316
import pathlib
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
parser = argparse.ArgumentParser(description="Animate swash output")
parser.add_argument("-v", "--verbose", action="count", default=0)
args = parser.parse_args()
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
log = logging.getLogger("post")
log.info("Starting post-processing")
config = configparser.ConfigParser()
config.read("config.ini")
inp = pathlib.Path(config.get("post", "inp"))
root = pathlib.Path(config.get("swash", "out"))
bathy = pd.read_hdf(
pathlib.Path(config.get("data", "out")).joinpath("bathy.h5"), "bathy"
)
def data(var):
return np.load(inp.joinpath(f"{var}.npy"))
x = data("xp")
t = data("tsec")
watl = data("watl")
botl = data("botl")
wl = np.maximum(watl, -botl)
# print(x.size, -np.arange(0, 1 * bathy.hstru.size, 1)[::-1].size)
fig, ax = plt.subplots()
ax.plot(x, -botl, c="k")
# ax.fill_between(
# x, -botl, -data["botl"] + bathy.hstru, color="k", alpha=0.2
# )
(line,) = ax.plot(x, wl[0])
def animate(i):
line.set_ydata(wl[i])
return (line,)
ani = animation.FuncAnimation(
fig, animate, frames=wl[:, 0].size, interval=20, blit=True
)
plt.show(block=True)

View File

@ -1,93 +1,3 @@
import argparse version https://git-lfs.github.com/spec/v1
import configparser oid sha256:93e058c82e05d4d81cb1bb68459b978780f6c32fd0ba6c5d3662212542a0d118
import logging size 2877
import pathlib
import sys
import numpy as np
import pandas as pd
try:
import matplotlib.pyplot as plt
except ImportError:
plt = None
parser = argparse.ArgumentParser(description="Pre-process bathymetry")
parser.add_argument("-v", "--verbose", action="count", default=0)
args = parser.parse_args()
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
log = logging.getLogger("bathy")
log.info("Starting bathymetry pre-processing")
config = configparser.ConfigParser()
config.read("config.ini")
root = pathlib.Path(config.get("data", "root"))
log.info(f"Reading input data from '{root}'")
bathy_hires = np.loadtxt(root.joinpath(config.get("data", "hires")))
bathy_lores = np.loadtxt(root.joinpath(config.get("data", "bathy")))
hstru = np.loadtxt(root.joinpath(config.get("data", "hstru")))
poro = np.loadtxt(root.joinpath(config.get("data", "poro")))
psize = np.loadtxt(root.joinpath(config.get("data", "psize")))
log.info("Generating grid")
x_hires = -np.arange(0, 0.5 * bathy_hires.size, 0.5)[::-1]
x_lores = -np.arange(0, 1 * bathy_lores.size, 1)[::-1]
x_hstru = -np.arange(0, 0.5 * hstru.size, 0.5)[::-1]
log.info("Generating output data")
bathy_hires_pd = pd.Series(bathy_hires.copy(), index=x_hires)
bathy_lores_pd = pd.Series(bathy_lores.copy(), index=x_lores)
bathy = pd.DataFrame(
index=bathy_lores_pd.index.union(bathy_hires_pd.index),
columns=("z", "hstru", "poro", "psize"),
data=0,
)
bathy.z[bathy_lores_pd.index] = bathy_lores_pd
bathy.z[bathy_hires_pd.index] = bathy_hires_pd
bathy.loc[x_hstru, ("hstru", "poro", "psize")] = np.array(
(hstru, poro, psize)
).T
bathy = bathy.reindex(bathy_lores_pd.index)
log.debug(f"Bathymetry:\n{bathy}")
log.info(
f"xmin: {bathy.index.min()}, "
f"xmax: {bathy.index.max()}, "
f"n: {bathy.index.size}"
)
if config.has_option("data", "out"):
out = pathlib.Path(config.get("data", "out"))
log.info(f"Writing output data to '{out}'")
out.mkdir(exist_ok=True)
np.savetxt(out.joinpath("bathy.dat"), bathy.z, newline=" ")
np.savetxt(out.joinpath("hstru.dat"), bathy.hstru, newline=" ")
np.savetxt(out.joinpath("poro.dat"), bathy.poro, newline=" ")
np.savetxt(out.joinpath("psize.dat"), bathy.psize, newline=" ")
bathy.to_hdf(out.joinpath("bathy.h5"), "bathy", mode="w")
if config.getboolean("proc", "plot", fallback=False):
if plt is None:
log.error("Could not import PyPlot")
sys.exit(1)
log.info("Plotting data")
fig, ax = plt.subplots()
ax.plot(x_hires, bathy_hires, label="High-res")
ax.plot(x_lores, bathy_lores, label="Low-res")
ax.plot(bathy.index, bathy.z, ls="-.", c="k", label="Combined")
ax.plot(bathy.index, bathy.z + bathy.hstru, label="Hstru")
ax.grid()
ax.legend()
plt.show(block=True)
log.info("Processing finished")

View File

@ -1,94 +1,3 @@
import argparse version https://git-lfs.github.com/spec/v1
import configparser oid sha256:8e3a75a559d7bf52e3e1703c5e45c8e473cd813aa99a95169bd9a500285f5a2d
import logging size 2923
import pathlib
import sys
import numpy as np
import pandas as pd
try:
import matplotlib.pyplot as plt
except ImportError:
plt = None
parser = argparse.ArgumentParser(description="Pre-process bathymetry")
parser.add_argument("-v", "--verbose", action="count", default=0)
args = parser.parse_args()
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
log = logging.getLogger("bathy")
log.info("Starting bathymetry pre-processing")
config = configparser.ConfigParser()
config.read("config.ini")
root = pathlib.Path(config.get("data", "root"))
log.info(f"Reading input data from '{root}'")
bathy_hires = np.loadtxt(root.joinpath(config.get("data", "hires")))
bathy_lores = np.loadtxt(root.joinpath(config.get("data", "bathy")))
hstru = np.loadtxt(root.joinpath(config.get("data", "hstru")))
poro = np.loadtxt(root.joinpath(config.get("data", "poro")))
psize = np.loadtxt(root.joinpath(config.get("data", "psize")))
log.info("Generating grid")
x_hires = -np.arange(0, 0.5 * bathy_hires.size, 0.5)[::-1]
x_lores = -np.arange(0, 1 * bathy_lores.size, 1)[::-1]
x_hstru = -np.arange(0, 0.5 * hstru.size, 0.5)[::-1]
log.info("Generating output data")
bathy_hires_pd = pd.Series(bathy_hires.copy(), index=x_hires)
bathy_lores_pd = pd.Series(bathy_lores.copy(), index=x_lores)
bathy = pd.DataFrame(
index=bathy_lores_pd.index.union(bathy_hires_pd.index),
columns=("z", "hstru", "poro", "psize"),
data=0,
)
bathy.z[bathy_lores_pd.index] = bathy_lores_pd
bathy.z[bathy_hires_pd.index] = bathy_hires_pd
bathy.z = np.minimum(bathy.z, -15)
# bathy.loc[x_hstru, ("hstru", "poro", "psize")] = np.array(
# (hstru, poro, psize)
# ).T
bathy = bathy.reindex(bathy_lores_pd.index)
log.debug(f"Bathymetry:\n{bathy}")
log.info(
f"xmin: {bathy.index.min()}, "
f"xmax: {bathy.index.max()}, "
f"n: {bathy.index.size}"
)
if config.has_option("data", "out_nb"):
out = pathlib.Path(config.get("data", "out_nb"))
log.info(f"Writing output data to '{out}'")
out.mkdir(exist_ok=True)
np.savetxt(out.joinpath("bathy.dat"), bathy.z, newline=" ")
np.savetxt(out.joinpath("hstru.dat"), bathy.hstru, newline=" ")
np.savetxt(out.joinpath("poro.dat"), bathy.poro, newline=" ")
np.savetxt(out.joinpath("psize.dat"), bathy.psize, newline=" ")
bathy.to_hdf(out.joinpath("bathy.h5"), "bathy", mode="w")
if config.getboolean("proc", "plot", fallback=False):
if plt is None:
log.error("Could not import PyPlot")
sys.exit(1)
log.info("Plotting data")
fig, ax = plt.subplots()
ax.plot(x_hires, bathy_hires, label="High-res")
ax.plot(x_lores, bathy_lores, label="Low-res")
ax.plot(bathy.index, bathy.z, ls="-.", c="k", label="Combined")
ax.plot(bathy.index, bathy.z + bathy.hstru, label="Hstru")
ax.grid()
ax.legend()
plt.show(block=True)
log.info("Processing finished")

View File

@ -1,92 +1,3 @@
import argparse version https://git-lfs.github.com/spec/v1
import configparser oid sha256:60aeefb03fe5f6ec669d64cd781e7254d7aeace3a2faab75098a4734343385a0
import logging size 1992
import pathlib
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
parser = argparse.ArgumentParser(description="Animate swash output")
parser.add_argument("-v", "--verbose", action="count", default=0)
args = parser.parse_args()
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
log = logging.getLogger("post")
log.info("Starting post-processing")
config = configparser.ConfigParser()
config.read("config.ini")
inp = pathlib.Path(config.get("post", "inp"))
root = pathlib.Path(config.get("swash", "out"))
bathy = pd.read_hdf(
pathlib.Path(config.get("data", "out")).joinpath("bathy.h5"), "bathy"
)
def data(var):
return np.load(inp.joinpath(f"{var}.npy"))
x = data("xp")
t = data("tsec")
watl = data("watl")
botl = data("botl")
zk = data("zk")
velk = data("velk")
vz = data("vz")
wl = np.maximum(watl, -botl)
# print(x.size, -np.arange(0, 1 * bathy.hstru.size, 1)[::-1].size)
fig, ax = plt.subplots()
# ax.plot(x, -botl, c="k")
# ax.fill_between(
# x, -botl, -data["botl"] + bathy.hstru, color="k", alpha=0.2
# )
n = 0
vk = np.sqrt((velk[n] ** 2).sum(axis=1))
# print(vk.shape)
# plt.imshow(vk)
# plt.colorbar()
lines = ax.plot(x, zk[n].T, c="#0066cc")
quiv = []
for i in range(10):
quiv.append(
ax.quiver(
x[::50],
(zk[n, i, ::50] + zk[n, i + 1, ::50]) / 2,
velk[n, i, 0, ::50],
vz[n, i, ::50],
units="dots",
width=2,
scale=0.05,
)
)
ax.autoscale(True, "w", True)
ax.set_ylim(top=15)
def animate(k):
for i, q in enumerate(quiv):
q.set_UVC(
velk[k, i, 0, ::50],
vz[k, i, ::50],
)
for i, l in enumerate(lines):
l.set_ydata(zk[k, i])
return *quiv, *lines
ani = animation.FuncAnimation(
fig, animate, frames=wl[:, 0].size, interval=20, blit=True
)
plt.show(block=True)

View File

@ -1,169 +1,3 @@
import argparse version https://git-lfs.github.com/spec/v1
import configparser oid sha256:c8fefac1023d769a2a43c86f159cf33155f5462aed2dcd4ac968d782f79760d4
import logging size 4665
import pathlib
import matplotlib.pyplot as plt
import numpy as np
import scipy.fft as fft
import scipy.signal as sgl
from .read_swash import *
parser = argparse.ArgumentParser(description="Post-process swash output")
parser.add_argument("-v", "--verbose", action="count", default=0)
args = parser.parse_args()
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
log = logging.getLogger("post")
log.info("Starting post-processing")
config = configparser.ConfigParser()
config.read("config.ini")
inp = pathlib.Path(config.get("post", "inp"))
root = pathlib.Path(config.get("swash", "out"))
log.info(f"Reading data from '{inp}'")
x = np.load(inp.joinpath("xp.npy"))
t = np.load(inp.joinpath("tsec.npy"))
botl = np.load(inp.joinpath("botl.npy"))
watl = np.load(inp.joinpath("watl.npy"))
vel = np.load(inp.joinpath("vel.npy"))
# Cospectral calculations
x0 = config.getint("post", "x0")
arg_x0 = np.abs(x - x0).argmin()
t0 = config.getfloat("post", "t0")
arg_t0 = np.abs(t - t0).argmin()
dt = config.getfloat("post", "dt")
f = 1 / dt
nperseg = config.getint("post", "nperseg", fallback=None)
log.info(f"Computing reflection coefficient at x={x0}")
eta = watl[t > t0, arg_x0]
u = vel[t > t0, 0, arg_x0]
phi_eta = sgl.welch(eta, f, nperseg=nperseg)
phi_u = sgl.welch(u, f, nperseg=nperseg)
phi_eta_u = sgl.csd(eta, u, f, nperseg=nperseg)
H = np.sqrt(np.abs(phi_eta[1]))
U = np.sqrt(np.abs(phi_u[1]))
G = H / U
th_eta_u = np.angle(phi_eta_u[1])
# R1 = 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(
(1 + G**2 - 2 * G * np.cos(th_eta_u))
/ (1 + G**2 + 2 * G * np.cos(th_eta_u))
)
if config.has_option("post", "compare"):
inp_comp = pathlib.Path(config.get("post", "compare"))
x_ = np.load(inp_comp.joinpath("xp.npy"))
t_ = np.load(inp_comp.joinpath("tsec.npy"))
botl_ = np.load(inp_comp.joinpath("botl.npy"))
watl_ = np.load(inp_comp.joinpath("watl.npy"))
vel_ = np.load(inp_comp.joinpath("vel.npy"))
arg_x0_ = np.abs(x_ - x0).argmin()
arg_t0_ = np.abs(t_ - t0).argmin()
eta_ = watl_[t_ > t0, arg_x0_]
u_ = vel_[t_ > t0, 0, arg_x0_]
phi_eta_ = sgl.welch(eta_, f, nperseg=nperseg)
phi_u_ = sgl.welch(u_, f, nperseg=nperseg)
phi_eta_u_ = sgl.csd(eta_, u_, f, nperseg=nperseg)
H_ = np.sqrt(np.abs(phi_eta_[1]))
U_ = np.sqrt(np.abs(phi_u_[1]))
G_ = H_ / U_
th_eta_u_ = np.angle(phi_eta_u_[1])
R_ = np.sqrt(
(1 + G_**2 - 2 * G_ * np.cos(th_eta_u_))
/ (1 + G_**2 + 2 * G_ * np.cos(th_eta_u_))
)
# Plotting
log.info("Plotting results")
fig, (ax_watl, ax_vel) = plt.subplots(2)
ax_watl.plot(t, watl[:, arg_x0], lw=1, label="watl")
ax_watl.set(xlabel="t (s)", ylabel="z (m)")
ax_watl.autoscale(axis="x", tight=True)
ax_watl.grid()
ax_watl.axvline(t0, c="k", alpha=0.2)
ax_vel.plot(t, vel[:, 0, arg_x0], lw=1, label="vel")
ax_vel.set(xlabel="t (s)", ylabel="U (m/s)")
ax_vel.autoscale(axis="x", tight=True)
ax_vel.grid()
ax_vel.axvline(t0, c="k", alpha=0.2)
fig.tight_layout()
fig_r, ax_r = plt.subplots()
ax_fft = ax_r.twinx()
ax_fft.plot(
*sgl.welch(eta, 1 / dt, nperseg=nperseg),
lw=1,
c="k",
alpha=0.2,
label="PSD ($\\eta$, cas 1)",
)
ax_r.plot(phi_eta[0], R, marker="+", label="R (cas 1)")
if config.has_option("post", "compare"):
ax_fft.plot(
*sgl.welch(eta_, 1 / dt, nperseg=nperseg),
lw=1,
c="k",
alpha=0.2,
label="PSD ($\\eta$, cas 2)",
)
ax_r.plot(phi_eta[0], R_, marker="+", label="R (cas 2)")
ax_r.set(xlim=(0, 0.3), ylim=(0, 1), xlabel="f (Hz)", ylabel="R")
ax_fft.set(ylim=0, ylabel="PSD (m²/Hz)")
ax_r.grid()
ax_r.legend(loc="upper left")
ax_fft.legend(loc="upper right")
fig_r.tight_layout()
fig_x, ax_x = plt.subplots(figsize=(10, 1))
ax_x.plot(x, -botl, color="k")
ax_x.plot(
x,
np.maximum(watl[arg_t0, :], -botl),
)
if config.has_option("post", "compare"):
ax_x.plot(x, -botl_, color="k", ls="-.")
ax_x.plot(
x,
np.maximum(watl_[arg_t0, :], -botl_),
ls="-.",
)
ax_x.axvline(x0, c="k", alpha=0.2)
ax_x.set(xlabel="x (m)", ylabel="z (m)")
ax_x.autoscale(axis="x", tight=True)
ax_x.set(aspect="equal")
fig_x.tight_layout()
out = pathlib.Path(config.get("post", "out")).joinpath(f"t{t0}x{x0}")
log.info(f"Saving plots in '{out}'")
out.mkdir(parents=True, exist_ok=True)
fig.savefig(out.joinpath("t.png"))
fig_r.savefig(out.joinpath("R.png"))
fig_x.savefig(out.joinpath("x.png"))
plt.show(block=True)
log.info("Finished post-processing")

View File

@ -1,52 +1,3 @@
import subprocess version https://git-lfs.github.com/spec/v1
import tempfile oid sha256:81ddc1baff1a727e68dc2819fe3f39ca657c488ab8cbeb83c2d260ae7c9c13fd
size 1349
import numpy as np
class ReadSwash:
def __init__(self):
self._n_x = None
self._n_t = None
self._t = None
self._x = None
@classmethod
def read_nohead(cls, path):
subprocess.run(("sed", "-i", r"s/ /\n/g", path))
return np.loadtxt(path)
def read_time(self, path):
self._t = np.unique(self.read_nohead(path))
self._n_t = self._t.size
return self.t
def read_x(self, path):
self._x = np.unique(self.read_nohead(path))
self._n_x = self._x.size
return self.x
def read_scalar(self, path, const=False):
if const:
return self.read_nohead(path).reshape((self._n_t, self._n_x))[0, :]
return self.read_nohead(path).reshape((self._n_t, self._n_x))
def read_const(self, path):
return self.read_scalar(path, const=True)
def read_vector(self, path):
return self.read_nohead(path).reshape((self._n_t, 2, self._n_x))
def read_scalar_lay(self, path):
return self.read_nohead(path).reshape((self._n_t, -1, self._n_x))
def read_vector_lay(self, path):
return self.read_nohead(path).reshape((self._n_t, -1, 2, self._n_x))
@property
def t(self):
return self._t
@property
def x(self):
return self._x

View File

@ -1,67 +1,3 @@
import argparse version https://git-lfs.github.com/spec/v1
import configparser oid sha256:b17bd29f45896e07ef9e48ab27c905158de21bdedc7b9ecbf1a7943e4af7ae70
import logging size 1962
import os
import pathlib
import shutil
import subprocess
import sys
import tempfile
parser = argparse.ArgumentParser(description="Run swash model")
parser.add_argument("-v", "--verbose", action="count", default=0)
args = parser.parse_args()
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
log = logging.getLogger("swash")
log.info("Starting swash model")
config = configparser.ConfigParser()
config.read("config.ini")
inp = pathlib.Path(config.get("swash", "input"))
out = pathlib.Path(config.get("swash", "out"))
if out.exists():
log.error(f"Swash output '{out}' already exists")
sys.exit(1)
with tempfile.TemporaryDirectory(prefix="swash_", dir=".") as tmp_raw:
tmpdir = pathlib.Path(tmp_raw)
log.info(f"Copying files to '{tmpdir}'")
shutil.copy2(inp, tmpdir)
if config.getboolean("swash", "nb", fallback=False):
path = pathlib.Path(config.get("data", "out_nb"))
else:
path = pathlib.Path(config.get("data", "out"))
shutil.copytree(path, tmpdir, dirs_exist_ok=True)
if config.has_option("swash", "mpi"):
mpi = ("-mpi", config.get("swash", "mpi"))
log.info(f"Using mpi with {mpi}")
else:
mpi = ()
with open(tmpdir.joinpath("sws.log"), "w") as logfile:
log.info(f"Runing swash in '{tmpdir}'")
path = pathlib.Path(config.get("swash", "path"))
cmd = (path.joinpath("swashrun"), "-input", inp.name, *mpi)
log.info(f"Running {cmd}")
swash_run = subprocess.Popen(
cmd,
cwd=tmpdir,
stdout=logfile,
stderr=logfile,
env={"PATH": f"{path}:{os.environ['PATH']}"},
)
code = swash_run.wait()
if code != 0:
log.error(f"Swash returned error code {code}")
log.info(f"Moving swash output to '{out}'")
shutil.move(tmpdir, out)
log.info(f"Swash model finished successfully")

View File

@ -1,51 +1,3 @@
import argparse version https://git-lfs.github.com/spec/v1
import configparser oid sha256:f3b186f594089b65b3739d2f03855c691f45e0b2744e37196e07cdf60c896cfc
import logging size 1393
import pathlib
from multiprocessing.pool import ThreadPool
import numpy as np
import pandas as pd
from .read_swash import ReadSwash
parser = argparse.ArgumentParser(description="Convert swash output to numpy")
parser.add_argument("-v", "--verbose", action="count", default=0)
args = parser.parse_args()
logging.basicConfig(level=max((10, 20 - 10 * args.verbose)))
log = logging.getLogger("sws_npz")
log.info("Starting sws -> npz converter")
config = configparser.ConfigParser()
config.read("config.ini")
sws_out = pathlib.Path(config.get("swash", "out"))
inp = pathlib.Path(config.get("post", "inp"))
log.info(f"Reading swash output from '{sws_out}'")
rsws = ReadSwash()
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,
"vel": rsws.read_vector,
"press": rsws.read_scalar,
"zk": rsws.read_scalar_lay,
"velk": rsws.read_vector_lay,
"vz": rsws.read_scalar_lay,
}
inp.mkdir(exist_ok=True)
with ThreadPool() as pool:
log.info("Converting all data")
pool.map(
lambda x: np.save(
inp.joinpath(x[0]),
x[1](sws_out.joinpath(x[0]).with_suffix(".dat")),
),
var.items(),
)

View File

@ -1,58 +1,3 @@
$************************* GENERAL *************************************** version https://git-lfs.github.com/spec/v1
PROJ 'GW' 'T1' oid sha256:3f85c1b0ecdfa156bd0d04a7654abd412080df57aa4a24190bbaac57b0335a12
SET NAUT size 2300
SET LEVEL 0.94
SET MAXERR 1
SET DEPMIN 0.001
MODE DYN ONED
$************************ GRIDS ***************************************
CGRID REG -1251 0 0 1251 0 1250 0
INPGRID BOT REG -1251 0 0 1250 0 1 0 $x0 y0 theta nx-1 ny-1 dx dy
VERT 10 $nb couches
READ BOTTOM -1 'bathy.dat' 3 0 FREE
INPGRID PORO REG -1251 0 0 1250 0 1 0
INPGRID PSIZ REG -1251 0 0 1250 0 1 0
INPGRID HSTRUC REG -1251 0 0 1250 0 1 0
READINP PORO 1 'poro.dat' 3 0 FREE
READINP PSIZ 1 'psize.dat' 3 0 FREE
READINP HSTRUC 1 'hstru.dat' 3 0 FREE
$*********************** BOUNDARIES ****************************************
INIT ZERO
BOUN SHAP JON SIG PEAK DSPR DEGR
BOUN SIDE W BTYPE WEAK SMOOT 10 SEC ADDBOUNDWAVE CON SPECT 1.55 13.3 0 0 CYCLE 20 MIN
BOUN SIDE E BTYPE SOMMERFELD
$*********************** PHYSICS *******************************************
BRE 0.6 0.2
FRICTION MANN 0.08
POROsity 4 200 1.1 13
VISC V KEPS
$*********************** NUMERICS ******************************************
NONHYD BOX 1.0 PREC ILU
DISCRET UPW MOM
TIMEI 0.2 0.6
$*********************** OUTPUTS *******************************************
SET OUTLEV 1
$BLOCK 'COMPGRID' HEAD 'test.txt' LAY 4 TSEC XP DEP BOTL WATL PRESS DISCH USTAR VEL VZ VELK ZK BRKP OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'tsec.dat' TSEC OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'xp.dat' XP OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'dep.dat' DEP OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'botl.dat' BOTL OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'watl.dat' WATL OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'press.dat' PRESS OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'disch.dat' DISCH OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'ustar.dat' USTAR OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'vel.dat' VEL OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'vz.dat' VZ OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'velk.dat' VELK OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'zk.dat' ZK OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'brkp.dat' BRKP OUTPUT 000000.00 0.25 SEC
COMPUTE 000000.000 0.015 SEC 003000.000 $timeini dtini unit timefin
STOP

View File

@ -1,58 +1,3 @@
$************************* GENERAL *************************************** version https://git-lfs.github.com/spec/v1
PROJ 'GW' 'T1' oid sha256:ce3044df5425b1858aada8e6a1aab3f081f0b48151902c66a3c02f0463f13d98
SET NAUT size 2299
SET LEVEL 4.5
SET MAXERR 1
SET DEPMIN 0.001
MODE DYN ONED
$************************ GRIDS ***************************************
CGRID REG -1250 0 0 1250 0 1250 0
INPGRID BOT REG -1250 0 0 1250 0 1 0 $x0 y0 theta nx-1 ny-1 dx dy
VERT 10 $nb couches
READ BOTTOM -1 'bathy.dat' 3 0 FREE
INPGRID PORO REG -1251 0 0 1250 0 1 0
INPGRID PSIZ REG -1251 0 0 1250 0 1 0
INPGRID HSTRUC REG -1251 0 0 1250 0 1 0
READINP PORO 1 'poro.dat' 3 0 FREE
READINP PSIZ 1 'psize.dat' 3 0 FREE
READINP HSTRUC 1 'hstru.dat' 3 0 FREE
$*********************** BOUNDARIES ****************************************
INIT ZERO
BOUN SHAP JON SIG PEAK DSPR DEGR
BOUN SIDE W BTYPE WEAK SMOOT 10 SEC ADDBOUNDWAVE CON SPECT 7.31 16.9 0 0 CYCLE 20 MIN
BOUN SIDE E BTYPE SOMMERFELD
$*********************** PHYSICS *******************************************
BRE 0.6 0.2
FRICTION MANN 0.08
POROsity 4 200 1.1 13
VISC V KEPS
$*********************** NUMERICS ******************************************
NONHYD BOX 1.0 PREC ILU
DISCRET UPW MOM
TIMEI 0.2 0.6
$*********************** OUTPUTS *******************************************
SET OUTLEV 1
$BLOCK 'COMPGRID' HEAD 'test.txt' LAY 4 TSEC XP DEP BOTL WATL PRESS DISCH USTAR VEL VZ VELK ZK BRKP OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'tsec.dat' TSEC OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'xp.dat' XP OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'dep.dat' DEP OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'botl.dat' BOTL OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'watl.dat' WATL OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'press.dat' PRESS OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'disch.dat' DISCH OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'ustar.dat' USTAR OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'vel.dat' VEL OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'vz.dat' VZ OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'velk.dat' VELK OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'zk.dat' ZK OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'brkp.dat' BRKP OUTPUT 000000.00 0.25 SEC
COMPUTE 000000.000 0.015 SEC 002500.000 $timeini dtini unit timefin
STOP

View File

@ -1,59 +1,3 @@
$************************* GENERAL *************************************** version https://git-lfs.github.com/spec/v1
PROJ 'GW' 'T1' oid sha256:e307c866ed9c49575428171b676dfb21a1af867f99dab1c99aa095ab9520d5e2
SET NAUT size 2310
SET LEVEL 4.5
SET MAXERR 1
SET DEPMIN 0.001
MODE DYN ONED
$************************ GRIDS ***************************************
CGRID REG -1250 0 0 1250 0 1250 0
INPGRID BOT REG -1250 0 0 1250 0 1 0 $x0 y0 theta nx-1 ny-1 dx dy
VERT 10 $nb couches
READ BOTTOM -1 'bathy.dat' 3 0 FREE
INPGRID PORO REG -1251 0 0 1250 0 1 0
INPGRID PSIZ REG -1251 0 0 1250 0 1 0
INPGRID HSTRUC REG -1251 0 0 1250 0 1 0
READINP PORO 1 'poro.dat' 3 0 FREE
READINP PSIZ 1 'psize.dat' 3 0 FREE
READINP HSTRUC 1 'hstru.dat' 3 0 FREE
$*********************** BOUNDARIES ****************************************
INIT ZERO
BOUN SHAP JON SIG PEAK DSPR DEGR
BOUN SIDE W BTYPE WEAK SMOOT 10 SEC ADDBOUNDWAVE CON SPECT 7.31 16.9 0 0 CYCLE 20 MIN
BOUN SIDE E BTYPE SOMMERFELD
SPON E 250
$*********************** PHYSICS *******************************************
BRE 0.6 0.2
FRICTION MANN 0.08
POROsity 4 200 1.1 13
VISC V KEPS
$*********************** NUMERICS ******************************************
NONHYD BOX 1.0 PREC ILU
DISCRET UPW MOM
TIMEI 0.2 0.6
$*********************** OUTPUTS *******************************************
SET OUTLEV 1
$BLOCK 'COMPGRID' HEAD 'test.txt' LAY 4 TSEC XP DEP BOTL WATL PRESS DISCH USTAR VEL VZ VELK ZK BRKP OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'tsec.dat' TSEC OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'xp.dat' XP OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'dep.dat' DEP OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'botl.dat' BOTL OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'watl.dat' WATL OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'press.dat' PRESS OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'disch.dat' DISCH OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'ustar.dat' USTAR OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'vel.dat' VEL OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'vz.dat' VZ OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'velk.dat' VELK OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'zk.dat' ZK OUTPUT 000000.00 0.25 SEC
BLOCK 'COMPGRID' NOHEAD 'brkp.dat' BRKP OUTPUT 000000.00 0.25 SEC
COMPUTE 000000.000 0.015 SEC 002500.000 $timeini dtini unit timefin
STOP

View File

@ -1,5 +1,3 @@
# Tasks version https://git-lfs.github.com/spec/v1
oid sha256:039b226e1905ffff4943cc6ad2b34e53f901b98658ee9fd35cbec3ba151e8ecf
- 1D SWASH with buoy input -> reflection depending on breakwater size 170
- Input 1D SWASH output as initial and boundary conditions in olaFlow
- 2Dh SWASH -> 3D olaFlow