Skip to content

slitvinov/lammps-sph-multiphase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Installation

For the general installation instruction please refer to the documentation of LAMMPS and to SPH-USER package:

Installation examples

Ubuntu 12.04.5 LTS (Precise Pangolin)

  • Install libraries
sudo apt-get install git
sudo apt-get install openmpi-dev
sudo apt-get install openmpi-bin
sudo apt-get install libjpeg-dev
  • Clone the repository
git clone https://github.com/slitvinov/lammps-sph-multiphase.git lammps-sph
  • Build the package
cd lammps-sph/src
make yes-USER-SPH
make linux CC=mpicc LINK=mpicc CCFLAGS='-O2 -g' FFT_LIB=-lm

Ubuntu 14.04.1 LTS (Trusty Tahr)

  • Install libraries
sudo apt-get install git
sudo apt-get install g++
sudo apt-get install openmpi-bin
sudo apt-get install libopenmpi-dev
  • Install libjpeg from source
wget http://www.ijg.org/files/
tar zxvf jpegsrc.v9a.tar.gz
cd jpeg-9a
./configure --prefix=${HOME}/prefix-jpeg-9a
make install
cd ..
  • Clone the repository
git clone https://github.com/slitvinov/lammps-sph-multiphase.git lammps-sph
  • Build the package
cd lammps-sph/src
make yes-USER-SPH
make linux CC=mpic++ LINK=mpic++ CCFLAGS="-O2 -g -I${HOME}/prefix-jpeg-9a/include" FFT_LIB=-lm LINKFLAGS="-O -L${HOME}/prefix-jpeg-9a/lib" MPI_LIB=

CentOS Linux 6.5

  • Install libraries
sudo yum install git
sudo yum install mpich2-devel
sudo yum install gcc-c++
sudo yum install libjpeg-devel
  • Clone the repository
git clone https://github.com/slitvinov/lammps-sph-multiphase.git lammps-sph
  • Build the package
cd lammps-sph/src
make yes-USER-SPH
make linux CC=mpicc LINK=mpicc CCFLAGS='-O2 -g' FFT_LIB=-lm MPI_LIB=

Debian Wheezy 7.5 x64

  • Install libraries
sudo apt-get install mpich2
sudo apt-get install libjpeg8-dev
  • Clone the repository
git clone https://github.com/slitvinov/lammps-sph-multiphase.git lammps-sph
  • Build the package
cd lammps-sph/src
make yes-USER-SPH
make linux CC=mpicc LINK=mpicc CCFLAGS='-O2 -g' FFT_LIB=-lm MPI_LIB=

Installation using src/Make.py

cd    src
mkdir -p MAKE/MINE
python Make.py -o linux  -v -p user-sph  -cc mpi -fft none -jpg no -a file mpi

Implementation

We add the following extension to USER-SPH package:

atom_style meso/multiphase

This is data structures which provides

  • position
  • velocity
  • extrapolated velocity (vest)
  • forces
  • SPH density (rho)
  • time derivative of SPH density (drho)
  • internal energy per particle (e)
  • time derivative of internal energy per particle (de)
  • color gradient vector (colorgradient)
  • per-particle heat capacity (cv)

This data structure can be activated by

atom_style meso/multiphase

pair_sph_colorgradient

A pair_style to calculate a color gradient

pair_style         sph/colorgradient
pair_coeff         I J     ${h} ${alpha}

Here, I and J are the types of SPH particles for which a color gradient is calculated, alpha is a surface tension coefficient, h is a cutoff.

pair_sph_surfacetension

A pair_style to calculate surface tension

pair_coeff         I J     sph/surfacetension ${h}

Here, I and J are the types of SPH particles for which a surface tension is calculated, h is a cutoff. Note that surface tension coefficient is included into color gradient.

pair_sph_heatconduction_phasechange

A modified heat conduction equation to use for phase change model. Has to forms. Simple form is equivalent to the heat conduction equation from USER-SPH package

pair_coeff         I J  sph/heatconduction/phasechange  ${D_heat_ld}

Here, I and J are the types of SPH particles which interact and D is a heat diffusion coefficient.

Full form of the pair style is

pair_coeff         I J  sph/heatconduction/phasechange  ${D_heat_ld} TI TJ

where TI and TJ are temperatures for corresponding particles in I and J interactions.

NULL can be used as a placeholder to indicate that normal temperate should be used for corresponding particle

pair_coeff         I J  sph/heatconduction/phasechange  ${D_heat_ld} TI NULL

fix_phase_change

Fix which adds a phase change

fix                fix_ID group_ID phase_change &
                   ${Tc} ${Tt} ${Hwv} ${dr} ${mass_v} &
                   ${pcutoff} ${l_type} ${v_type} ${insert_every} 123456 ${prob} region

fix_ID and group_ID are described in LAMMPS documentation. TC is critical temperature of the phase change, TT is transition temperature for the algorithm (should be set above TC), dr a characteristic distance for a new particle position, mass a mass of a new particle, h cutoff of the interaction, from_type and to_type types of the particles involved in phase transition, N frequency of the check for phase transition algorithm, seed a seed for random number generator, prob probability of the phase transition if all criteria are met (0<prob<1), region a region where algorithm checks for potential phase transition.

Examples

See examples/USER/sph/

examples/USER/sph/poiseuille

Low Reynolds number Poiseuille flow simulation with parameters from [1] and driven by uniform body forces in opposite directions along two-halves of a computational domain [2].

examples/USER/sph/img/poiseuille.png

examples/USER/sph/flow_around_cylinder

Flow around cylinder simulation with parameters from [1].

examples/USER/sph/img/flow.png

examples/USER/sph/slub

Infinite slub simulation [3]

examples/USER/sph/img/infslab.png

examples/USER/sph/square_to_sphere

A cube changes to a sphere under the effect of surface tension

examples/USER/sph/droplet_grid

Circular liquid-droplet oscillation under the action of capillary forces [4]

examples/USER/sph/img/cap_waves.png

examples/USER/sph/img/cap_waves100.png

examples/USER/sph/bubble_random

Bubble growth in super-heated liquid

bash run.sh

To see the particles in VMD

vmd -e deposit.tcl  -args data-ndim3-nx40/data.xyz

To plot the volume of the bubble vs time

plot "data-ndim2/rg.dat" w lp

Footnotes

[1] Morris, J. P., Fox, P. J. & Zhu, Y. Modeling Low Reynolds Number Incompressible Flows Using SPH. Journal of Computational Physics 136, 214–226 (1997).

[2] Fedosov, D. A., Karniadakis, G. E. & Caswell, B. Steady shear rheometry of dissipative particle dynamics models of polymer fluids in reverse Poiseuille flow. J Chem Phys 132, (2010).

[3] Cleary, Paul W., and Joseph J. Monaghan. “Conduction modelling using smoothed particle hydrodynamics.” Journal of Computational Physics 148.1 (1999): 227-264.

[4] Hu, X. Y. & Adams, N. A. A Multi-phase SPH Method for Macroscopic and Mesoscopic Flows. J. Comput. Phys. 213, 844–861 (2006).

About

Multiphase SPH simulation with evaporation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published