Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/waterwavesmodels/waterwaves1d.jl
Water wave models in one dimension
https://github.com/waterwavesmodels/waterwaves1d.jl
julialang shallow-water-equations water-wave
Last synced: 3 months ago
JSON representation
Water wave models in one dimension
- Host: GitHub
- URL: https://github.com/waterwavesmodels/waterwaves1d.jl
- Owner: WaterWavesModels
- License: mit
- Created: 2018-10-25T19:05:05.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-15T09:38:25.000Z (over 1 year ago)
- Last Synced: 2024-04-27T06:02:44.816Z (8 months ago)
- Topics: julialang, shallow-water-equations, water-wave
- Language: Jupyter Notebook
- Homepage: https://waterwavesmodels.github.io/WaterWaves1D.jl/dev/
- Size: 75.2 MB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Citation: CITATION.cff
Awesome Lists containing this project
README
# WaterWaves1D.jl
[![Build Status](https://github.com/WaterWavesModels/WaterWaves1D.jl/workflows/CI/badge.svg)](https://github.com/WaterWavesModels/WaterWaves1D.jl/actions)
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://waterwavesmodels.github.io/WaterWaves1D.jl/stable/)
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://waterwavesmodels.github.io/WaterWaves1D.jl/dev/)
[![codecov](https://codecov.io/gh/WaterWavesModels/WaterWaves1D.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/WaterWavesModels/WaterWaves1D.jl)
[![DOI](https://zenodo.org/badge/154723425.svg)](https://zenodo.org/badge/latestdoi/154723425)## Installation
```julia
(v1.8) pkg> add WaterWaves1D
using WaterWaves1D
```## Overview
`WaterWaves1D.jl` is a [Julia](https://julialang.org/) package providing a framework to study and compare several models for the propagation of unidimensional surface gravity waves (a.k.a. ["water waves"](https://waterwavesmodels.github.io/WaterWaves1D.jl/dev/background/#Water-waves)).
Several models are already implemented, including ([but not limited to](https://waterwavesmodels.github.io/WaterWaves1D.jl/dev/background/#Models)) the so-called water waves system, its truncated spectral expansion, the Green-Naghdi system, the Matsuno system, and so on. You may easily add your favorite one to the gang: see the [how-to guide](https://waterwavesmodels.github.io/WaterWaves1D.jl/dev/how-to/#build-your-model).
## Documentation
See [here](https://waterwavesmodels.github.io/WaterWaves1D.jl/dev/).
## Example
A simple example of a typical use of the package can be found below. More advanced examples are available at the [examples](examples/) and [notebooks](notebooks/) folders.
Gather parameters of the problem.
```julia
param = (
# Physical parameters. Variables are non-dimensionalized as in Lannes, The water waves problem, isbn:978-0-8218-9470-5
μ = 1, # shallow-water dimensionless parameter
ϵ = 1/4, # nonlinearity dimensionless parameter
# Numerical parameters
N = 2^11, # number of collocation points
L = 10, # half-length of the numerical tank (-L,L)
T = 5, # final time of computation
dt = 0.01, # timestep
);
```Define initial data (here, a "heap of water").
```julia
z(x) = exp.(-abs.(x).^4); # surface deformation
v(x) = 0*exp.(-x.^2); # zero initial velocity
init = Init(z,v); # generate the initial data with correct type
```Set up initial-value problems for different models to compare.
```julia
# Build models
model_WW=WaterWaves(param,verbose=false) # The water waves system
model_WW2=WWn(param;n=2,dealias=1,δ=1/10) # The quadratic model (WW2)
# Build problems
problem_WW=Problem(model_WW, init, param) ;
problem_WW2=Problem(model_WW2, init, param) ;
```Integrate in time the initial-value problems.
```julia
solve!([problem_WW problem_WW2]);
```Plot solutions at final time.
```julia
using Plots
plot([problem_WW, problem_WW2])
```
![](./notebooks/Example.png)Generate an animation.
```julia
anim = @animate for t = LinRange(0,5,101)
plot([problem_WW, problem_WW2];T=t,ylims=(-0.5,1))
end
gif(anim, "Example.gif", fps=15)
```
![](./notebooks/Example.gif)## Developers
`WaterWaves1D.jl` is being developed by [Vincent Duchêne](https://perso.univ-rennes1.fr/vincent.duchene/) and [Pierre Navaro](https://github.com/pnavaro).
## Citing
The code is citable via [zenodo](https://zenodo.org). Please cite as:
> V. Duchêne, P. Navaro. WaterWaves1D.jl (Version v0.1.0). Zenodo. [https://doi.org/10.5281/zenodo.7142921](https://doi.org/10.5281/zenodo.7142921)