Skip to content

Commit

Permalink
Updating the shear1 example
Browse files Browse the repository at this point in the history
  • Loading branch information
llaniewski committed Jun 24, 2024
1 parent a3ccf75 commit 3c1f54c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
29 changes: 15 additions & 14 deletions example/particle/3d/shear1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<CLBConfig version="2.0" permissive="true" output="output/">
<Units>
<Param name="H" value="1m" gauge="32"/>
<Param name="L" value="1x" gauge="2m"/>
<Param name="nu" value="1m2/s" gauge="0.166666"/>
<Param name="L" value="1x" gauge="1m"/>
<Param name="nu" value="1m2/s" gauge="0.16"/><!-- 1s -->
<Param name="rho" value="1kg/m3" gauge="1"/>
</Units>
<Geometry nx="1x" ny="1m+2" nz="1x" px="-0.5x" py="-1" pz="-0.5x">
Expand All @@ -13,7 +13,7 @@
</Geometry>
<Model>
<Param name="VelocityX" value="1m/s" zone="topwall"/>
<RemoteForceInterface integrator="LAMMPS" radius="3/m">
<RemoteForceInterface integrator="LAMMPS" radius="3/m" height="1m/m" length="1x/m" iterations="5s" vtk_it="1s" log_it="100">
units cgs
boundary p f f
newton off # required off for tangential history
Expand All @@ -27,14 +27,15 @@
neigh_modify delay 0

# Declare domain
region domain block -1 1 0 1 -1 1
variable len2 equal ${length}*0.5
region domain block -${len2} ${len2} 0 ${height} -${len2} ${len2}
create_box 1 domain

# Specify particle groups
group particle_group type 1

# Define region for particle insertion
region pack block -1 1 0 1 -1 1
region pack block -${len2} ${len2} 0 ${height} -${len2} ${len2}

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

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

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
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
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
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}

# Define physics for particle interactions
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
Expand All @@ -74,20 +75,20 @@
variable bfx equal f_bottomwall[1]
variable bfy equal f_bottomwall[2]
variable bfz equal f_bottomwall[3]
dump forces all mesh/vtk 1000 ${output}_wall_*.vtk output interpolate id stress stresscomponents
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
dump forces all mesh/vtk ${vtk_it} ${output}_wall_*.vtk output interpolate id stress stresscomponents
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

dump vtk_dump all atom/vtk 1000 ${output}_part_*.vtu
dump vtk_dump all atom/vtk ${vtk_it} ${output}_part_*.vtu


timestep ${timestep}

run 50000
run ${iterations}
</RemoteForceInterface>
</Model>
<!-- <VTK Iterations="1000" what="U,Solid"/> -->
<!-- 10s 1.8m/s 0.01Pa 1/Pa-->
<Log Iterations="1s"/>
<Log Iterations="100"/>
<VTK Iterations="5s"/>
<Solve Iterations="50000"/>
<Solve Iterations="5s"/>
</CLBConfig>
4 changes: 2 additions & 2 deletions src/lammps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ int main(int argc, char* argv[]) {
ret = sscanf(value.c_str(),"%lf%n", &val, &len);
if ((ret > 0) && (len == value.size())) {
is_numeric = true;
fprintf(fp, "variable %s equal %.15lg\n", v.c_str(), val);
fprintf(fp, "variable %s equal %.13lg\n", v.c_str(), val);
}
}
if (!is_numeric) fprintf(fp, "variable %s string %s\n", v.c_str(), value.c_str());
}
fprintf(fp, "variable timestep equal %.15lg\n", RFI.auto_timestep);
fprintf(fp, "variable timestep equal %.13lg\n", RFI.auto_timestep);
fprintf(fp, "\n");
fprintf(fp, "%s\n", RFI.getVar("content").c_str());
fprintf(fp, "\n");
Expand Down

0 comments on commit 3c1f54c

Please sign in to comment.