How to relate to each other the stresses calculated respectively from force on the wall and contact force
Dear All,
I added left, right, front and back walls to the script of rot_compression.py in the Tutorial Version 2.3,
and calculated the stresses via two methods ( one was the same as in the tutorial using forces on the wall and the position of wall, the other was via interparticle contact force and branchvector).
However, I found that the stresses from the two methods differ from each other.
So, What's the relation between the stresses from the two methods.
Related codes are as following
1) modified rot_compression.py
#scripts from rot_compress.py in Tutorial version 2.3
#import the appropriate ESyS-Particle modules:
from esys.lsm import *
from esys.lsm.util import *
from esys.lsm.geometry import *
from WallLoader import WallLoaderRunnable
from math import *
print pi
#create a simulation container object:
# N.B. there must be at least two sub-divisions
# in the X-direction for periodic boundaries
sim = LsmMpi (numWorkerProce
sim.initNeighbo
particleType = "RotSphere",
gridSpacing = 5.0000,
verletDist = 0.08000
)
#specify the number of timesteps and timestep increment:
sim.setNumTimeS
sim.setTimeStep
#specify the spatial domain and direction of periodic boundaries:
domain = BoundingBox ( Vec3 (-20,-20,-20), Vec3 (20,20,20) )
sim.setSpatialD
#construct a prism of spherical particles:
geoRandomBlock = RandomBoxPacker (
minRadius = 0.400,
maxRadius = 2.000,
cubicPackRadius = 2.2000,
maxInsertFails = 5000,
bBox = BoundingBox(
Vec3(-5.0, 0.0,-5.0),
Vec3(5.0, 20.0, 5.0)
),
circDimList = [False, False, False],
tolerance = 1.0e-5
)
geoRandomBlock.
geoRandomBlock_
sim.createParti
#bond particles together with bondTag = 1:
sim.createConne
ConnectionFinder(
maxDist = 0.005,
bondTag = 1,
pList = geoRandomBlock_
)
)
#create a wall on the left of the model:
sim.createWall (
name = "left_wall",
posn = Vec3(-5.0000, 0.0000, -5.0000),
normal = Vec3(1.0000, 0.0000, 0.0000)
)
#create a wall at the bottom of the model:
sim.createWall (
name = "bottom_wall",
posn = Vec3(-5.0000, 0.0000, -5.0000),
normal = Vec3(0.0000, 1.0000, 0.0000)
)
#create a wall at the back of the model:
sim.createWall (
name = "back_wall",
posn = Vec3(-5.0000, 0.0000, -5.0000),
normal = Vec3(0.0000, 0.0000, 1.0000)
)
#create a wall at the right of the model:
sim.createWall (
name = "right_wall",
posn = Vec3(20.0000, 20.0000, 20.0000),
normal = Vec3(-1.0000, 0.0000, 0.0000)
)
#create a wall at the top of the model:
sim.createWall (
name = "top_wall",
posn = Vec3(20.0000, 20.0000, 20.0000),
normal = Vec3(0.0000, -1.0000, 0.0000)
)
#create a wall at the top of the model:
sim.createWall (
name = "front_wall",
posn = Vec3(20.0000, 20.0000, 20.0000),
normal = Vec3(0.0000, 0.0000, -1.0000)
)
#create rotational elastic-brittle bonds between particles:
pp_bonds = sim.createInter
BrittleBeamPrms(
name="pp_bonds",
youngsModulus
poissonsRatio
cohesion=100.0, #100.0
tanAngle=1.0, #1.0
tag=1
)
)
#initialise frictional interactions for unbonded particles:
sim.createInter
FrictionPrms(
name="friction",
youngsModulus
poissonsRatio
dynamicMu=0.4, # 0.4
staticMu=0.6 # 0.6
)
)
#create an exclusion between bonded and frictional interactions:
sim.createExclusion (
interactionName1 = "pp_bonds",
interactionName2 = "friction"
)
#specify elastic repulsion from the bottom wall:
sim.createInter
NRotElasticWal
name = "bottom_
wallName = "bottom_wall",
normalK = 100000.0
)
)
#specify elastic repulsion from the top wall:
sim.createInter
NRotElasticWal
name = "top_wall_repel",
wallName = "top_wall",
normalK = 100000.0
)
)
#specify elastic repulsion from the left wall:
sim.createInter
NRotElasticWal
name = "left_wall_repel",
wallName = "left_wall",
normalK = 100000.0
)
)
#specify elastic repulsion from the right wall:
sim.createInter
NRotElasticWal
name = "right_wall_repel",
wallName = "right_wall",
normalK = 100000.0
)
)
#specify elastic repulsion from the back wall:
sim.createInter
NRotElasticWal
name = "back_wall_repel",
wallName = "back_wall",
normalK = 100000.0
)
)
#specify elastic repulsion from the top wall:
sim.createInter
NRotElasticWal
name = "back_wall_repel",
wallName = "back_wall",
normalK = 100000.0
)
)
#add translational viscous damping:
sim.createInter
LinDampingPrms(
name="damping1",
viscosity=0.002,
maxIterations=50
)
)
#add rotational viscous damping:
sim.createInter
RotDampingPrms(
name="damping2",
viscosity=0.002,
maxIterations=50
)
)
#add a wall loader to move the top wall:
wall_loader1 = WallLoaderRunnable(
LsmMpi = sim,
wallName = "top_wall",
vPlate = Vec3 (0.0, -0.125, 0.0),
startTime = 0,
rampTime = 50000
)
sim.addPreTimeS
#add a wall loader to move the bottom wall:
wall_loader2 = WallLoaderRunnable(
LsmMpi = sim,
wallName = "bottom_wall",
vPlate = Vec3 (0.0, 0.125, 0.0),
startTime = 0,
rampTime = 50000
)
sim.addPreTimeS
#create a FieldSaver to store number of bonds:
sim.createField
InteractionSca
interactionNa
fieldName=
fileName=
fileFormat="SUM",
beginTimeStep=0,
endTimeStep=
timeStepIncr=1000
)
)
#create a FieldSaver to store the total kinetic energy of the particles:
sim.createField
ParticleScalar
fieldName=
fileName=
fileFormat="SUM",
beginTimeStep=0,
endTimeStep=
timeStepIncr=1000
)
)
#create a FieldSaver to store potential energy stored in bonds:
sim.createField
InteractionSca
interactionNa
fieldName=
fileName=
fileFormat="SUM",
beginTimeStep=0,
endTimeStep=
timeStepIncr=1000
)
)
#create a FieldSaver to wall positions:
posn_saver = WallVectorField
wallName=
fieldName=
fileName=
fileFormat=
beginTimeStep=0,
endTimeStep=
timeStepIncr=1000
)
sim.createField
#create a FieldSaver to wall forces:
force_saver = WallVectorField
wallName=
fieldName="Force",
fileName=
fileFormat=
beginTimeStep=0,
endTimeStep=
timeStepIncr=1000
)
sim.createField
#create a FieldSaver to contact force and particle positions
bond_contact_
interactionName = "pp_bonds",
fieldName = "force",
fileName = "bond_contactFo
fileFormat = "RAW_WITH_POS_ID",
beginTimeStep = 0,
endTimeStep = 250000,
timeStepIncr = 1000
)
sim.createField
#create a FieldSaver to contact force and particle positions
friction_
interactionName = "friction",
fieldName = "force",
fileName = "friction_
fileFormat = "RAW_WITH_POS_ID",
beginTimeStep = 0,
endTimeStep = 250000,
timeStepIncr = 1000
)
sim.createField
#execute the simulation:
sim.run()
2) code for calculating the stress via forces on wall and the position of wall
from math import *
posnfile = open("out_
posn = posnfile.
posnfile.close()
forcefile = open("out_
force = forcefile.
forcefile.close()
for i in range (len(posn)):
Y_bottom = float(posn[
Y_top = float(posn[
F_bottom = float(force[
F_top = float(force[
stress = (F_bottom - F_top)/200.0
strain = 1.0 - (Y_top - Y_bottom)/20.0
print i*1000,
3) code for calculating stress via interparticle contact forces and branchvector
from math import *
posnfile = open("out_
posn = posnfile.
posnfile.close()
for j in range(251):
#calculating volume
X_left = float(posn[
X_right = float(posn[
Y_bottom = float(posn[
Y_top = float(posn[
Z_back = float(posn[
Z_front = float(posn[
volume = (Z_front-
#set zero
stress = [[0,0,0]
force = [0,0,0]
branchvector = [0,0,0]
#calculate the stress from bond_contactForces
bondcontactfor
bondcontactfor
bondcontactforce = bondcontactforc
bondcontactfor
for i in range (len(bondcontac
force[0] = float(bondconta
force[1] = float(bondconta
force[2] = float(bondconta
branchvector[0] = float(bondconta
branchvector[1] = float(bondconta
branchvector[2] = float(bondconta
stress[0][0] += force[0]
stress[0][1] += force[0]
stress[0][2] += force[0]
stress[1][0] += force[1]
stress[1][1] += force[1]
stress[1][2] += force[1]
stress[2][0] += force[2]
stress[2][1] += force[2]
stress[2][2] += force[2]
#calculate the stress from friction_
frictioncontac
frictioncontac
frictioncontac
frictioncontac
for i in range (len(frictionco
force[0] = float(frictionc
force[1] = float(frictionc
force[2] = float(frictionc
branchvector[0] = float(frictionc
branchvector[1] = float(frictionc
branchvector[2] = float(frictionc
stress[0][0] += force[0]
stress[0][1] += force[0]
stress[0][2] += force[0]
stress[1][0] += force[1]
stress[1][1] += force[1]
stress[1][2] += force[1]
stress[2][0] += force[2]
stress[2][1] += force[2]
stress[2][2] += force[2]
#output stress in TimeStep j*timeStepIncr
print j*1000,
Best regards,
Jiadun
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- ceguo
- Solved:
- Last query:
- Last reply: