1
####################################################################################################
3
# MPM test: Cahn-Hilliard phase separation of initially random order parameter field
5
####################################################################################################
7
####################################################################################################
9
####################################################################################################
10
variable rho equal 1000 # mass density
12
####################################################################################################
14
####################################################################################################
24
####################################################################################################
25
# CREATE SIMULATION BOX
26
####################################################################################################
27
variable l0 equal 1.0 # initial particle lattice spacing
28
region box block -50 50 -50 50 -0.1 0.1 units box
31
####################################################################################################
33
####################################################################################################
37
####################################################################################################
38
# DISCRETIZATION PARAMETERS
39
####################################################################################################
40
variable vol_one equal ${l0}^2 # initial particle volume for 2d simulation
41
variable contact_radius equal ${l0}/2
42
set group all diameter ${l0}
43
set group all smd_contact_radius ${contact_radius}
44
set group all volume ${vol_one}
45
set group all smd_mass_density ${rho}
46
set group all smd_heat 1000.0
47
variable skin equal ${l0} # Verlet list range
49
variable mpm_cellsize equal 1.0*${l0}
51
####################################################################################################
52
# DEFINE BOUNDARY CONDITIONS
53
####################################################################################################
56
region outside block -47 47 -47 47 EDGE EDGE units box side out
57
#set region outside mol 1001
58
region center block -5 5 -5 5 EDGE EDGE units box
59
set region center mol 1001 # constant temperature
60
set region center smd_heat 100
62
####################################################################################################
63
# INTERACTION PHYSICS / MATERIAL MODEL
64
####################################################################################################
65
pair_style smd/mpm_linear ${mpm_cellsize} FLIP 0.9 2d cahn_hilliard 3 1 10 0.5 thermal
68
####################################################################################################
70
####################################################################################################
71
fix dtfix all smd/adjust_dt 0.5 # dynamically adjust time increment every step
73
####################################################################################################
74
# SPECIFY TRAJECTORY OUTPUT
75
####################################################################################################
76
compute op all smd/op # Cahn Hilliard order parameter
77
compute contact_radius all smd/contact_radius
78
compute eint all smd/energy # index 1: elastic energy, 2: heat energy, 3: temperature
79
variable thermal_energy atom c_eint[2]
80
variable temperature atom c_eint[3]
83
dump dump_id all custom 100 dump.LAMMPS id type x y &
84
fx fy c_op c_contact_radius mol &
85
radius proc v_temperature
86
dump_modify dump_id first yes
89
####################################################################################################
91
####################################################################################################
92
compute sumop all reduce sum c_op # all thermal energy
94
thermo_style custom step time dt c_sumop
96
####################################################################################################
98
####################################################################################################
100
#smd_run_duration 2000