For the general installation instruction please refer to the documentation of LAMMPS and to SPH-USER package:
- http://lammps.sandia.gov/doc/Section_start.html
- http://lammps.sandia.gov/doc/USER/sph/SPH_LAMMPS_userguide.pdf
- 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
- 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=
- 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=
- 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=
cd src mkdir -p MAKE/MINE python Make.py -o linux -v -p user-sph -cc mpi -fft none -jpg no -a file mpi
We add the following extension to USER-SPH package:
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
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.
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.
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 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.
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].
Flow around cylinder simulation with parameters from [1].
Infinite slub simulation [3]
A cube changes to a sphere under the effect of surface tension
Circular liquid-droplet oscillation under the action of capillary forces [4]
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
[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).