项目作者: WaterWavesModels

项目描述 :
Shallow Water models
高级语言: Jupyter Notebook
项目地址: git://github.com/WaterWavesModels/ShallowWaterModels.jl.git
创建时间: 2018-10-25T19:05:05Z
项目社区:https://github.com/WaterWavesModels/ShallowWaterModels.jl

开源协议:MIT License

下载


WaterWaves1D.jl

Build Status


codecov
DOI

Installation

  1. (v1.8) pkg> add WaterWaves1D
  2. using WaterWaves1D

Overview

WaterWaves1D.jl is a Julia package providing a framework to study and compare several models for the propagation of unidimensional surface gravity waves (a.k.a. “water waves”).

Several models are already implemented, including (but not limited to) 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.

Documentation

See here.

Example

A simple example of a typical use of the package can be found below. More advanced examples are available at the examples and notebooks folders.

Gather parameters of the problem.

  1. param = (
  2. # Physical parameters. Variables are non-dimensionalized as in Lannes, The water waves problem, isbn:978-0-8218-9470-5
  3. μ = 1, # shallow-water dimensionless parameter
  4. ϵ = 1/4, # nonlinearity dimensionless parameter
  5. # Numerical parameters
  6. N = 2^11, # number of collocation points
  7. L = 10, # half-length of the numerical tank (-L,L)
  8. T = 5, # final time of computation
  9. dt = 0.01, # timestep
  10. );

Define initial data (here, a “heap of water”).

  1. z(x) = exp.(-abs.(x).^4); # surface deformation
  2. v(x) = 0*exp.(-x.^2); # zero initial velocity
  3. init = Init(z,v); # generate the initial data with correct type

Set up initial-value problems for different models to compare.

  1. # Build models
  2. model_WW=WaterWaves(param,verbose=false) # The water waves system
  3. model_WW2=WWn(param;n=2,dealias=1,δ=1/10) # The quadratic model (WW2)
  4. # Build problems
  5. problem_WW=Problem(model_WW, init, param) ;
  6. problem_WW2=Problem(model_WW2, init, param) ;

Integrate in time the initial-value problems.

  1. solve!([problem_WW problem_WW2]);

Plot solutions at final time.

  1. using Plots
  2. plot([problem_WW, problem_WW2])

Generate an animation.

  1. anim = @animate for t = LinRange(0,5,101)
  2. plot([problem_WW, problem_WW2];T=t,ylims=(-0.5,1))
  3. end
  4. gif(anim, "Example.gif", fps=15)

Developers

WaterWaves1D.jl is being developed by Vincent Duchêne and Pierre Navaro.

Citing

The code is citable via zenodo. Please cite as:

V. Duchêne, P. Navaro. WaterWaves1D.jl (Version v0.1.0). Zenodo. https://doi.org/10.5281/zenodo.7142921