Coder Social home page Coder Social logo

rubensamarojr / polymps Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 7.0 56 MB

Moving Particle Semi-implicit (MPS) method with Polygon or Particle wall. C++/OpenMP code for physical simulation of fluid with presence of free surface

License: MIT License

C++ 99.50% Makefile 0.50%
mps particle-methods free-surface-flows cfd fluid-simulation

polymps's Introduction

logo_PolyMPS

A C++ code for numerical modelling of free-surface flow ๐ŸŒŠ using Explicit, Weakly Compressible or Incompressible Moving Particle Simulation/Semi-implicit MPS method. Boundary walls can be modeled by polygonal mesh (triangles) or discrete layers of wall and dummy (ghost) particles.

See EXAMPLES in the folder input.

How to cite PolyMPS ?

If you use PolyMPS, please cite the following reference:

Amaro Jr, R. A. and Cheng, L.Y. "PolyMPS - An open source CFD solver based on Polygon walls in Moving Particle Semi-implicit (MPS) method", Software Impacts, 14. https://doi.org/10.1016/j.simpa.2022.100376

Forum

On the PolyMPS Discussions page you can ask questions, discuss about simulation issues, share ideas, and interact with other members.

Contents

Dependencies

In order to install C++ compiler (GCC) on windows, we recommend to install Cygwin. You can find here how to install Cygwin. The following Packages should be selected during the Cygwin installation:

  • automake
  • gcc-core
  • gcc-fortran
  • gcc-g++
  • gdb
  • libstdc++
  • make

Eigen, libigl and JSON for Modern C++ are third party header-only libraries, i.e., they do not need to be separately compiled, packaged and installed to be used ๐Ÿ˜.

PolyMPS workflow

Input files

Have a look at some examples in the folder input.

In order to run these examples, please, go to the directory input/grid and extract the compressed folder grid.zip in the grid directory itself.

Foldernames, Filenames, Physical and Numerical parameters

It is necessary to create a file (extension .json) and set all parameters.

Solid domain

  1. ... using triangular meshes. It is necessary to create a file (extension .stl) with informations about the initial geometry.
  2. ... using particles. Necessary to add one layer of wall particles (material ID = 2) and two layers of dummy particles (material ID = 3) in the .grid file.

Fluid domain

It is necessary to create a file (extension .grid) with informations about the initial geometry and some numerical and physical parameters:

  • First line: 0
  • Second line: number of particles
  • Next lines in the columns:
    • material ID
    • initial coordinates of particles X Y Z
    • initial fluid velocities VX VY VZ (generally 0.0 0.0 0.0)
    • initial particle pressure P (generally 0.0)
    • initial presure average PAV (generally 0.0)

Compile

Code compiled and tested on Windows 7, and Linux CentOS 7 and Ubuntu64.

You can build the project in GNU/Linux using the makefile. Follow these steps (CPU version):

Clone this repository into your system using terminal in Linux, and Git BASH or command prompt (cmd) in Windows

git clone https://github.com/rubensaaj/polymps.git

Go to the folder polymps

cd polymps

Now, clone the third party libraries. You must run two commands

git submodule init

to initialize your local configuration file, and

git submodule update

to fetch all the data from the third party libraries.

Edit the Makefile file (if necessary) with a text editor.

Make sure the environment is clean and ready to compile

make clean

Execute make

make all

This should create a binary main in folder bin

Run

โš ๏ธFIRST OF ALL, go to the directory input/grid and extract the compressed folder grid.zip in the grid directory itself. Check if dam1610_3D_fluid_lo0p010_mps.grid contains the data mentioned before in Fluid domain.

on LINUX

In the terminal, type

./bin/main

on WINDOWS

You can do this in two ways:

1st way - In the command prompt, type

bin\main.exe

2nd way - Move the main.exe from the folder bin to the root folder polymps. After that, double click on main.exe.

Json input filename

Type the name of the json input file (located in input directory), e.g.

MpsInputExample

You can specify a different case by changing numerical and physical parameters in the input json file. Also, input grid and stl files should be updated according your problem. We recommend that you rename the json file, e.g. case_02.json, and set a new name to output folder. After that, you can run PolyMPS at any time, and type the name of the new json input file, e.g.

case_02

Output

This code writes pvd (header file) and corresponding vtu files as output. Look in the output directory. You can visualize them by open the pvd file with Paraview ๐Ÿ‘€.

Directories

The PolyMPS contains several files and directories:

File/Folder Description
eigen library for linear algebra: matrices, vectors, numerical solvers, and related algorithms
include header files
input simple input examples (json, grid and stl files). Grid files compressed in a folder
libigl geometry processing library
json file that uses human-readable text to store and transmit data objects
output ouput files (pvd, vtu and txt files)
src source files
LICENSE MIT License
Makefile set of tasks to compile the program
README text file

License

This project is licensed under the MIT License - see the LICENSE file for details.

polymps's People

Contributors

rubensamarojr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

polymps's Issues

To-Do list

  • Velocity Laplacian in the explicit part. Need particle-polygon search 2x.
  • NPCD using look table like pnd
  • BC wall pressure
  • Print TXT file of the screen and output simulation info
  • Json input jump over irrelevant data for the case
  • Update branchs
  • Mean pressure in corners. Perform a test.
  • Find Libs that give all triangles near the particle, or at least the average of normals and distances.
  • Typedef double real
  • Typedef float real

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.