Commit 91f49402 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6836 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 31790144
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
see the USER-SPH user's guide for a detailed explanation of these examples.
+63 −0
Original line number Diff line number Diff line
dimension          2
units              si
atom_style         meso

# create simulation box
region             box block -0.050e-3 1.044e-3 -0.05e-3 1.044e-3 -1.0e-6 1.0e-6 units box
create_box         3 box

# create fluid particles
region             fluid block 0.0001e-3 0.999e-3 0.0001e-3 0.999e-3 EDGE EDGE side in units box 
lattice            sq 0.025e-3
create_atoms       1 region fluid

# create bottom, left, and right wall
region             walls block 0.0001e-3 0.999e-3 0.0001e-3 EDGE EDGE EDGE side out units box 
lattice            sq2 0.025e-3
create_atoms       2 region walls

# create a driver strip of particles, which exerts shear forces on the fluid
region             driver block EDGE EDGE 0.999e-3 EDGE EDGE EDGE side in units box 
create_atoms       3 region driver

group              fluid type 1 
group              walls type 2 
group              driver type 3
group              integrate_full union fluid driver

mass               3 2.0e-7
mass               2 2.0e-7
mass               1 4.0e-7
set                group all meso_rho 1000.0

# use Tait's EOS in combination with Morris' laminar viscosity.
# We set rho_0 = 1000 kg/m^3, c = 0.1 m/s, h = 6.5e-5 m.
# The dynamic viscosity is set to 1.0e-3 Pa s, corresponding to a kinematic viscosity of 1.0e-6 m^2/s
pair_style         hybrid sph/taitwater/morris
pair_coeff         * *    sph/taitwater/morris 1000 0.1 1.0e-3 6.5e-5
pair_coeff         2 3    none # exclude interaction between walls and shear driver

compute            rho_peratom all meso_rho/atom
compute            e_peratom all meso_e/atom
compute            ke_peratom all ke/atom
compute            esph all reduce sum c_e_peratom
compute            ke all ke
variable           etot equal c_ke+c_esph

# assign a constant velocity to shear driver
velocity           driver set 0.001 0.0 0.0 units box
fix                freeze_fix driver setforce 0.0 0.0 0.0

# do full time integration for shear driver and fluid, but keep walls stationary
fix                integrate_fix_full integrate_full meso
fix                integrate_fix_stationary walls meso/stationary

dump               dump_id all custom 100 dump.lammpstrj id type xs ys zs vx vy c_rho_peratom c_e_peratom
dump_modify        dump_id first yes
thermo             100
thermo_style       custom step c_esph v_etot
thermo_modify      norm no

neighbor           3.0e-6 bin
timestep           5.0e-5
run                4000
+24 −0
Original line number Diff line number Diff line
#!/usr/bin/gnuplot

# compare sph/heatconduction output with analytic solution to diffusion equation

alpha = 1.0e-4
time = 4.0

analytic_profile(x) = 1.5 + 0.5*erf((x-49.5e-2)/sqrt(4.0*alpha*time))

set ylabel "internal energy per particle"
set xlabel "x position [m]"

plot [][0.5:2.5]'dump.last' u 3:6 ti "SPH simulation", analytic_profile(x) ti "analytic solution"

pause -1
#set terminal postscript color enhanced lw 2
#set out "heat_profile.ps"
set table "simu.dat"
plot [0:1][0.5:2.5]'dump.last' u 3:6

set table "analytic.dat"
set samples 1000
plot [0:1][0.5:2.5] analytic_profile(x)
#replot
+51 −0
Original line number Diff line number Diff line
# mesoscopic heat conduction
# heat flow from hot right region to cold left region
# compare the temperature profile at the end opf the simulation,
# contained in file dump.last, to analytic solution.
#
#
dimension       2
units		si
atom_style	meso
boundary        f p p

lattice		sq 0.01
region		box block 0 100 0 10 0 0.1 
create_box	1 box
create_atoms	1 box
mass            1 1.0e-5

region          left  block EDGE 49.9  EDGE EDGE EDGE EDGE
region          right block 50 EDGE EDGE EDGE EDGE EDGE
set             region left  meso_e 1.0 # internal energies
set             region right meso_e 2.0
set             group all meso_rho 0.1 # mesoscopic density is also needed for this pair style
#               For correct temperature profiles, mescoscopic density and mass * number density must coincide!

pair_style      sph/heatconduction
#               i j diffusion coeff. cutoff
pair_coeff      1 1 1.0e-4           2.0e-2

compute         ie_atom all meso_e/atom
compute         ie all reduce sum c_ie_atom

thermo		10
thermo_style    custom step temp c_ie
timestep        0.25e-1
neighbor	0.2e-2 bin
fix             integrate_fix all meso/stationary

dump		dump_fix all custom 10 dump.heat id type x y z c_ie_atom
dump_modify     dump_fix first yes
run             160
undump          dump_fix

dump		dump_fix all custom 10 dump.last id type x y z c_ie_atom
dump_modify     dump_fix first yes
run             0
undump          dump_fix

dump		dump_fix all custom 10 dump.last.xs id type xs ys zs c_ie_atom
dump_modify     dump_fix first yes
run             0
undump          dump_fix
+49 −0
Original line number Diff line number Diff line
# mesoscopic heat conduction
# heat flow from hot right region to cold left region
# compare the temperature profile at the end opf the simulation,
# contained in file dump.last, to analytic solution.
#
#
units		si
atom_style	meso
newton          on
boundary        f p p

lattice		sc 0.01
region		box block 0 100 0 10 0 10 
create_box	1 box
create_atoms	1 box
mass            1 1.0e-5

region          left  block EDGE 49.9  EDGE EDGE EDGE EDGE
region          right block 50 EDGE EDGE EDGE EDGE EDGE
set             region left  meso_e 1.0 # internal energies
set             region right meso_e 2.0
set             group all meso_rho 10.0 # mesoscopic density is also needed for this pair style
#               For correct temperature profiles, mescoscopic density and mass * number density must coincide!

pair_style      sph/heatconduction
#               i j diffusion coeff. cutoff
pair_coeff      1 1 1.0e-4           2.0e-2
neighbor	0.2e-2 bin
neigh_modify	every 20 delay 0 check no

compute         ie_atom all meso_e/atom
compute         ie all reduce sum c_ie_atom

thermo_style    custom step temp c_ie
thermo_modify   norm no

fix             integrate_fix all meso/stationary

thermo		10
timestep        0.25e-1

dump		dump_fix all custom 10 dump.heat id type x y z c_ie_atom
dump_modify     dump_fix first yes
run             160
undump          dump_fix

dump		dump_fix all custom 10 dump.last id type x y z c_ie_atom
dump_modify     dump_fix first yes
run             0
Loading