GithubHelp home page GithubHelp logo

zzwei1 / pyburgers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeremygibbs/pyburgers

0.0 1.0 0.0 386 KB

One-dimensional DNS and LES of Burgers turbulence written in Python

License: Do What The F*ck You Want To Public License

Python 100.00%

pyburgers's Introduction

Image of pyburgers logo

Burgers Turbulence (Burgulence)

  • Originally conceived by Dutch scientist, J.M. Burgers in the 1930s
  • One of the first attempts to arrive at the statistical theory of turbulent fluid motion
  • The original equation shares a lot in common with the Navier-Stokes (N-S) equations:
    • Advective non-linearity, diffusion,, invariance and conservation laws
  • This equation is not an ideal model for the chaotic nature of turbulence
    • Can be integrated explicitly, meaning it is not sensitive to small changes in initial conditions
    • Shock waves form in the limit of vanishing viscosity
  • A popular modification is the addition of a forcing term that accounts for the neglected effects
    • An example is perturbing the system with a stochastic process that is stationary in time/space
  • A popular verison is called the 1D Stochastic Burgers Equation
    • Allows insight into turbulence without having to generalize to the fully-3D case
  • 1D SBE shares characteristics of 3D turbulence
    • nonlinearity, energy spectrum, intermittent energy dissipation
  • 1D SBE is super-cheap computationally

pyBurgers

  • Many solutions exist for the 1D SBE
  • pyBurgers follows the procedures in Basu (2009)
  • Fourier methods are used in space, and time is advanced in real space
    • Fourier collocation for spatial derivatives, 2nd-order Adams-Bashforth in time
  • Offers a direct numerical simulation (DNS) mode
  • Offers a large-eddy simulation (LES) mode, with 4 subgrid-scale (SGS) models
    • Constant-coefficient Smagorinsky
    • Dyanmic Smagorinsky
    • Dynamic Wong-Lilly
    • Deardorff 1.5-order TKE
  • Stochastic term is fractional Brownian motion (FBM) noise
  • Output in NetCDF
  • DNS took 70 minutes on a 2019 iMac
  • LES took 62 minutes on a 2019 iMac

Namelist Settings

  • nx: number of grid points in the x-direction
  • nt: number of time steps
  • dt: time step (s)
  • visc: kinematic viscosity (m^2 s^-3)
  • damp: noise amplitude for FBM noise
  • sgs: subgrid-scale model
    • 0 = no model
    • 1 = constant-coefficient Smagorinsky
    • 2 = dynamic Smagorinsky
    • 3 = dynamic Wong-Lilly
    • 4 = Deardorff 1.5-order TKE

Requirements

  • pyBurgers requires Python 3, NumPy, SciPy, json, and netCDF4

How to run

python pyBurgersDNS.py

or

python pyBurgersLES.py

Disclaimer

I may have made errors! If you find one, let me know! I have not tried to optimize the code, but may do so in the future.

License

This template is free source code. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://www.wtfpl.net for more details.

pyburgers's People

Contributors

jeremygibbs avatar

Watchers

James Cloos 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.