~jluissandovalm/smoothmachdynamics/testing2

« back to all changes in this revision

Viewing changes to examples/USER/smd/MPM/CahnHilliard/CahnHilliard_spherical.lmp

  • Committer: GCG
  • Date: 2016-11-19 21:22:43 UTC
  • Revision ID: gcg-20161119212243-xg8cw5u8gx7xq28m
reworked Cahn-Hilliard

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
####################################################################################################
 
2
#
 
3
# MPM test: Cahn-Hilliard phase separation of initially random order parameter field
 
4
#
 
5
####################################################################################################
 
6
 
 
7
####################################################################################################
 
8
# MATERIAL PARAMETERS
 
9
####################################################################################################
 
10
variable        rho equal 1000 # mass density
 
11
 
 
12
####################################################################################################
 
13
# INITIALIZE LAMMPS
 
14
####################################################################################################
 
15
units           si
 
16
dimension       2
 
17
boundary        s s p
 
18
atom_style      smd
 
19
neigh_modify    once yes
 
20
comm_modify     vel yes
 
21
newton          off
 
22
comm_style      brick
 
23
 
 
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
 
29
create_box      1 box
 
30
 
 
31
####################################################################################################
 
32
# CREATE PARTICLES
 
33
####################################################################################################
 
34
lattice         sq ${l0}
 
35
create_atoms    1 box
 
36
 
 
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
 
48
neighbor        ${skin} bin
 
49
variable        mpm_cellsize equal 1.0*${l0}
 
50
 
 
51
####################################################################################################
 
52
# DEFINE BOUNDARY CONDITIONS
 
53
####################################################################################################
 
54
variable        xl equal -47
 
55
variable        xr equal 47
 
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
 
61
 
 
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
 
66
pair_coeff      1 1
 
67
 
 
68
####################################################################################################
 
69
# TIME INTEGRATION
 
70
####################################################################################################
 
71
fix             dtfix all smd/adjust_dt 0.5 # dynamically adjust time increment every step
 
72
 
 
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]
 
81
 
 
82
 
 
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
 
87
 
 
88
 
 
89
####################################################################################################
 
90
# STATUS OUTPUT
 
91
####################################################################################################
 
92
compute         sumop all reduce sum c_op # all thermal energy
 
93
thermo          100
 
94
thermo_style    custom step time dt c_sumop
 
95
 
 
96
####################################################################################################
 
97
# RUN SIMULATION
 
98
####################################################################################################
 
99
run 100000
 
100
#smd_run_duration 2000
 
101
#run 99999999
 
102