Skip to content

Commit 3c1f54c

Browse files
committed
Updating the shear1 example
1 parent a3ccf75 commit 3c1f54c

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

example/particle/3d/shear1.xml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<CLBConfig version="2.0" permissive="true" output="output/">
33
<Units>
44
<Param name="H" value="1m" gauge="32"/>
5-
<Param name="L" value="1x" gauge="2m"/>
6-
<Param name="nu" value="1m2/s" gauge="0.166666"/>
5+
<Param name="L" value="1x" gauge="1m"/>
6+
<Param name="nu" value="1m2/s" gauge="0.16"/><!-- 1s -->
77
<Param name="rho" value="1kg/m3" gauge="1"/>
88
</Units>
99
<Geometry nx="1x" ny="1m+2" nz="1x" px="-0.5x" py="-1" pz="-0.5x">
@@ -13,7 +13,7 @@
1313
</Geometry>
1414
<Model>
1515
<Param name="VelocityX" value="1m/s" zone="topwall"/>
16-
<RemoteForceInterface integrator="LAMMPS" radius="3/m">
16+
<RemoteForceInterface integrator="LAMMPS" radius="3/m" height="1m/m" length="1x/m" iterations="5s" vtk_it="1s" log_it="100">
1717
units cgs
1818
boundary p f f
1919
newton off # required off for tangential history
@@ -27,14 +27,15 @@
2727
neigh_modify delay 0
2828

2929
# Declare domain
30-
region domain block -1 1 0 1 -1 1
30+
variable len2 equal ${length}*0.5
31+
region domain block -${len2} ${len2} 0 ${height} -${len2} ${len2}
3132
create_box 1 domain
3233

3334
# Specify particle groups
3435
group particle_group type 1
3536

3637
# Define region for particle insertion
37-
region pack block -1 1 0 1 -1 1
38+
region pack block -${len2} ${len2} 0 ${height} -${len2} ${len2}
3839

3940
# Insert particles
4041
fix part_1 particle_group particletemplate/sphere 17891 atom_type 1 density constant 1.0 radius constant ${radius}
@@ -47,13 +48,13 @@
4748

4849
# Define material properties (from which kn kt etc. are calculated for hertz interactions)
4950
soft_particles yes
50-
fix m1 all property/global youngsModulus peratomtype 3000.000000 # defines kn, kt, gamma_n, gamma_t
51+
fix m1 all property/global youngsModulus peratomtype 30000.000000 # defines kn, kt, gamma_n, gamma_t
5152
fix m2 all property/global poissonsRatio peratomtype 0.5 # defines kn, kt, gamma_n, gamma_t
5253
fix m3 all property/global coefficientRestitution peratomtypepair 1 0.8 # defines damping, must be >0.05
5354
fix m4 all property/global coefficientFriction peratomtypepair 1 0.5 # defines friction
5455

55-
fix topwall all mesh/surface/stress file example/data/plane1x1.stl type 1 scale 2 rotate axis 1 0 0 angle 90 move -1 1 -1 surface_vel 1 0 0
56-
fix bottomwall all mesh/surface/stress file example/data/plane1x1.stl type 1 scale 2 rotate axis 1 0 0 angle 90 move -1 0 -1
56+
fix topwall all mesh/surface/stress file example/data/plane1x1.stl type 1 scale ${length} rotate axis 1 0 0 angle 90 move -${len2} ${height} -${len2} surface_vel 1 0 0
57+
fix bottomwall all mesh/surface/stress file example/data/plane1x1.stl type 1 scale ${length} rotate axis 1 0 0 angle 90 move -${len2} 0 -${len2}
5758

5859
# Define physics for particle interactions
5960
pair_style gran model hertz tangential history # 'tangential off' sets Ft=0; 'tangential no_history' incorporates damping to Ft, sets kt=0; 'tangential history' incorporate kt and damping into Ft
@@ -74,20 +75,20 @@
7475
variable bfx equal f_bottomwall[1]
7576
variable bfy equal f_bottomwall[2]
7677
variable bfz equal f_bottomwall[3]
77-
dump forces all mesh/vtk 1000 ${output}_wall_*.vtk output interpolate id stress stresscomponents
78-
fix forceslog all print 100 "${time},${tfx},${tfy},${tfz},${bfx},${bfy},${bfz}" file ${output}_forces.csv title "t,tFx,tFy,tFz,bFx,bFy,bFz" screen no
78+
dump forces all mesh/vtk ${vtk_it} ${output}_wall_*.vtk output interpolate id stress stresscomponents
79+
fix forceslog all print ${log_it} "${time},${tfx},${tfy},${tfz},${bfx},${bfy},${bfz}" file ${output}_forces.csv title "t,tFx,tFy,tFz,bFx,bFy,bFz" screen no
7980

80-
dump vtk_dump all atom/vtk 1000 ${output}_part_*.vtu
81+
dump vtk_dump all atom/vtk ${vtk_it} ${output}_part_*.vtu
8182

8283

8384
timestep ${timestep}
8485

85-
run 50000
86+
run ${iterations}
8687
</RemoteForceInterface>
8788
</Model>
8889
<!-- <VTK Iterations="1000" what="U,Solid"/> -->
8990
<!-- 10s 1.8m/s 0.01Pa 1/Pa-->
90-
<Log Iterations="1s"/>
91+
<Log Iterations="100"/>
9192
<VTK Iterations="5s"/>
92-
<Solve Iterations="50000"/>
93+
<Solve Iterations="5s"/>
9394
</CLBConfig>

src/lammps.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ int main(int argc, char* argv[]) {
132132
ret = sscanf(value.c_str(),"%lf%n", &val, &len);
133133
if ((ret > 0) && (len == value.size())) {
134134
is_numeric = true;
135-
fprintf(fp, "variable %s equal %.15lg\n", v.c_str(), val);
135+
fprintf(fp, "variable %s equal %.13lg\n", v.c_str(), val);
136136
}
137137
}
138138
if (!is_numeric) fprintf(fp, "variable %s string %s\n", v.c_str(), value.c_str());
139139
}
140-
fprintf(fp, "variable timestep equal %.15lg\n", RFI.auto_timestep);
140+
fprintf(fp, "variable timestep equal %.13lg\n", RFI.auto_timestep);
141141
fprintf(fp, "\n");
142142
fprintf(fp, "%s\n", RFI.getVar("content").c_str());
143143
fprintf(fp, "\n");

0 commit comments

Comments
 (0)