Merge branch 'correct_user_smd_examples' of github.com:dboemer/lammps into collected-small-changes
This commit is contained in:
@ -6,17 +6,16 @@
|
||||
#
|
||||
####################################################################################################
|
||||
|
||||
|
||||
####################################################################################################
|
||||
# MATERIAL PARAMETERS
|
||||
####################################################################################################
|
||||
variable E equal 70.0 # Young's modulus
|
||||
variable nu equal 0.3 # Poisson ratio
|
||||
variable rho equal 1 # initial mass density
|
||||
variable E equal 70.0 # Young's modulus
|
||||
variable nu equal 0.3 # Poisson ratio
|
||||
variable rho equal 1 # initial mass density
|
||||
variable q1 equal 0.56 # standard artificial viscosity linear coefficient
|
||||
variable q2 equal 0.0 # standard artificial viscosity quadratic coefficient
|
||||
variable hg equal 10.0 # hourglass control coefficient
|
||||
variable cp equal 1.0 # heat capacity of material -- not used here
|
||||
variable cp equal 1.0 # heat capacity of material -- not used here
|
||||
|
||||
variable JC_A equal 0.3241 # Johnson Cook parameters
|
||||
variable JC_B equal 0.1138
|
||||
@ -39,10 +38,10 @@ variable eosC6 equal 0.0
|
||||
# INITIALIZE LAMMPS
|
||||
####################################################################################################
|
||||
dimension 2
|
||||
units si
|
||||
units si
|
||||
boundary sm sm p # simulation box boundaries
|
||||
atom_style smd
|
||||
atom_modify map array
|
||||
atom_modify map array
|
||||
comm_modify vel yes
|
||||
neigh_modify every 10 delay 0 check yes # re-build neighbor list every 10 steps
|
||||
newton off
|
||||
@ -50,37 +49,36 @@ newton off
|
||||
####################################################################################################
|
||||
# CREATE INITIAL GEOMETRY
|
||||
####################################################################################################
|
||||
variable l0 equal 1.0 # lattice spacing for creating particles
|
||||
lattice sq ${l0}
|
||||
region box block -10 10 -10 10 -0.1 0.1 units box
|
||||
create_box 1 box
|
||||
create_atoms 1 box
|
||||
group tlsph type 1
|
||||
|
||||
variable l0 equal 1.0 # lattice spacing for creating particles
|
||||
lattice sq ${l0}
|
||||
region box block -10 10 -10 10 -0.1 0.1 units box
|
||||
create_box 1 box
|
||||
create_atoms 1 box
|
||||
group tlsph type 1
|
||||
|
||||
####################################################################################################
|
||||
# DISCRETIZATION PARAMETERS
|
||||
####################################################################################################
|
||||
variable h equal 2.01*${l0} # SPH smoothing kernel radius
|
||||
variable vol_one equal ${l0}^2 # volume of one particle -- assuming unit thickness
|
||||
variable skin equal ${h} # Verlet list range
|
||||
variable h equal 2.01*${l0} # SPH smoothing kernel radius
|
||||
variable vol_one equal ${l0}^2 # volume of one particle -- assuming unit thickness
|
||||
variable skin equal ${h} # Verlet list range
|
||||
neighbor ${skin} bin
|
||||
set group all volume ${vol_one}
|
||||
set group all volume ${vol_one}
|
||||
set group all smd/mass/density ${rho}
|
||||
set group all diameter ${h} # set SPH kernel radius
|
||||
set group all diameter ${h} # set SPH kernel radius
|
||||
|
||||
####################################################################################################
|
||||
# DEFINE VELOCITY BOUNDARY CONDITIONS
|
||||
####################################################################################################
|
||||
variable vel0 equal 0.02 # pull velocity
|
||||
region top block EDGE EDGE 9.0 EDGE EDGE EDGE units box
|
||||
region bot block EDGE EDGE EDGE -9.1 EDGE EDGE units box
|
||||
variable vel0 equal 0.02 # pull velocity
|
||||
region top block EDGE EDGE 9.0 EDGE EDGE EDGE units box
|
||||
region bot block EDGE EDGE EDGE -9.1 EDGE EDGE units box
|
||||
group top region top
|
||||
group bot region bot
|
||||
variable vel_up equal ${vel0}*(1.0-exp(-0.01*time))
|
||||
variable vel_down equal -v_vel_up
|
||||
fix veltop_fix top smd/setvelocity 0 v_vel_up 0
|
||||
fix velbot_fix bot smd/setvelocity 0 v_vel_down 0
|
||||
fix veltop_fix top smd/setvel 0 v_vel_up 0
|
||||
fix velbot_fix bot smd/setvel 0 v_vel_down 0
|
||||
|
||||
####################################################################################################
|
||||
# INTERACTION PHYSICS / MATERIAL MODEL
|
||||
@ -89,8 +87,8 @@ fix velbot_fix bot smd/setvelocity 0 v_vel_down 0
|
||||
####################################################################################################
|
||||
pair_style smd/tlsph
|
||||
pair_coeff 1 1 *COMMON ${rho} ${E} ${nu} ${q1} ${q2} ${hg} ${cp} &
|
||||
*EOS_POLYNOMIAL ${eosC0} ${eosC1} ${eosC2} ${eosC3} ${eosC4} ${eosC5} ${eosC6} &
|
||||
*JOHNSON_COOK ${JC_A} ${JC_B} ${JC_N} ${JC_C} ${JC_epsdot0} ${Troom} ${Tmelt} ${JC_M} &
|
||||
*EOS_POLYNOMIAL ${eosC0} ${eosC1} ${eosC2} ${eosC3} ${eosC4} ${eosC5} ${eosC6} &
|
||||
*JOHNSON_COOK ${JC_A} ${JC_B} ${JC_N} ${JC_C} ${JC_epsdot0} ${Troom} ${Tmelt} ${JC_M} &
|
||||
*FAILURE_MAX_PLASTIC_STRAIN 1.2 &
|
||||
*END
|
||||
|
||||
@ -104,36 +102,36 @@ fix integration_fix tlsph smd/integrate_tlsph
|
||||
# SPECIFY TRAJECTORY OUTPUT
|
||||
####################################################################################################
|
||||
compute dt_atom all smd/tlsph/dt
|
||||
compute p all smd/plastic/strain
|
||||
compute epsdot all smd/plastic/strain/rate
|
||||
compute S all smd/tlsph/stress # Cauchy stress tensor
|
||||
compute D all smd/tlsph/strain/rate
|
||||
compute E all smd/tlsph/strain
|
||||
compute nn all smd/tlsph/num/neighs # number of neighbors for each particle
|
||||
compute p all smd/plastic/strain
|
||||
compute epsdot all smd/plastic/strain/rate
|
||||
compute S all smd/tlsph/stress # Cauchy stress tensor
|
||||
compute D all smd/tlsph/strain/rate
|
||||
compute E all smd/tlsph/strain
|
||||
compute nn all smd/tlsph/num/neighs # number of neighbors for each particle
|
||||
compute shape all smd/tlsph/shape
|
||||
compute damage all smd/damage
|
||||
dump dump_id all custom 100 dump.LAMMPS id type x y z &
|
||||
c_S[1] c_S[2] c_S[3] c_S[4] c_S[5] c_S[6] c_S[7] c_nn c_p &
|
||||
c_E[1] c_E[2] c_E[3] c_E[4] c_E[5] c_E[6] &
|
||||
c_shape[1] c_shape[2] c_shape[3] c_shape[4] c_shape[5] c_shape[6] c_shape[7] &
|
||||
c_D[1] c_D[2] c_D[4] c_damage radius c_epsdot &
|
||||
vx vy vz c_dt_atom
|
||||
dump_modify dump_id first yes
|
||||
compute damage all smd/damage
|
||||
dump dump_id all custom 100 dump.LAMMPS id type x y z &
|
||||
c_S[1] c_S[2] c_S[3] c_S[4] c_S[5] c_S[6] c_S[7] c_nn c_p &
|
||||
c_E[1] c_E[2] c_E[3] c_E[4] c_E[5] c_E[6] &
|
||||
c_shape[1] c_shape[2] c_shape[3] c_shape[4] c_shape[5] c_shape[6] c_shape[7] &
|
||||
c_D[1] c_D[2] c_D[4] c_damage radius c_epsdot &
|
||||
vx vy vz c_dt_atom
|
||||
dump_modify dump_id first yes
|
||||
|
||||
####################################################################################################
|
||||
# STATUS OUTPUT
|
||||
####################################################################################################
|
||||
variable stress equal 0.5*(f_velbot_fix[2]-f_veltop_fix[2])/20
|
||||
variable length equal xcm(top,y)-xcm(bot,y)
|
||||
variable strain equal (v_length-${length})/${length} # engineering strain
|
||||
variable time equal f_dtfix
|
||||
fix stress_curve all print 10 "${time} ${strain} ${stress}" file stress_strain.dat screen no
|
||||
variable stress equal 0.5*(f_velbot_fix[2]-f_veltop_fix[2])/20
|
||||
variable length equal xcm(top,y)-xcm(bot,y)
|
||||
variable strain equal (v_length-${length})/${length} # engineering strain
|
||||
variable time equal f_dtfix
|
||||
fix stress_curve all print 10 "${time} ${strain} ${stress}" file stress_strain.dat screen no
|
||||
|
||||
thermo 100
|
||||
thermo_style custom step dt f_dtfix time v_strain
|
||||
thermo 100
|
||||
thermo_style custom step dt f_dtfix time v_strain
|
||||
|
||||
####################################################################################################
|
||||
# RUN SIMULATION
|
||||
####################################################################################################
|
||||
#fix 2 all enforce2d
|
||||
run 25000
|
||||
#fix 2 all enforce2d
|
||||
run 25000
|
||||
|
||||
@ -35,7 +35,7 @@ variable Cp equal 1.0 # heat capacity -- not used here
|
||||
####################################################################################################
|
||||
# INITIALIZE LAMMPS
|
||||
####################################################################################################
|
||||
units si
|
||||
units si
|
||||
dimension 2
|
||||
boundary sm sm p
|
||||
atom_style smd
|
||||
@ -102,11 +102,11 @@ fix gfix all gravity -9.81 vector 0 1 0 # add gravity
|
||||
pair_style hybrid/overlay smd/ulsph *DENSITY_CONTINUITY *VELOCITY_GRADIENT *NO_GRADIENT_CORRECTION &
|
||||
smd/tlsph smd/hertz ${contact_scale}
|
||||
pair_coeff 1 1 smd/ulsph *COMMON ${rho_water} ${c0} ${q1} ${Cp} 0 &
|
||||
*EOS_TAIT 7.0 &
|
||||
*END
|
||||
*EOS_TAIT 7.0 &
|
||||
*END
|
||||
pair_coeff 2 2 smd/tlsph *COMMON ${rho_obj} ${E} ${nu} ${q1} ${q2} ${Hg} ${Cp} &
|
||||
*STRENGTH_LINEAR_PLASTIC ${sigma_yield} ${hardening_parameter} &
|
||||
*EOS_LINEAR &
|
||||
*EOS_LINEAR &
|
||||
*END
|
||||
pair_coeff 3 3 none
|
||||
pair_coeff 1 2 smd/hertz ${contact_stiffness}
|
||||
@ -152,5 +152,3 @@ thermo_modify lost ignore
|
||||
####################################################################################################
|
||||
fix balance_fix all balance 1000 0.9 rcb # load balancing for MPI
|
||||
run 40000
|
||||
|
||||
|
||||
|
||||
@ -9,12 +9,11 @@
|
||||
#
|
||||
####################################################################################################
|
||||
|
||||
|
||||
####################################################################################################
|
||||
# MATERIAL PARAMETERS
|
||||
####################################################################################################
|
||||
variable c0 equal 10.0 # speed of sound for fluid
|
||||
variable rho equal 1.0e-6 # initial mass density
|
||||
variable c0 equal 10.0 # speed of sound for fluid
|
||||
variable rho equal 1.0e-6 # initial mass density
|
||||
variable q1 equal 0.06 # standard artificial viscosity linear coefficient
|
||||
variable q2 equal 0.0 # standard artificial viscosity quadratic coefficient
|
||||
variable hg equal 0.0 # hourglass control coefficient
|
||||
@ -26,7 +25,7 @@ variable contact_stiffness equal 0.1*${K}
|
||||
# INITIALIZE LAMMPS
|
||||
####################################################################################################
|
||||
dimension 3
|
||||
units si
|
||||
units si
|
||||
boundary f f f # simulation box boundaries
|
||||
atom_style smd
|
||||
atom_modify map array
|
||||
@ -38,31 +37,31 @@ newton off
|
||||
####################################################################################################
|
||||
# CREATE INITIAL GEOMETRY
|
||||
####################################################################################################
|
||||
variable l0 equal 5.0 # lattice spacing for creating particles
|
||||
lattice sc ${l0}
|
||||
region box block -110 60 -30 220 -90 130 units box
|
||||
create_box 2 box
|
||||
region particles cylinder y 0 -30 47 135 200 units box
|
||||
create_atoms 1 region particles
|
||||
variable l0 equal 5.0 # lattice spacing for creating particles
|
||||
lattice sc ${l0}
|
||||
region box block -110 60 -30 220 -90 130 units box
|
||||
create_box 2 box
|
||||
region particles cylinder y 0 -30 47 135 200 units box
|
||||
create_atoms 1 region particles
|
||||
group water type 1
|
||||
|
||||
####################################################################################################
|
||||
# DISCRETIZATION PARAMETERS
|
||||
####################################################################################################
|
||||
variable h equal 2.01*${l0} # SPH smoothing kernel radius
|
||||
variable vol_one equal ${l0}^3 # volume of one particle -- assuming unit thickness
|
||||
variable skin equal 0.1*${h} # Verlet list range
|
||||
variable h equal 2.01*${l0} # SPH smoothing kernel radius
|
||||
variable vol_one equal ${l0}^3 # volume of one particle -- assuming unit thickness
|
||||
variable skin equal 0.1*${h} # Verlet list range
|
||||
neighbor ${skin} bin
|
||||
variable cr equal ${l0}/2
|
||||
set group all smd/contact/radius ${cr}
|
||||
set group all volume ${vol_one}
|
||||
set group all volume ${vol_one}
|
||||
set group all smd/mass/density ${rho}
|
||||
set group all diameter ${h} # set SPH kernel radius
|
||||
set group all diameter ${h} # set SPH kernel radius
|
||||
|
||||
####################################################################################################
|
||||
# DEFINE GRAVITY BOUNDARY CONDITION
|
||||
####################################################################################################
|
||||
fix gfix all gravity 0.01 vector 0.0 -1. 0.0
|
||||
fix gfix all gravity 0.01 vector 0.0 -1. 0.0
|
||||
|
||||
####################################################################################################
|
||||
# INTERACTION PHYSICS / MATERIAL MODEL
|
||||
@ -72,13 +71,11 @@ fix gfix all gravity 0.01 vector 0.0 -1. 0.0
|
||||
pair_style hybrid/overlay smd/tri_surface 1.0 &
|
||||
smd/ulsph *DENSITY_CONTINUITY *VELOCITY_GRADIENT *NO_GRADIENT_CORRECTION
|
||||
pair_coeff 1 1 smd/ulsph *COMMON ${rho} ${c0} ${q1} ${cp} ${hg} &
|
||||
*EOS_TAIT 2 &
|
||||
*END
|
||||
*EOS_TAIT 2 &
|
||||
*END
|
||||
pair_coeff 2 2 none
|
||||
pair_coeff 1 2 smd/tri_surface ${contact_stiffness}
|
||||
|
||||
|
||||
|
||||
####################################################################################################
|
||||
# LOAD STL SURFACE
|
||||
####################################################################################################
|
||||
@ -97,15 +94,15 @@ fix integration_fix all smd/integrate_ulsph adjust_radius 1.01 10 15
|
||||
# SPECIFY TRAJECTORY OUTPUT
|
||||
####################################################################################################
|
||||
variable dumpFreq equal 100
|
||||
compute rho all smd/rho
|
||||
compute nn all smd/ulsph/num/neighs # number of neighbors for each particle
|
||||
compute rho all smd/rho
|
||||
compute nn all smd/ulsph/num/neighs # number of neighbors for each particle
|
||||
compute contact_radius all smd/contact/radius
|
||||
compute surface_coords surface smd/triangle/vertices
|
||||
|
||||
|
||||
dump dump_id water custom ${dumpFreq} dump.LAMMPS id type x y z vx vy vz &
|
||||
c_rho c_nn c_contact_radius proc
|
||||
dump_modify dump_id first yes
|
||||
dump dump_id water custom ${dumpFreq} dump.LAMMPS id type x y z vx vy vz &
|
||||
c_rho c_nn c_contact_radius proc
|
||||
dump_modify dump_id first yes
|
||||
|
||||
dump surf_dump surface custom 999999999 surface.LAMMPS id type mol x y z &
|
||||
c_surface_coords[1] c_surface_coords[2] c_surface_coords[3] &
|
||||
@ -119,8 +116,8 @@ dump_modify surf_dump first yes
|
||||
compute eint all smd/internal/energy
|
||||
compute alleint all reduce sum c_eint
|
||||
variable etot equal pe+ke+c_alleint+f_gfix # total energy of the system
|
||||
thermo 100
|
||||
thermo_style custom step dt f_dtfix pe ke v_etot
|
||||
thermo 100
|
||||
thermo_style custom step dt f_dtfix pe ke v_etot
|
||||
|
||||
####################################################################################################
|
||||
# RUN SIMULATION
|
||||
|
||||
@ -24,10 +24,10 @@ variable cp equal 1.0 # heat capacity of material -- not used here
|
||||
# INITIALIZE LAMMPS
|
||||
####################################################################################################
|
||||
dimension 3
|
||||
units si
|
||||
units si
|
||||
boundary sm sm sm # simulation box boundaries
|
||||
atom_style smd
|
||||
atom_modify map array
|
||||
atom_modify map array
|
||||
comm_modify vel yes
|
||||
neigh_modify every 10 delay 0 check yes # re-build neighbor list every 10 steps
|
||||
newton off
|
||||
@ -68,11 +68,11 @@ velocity right set -${vel} 0 0 sum no units box
|
||||
pair_style hybrid/overlay smd/tlsph smd/hertz 1.0 # activate Total-Lagrangian SPH
|
||||
pair_coeff 1 1 smd/tlsph *COMMON ${rho} ${E} ${nu} ${q1} ${q2} ${hg} ${cp} &
|
||||
*STRENGTH_LINEAR &
|
||||
*EOS_LINEAR &
|
||||
*EOS_LINEAR &
|
||||
*END
|
||||
pair_coeff 2 2 smd/tlsph *COMMON ${rho} ${E} ${nu} ${q1} ${q2} ${hg} ${cp} &
|
||||
*STRENGTH_LINEAR_PLASTIC ${sigma_yield} 0.0 &
|
||||
*EOS_LINEAR &
|
||||
*EOS_LINEAR &
|
||||
*END
|
||||
pair_coeff 1 1 smd/hertz ${contact_stiffness}
|
||||
pair_coeff 2 2 smd/hertz ${contact_stiffness}
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
#
|
||||
####################################################################################################
|
||||
|
||||
|
||||
####################################################################################################
|
||||
# MATERIAL PARAMETERS
|
||||
####################################################################################################
|
||||
@ -62,8 +61,8 @@ group top region top
|
||||
group bot region bot
|
||||
variable vel_up equal ${vel0}*(1.0-exp(-0.01*time))
|
||||
variable vel_down equal -v_vel_up
|
||||
fix veltop_fix top smd/setvelocity 0 v_vel_up 0
|
||||
fix velbot_fix bot smd/setvelocity 0 v_vel_down 0
|
||||
fix veltop_fix top smd/setvel 0 v_vel_up 0
|
||||
fix velbot_fix bot smd/setvel 0 v_vel_down 0
|
||||
|
||||
####################################################################################################
|
||||
# INTERACTION PHYSICS / MATERIAL MODEL
|
||||
@ -87,9 +86,9 @@ compute S all smd/tlsph/stress # Cauchy stress tensor
|
||||
compute E all smd/tlsph/strain # Green-Lagrange strain tensor
|
||||
compute nn all smd/tlsph/num/neighs # number of neighbors for each particle
|
||||
dump dump_id all custom 10 dump.LAMMPS id type x y z vx vy vz &
|
||||
c_S[1] c_S[2] c_S[4] c_nn &
|
||||
c_E[1] c_E[2] c_E[4] &
|
||||
vx vy vz
|
||||
c_S[1] c_S[2] c_S[4] c_nn &
|
||||
c_E[1] c_E[2] c_E[4] &
|
||||
vx vy vz
|
||||
dump_modify dump_id first yes
|
||||
|
||||
####################################################################################################
|
||||
|
||||
Reference in New Issue
Block a user