All Projects → python-hydro → hydro_examples

python-hydro / hydro_examples

Licence: BSD-3-Clause license
Simple one-dimensional examples of various hydrodynamics techniques

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language
fortran
972 projects
Makefile
30231 projects

Projects that are alternatives of or similar to hydro examples

Kinetic.jl
Universal modeling and simulation of fluid dynamics upon machine learning
Stars: ✭ 82 (-1.2%)
Mutual labels:  finite-volume, pde
euler2d kokkos
Simple 2d finite volume solver for Euler equations using c++ kokkos library
Stars: ✭ 27 (-67.47%)
Mutual labels:  finite-volume, hydrodynamics
MAESTRO
A low Mach number stellar hydrodynamics code
Stars: ✭ 29 (-65.06%)
Mutual labels:  pde, hydrodynamics
devsim
TCAD Semiconductor Device Simulator
Stars: ✭ 104 (+25.3%)
Mutual labels:  finite-volume, pde
Pylians3
Libraries to analyze numerical simulations (python3)
Stars: ✭ 35 (-57.83%)
Mutual labels:  hydrodynamics
unstructured-finite-volume
Unstructured Finite Volume Solver for Partial Differential Equations
Stars: ✭ 26 (-68.67%)
Mutual labels:  finite-volume-methods
Bridge.jl
A statistical toolbox for diffusion processes and stochastic differential equations. Named after the Brownian Bridge.
Stars: ✭ 99 (+19.28%)
Mutual labels:  diffusion
Laghos
High-order Lagrangian Hydrodynamics Miniapp
Stars: ✭ 131 (+57.83%)
Mutual labels:  hydrodynamics
PSyclone
Domain-specific compiler for Finite Difference/Volume/Element Earth-system models in Fortran
Stars: ✭ 67 (-19.28%)
Mutual labels:  finite-volume
openBF
1D blood flow model
Stars: ✭ 16 (-80.72%)
Mutual labels:  finite-volume
DGM-and-DRM
Several code for the paper: A comparison study of deep Galerkin method and deep Ritz method for elliptic problems with different boundary conditions
Stars: ✭ 15 (-81.93%)
Mutual labels:  pde
SGpp
SG⁺⁺ – the numerical library for Sparse Grids in all their variants.
Stars: ✭ 59 (-28.92%)
Mutual labels:  pde
exadg
ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
Stars: ✭ 62 (-25.3%)
Mutual labels:  multigrid
euler2d cudaFortran
2nd order Godunov solver for 2d Euler equations written in CUDA Fortran and stdpar (standard paralelism)
Stars: ✭ 24 (-71.08%)
Mutual labels:  hydrodynamics
Numerical-Algorithms
Numerical Experiments
Stars: ✭ 15 (-81.93%)
Mutual labels:  pde
raptor
General, high performance algebraic multigrid solver
Stars: ✭ 50 (-39.76%)
Mutual labels:  multigrid
rheoTool
Toolbox to simulate GNF and viscoelastic fluid flows in OpenFOAM®
Stars: ✭ 104 (+25.3%)
Mutual labels:  finite-volume
PyFRAP
PyFRAP: A Python based FRAP analysis tool box
Stars: ✭ 15 (-81.93%)
Mutual labels:  pde
mole
Mimetic Operators Library Enhanced
Stars: ✭ 15 (-81.93%)
Mutual labels:  pde
pollinations
Generate Art
Stars: ✭ 100 (+20.48%)
Mutual labels:  diffusion

hydro_examples

Simple one-dimensional examples of various hydrodynamics techniques

This is a collection of simple python codes (+ a few Fortran ones) that demonstrate some basic techniques used in hydrodynamics codes. All the codes are standalone -- there are no interdependencies.

These codes go together with the lecture notes at:

http://bender.astro.sunysb.edu/hydro_by_example/CompHydroTutorial.pdf

and with the pyro2 code:

https://github.com/python-hydro/pyro2

  • advection/

    • advection.py: a 1-d second-order linear advection solver with a wide range of limiters.

    • fdadvect_implicit.py: a 1-d first-order implicit finite-difference linear advection solver using periodic boundary conditions.

    • fdadvect.py: a 1-d first-order explicit finite-difference linear advection solver using upwinded differencing.

    • fv_mol.py: a 1-d method-of-lines second-order accurate advection solver.

    • Fortran/:

      • advect.f90: a Fortran implementation of second-order linear advection. This version does piecewise constant, piecewise linear, and piecewise parabolic (PPM) reconstruction.
  • basic-numerics

    • orbit-converge.py (and orbit.py): a demonstration of the convergence of different ODE integration methods for the problem of Earth orbiting around the Sun.
  • burgers/

    • burgers.py: a 1-d second-order solver for the inviscid Burgers’ equation, with initial conditions corresponding to a shock and a rarefaction.
  • compressible/

    • euler.ipynb: a SymPy IPython notebook that derives the eigenvalues and eigenvectors for the Euler equations.

    • riemann-phase.py: a simple script that plots the Hugoniot curves for a compressible Riemann problem (assuming a gamma-law gas)

  • diffusion/

    • diffusion-explicit.py: solve the constant-diffusivity diffusion equation explicitly. The method is first-order accurate in time, but second- order in space. A Gaussian profile is diffused--the analytic solution is also a Gaussian.

    • diffusion-implicit.py: solve the constant-diffusivity diffusion equation implicitly. Crank-Nicolson time-discretization is used, resulting in a second-order method. A Gaussian profile is diffused.

  • elliptic/

    • poisson_fft.py: an FFT solver for a 2-d Poisson problem with periodic boundaries.
  • finite-volume/

    • conservative-interpolation.ipynb: an IPython notebook that illustrates how to derive high-order conservative interpolants for finite-volume data.
  • incompressible/

    • project.py: a simple example of using a projection to recover a divergence-free velocity field.
  • multigrid/

    • mg_converge.py: a convergence test of the multigrid solver. A Poisson problem is solved at various resolutions and compared to the exact solution. This demonstrates second-order accuracy.

    • mg_test.py: a simple driver for the multigrid solver. This sets up and solves a Poisson problem and plots the behavior of the solution as a function of V-cycle number.

    • multigrid.py: a multigrid class for cell-centered data. This implements pure V-cycles. A square domain with 2 N zones (N a positive integer) is required.

    • patch1d.py: a class for 1-d cell-centered data that lives on a grid. This manages the data, handles boundary conditions, and provides routines for prolongation and restriction to other grids.

  • multiphysics/

    • burgersvisc.py: solve the viscous Burgers equation. The advective terms are treated explicitly with a second-order accurate method. The diffusive term is solved using an implicit Crank-Nicolson discretiza- tion. The overall coupling is second-order accurate.

    • diffusion-reaction.py: solve a diffusion-reaction equation that propagates a diffusive reacting front (flame). A simple reaction term is modeled. The diffusion is solved using a second-order Crank-Nicolson discretization. The reactions are evolved using the VODE ODE solver (via SciPy). The two processes are coupled together using Strang-splitting to be second-order accurate in time.

  • parallel/

    • relax-mpi.f90: a simple example of pure relaxiation using domain decomposition + message passing (through MPI) to implement smoothing in a parallel fashion.

    • relax-omp.f90: a simple example of pure relaxation using OpenMP to parallelize the loops using shared-memory.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].