Impact simulation
Hi there,
Please I am trying to impact a steel ball on the surface area of a cylindrical rod. I want to get the force-time history during the impact and also need an output file to view in paraview. Please I need help with the following:
1) Specification of material micro properties such as young modulus and poisson's ratio for the steel-ball and steel rod . The impactor is a steel and my rod is also a steel
2)Inserting the cylindrical (0.02m diamter and 1.5m length) rod into the domain
3)Basis of getting the normalK based on the material properties.
i was able to modify part of the tutorial code to suit my work. Here is the code and response that I am getting after attempting to run it.
#Import the appropriate Esys-Particle module
from esys.lsm import*
from esys.lsm.util import Vec3, BoundingBox
from esys.lsm.geometry import*
#instantiate a simulation object
#number of processor for simulation
sim = LsmMpi (numWorkerProce
#initialise the neighbour search algorithm:
sim.initNeighbo
particleType=
gridSpacing=
verletDist=0.005 #i.e, 0.2 Xply by min. particle radius which is 0.025m
)
#setting number of timestep and timestep size
sim.setNumTimeS
sim.setTimeStep
#Domain of simulation: here is the cube with 40m each size
domain = BoundingBox(
sim.setSpatialD
#create a steel ball with NRotSphere type, id=0 position at that vector posn, with the specified radius and mass
steel_ball=
#initialise the velocity of the steel_ball Vx, Vy and Vz (m/s)
steel_ball.
#add the newly created steel_ball
sim.createParti
#initialise gravity in the domain:
sim.createInter
GravityPrms(
)
#add a horizontal wall to act like the steel rod surface:
sim.createWall(
name="steel_rod",
posn=Vec3(0,0,0),
normal=Vec3(0,1,0)
)
#specify the type of interaction between wall and steel ball
sim.createInter
NRotElasticWal
name=
wallName=
normalK=10000.0
)
)
#add local viscosity to simulate air resistance
sim.createInter
LinDampingPrms(
name=
viscosity=0.1,
maxIterations=100
)
)
#create a FieldSaver to store forces on the steelrod:
force_saver=
wallName=
fieldName="Force",
fileName=
YbeginTimeStep=0,
endTimeStep=100,
timeStepIncr=0.001
)
sim.createField
#add check pointer to store simulation data for paraview
sim.createCheck
CheckPointPrms (
fileNamePrefix ="snapshot",
beginTimeStep =0,
endTime=1000,
timeStepIncr=4
)
)
#run the simulation
sim.run()
adminuser@
adminuser@
adminuser@
adminuser@
adminuser@
adminuser@
CSubLatticeCont
slave started at local/global rank 0 / 1
Traceback (most recent call last):
File "calibration.py", line 71, in <module>
timeStepIncr=4
Boost.Python.
CheckPointP
did not match C++ signature:
__init_
Kind Regards
Tope
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Temitope
- Solved:
- 2017-07-19
- Last query:
- 2017-07-19
- Last reply:
- 2017-07-10
Vince Boros (v-boros) said : | #1 |
You have an incorrect parameter in CheckPointPrms(). Change 'endTime' to 'endTimeStep' to avoid the error message you received.
Regards,
Vince
Vince Boros (v-boros) said : | #2 |
I noticed another mistake in the code. In WallVectorField
Vince
Temitope (temitope) said : | #3 |
Hi Vince,
I did correct it . Here is the message that I am getting after the correction.
adminuser@
adminuser@
adminuser@
adminuser@
adminuser@
adminuser@
CSubLatticeCont
slave started at local/global rank 0 / 1
Traceback (most recent call last):
File "calibration.py", line 70, in <module>
timeStepInc
Boost.Python.
WallVectorF
did not match C++ signature:
__init_
__init_
__init_
Kind Regards
Tope
Dion Weatherley (d-weatherley) said : | #4 |
Hi Tope,
Just checking that you replaced "YbeginTimeStep" with "beginTimeStep" on line number 68, as suggested by Vince.
If so, please post your new "calibration.py" script in full, so we can look for other possible errors.
Cheers,
Dion
Temitope (temitope) said : | #5 |
Hi Dion,
Here is my script as requested:
#Import the appropriate Esys-Particle module
from esys.lsm import*
from esys.lsm.util import Vec3, BoundingBox
from esys.lsm.geometry import*
#instantiate a simulation object
#number of processor for simulation
sim = LsmMpi (numWorkerProce
#initialise the neighbour search algorithm:
sim.initNeighbo
particleType=
gridSpacing=
verletDist=0.005 #i.e, 0.2 Xply by min. particle radius which is 0.025m
)
#setting number of timestep and timestep size
sim.setNumTimeS
sim.setTimeStep
#Domain of simulation: here is the cube with 40m each size
domain = BoundingBox(
sim.setSpatialD
#create a steel ball with NRotSphere type, id=0 position at that vector posn, with the specified radius and mass
steel_ball=
#initialise the velocity of the steel_ball Vx, Vy and Vz (m/s)
steel_ball.
#add the newly created steel_ball
sim.createParti
#initialise gravity in the domain:
sim.createInter
GravityPrms(
)
#add a horizontal wall to act like the steel rod surface:
sim.createWall(
name="steel_rod",
posn=Vec3(0,0,0),
normal=Vec3(0,1,0)
)
#specify the type of interaction between wall and steel ball
sim.createInter
NRotElasticWal
name=
wallName=
normalK=10000.0
)
)
#add local viscosity to simulate air resistance
sim.createInter
LinDampingPrms(
name=
viscosity=0.1,
maxIterations=100
)
)
#create a FieldSaver to store forces on the steelrod:
force_saver=
wallName=
fieldName="Force",
fileName=
beginTimeStep=0,
endTimeStep=100,
timeStepIncr=0.001
)
sim.createField
#add check pointer to store simulation data for paraview
sim.createCheck
CheckPointPrms (
fileNamePrefix ="snapshot",
beginTimeStep =0,
endTimeStep=1000,
timeStepIncr=4
)
)
#run the simulation
sim.run()
Kind Regards
Tope
Dion Weatherley (d-weatherley) said : | #6 |
Hi Tope,
OK, I missed this earlier: you need to add an extra line specifying the "fileFormat" for your force_saver. Replace your current definition of the force_saver with the following:
force_saver=
wallName=
fieldName="Force",
fileName=
fileFormat=
beginTimeStep=0,
endTimeStep=100,
timeStepIncr=0.001
)
Hopefully your script will work now. Have fun!
Cheers,
Dion
Temitope (temitope) said : | #7 |
Hi Dion,
I have added the line of line and here is what i am getting:
adminuser@
adminuser@
adminuser@
adminuser@
adminuser@
adminuser@
CSubLatticeCont
slave started at local/global rank 0 / 1
Traceback (most recent call last):
File "calibration.py", line 71, in <module>
timeStepInc
Boost.Python.
WallVectorF
did not match C++ signature:
__init_
__init_
__init_
here is my code:
#Calibration of SILC device: Steelball-steelrod impact
#Drop a 0.51kg steel ball from 0.3m height on a steel rod
#Author: Oladele T.P (2017)
#Acknowledged ESyS-particle tutorial
#Import the appropriate Esys-Particle module
from esys.lsm import*
from esys.lsm.util import Vec3, BoundingBox
from esys.lsm.geometry import*
#instantiate a simulation object
#number of processor for simulation
sim = LsmMpi (numWorkerProce
#initialise the neighbour search algorithm:
sim.initNeighbo
particleType=
gridSpacing=
verletDist=0.005 #i.e, 0.2 Xply by min. particle radius which is 0.025m
)
#setting number of timestep and timestep size
sim.setNumTimeS
sim.setTimeStep
#Domain of simulation: here is the cube with 40m each size
domain = BoundingBox(
sim.setSpatialD
#create a steel ball with NRotSphere type, id=0 position at that vector posn, with the specified radius and mass
steel_ball=
#initialise the velocity of the steel_ball Vx, Vy and Vz (m/s)
steel_ball.
#add the newly created steel_ball
sim.createParti
#initialise gravity in the domain:
sim.createInter
GravityPrms(
)
#add a horizontal wall to act like the steel rod surface:
sim.createWall(
name="steel_rod",
posn=Vec3(0,0,0),
normal=Vec3(0,1,0)
)
#specify the type of interaction between wall and steel ball
sim.createInter
NRotElasticWal
name=
wallName=
normalK=10000.0
)
)
#add local viscosity to simulate air resistance
sim.createInter
LinDampingPrms(
name=
viscosity=0.1,
maxIterations=100
)
)
#create a FieldSaver to store forces on the steelrod:
force_saver=
wallName=
fieldName="Force",
fileName=
fileFormat=
beginTimeStep=0,
endTimeStep=100,
timeStepIncr=0.001
)
sim.createField
#add check pointer to store simulation data for paraview
sim.createCheck
CheckPointPrms (
fileNamePrefix ="snapshot",
beginTimeStep =0,
endTimeStep=1000,
timeStepIncr=4
)
)
#run the simulation
sim.run()
Dion Weatherley (d-weatherley) said : | #8 |
Hi Tope,
I finally found the problem! Try changing timeStepIncr from 0.001 to simply 1. On my PC your script executes once this is changed.
In your script, your wall field saver is given a fractional timeStepIncr. This needs to be an integer >=1.
Let me explain:
* 'beginTimeStep' : the timestep number to begin saving data
* 'endTimeStep' : the timestep number to end saving data
* 'timeStepIncr': the number of timesteps to ignore between each successive data output step
so if I set these to 0, 1000, 100 resp., I will record simulation data at timesteps 0,100,200,
Note that each timestep equates to an increment of the simulation by dt = timeStepSize (in your script dt = 0.001).
Cheers,
Dion
Temitope (temitope) said : | #9 |
Hi Dion,
it worked!
Thanks a lot
Tope
Temitope (temitope) said : | #10 |
Thanks Dion Weatherley, that solved my question.
Temitope (temitope) said : | #11 |
Hi Dion,
I have few questions in creating a moving object such as a wall or steel ball. Their properties (young's modulus, poisson's ratio, density etc) are different from the properties of the particles. How do I include impacting a spherical steel ball on my particles? And how do I describe their properties in ESyS particle?
Tope
Hi Tope,
This question requires quite some in-depth answers that might be best done via phone/email. I'm happy to collaborate with you to help with this issue. Can you please email me to arrange a time to discuss this?
For the benefit of others, there are currently 2 ways a spherical impactor might be simulated:
1) As a bonded assembly of spheres whose bond parameters are tuned to the mechanical properties of steel,
2) As a so-called "SphereBody" which is essentially a spherical wall (akin to a planar wall) that may be moved via a Runnable.
The first method is arguably better because deformation of the ball is simulated but it can result in simulation models with a very large number of DEM spheres. The second method has been successfully used to model the impact of a steel ball upon a rock, reproducing nicely the deformation and breakage of rocks in the so-called Short Impact Load Cell apparatus. The downside of the second method is that the steel ball is rigid so phenomena associated with deformation of the ball (e.g. elastic restitution) is not simulated. In any case, if the motion of the ball is carefully prescribed, this is a computationally efficient method to simulate a large spherical indentor's effect upon a bonded particle assembly.
Cheers,
Dion
Temitope (temitope) said : | #13 |
Hi Dion,
I have been thinking about the second option but have not been able to include the properties. The first option seems to be a better idea since mechanical properties of the steel can be defined there. I have sent you the email as requested.
Kind Regards
Tope
Temitope (temitope) said : | #14 |
Hi Dion and Vince,
I attempted making my impactor (steel ball) using gengeo. I tried implementing the Sphere argument in a similar way to the simple_box tutorial. I not sure of where i went wrong. Please see my script and the response i got after execution.
#particle cluster for steelball geometry
from gengeo import*
#-- parameters --
#position of the steel sphere
xdim=0
ydim=0.325
zdim=0
#Steelball radius
R= 0.05
#particle size range
minRadius = 0.0001 #1micron
maxRadius = 0.0001
centre = Vector3(
radius = R
#Steel ball volume
steel_ball = Sphere(centre, radius)
#neighbour table
mntable =MNTable3D(
centre=centre,
radius=radius,
gridSize=
numGroups=1
)
#setup packer and iteration parameters
insertFails=1000
maxIter=1000
tol =1.0e-6
#packer; place particles into volume
packer=
#generte the packerinto volume
packer.
#create bonds between between neighbouring paricles:
mntable.
mntable.
adminuser@
python: can't open file 'steel_ball.py': [Errno 2] No such file or directory
adminuser@
Traceback (most recent call last):
File "steelball.py", line 29, in <module>
numGroups=1
Boost.Python.
MNTable3D.
did not match C++ signature:
__init_
__init_
__init_
adminuser@
Traceback (most recent call last):
File "steelball.py", line 29, in <module>
numGroups=0
Boost.Python.
MNTable3D.
did not match C++ signature:
__init_
__init_
__init_
Kind Regards
Tope
Hi Tope,
There are 3 problems with your gengeo script:
1) the volume to be filled should be a "SphereVol" rather than a "Sphere":
steel_ball = SphereVol(centre, radius)
2) the MNTable3D is given incorrect arguments. You need to supply the minPoint and maxPoint of a rectangular prism surrounding the sphere:
mntable = MNTable3D(
minPoint = Vector3(
maxPoint = Vector3(
numGroups=1
)
3) the InsertGenerator3D is also incorrectly specified. You need to supply the minRadius and maxRadius of DEM particles to pack inside the sphere:
packer=
I also recommend you increase minRadius and maxRadius to around 0.001 (10micron), at least for initial testing of your simulations. This results in a sphere comprised of approximately 85,000 particles. If you use 1 micron particles, I expect your sphere will contain upwards of 1 million particles, requiring of order 100 CPUs to conduct a simulation in a reasonable amount of time. This is far too many particles for initial design and testing of simulation scripts.
Cheers,
Dion
Temitope (temitope) said : | #16 |
Hi Dion,
Thanks a lot it worked!
Please I also use this means to give you a kind reminder about the email I sent to you.
Kind Regards
Tope
Temitope (temitope) said : | #17 |
Thanks Dion Weatherley, that solved my question.
Temitope (temitope) said : | #18 |
Hi Dion,
I am happy with the gengeo output of my sphere but I tried to import this gengeo file into my impact simulation script. I'm not so sure of what i'm not doing correctly:
#Import the appropriate Esys-Particle module
from esys.lsm import*
from esys.lsm.util import Vec3, BoundingBox
from esys.lsm.geometry import*
from gengeo import *
from steel_ball import*
#instantiate a simulation object
#number of processor for simulation
sim = LsmMpi (numWorkerProce
#initialise the neighbour search algorithm:
sim.initNeighbo
particleType=
gridSpacing=
verletDist=0.00002 #i.e, 0.2 Xply by min. particle radius which is 0.0001m
)
#setting number of timestep and timestep size
sim.setNumTimeS
sim.setTimeStep
#Domain of simulation: here is the cube with
domain = BoundingBox(
sim.setSpatialD
#initialise the velocity of the steel_ball Vx, Vy and Vz (m/s)
steel_ball.
#initialise gravity in the domain:
sim.createInter
GravityPrms(
)
#add a horizontal wall to act like the steel rod surface:
sim.createWall(
name="steel_rod",
posn=Vec3(0,0,0),
normal=Vec3(0,1,0)
)
#specify the type of interaction between wall and steel ball
#normalK calculated from steel properties i.e function of young modulus (wikipedia)
sim.createInter
NRotElasticWal
name=
wallName=
normalK= 10000
)
)
#create rotational elastic-brittle bonds between between steel_ball particles:
pp_bonds = sim.createInter
BrittleBeamPrms(
name=
youngsModulus
poissonsRatio
cohesion=100.0, #check this again!
tanAngle=1.0,
tag=1
)
)
#add local viscosity to simulate air resistance
sim.createInter
LinDampingPrms(
name=
viscosity=0.1,
maxIterations=100
)
)
#create a FieldSaver to store forces on the steelrod:
force_saver=
wallName=
fieldName="Force",
fileName=
fileFormat=
beginTimeStep=0,
endTimeStep=1000,
timeStepIncr=1
)
sim.createField
#add check pointer to store simulation data for paraview
sim.createCheck
CheckPointPrms (
fileNamePrefix ="snapshot",
beginTimeStep =0,
endTimeStep=1000,
timeStepIncr=4
)
)
#run the simulation
sim.run()
adminuser@
adminuser@
adminuser@
adminuser@
adminuser@
adminuser@
CSubLatticeCont
nx,ny,nz: 27 , 27 , 27
InsertGenerator
bbx: -0.05 0.275 -0.05 - 0.05 0.375 0.05
total tries: 0
slave started at local/global rank 0 / 1
Traceback (most recent call last):
File "single_
steel_
AttributeError: 'SphereVol' object has no attribute 'setLinearVelocity'
kind regards
Tope
Hi Tope,
You need to import the geometry file ("steel_ball.geo") into your simulation using the sim.readGeometr
Replace the line containing steel_ball.
sim.readGeometr
Cheers,
Dion
Temitope (temitope) said : | #20 |
Hi Dion,
Thanks for the response.
I created a similar particle (particle_1) in gengeo which I intend to break by impact the first one and read it into the simulation script.
1) I do not know how to distinguish the properties (young's modulus, ....) of the two particles in the domain. I was able to create of the steel ball but i'm not sure if it allocated it to the steel ball.
2) I expect the steel ball to fall on particle_1 but seems my model is not running properly. Doesn't the initialisation of the velocity matter anymore after replacing it with sim.readGeometr
#Import the appropriate Esys-Particle module
from esys.lsm import*
from esys.lsm.util import Vec3, BoundingBox
from esys.lsm.geometry import*
from gengeo import *
from steel_ball import*
#instantiate a simulation object
#number of processor for simulation
sim = LsmMpi (numWorkerProce
#initialise the neighbour search algorithm:
sim.initNeighbo
particleType=
gridSpacing=
verletDist=0.00002 #i.e, 0.2 Xply by min. particle radius which is 0.0001m
)
#setting number of timestep and timestep size
sim.setNumTimeS
sim.setTimeStep
#Domain of simulation: here is the cube with
domain = BoundingBox(
sim.setSpatialD
#initialise the velocity of the steel_ball Vx, Vy and Vz (m/s)
###steel_
#read the steel_ball geometry
sim.readGeometr
#read the single particle geometry
sim.readGeometr
#initialise gravity in the domain:
sim.createInter
GravityPrms(
)
#add a horizontal wall to act like the steel rod surface:
sim.createWall(
name="steel_rod",
posn=Vec3(0,0,0),
normal=Vec3(0,1,0)
)
#specify the type of interaction between wall and steel ball
#normalK calculated from steel properties i.e function of young modulus (wikipedia)
sim.createInter
NRotElasticWal
name=
wallName=
normalK= 10000
)
)
#create rotational elastic-brittle bonds between between steel_ball particles:
pp_bonds = sim.createInter
BrittleBeamPrms(
name=
youngsModulus
poissonsRatio
cohesion=100.0, #check this again!
tanAngle=1.0,
tag=1
)
)
#add local viscosity to simulate air resistance
sim.createInter
LinDampingPrms(
name=
viscosity=0.1,
maxIterations=100
)
)
#create a FieldSaver to store forces on the steelrod:
force_saver=
wallName=
fieldName="Force",
fileName=
fileFormat=
beginTimeStep=0,
endTimeStep=1000,
timeStepIncr=1
)
sim.createField
#add check pointer to store simulation data for paraview
sim.createCheck
CheckPointPrms (
fileNamePrefix ="snapshot",
beginTimeStep =0,
endTimeStep=1000,
timeStepIncr=4
)
)
#run the simulation
sim.run()
Nothing happened after waiting for about 1 hour for the simulation to run
adminuser@
adminuser@
adminuser@
adminuser@
adminuser@
adminuser@
CSubLatticeCont
nx,ny,nz: 27 , 27 , 27
InsertGenerator
bbx: -0.025 0.3 -0.025 - 0.025 0.35 0.025
total tries: 0
MNTable3D:
slave started at local/global rank 0 / 1
Geometry info read from file is incompatible with previously set geometry (bounding box, circular boundaries) - Model may not run properly!
Geometry info read from file is incompatible with previously set geometry (bounding box, circular boundaries) - Model may not run properly!
constructing FieldMaster for field Force
Kind Regards
Tope
Temitope (temitope) said : | #21 |
Hi Dion and Vince,
Please I am trying to construct my collection of sphere in the simulation script as shown in the code below but I seem not figure out what the challenge is when I ran the code. Please help me with this.
#Import the appropriate Esys-Particle module
from esys.lsm import*
from esys.lsm.util import Vec3, BoundingBox
from esys.lsm.geometry import*
#instantiate a simulation object
#number of processor for simulation
sim = LsmMpi (numWorkerProce
#initialise the neighbour search algorithm:
sim.initNeighbo
particleType=
gridSpacing=
verletDist=0.005 #i.e, 0.2 Xply by min. particle radius
)
#setting number of timestep and timestep size
sim.setNumTimeS
sim.setTimeStep
#Domain of simulation: here is the cube with
domain = BoundingBox(
sim.setSpatialD
#create a steel ball with NRotSphere type, id=0 position at that vector posn, with the specified radius and mass
steel_ball=
#initialise the velocity of the steel_ball Vx, Vy and Vz (m/s)
steel_ball.
#add the newly created steel_ball
sim.createParti
#read the single particle geometry
#sim.readGeomet
#create a sphere of spherical particles:
geoRandomSphere = RandomSpherePacker (
minRadius = 0.0001,
maxRadius = 0.00025,
cubicPackRadius = 0.0025,
maxInsertFails = 200000,
bSphere = BoundingSphere(
Vec3(0.0000, 0.0000, 0.0000),
Vec3(0.1000, 0.0025, 0.1000)
),
circDimList = [False, False, False],
tolerance = 1.0000e-06
)
geoRandomSphere
geoRandomSphere
#add the particles to the simulation object:
sim.createParti
#bond particles together with bondTag = 1:
sim.createConne
ConnectionFinder(
maxDist = 0.0005,
bondTag = 1,
pList = geoRandomSphere
)
)
#initialise gravity in the domain:
sim.createInter
GravityPrms(
)
#add a horizontal wall to act like the steel rod surface:
sim.createWall(
name="steel_rod",
posn=Vec3(0,0,0),
normal=Vec3(0,1,0)
)
#specify the type of interaction between wall and steel ball
#normalK calculated from steel properties i.e function of young modulus (wikipedia)
sim.createInter
NRotElasticWal
name=
wallName=
normalK= 1000000
)
)
#add local viscosity to simulate air resistance
sim.createInter
LinDampingPrms(
name=
viscosity=0.1,
maxIterations=100
)
)
#create a FieldSaver to store forces on the steelrod:
force_saver=
wallName=
fieldName="Force",
fileName=
fileFormat=
beginTimeStep=0,
endTimeStep=1000,
timeStepIncr=1
)
sim.createField
#add check pointer to store simulation data for paraview
sim.createCheck
CheckPointPrms (
fileNamePrefix ="snapshot",
beginTimeStep =0,
endTimeStep=1000,
timeStepIncr=4
)
)
#run the simulation
sim.run()
adminuser@
CSubLatticeCont
slave started at local/global rank 0 / 1
Traceback (most recent call last):
File "single_
Vec3(0.1000, 0.0025, 0.1000)
Boost.Python.
BoundingSph
did not match C++ signature:
__init_
__init_
__init_
__init_
Kind Regards
Tope
Temitope (temitope) said : | #22 |
i figured it out