Code Monkey home page Code Monkey logo

srd2dsubmission's Introduction

Processing implementation of the paper "Two-Dimensional Stochastic Rotation Dynamics for Fluid Simulation"
Copyright (C) 2019 B. Crespin, C.T. Tran, M. Cerbelaud, A. Videcoq, E. Darles

==========================================================================================================
Installation:

* Download Processing: https://processing.org/download/
* Download directory "SRD2Dsubmission/"
* Open and run the file "SRD2Dsubmission/SRD2Dsubmission.pde"

==========================================================================================================
Usage:

Press SPACE to add droplet / 'd': dam break flood / 'r': fluid at rest
      'v': mixing fluids / 'b': add/remove ball / Use the mouse to push
      'a/A': change alpha value
      'h': print this help message

==========================================================================================================
Structure:

The code is structured into files/classes. In the main file "SRD2Dsubmission.pde" we define all the 
parameters, initialize the objects corresponding to particles and cells, then run the simulation iterations 
in an infinite loop (function "draw"). This loop also include the interactions with the user 
(keyboard or mouse) and rendering.

The file "Particle.pde" first declares the attributes of a particle such as its position, velocity, the 
index of its associated cell, etc. The computation of the local repulsion and SRD collision steps is 
defined here, as well as the application of the gravity and the pressure force, and finally the advection 
of a particle before the next iteration.

The file "Cell.pde" declares the attribute of a cell, including its position and a list of the particles it 
contains. All the code needed for cell pressure computation is defined here, such as average velocity, 
divergence, pressure, pressure gradient and density ratio. An integer value is also used to characterize if 
the cell is empty, has an empty cell neighbor, or is surrounded by non-empty cells.

An additional file "Ball.pde" defines the behavior of the moving ball interacting with the fluid.

==========================================================================================================
License:

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General 
Public License as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public 
License for more details.

You should have received a copy of the GNU General Public License along with this program.  If not, see 
<https://www.gnu.org/licenses/>

srd2dsubmission's People

Contributors

benoitcrespin 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.