Update README, orbitals
This commit is contained in:
parent
c5e2478b91
commit
d3358fa40d
3 changed files with 44 additions and 100 deletions
100
README.md
100
README.md
|
@ -27,101 +27,9 @@ Le projet est séparé en dossiers pour chaque partie. Les dossiers sont les sui
|
|||
`swash`
|
||||
: Modèle 1D NLSW Swash
|
||||
|
||||
## Configuration
|
||||
## Fonctionnement
|
||||
|
||||
Each part can be run in their respective directories.
|
||||
```
|
||||
$ python -m processing.swash -h
|
||||
usage: swash.py [-h] [-v] [-c CONFIG]
|
||||
Dans chaque dossier se trouve un fichier `README.md` détaillant son fonctionnement.
|
||||
|
||||
Run swash model
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-v, --verbose
|
||||
-c CONFIG, --config CONFIG
|
||||
```
|
||||
|
||||
## Bathymetry
|
||||
|
||||
Configuration:
|
||||
```
|
||||
[inp]
|
||||
root: input directory
|
||||
base: bathymetry database (.xyz) -- not provided in this repository
|
||||
hires: 1d hires smoothed breakwater profile (.dat)
|
||||
hstru: 1d hires smoothed breakwater porosity height (.dat)
|
||||
poro: 1d breakwater porosity (.dat)
|
||||
psize: 1d porosity size (.dat)
|
||||
hires_step: mesh sizing of 1d profile
|
||||
|
||||
[out]
|
||||
margin: margin around the buoy and breakwater for subdomain
|
||||
no_breakwater: option to remove breakwater
|
||||
root: output directory
|
||||
sub: output file for subdomain
|
||||
out: output file for 1d projection
|
||||
step: mesh size
|
||||
left: margin for 1d projection (breakwater side)
|
||||
right: margin for 1d projection (buoy side)
|
||||
|
||||
[artha]
|
||||
lat: latitude of the breakwater
|
||||
lon: longitude of the breakwater
|
||||
|
||||
[buoy]
|
||||
lat: latitude of the buoy
|
||||
lon: longitude of the buoy
|
||||
```
|
||||
|
||||
* Insert database in `data/data`
|
||||
* Run `processing.subdomain` to generate 2D data in a smaller domain
|
||||
* Run `processing.projection` to generate a 1D bathymetry
|
||||
|
||||
## Swash
|
||||
|
||||
Configuration:
|
||||
```
|
||||
[data]
|
||||
out: input directory (output of bathymetry)
|
||||
|
||||
[swash]
|
||||
input: swash input file (.sws)
|
||||
path: path to swash directory (should contain swashrun and swash.exe)
|
||||
out: output directory for swash (created at the end of the computation)
|
||||
mpi: number of mpi threads (omit to use serial)
|
||||
|
||||
[post]
|
||||
inp: input directory for post-processing (output of sws_npz)
|
||||
compare: input directory for post-processing comparison (omit to display results from single case)
|
||||
out: output directory for figures
|
||||
x0: position of reflection calculations
|
||||
t0: minimum time for reflection calculations (necessary because of boundary condition ramping)
|
||||
```
|
||||
|
||||
* Run `processing.swash` to run the Swash model
|
||||
* Run `processing.sws_npz` to convert Swash output to Numpy files
|
||||
* Run `processing.post` to plot wave height at a point, water level at an
|
||||
instant, reflection coefficient at a point
|
||||
* Run `processing.animate` to plot an animation of water level
|
||||
* Run `processing.layers` to plot an animation of layers with flow velocity
|
||||
|
||||
## OlaFlow
|
||||
|
||||
Configuration:
|
||||
```
|
||||
[swash]
|
||||
np_out: input of olaflow from swash (output of sws_npz)
|
||||
|
||||
[bathy]
|
||||
bathy: bathymetry to be used by olaflow
|
||||
hstru: height of porous domain (see bathy)
|
||||
scale: openscad scaling (mesh sizing in [x,y,z])
|
||||
out: output folder for stl bathymetry
|
||||
|
||||
[olaflow]
|
||||
root: olaflow computation directory
|
||||
```
|
||||
|
||||
* Run `processing.bathy` to generate stl input files
|
||||
* Run `run_ola.sh` to run OlaFlow model
|
||||
Les scripts Python sont regroupés dans un dossier `processing`, et généralement exécutables en fonctionnement module :
|
||||
`python -m processing.script`.
|
||||
|
|
38
data/README.md
Normal file
38
data/README.md
Normal file
|
@ -0,0 +1,38 @@
|
|||
# Data
|
||||
|
||||
Ce dossier regroupe les données d'entrée et les scripts de pré-traitement des données.
|
||||
|
||||
## Configuration initiale
|
||||
|
||||
Afin de limiter l'espace utilisé, le fichier de bathymétrie n'est pas fourni. Il est recommandé d'utiliser la base de
|
||||
donnée construite par V. Roeber.
|
||||
|
||||
Les scripts de ce dossier sont configurés à l'aide d'un fichier `config.ini`. Les options seront détaillées pour chaque
|
||||
script par la suite.
|
||||
|
||||
## Scripts
|
||||
### Lambert
|
||||
`lambert.py` contient une classe permettant de réaliser la projection en coordonnées cartésiennes de la bathymétrie en
|
||||
coordonnées sphériques.
|
||||
|
||||
### Nandasena
|
||||
`nandasena.py` permet de calculer le critère de déplacement de bloc de Nandasena (2011). Configuration dans le code
|
||||
directement en modifiant le contenu de la variable `const`.
|
||||
|
||||
### Orbitals
|
||||
`orbitals.py` permet de tracer la trajectoire de la bouée lors du passage de la vague scélérate identifiée en 2 et 3
|
||||
dimensions.
|
||||
|
||||
`python -m processing.orbitals [-c CONFIG] [-v]`
|
||||
|
||||
* `-c CONFIG` : choix d'un fichier de configuration (`.ini`)
|
||||
* `-v` : verbose
|
||||
|
||||
```
|
||||
[inp]
|
||||
root : racine des fichiers d'entrée
|
||||
raw_ts : liste des chemins vers les fichiers de données brutes de la bouée
|
||||
|
||||
[out]
|
||||
root : racine des fichiers de sortie
|
||||
```
|
|
@ -22,8 +22,6 @@ config.read(args.config)
|
|||
inp_root = pathlib.Path(config.get("inp", "root"))
|
||||
out_root = pathlib.Path(config.get("out", "root"))
|
||||
|
||||
out_ts = out_root.joinpath("ts.dat")
|
||||
|
||||
raw_ts = []
|
||||
for tsi in config.get("inp", "raw_ts").split(","):
|
||||
raw_ts.append(
|
||||
|
@ -98,7 +96,7 @@ ax2dv.grid(c="k", alpha=.2)
|
|||
ax2dv.set(aspect="equal", xlabel="x (m)", ylabel="z (m)")
|
||||
ax2dv.set(ylim=(-10, 10))
|
||||
ax2dv.yaxis.set_minor_locator(MultipleLocator(1))
|
||||
fig2dv.savefig("out_orbitals.pdf")
|
||||
fig2dv.savefig("out_orbitals.jpg")
|
||||
fig2dv.savefig(out_root.joinpath("orbitals.pdf"))
|
||||
fig2dv.savefig(out_root.joinpath("out_orbitals.jpg"))
|
||||
|
||||
plt.show()
|
||||
|
|
Loading…
Reference in a new issue