Coder Social home page Coder Social logo

ns2d.jl's Introduction

NS2D

Lifecycle Build Status Build Status Coverage

Julia flow

Overview

NS2D is a simple pseudo-spectral solver for the two-dimensional Navier-Stokes equations in a doubly periodic domain written in Julia. Its aim is primarily to get myself familiar with the Julia ecosystem for scientific computing as well as illustrating how pseudo-spectral solvers work for my students. If you nonetheless think that such a simple solver written in Julia could be beneficial for your research, please do not hesitate to use it, fork it and/or send pull requests !

Method / Capabilities

NS2D solves the two-dimensional Navier-Stokes equations in a doubly-periodic domain using the vorticity-streamfunction formulation. Most of the computation is performed in spectral space while the non-linear advection term is computed in physical space using standard techniques for dealiasing. At its core, NS2D uses FFTW.jl with multi-threading and preallocated arrays for in-place fast Fourier transforms while time-integration is performed thanks to DifferentialEquations.jl.

Examples

Below is a list of canonical examples that can be simulate using NS2D.

Taylor-Green vortices

In two dimensions, the Taylor-Green vortices are one of the few analytic solutions to the incompressible Navier-Stokes we know of. It is quite often used for testing and validation of the spatial and/or temporal accuracy of Navier-Stokes solvers. The figure below shows the initial vorticity field (top panel) and the maximum pointwise error over time between the analytic solution and the one simulated using NS2D (bottom panel).

These results have been obtained with :

  • Viscosity ν=1e-3,
  • Number of grid points per direction n=128,
  • Fifth order accurate time-stepping with variable time step using alg=Tsit5() from DifferentialEquations.jl,
  • Absolute and relative tolerances set to abstol = 1e-8 and reltol=1e-6, respectively.

Two-dimensional decaying isotropic turbulence

TBA

Two-dimensional Kolmogorov flow

TBA

Developments goals

As stated, NS2D is primary a sandbox for me to get familiar with the Julia ecosystem and test some ideas. Below is a non-exhaustive lists of such ideas. If you are interested in any of them, please do not hesitate to get in touch !

  • Deterministic and stochastic forcing for forced turbulence,
  • Parallel computing,
  • GPU acceleration with CUDA.jl,
  • Automatic differentiation with JuliaDiff for optimization and machine-learning,

ns2d.jl's People

Contributors

loiseaujc avatar github-actions[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.