Code Monkey home page Code Monkey logo

jimmy-inl / sph Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hustic/sph

0.0 1.0 0.0 126.24 MB

Smoothed Particle Hydrodynamics (SPH) is a meshless method for solving the Navier-Stokes equation, in which fluid properties are stored on Lagrangian fluid particles (i.e. on particles which move with the fluid flow). The particles interact to generate values across the entire fluid domain through continuous smoothing kernels.

Jupyter Notebook 99.76% Makefile 0.01% C++ 0.21% Python 0.02%

sph's Introduction

README

SPH

Smoothed Particle Hydrodynamics (SPH) is a meshless method for solving the Navier-Stokes equation, in which fluid properties are stored on Lagrangian fluid particles (i.e. on particles which move with the fluid flow). The particles interact to generate values across the entire fluid domain through continuous smoothing kernels.

As the SPH method is meshless and Lagrangian, it is ideal for solving problems involving fluid flow with interfaces and free surfaces. This tool implements the SPH method in C++ to solve wave generation in a lock-release/dam-break problem.

Compilation/Installation Guide

A Makefile has been provided that builds the tool and places the executables in the bin folder. Reading through the Makefile is highly encouraged to see all the options a user has for building and testing the tool. The simplest way to compile is:

make

Note, that the post.py uses the lxlm library. The installation of that library changes from system to system. Users are thus encouraged to check out the installation page on the lxlm website.

Also note, that the testing routines use the BOOST library, which is another can of worms. If you are using a Linux distribution (however) you can just use apt-get:

sudo apt-get install libboost-all-dev

, or any other package manager your distribution comes with.

User instructions

After a successfull complilation, the user can run the tool with his/her desired initial configuration, by running:

./bin/SPH_2D input.txt

The input.txt should look like:

30.0  <-- length of the simulation in seconds
0.05  <-- time-step to output to disk
0.2   <-- dx
0     <-- switch off analysisMode (to be deprecated)
-0.6 -0.6 0.1 10.7 1   <-- Define bottom left and top right corners (first 4)
0.0 10.0 20.0 10.7 1   <-- 5th argument is the type of particle (1 for boundary)
20.0 -0.6 20.6 10.7 1
0.0 -0.6 20.0 0.1 1
0.2 0.2 3.1 5.1 0
3.2 0.2 19.9 2.1 0

Documentation

Extensive Documentation has been written for both the tool and its testing routines. You can either check the Markdown version (incomplete :( ), emacs org-mode version (no latex functions unfortunately), pdf version.

Testing

The tool includes tests, which you can use to check its operation on your system. With the code compiled, these can be run with

python run_tests.py

If you are on a Linux distribution and you want to compile and run the complete testing routines, you can use:

make runtests

sph's People

Contributors

acse-kw3515 avatar acse-nz319 avatar acse-oft119 avatar acse-sg3219 avatar acse-wy619 avatar hustic avatar jrper avatar

Watchers

 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.