Question #652968 on Yade changed:
https://answers.launchpad.net/yade/+question/652968
Status: Answered => Open
Nima Goudarzi is still having a problem:
Dear Bruno,
Thanks so much for all your helps. I finally implemented my model in YADE but
got some new problems in modelling uniaxial compaction in the python script. I
am trying to compact a soil sample layer by layer to reach a target void ratio
for each layer and finally a target void ratio for the whole assembly. Worthy
to say that, I'll have two distinct scripts. One for uniaxial compaction and
one for triaxial test that is to say that I'll export final positions of
spheres (after compaction) to my triaxial script. I am familiar with
triaxStressController but prefer not to use it since I don't want to use the
lubrication concept and expanding the particle size (or shrinking the walls).
My final test is a trixal test but I prefer to use a very simple method for
compacting using a plate from top of each layer. I mean, I want to use a
facetBox as a mold and a simple plate. I have modeled the gravity deposition of
the first layer and also put the plate on top of the layer and applied some
constant velocity in z direction for moving the plate. Everything goes well but
I have a problem with stopping the plate when the porosity of the layer reaches
my target porosity. I got some hints from some YADE users regarding this to for
checking the voxelPorosity against my target porosity to stop the plate. Here
are my questions:
1- I don't know how I can check the updating porosity against my target
porosity since the volume of my layer is changing due to the compaction and as
far as I know, voxelPorosity needs a height vector (let's say mx) which in my
case is not constant and is gradually deceasing. Is there a way to stop the
plate with target porosity in my case or I am enforced to use
triaxStressController?
2- My parameters are updating from compaction to triaxial (due to numerical
reasons). One of the reasons I prefer to use two scripts is this. Actually, I
don't know if there is an approach to update material parameters in one single
script. Please give me some hints if there is a solution.
Here is a draft of my script for compacting the first layer. It doesn't work
from yade.pack import *from yade import utilsfrom yade import exportfrom yade
import plotn_s = 2000n_band = 26# For now I'm using Sobieski's PSD. I need to
change it to my own PSD latertargetPorosity=
0.422################################################## Particle Size
Distribution
##################################################psdSizes=[5.8598400e+00,5.8761600e+00,5.8924800e+00,5.9088000e+00,5.9251200e+00,5.9414400e+00,5.9577600e+00,5.9740800e+00,5.9904000e+00,6.0067200e+00,6.0230400e+00,6.0393600e+00,6.0556800e+00,6.0720000e+00,6.0883200e+00,6.1046400e+00,6.1209600e+00,6.1372800e+00,6.1536000e+00,6.1699200e+00,6.1862400e+00,6.2025600e+00,6.2188800e+00,6.2352000e+00,6.2515200e+00,6.2678400e+00]psdCumm=[0.0,8.4945735e-05,3.5804112e-04,1.1512195e-03,3.2324246e-03,8.1658647e-03,1.8731095e-02,3.9172232e-02,7.4902028e-02,1.3132521e-01,2.1182373e-01,3.1558203e-01,4.3640887e-01,5.6352779e-01,6.8435463e-01,7.8811293e-01,8.6861145e-01,9.2503463e-01,9.6076443e-01,9.8120556e-01,9.9177079e-01,9.9670423e-01,9.9878544e-01,9.9957862e-01,9.9985171e-01,1.0]
i = 0while i < n_band: psdSizes[i]=psdSizes[i]/1000. #scaling from [mm] to
[m] print "\r psdSizes:",i,psdSizes[i] i = i +1
#If the bed volume is defined, then the average diameter of particles (when the
target porosity is reached) is the same like in the
measurement###########################################################
facetBox ############################################################
Compaction will be in Y-Directionl = 3.5e-3h = 7.1e-3vol = l*h*l# You maybe
don't need this if you use compaction from the top of the sample (using plate)
mn = Vector3(0,0,0)mx = Vector3(l,l,h/5)
O.materials.append(FrictMat(young=5e6,poisson=0.5,frictionAngle=0,density=0,label='walls'))O.materials.append(FrictMat(young=5e6,poisson=0.5,frictionAngle=radians(30),density=2600,label='spheres'))O.bodies.append(geom.facetBox((l/2,l/2,h/2),(l/2,l/2,h/2),wallMask=31,material='walls'))#
This will be an open-top boxsp =
yade._packSpheres.SpherePack()sp.makeCloud(mn,mx,psdSizes=psdSizes,psdCumm=psdCumm,num=n_s,distributeMass=1)O.bodies.append([sphere(s[0],s[1],material='spheres')
for s in sp])Porosity = voxelPorosity(200,mn,mx)print "\r Porosity:
",Porosity,O.engines=[ ForceResetter(), # sphere, facet, wall
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),
InteractionLoop( # the loading plate is a wall, we need to handle
sphere+sphere, sphere+facet, sphere+wall
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()] ),
NewtonIntegrator(gravity=(0,0,-9.81),damping=0.5), # the label creates an
automatic variable referring to this engine # we use it below to change its
attributes from the functions called
PyRunner(command='checkUnbalanced()',realPeriod=2,label='checker'),]O.dt=.5*PWaveTimeStep()
def checkUnbalanced(): # at the very start, unbalanced force can be low as
there is only few contacts, but it does not mean the packing is stable if
O.iter<5000: return # the rest will be run only if unbalanced is < .1
(stabilized packing) if unbalancedForce()>.1: return # add plate at the
position on the top of the packing # the maximum finds the z-coordinate of
the top of the topmost particle
O.bodies.append(wall(max([b.state.pos[2]+b.shape.radius for b in O.bodies if
isinstance(b.shape,Sphere)]),axis=2,sense=-1)) global plate # without
this line, the plate variable would only exist inside this function
plate=O.bodies[-1] # the last particles is the plate # Wall objects are
"fixed" by default, i.e. not subject to forces # prescribing a velocity will
therefore make it move at constant velocity (downwards)
plate.state.vel=(0,0,-.1) # start plotting the data now, it was not
interesting before
O.engines=O.engines+[PyRunner(command='addPlotData()',iterPeriod=200)] # next
time, do not call this function anymore, but the next one (unloadPlate) instead
checker.command='unloadPlate()'def unloadPlate(): # if the porosity of the
layer goes below the target porosity stop unloading
maxz=max([b.state.pos[2]+b.shape.radius for b in O.bodies if is
instance(b.shape,Sphere)]) mx=maxz# Iknow this doesn't work
Por_osity=voxelPorosity(200,mn,mx) if Por_osity <targetPorosity:
plate.state.vel=(0,0,0)
Thanks so much,
Sincerely yours
Nima On Monday, July 31, 2017, 7:27:43 AM CDT, Bruno Chareyre
<[email protected]> wrote:
Your question #652968 on Yade changed:
https://answers.launchpad.net/yade/+question/652968
Status: Open => Answered
Bruno Chareyre proposed the following answer:
Hi,
This code you mention is related to viscous contact damping, not Cundall's
damping. It appears to be doing nothing if "useDamping" is turned false, so I
guess you can do just that and then there is no need to worry about cn, cs.
I mean to set useDamping=False in simulation scripts, there is absolutely
nothing to change in the source code as I see it.
Cheers
Bruno
--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/yade/+question/652968/+confirm?answer_id=5
If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/yade/+question/652968
You received this question notification because you asked the question.
You received this question notification because your team yade-users is
an answer contact for Yade.
_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help : https://help.launchpad.net/ListHelp