Re: [Yade-users] [Question #685944]: Failed in Parametric Studies
Question #685944 on Yade changed: https://answers.launchpad.net/yade/+question/685944 Status: Needs information => Open Rong Zhao gave more information on the question: Thanks, Jérôme Duriez (jduriez) . >>>Does the "yade" you're using to successfully run this script is obtained the same way ? (compilation of same source code to home/zhaorong/myYade/install/bin/yade-2019-11-07.git-09bc730) >>>Yes, it is. -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
[Yade-users] [Question #685944]: Failed in Parametric Studies
New question #685944 on Yade: https://answers.launchpad.net/yade/+question/685944 I would like to make a parametric studies on periodic triaxial test. To be specific, I just want to generate the different packing with different porosity by control of friction angel ranging from 0 degree to 100 degrees. Then I conduct the axial loading. It should be noted that the friction angel is set to 0.5 in radian before the axial loading phase. First, isotropic compaction is ended by calling compactionFinished1() until -1e5 is reached in all directions. Second, by calling compactionFinished2(), isotropic compaction is run again to set the friction angel being 0.5 in radian before the axial loading. Third, constant-strain deformation along the z-axis while maintaining constant stress (sigmaIso) laterally is ended by calling triaxFinished(). Here are the codes. = from __future__ import print_function readParamsFromTable(unknownOk=True, compFricDegree=0, noTableOk=True ) from yade.params.table import * young=1e7 poisson=0.3 density=1000 sigmaIso=-1e5 #import matplotlib #matplotlib.use('Agg') # generate loose packing from yade import pack, plot O.materials.append(FrictMat(young=young,poisson=poisson,frictionAngle=radians(compFricDegree),density=density,label='clumps')) O.periodic=True sp=pack.SpherePack() if 0: ## uniform distribution sp.makeCloud((0,0,0),(2,2,2),rMean=.1,rRelFuzz=.3,periodic=True) else: ## create packing from clumps # configuration of one clump c1=pack.SpherePack([((0,0,0),.0),((.03,0,0),.017),((0,.03,0),.017)]) # make cloud using the configuration c1 (there could c2, c3, ...; selection between them would be random) sp.makeClumpCloud((0,0,0),(2,2,2),[c1],periodic=True,num=500) # setup periodic boundary, insert the packing sp.toSimulation(material='clumps') O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), PeriTriaxController(label='triax', # specify target values and whether they are strains or stresses goal=(sigmaIso,sigmaIso,sigmaIso),stressMask=7, # type of servo-control dynCell=True,maxStrainRate=(10,10,10), # wait until the unbalanced force goes below this value maxUnbalanced=.01,relStressTol=1e-3, # call this function when goal is reached and the packing is stable doneHook='compactionFinished1()' ), NewtonIntegrator(damping=.2), PyRunner(command='addPlotData1()',iterPeriod=100,label='checker'), ] O.dt=.5*PWaveTimeStep() def addPlotData1(): plot.addData(unbalanced=unbalancedForce(),i=O.iter, sxx=-triax.stress[0],syy=-triax.stress[1],szz=-triax.stress[2], exx=-triax.strain[0],eyy=-triax.strain[1],ezz=-triax.strain[2], #DeviatorStress=-triax.stress[2]-(-triax.stress[0]-triax.stress[1])/2, # save all available energy data Etot=O.energy.total(),**O.energy ) plot.saveDataTxt('data1' + O.tags['d.id'] + '.txt') # enable energy tracking in the code O.trackEnergy=True # define what to plot plot.plots={'i':('unbalanced',),'i ':('sxx','syy','szz'),' i':('exx','eyy','ezz'), # energy plot #' i ':(O.energy.keys,None,'Etot') 'ezz':('DeviatorStress',) } # show the plot plot.plot() def compactionFinished1(): O.materials[0].frictionAngle=.5 # set the current cell configuration to be the reference one O.cell.trsf=Matrix3.Identity triax.doneHook='compactionFinished2()' def compactionFinished2(): # set the current cell configuration to be the reference one print(O.iter+1, porosity()) # O.materials[0].frictionAngle=.5 O.cell.trsf=Matrix3.Identity # change control type: keep constant confinement in x,y, 20% compression in z triax.goal=(sigmaIso,sigmaIso,-.2) triax.stressMask=3 # allow faster deformation along x,y to better maintain stresses triax.maxStrainRate=(1.,1.,.1) # next time, call triaxFinished instead of compactionFinished triax.doneHook='triaxFinished()' # do not wait for stabilization before calling triaxFinished triax.maxUnbalanced=10 O.engines=O.engines[0:5]+[PyRunner(iterPeriod=20, command='addPlotData2()')] def addPlotData2(): plot.addData(unbalanced=unbalancedForce(),i=O.iter, sxx=-triax.stress[0],syy=-triax.stress[1],szz=-triax.stress[2], exx=-triax.strain[0],eyy=-triax.strain[1],ezz=-triax.strain[2],
[Yade-users] [Question #685892]: Importing Yade in other Python applications
New question #685892 on Yade: https://answers.launchpad.net/yade/+question/685892 Hi, I have a problem with importing Yade in other Python applications. The Yade documentation provides the easiest way to import the Yade in other Python applications. I try the provided method to create a symbolic link as explained below. = $ cd /home/zhaorong/Desktop/ $ ln -s /home/zhaorong/myYade/build/bins/yade-2019.01a /home/zhaorong/Desktop/yadeimport.py = Then, I tried in Python2 and it succeeded. == zhaorong@ubuntu64:~/Desktop$ python2 Python 2.7.16 (default, Oct 7 2019, 17:36:04) [GCC 8.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path.append('/home/zhaorong/Desktop/') >>> from yadeimport import * === But when I used the same method in python3, it failed. === zhaorong@ubuntu64:~/Desktop$ python3 Python 3.7.3 (default, Oct 7 2019, 12:56:13) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path.append('/home/zhaorong/Desktop/') >>> from yadeimport import * Traceback (most recent call last): File "", line 1, in File "/home/zhaorong/Desktop/yadeimport.py", line 71 print 'Yade version: %s%s'%(version,debugbuild) ^ SyntaxError: invalid syntax === I want to know whether the Yade is imported to Python2 applications only, not Python3 applications. Thanks. -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #685675]: "FATAL" error in https://gitlab.com/yade-dev/trunk/blob/master/doc/sphinx/tutorial/06-periodic-triaxial-test.py
Question #685675 on Yade changed: https://answers.launchpad.net/yade/+question/685675 Status: Answered => Solved Rong Zhao confirmed that the question is solved: Thanks very much, Bruno Chareyre. You solved my 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #685653]: problem about makeClumpCloud()
Question #685653 on Yade changed: https://answers.launchpad.net/yade/+question/685653 Status: Open => Solved Rong Zhao confirmed that the question is solved: Thanks Robert Caulk, that solved my 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #685653]: problem about makeClumpCloud()
Question #685653 on Yade changed: https://answers.launchpad.net/yade/+question/685653 Status: Answered => Open Rong Zhao is still having a problem: Thanks, Robert Caulk. May I view the packing in Paraview through the post-process? -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #685653]: problem about makeClumpCloud()
Question #685653 on Yade changed: https://answers.launchpad.net/yade/+question/685653 Status: Answered => Open Rong Zhao is still having a problem: Thanks, Robert Caulk. I try the method or function you provide for me. Here are the codes: *** from yade import utils O.periodic=True sp=pack.SpherePack() c1=pack.SpherePack([((0,0,0),.0),((.03,0,0),.017),((0,.03,0),.017)]) sp.makeClumpCloud((0,0,0),(2,4,2),[c1],periodic=True,num=500) sp.toSimulation() print(utils.aabbExtrema()[-1] - utils.aabbExtrema()[0]) # upper corner coordinates - # lower corner coordinates *** When I run the above codes serval times, it returns the different values of the difference between upper corner coordinates and lower corner coordinates each time. For example, (1.63..., 3.95..., 1.80...), (1.44..., 3.39..., 1.75...) etc.. It is not equal to (2, 4, 2). I want to know why the strange behavior occurs. -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
[Yade-users] [Question #685675]: "FATAL" error in https://gitlab.com/yade-dev/trunk/blob/master/doc/sphinx/tutorial/06-periodic-triaxial-test.py
New question #685675 on Yade: https://answers.launchpad.net/yade/+question/685675 When I try to run the script of tutorial example for periodic triaxial test from[1], the following error message pops up: == FATAL /build/yade-fDuCoe/yade-2018.02b/pkg/common/InsertionSortCollider.cpp:495 spatialOverlapPeri: Body #669 spans over half of the cell size 0.167282 (axis=2, see flag allowBiggerThanPeriod) FATAL /build/yade-fDuCoe/yade-2018.02b/core/ThreadRunner.cpp:30 run: Exception occured: /build/yade-fDuCoe/yade-2018.02b/pkg/common/InsertionSortCollider.cpp: Body larger than half of the cell size encountered. = By the way, The version of Yade I installed is the 2018.02b. I hope someone can advise me on how to solve this problem. Thanks in advance! [1]https://gitlab.com/yade-dev/trunk/blob/master/doc/sphinx/tutorial/06-periodic-triaxial-test.py -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #685653]: problem about makeClumpCloud()
Question #685653 on Yade changed: https://answers.launchpad.net/yade/+question/685653 Status: Answered => Open Rong Zhao is still having a problem: But the parallelepiped box I saw in the GUI of the Yade is a square box, how can I determine it is a parallelepiped measuring 2 x 4 x 2? -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #683427]: I don not understand how to simulate triaxial-test in Yade.
Question #683427 on Yade changed: https://answers.launchpad.net/yade/+question/683427 Status: Answered => Solved Rong Zhao confirmed that the question is solved: Thanks Bruno Chareyre, that solved my 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #685653]: problem about makeClumpCloud()
Question #685653 on Yade changed: https://answers.launchpad.net/yade/+question/685653 Status: Needs information => Open Rong Zhao gave more information on the question: Thank your reply, Robert Caulk. I'd like to generate the initial packing of the cloud of clumps in a rectangular box whose length is 2 in the x-direction, height is 4 in the y-direction and width is 2 in the z-direction using the following codes. *** O.periodic=True sp=pack.SpherePack() c1=pack.SpherePack([((0,0,0),.0),((.03,0,0),.017),((0,.03,0),.017)]) sp.makeClumpCloud((0,0,0),(2,4,2),[c1],periodic=True,num=500) sp.toSimulation() *** But the problem I met is that the packing is not in a rectangular box, it is in a square box whose length is 2 in all three directions when I view it in GUI. -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
[Yade-users] [Question #685653]: problem about makeClumpCloud()
New question #685653 on Yade: https://answers.launchpad.net/yade/+question/685653 Hi Yade developers & users, The version of Yade I installed is the 2018.02b version. I'd like to generate the initial packing of the cloud of clumps in a rectangular box whose length is 2 in the x-direction, height is 4 in the y-direction and width is 2 in the z-direction. But it seems to don't work once the O.periodic=True is uncommented in the following codes because the box is a square box in 3d view. Here are the codes: # O.periodic=True sp=pack.SpherePack() c1=pack.SpherePack([((0,0,0),.0),((.03,0,0),.017),((0,.03,0),.017)]) sp.makeClumpCloud((0,0,0),(2,4,2),[c1],periodic=True,num=500) sp.toSimulation() Thank you. -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
[Yade-users] [Question #684820]: The code of O.engines[5]=PyRunner(iterPeriod=20, command='history()') seems to don't work.
New question #684820 on Yade: https://answers.launchpad.net/yade/+question/684820 Hi, everybody. I am learning an example of the triaxial test[1]. I have a question about it. When I run the following codes, the code of O.engines[5]=PyRunner(iterPeriod=20,command='history()') seems to don't work, it does not replace the previous O.engines[5], that is O.engines[5]=TriaxialStateRecorder(iterPeriod=100,file='WallStresses') when I look inside in the Inspect window. Here are the codes: # -*- coding: utf-8 -*- from yade import pack ### DEFINING VARIABLES AND MATERIALS ### # The following 5 lines will be used later for batch execution nRead=readParamsFromTable( num_spheres=1000,# number of spheres compFricDegree = 30, # contact friction during the confining phase key='_triax_base_', # put you simulation's name here unknownOk=True ) from yade.params import table num_spheres=table.num_spheres# number of spheres key=table.key targetPorosity = 0.43 #the porosity we want for the packing compFricDegree = table.compFricDegree # initial contact friction during the confining phase (will be decreased during the REFD compaction process) finalFricDegree = 30 # contact friction during the deviatoric loading rate=-0.02 # loading rate (strain rate) damp=0.2 # damping coefficient stabilityThreshold=0.01 # we test unbalancedForce against this value in different loops (see below) young=5e6 # contact stiffness mn,mx=Vector3(0,0,0),Vector3(1,1,1) # corners of the initial packing ## create materials for spheres and plates O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres')) O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls')) ## create walls around the packing walls=aabbWalls([mn,mx],thickness=0,material='walls') wallIds=O.bodies.append(walls) ## use a SpherePack object to generate a random loose particles packing sp=pack.SpherePack() clumps=False #turn this true for the same example with clumps if clumps: ## approximate mean rad of the futur dense packing for latter use volume = (mx[0]-mn[0])*(mx[1]-mn[1])*(mx[2]-mn[2]) mean_rad = pow(0.09*volume/num_spheres,0.) ## define a unique clump type (we could have many, see clumpCloud documentation) c1=pack.SpherePack([((-0.2*mean_rad,0,0),0.5*mean_rad),((0.2*mean_rad,0,0),0.5*mean_rad)]) ## generate positions and input them in the simulation sp.makeClumpCloud(mn,mx,[c1],periodic=False) sp.toSimulation(material='spheres') O.bodies.updateClumpProperties()#get more accurate clump masses/volumes/inertia else: sp.makeCloud(mn,mx,-1,0.,num_spheres,False, 0.95,seed=1) #"seed" make the "random" generation always the same O.bodies.append([sphere(center,rad,material='spheres') for center,rad in sp]) triax=TriaxialStressController( maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth) finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth) thickness = 0, stressMask = 7, internalCompaction=True, # If true the confining pressure is generated by growing particles ) newton=NewtonIntegrator(damping=damp) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), ## We will use the global stiffness of each body to determine an optimal timestep (see https://yade-dem.org/w/images/1/1b/Chareyre_licensed.pdf) GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax, TriaxialStateRecorder(iterPeriod=100,file='WallStresses'), newton ] ### ### APPLYING CONFINING PRESSURE ### ### #the value of (isotropic) confining stress defines the target stress to be applied in all three directions triax.goal1=triax.goal2=triax.goal3=-1 while 1: O.run(1000, True) unb=unbalancedForce() print 'unbalanced force:',unb,' mean stress: ',triax.meanStress if unbtargetPorosity: compFricDegree = 0.95*compFricDegree setContactFriction(radians(compFricDegree)) print "Friction: ",compFricDegree," porosity:",triax.porosity # print "\r Friction: ",compFricDegree," porosity:",triax.porosity, sys.stdout.flush() O.run(50,1) O.save('compactedState'+key+'.yade.gz') print "###Compacted state saved ###" # DIY print(triax.porosity) print(triax.meanStress) ## ### DEVIATORIC LOADING ### ## ##We move to deviatoric loading, let us turn internal compaction off
Re: [Yade-users] [Question #683981]: What does 'rMean=-1' mean
Question #683981 on Yade changed: https://answers.launchpad.net/yade/+question/683981 Rong Zhao posted a new comment: Hi, Robert Caulk. You said that '-1' is essentially a flag to direct the algorithm toward one of the four described methods of sphere radius distribution specification. But what is the algorithm it directs by -1 actually? -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
[Yade-users] [Question #684751]: Stress unit in TriaxialStressController()
New question #684751 on Yade: https://answers.launchpad.net/yade/+question/684751 Hi, everybody. I want to know the stress unit in TriaxialStressController(), such as the target values by goal1, goal2, and goal3, or the average stress on boundary "id" through stress((TriaxialStressController)arg1, (int)id) → Vector3. Thanks! -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #684078]: Why is the strain equal to 0 in the triaxial test in my codes?
Question #684078 on Yade changed: https://answers.launchpad.net/yade/+question/684078 Rong Zhao gave more information on the question: I am using ubuntu19.10 on VM15, so the yade version is yade_2019.01a. In this system, codes of DEVIATORIC LOADING seems to do not work, so the strain is always equal 0. However, when the same code was conducted in my ubuntu118.04.3 LTS operating system (yade version is yade_2018.02b), the strain varied. I do not understand the above phenomenon. -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #683642]: How to access the porosity once the compaction is finished in triaxial test?
Question #683642 on Yade changed: https://answers.launchpad.net/yade/+question/683642 Rong Zhao posted a new comment: I am sorry for asking the question in an inappropriate way to append new questions after an older question. You actually solved my problem that how to access the porosity once the compaction is finished in the triaxial test. -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #683642]: How to access the porosity once the compaction is finished in triaxial test?
Question #683642 on Yade changed: https://answers.launchpad.net/yade/+question/683642 Status: Open => Solved Rong Zhao confirmed that the question is solved: Thanks, Jan Stránský!You actually solved my problem that how to access the porosity once the compaction is finished in the triaxial test. -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #683642]: How to access the porosity once the compaction is finished in triaxial test?
Question #683642 on Yade changed: https://answers.launchpad.net/yade/+question/683642 Status: Expired => Open Rong Zhao is still having a problem: Thank you for your reply, Jan Stránský! But I am facing new problems. I am trying to specify porosity value after the compaction in periodic triaxial test base on the following codes, but there is something wrong with it. First, I am not sure whether porosity can be specified after the compaction in a periodic triaxial test like the example of the triaxial test using TriaxialStressController. Second, when I try to realize it in the periodic triaxial test using PeriTriaxController(), there is something wrong with it( local variable 'compFricDegree' referenced before assignment). Here is my conde. # Specify the porosity in periodic triaxial test from yade import pack, qt, plot sigmaIso=-1e5 targetPorosity = 0.3 compFricDegree = 30 young = 5e6 num_spheres = 1000 mn, mx = Vector3(0,0,0), Vector3(1,1,1) # generate loose packing O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres')) O.periodic=True sp=pack.SpherePack() sp.makeCloud(mn,mx,-1,0.,num_spheres,False, 0.95,seed=1) sp.toSimulation() # Set simulation loop O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), PeriTriaxController(label='triax', # specify target values and whether they are strains or stresses goal=(sigmaIso,sigmaIso,sigmaIso),stressMask=7, # type of servo-control dynCell=True,maxStrainRate=(10,10,10), # wait until the unbalanced force goes below this value maxUnbalanced=.1,relStressTol=1e-3, # call this function when goal is reached and the packing is stable doneHook='compactionFinished()' ), NewtonIntegrator(damping=.2), ] O.dt=.5*PWaveTimeStep() def compactionFinished(): print('Compaction Finished') O.pause() pc = utils.porosity() print("Porosity after compaction: " + str(pc)) # Reach a Specified Porosity precisely import sys #this is only for the flush() below while pc > targetPorosity: # we decrease friction value and apply it to all the bodies and contacts compFricDegree = 0.95*compFricDegree setContactFriction(radians(compFricDegree)) pc = utils.porosity() print "\r Friction: ",compFricDegree," porosity:",utils.porosity() sys.stdout.flush() O.run(500,1) return pc -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
[Yade-users] [Question #684130]: local variable 'compFricDegree' referenced before assignment
New question #684130 on Yade: https://answers.launchpad.net/yade/+question/684130 Hello, everyone! I am trying to specify porosity value after the compaction in periodic triaxial test base on the following codes, but there is something wrong with it. First, I am not sure whether porosity can be specified after the compaction in a periodic triaxial test like the example of the triaxial test using TriaxialStressController. Second, when I try to realize it in the periodic triaxial test using PeriTriaxController(), there is something wrong with it( local variable 'compFricDegree' referenced before assignment). Here is my conde. # Specify the porosity in periodic triaxial test from yade import pack, qt, plot sigmaIso=-1e5 targetPorosity = 0.3 compFricDegree = 30 young = 5e6 num_spheres = 1000 mn, mx = Vector3(0,0,0), Vector3(1,1,1) # generate loose packing O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres')) O.periodic=True sp=pack.SpherePack() sp.makeCloud(mn,mx,-1,0.,num_spheres,False, 0.95,seed=1) sp.toSimulation() # Set simulation loop O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), PeriTriaxController(label='triax', # specify target values and whether they are strains or stresses goal=(sigmaIso,sigmaIso,sigmaIso),stressMask=7, # type of servo-control dynCell=True,maxStrainRate=(10,10,10), # wait until the unbalanced force goes below this value maxUnbalanced=.1,relStressTol=1e-3, # call this function when goal is reached and the packing is stable doneHook='compactionFinished()' ), NewtonIntegrator(damping=.2), ] O.dt=.5*PWaveTimeStep() def compactionFinished(): print('Compaction Finished') O.pause() pc = utils.porosity() print("Porosity after compaction: " + str(pc)) # Reach a Specified Porosity precisely import sys #this is only for the flush() below while pc > targetPorosity: # we decrease friction value and apply it to all the bodies and contacts compFricDegree = 0.95*compFricDegree setContactFriction(radians(compFricDegree)) pc = utils.porosity() print "\r Friction: ",compFricDegree," porosity:",utils.porosity() sys.stdout.flush() O.run(500,1) return pc Thanks! -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #683427]: I don not understand how to simulate triaxial-test in Yade.
Question #683427 on Yade changed: https://answers.launchpad.net/yade/+question/683427 Status: Answered => Open Rong Zhao is still having a problem: Thanks for your reply, Bruno Chareyre! I almost understand the code of Periodic Triaxial Test in the tutorial. But there is something I don't understand. When the function of compactionFinished() being called, this virtually is to make loading, but why is triax.maxUnbalanced is specified to 10 after calling the function of triaxFinished()? -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #684103]: How to solve the problem of particles penetrating through boundary in triaxial test?
Question #684103 on Yade changed: https://answers.launchpad.net/yade/+question/684103 Status: Answered => Open Rong Zhao is still having a problem: Hello, Jan Stránský (honzik) . I try to the solution you provided for me to increase the stiffness of walls up to young=1e50*young, but it doesn't work, particles still penetrate through the boundary in triaxial test. -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
[Yade-users] [Question #684103]: How to solve the problem of particles penetrating through boundary in triaxial test?
New question #684103 on Yade: https://answers.launchpad.net/yade/+question/684103 Hello everybody: I am using the following code to conduct the triaxial test. But the particles penetrate through the boundary in the triaxial test. How to fix this problem? from yade import pack, qt ### DEFINING VARIABLES AND MATERIALS ### # The following 5 lines will be used later for batch execution nRead = readParamsFromTable( num_spheres = 1000, # number of spheres compFricDegree = 30, # contact friction during the confining phase key = '_triax_base_', # put you simulation's name here unknownOk = True ) from yade.params import table num_spheres = table.num_spheres # number of spheres key = table.key targetPorosity = 0.43 #the porosity we want for the packing compFricDegree = table.compFricDegree # initial contact friction during the confining phase (will be decreased during the REFD compaction process) finalFricDegree = 30 # contact friction during the deviatoric loading rate = -0.02 # loading rate (strain rate) damp = 0.2 # damping coefficient stabilityThreshold = 0.01 # we test unbalancedForce against this value in different loops (see below) young = 5e6 # contact stiffness mn, mx = Vector3(0,0,0), Vector3(1,1,1) # corners of the initial packing # create materials for spheres and plates O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres')) O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls')) # create walls around the packing walls = aabbWalls([mn,mx],thickness=0,material='walls') wallIds = O.bodies.append(walls) ## use a SpherePack object to generate a random loose particles packing sp = pack.SpherePack() sp.makeCloud(mn,mx,-1,0.,num_spheres,False, 0.95,seed=1) #"seed" make the "random" generation always the same O.bodies.append([sphere(center,rad,material='spheres') for center,rad in sp]) #or alternatively (higher level function doing exactly the same): #sp.toSimulation(material='spheres') ### DEFINING ENGINES ### triax = TriaxialStressController( maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth) finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth) thickness=0, stressMask=7, internalCompaction=True, # If true the confining pressure is generated by growing particles ) newton = NewtonIntegrator(damping=damp) O.engines = [ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), ## We will use the global stiffness of each body to determine an optimal timestep (see https://yade-dem.org/w/images/1/1b/Chareyre_licensed.pdf) GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.5), triax, newton ] # Display spheres with 2 colors for seeing rotations better Gl1_Sphere.stripes = 0 if nRead == 0: yade.qt.Controller(), yade.qt.View() ### ### APPLYING CONFINING PRESSURE ### ### # the value of (isotropic) confining stress defines the target stress to be applied in all three directions triax.goal1 = triax.goal2 = triax.goal3 = -1 while 1: O.run(1000, True) # the global unbalanced force on dynamic bodies, thus excluding boundaries, which are not at equilibrium unb = unbalancedForce() # print(f"unbalanced force:{unb},mean stress:{triax.meanStress}") print 'unbalanced force:',unb,' mean stress: ',triax.meanStress if unb < stabilityThreshold and abs(-1-triax.meanStress)/1 < 0.001: break O.save('confinedState'+key+'.yade.gz') print "### Isotropic state saved ###" ### ### REACHING A SPECIFIED POROSITY PRECISELY ### ### import sys #this is only for the flush() below while triax.porosity > targetPorosity: ## we decrease friction value and apply it to all the bodies and contacts compFricDegree = 0.95*compFricDegree setContactFriction(radians(compFricDegree)) print "\r Friction: ",compFricDegree," porosity:",triax.porosity, sys.stdout.flush() O.run(500,1) O.save('compactedState'+key+'.yade.gz') print "###Compacted state saved ###" ## ### DEVIATORIC LOADING ### ## # We move to deviatoric loading, let us turn internal compaction off to keep particles sizes constant
[Yade-users] [Question #684078]: Why is the strain equal to 0 in the triaxial test in my codes?
New question #684078 on Yade: https://answers.launchpad.net/yade/+question/684078 I am using TriaxialStressController to conduct the triaxial test numerically. Bur, why is the strain equal to 0 in the triaxial test after the code is implemented? Here is my code. from yade import pack, qt ### DEFINING VARIABLES AND MATERIALS ### # The following 5 lines will be used later for batch execution nRead = readParamsFromTable( num_spheres = 1000, # number of spheres compFricDegree = 30, # contact friction during the confining phase key = '_triax_base_', # put you simulation's name here unknownOk = True ) from yade.params import table num_spheres = table.num_spheres # number of spheres key = table.key targetPorosity = 0.43 #the porosity we want for the packing compFricDegree = table.compFricDegree # initial contact friction during the confining phase (will be decreased during the REFD compaction process) finalFricDegree = 30 # contact friction during the deviatoric loading rate = -0.02 # loading rate (strain rate) damp = 0.2 # damping coefficient stabilityThreshold = 0.01 # we test unbalancedForce against this value in different loops (see below) young = 5e6 # contact stiffness mn,mx = Vector3(0,0,0), Vector3(1,1,1) # corners of the initial packing # create materials for spheres and plates O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres')) O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls')) # create walls around the packing walls = aabbWalls([mn,mx],thickness=0,material='walls') wallIds = O.bodies.append(walls) ## use a SpherePack object to generate a random loose particles packing sp = pack.SpherePack() sp.makeCloud(mn,mx,-1,0.,num_spheres,False, 0.95,seed=1) #"seed" make the "random" generation always the same O.bodies.append([sphere(center,rad,material='spheres') for center,rad in sp]) #or alternatively (higher level function doing exactly the same): #sp.toSimulation(material='spheres') ### DEFINING ENGINES ### triax = TriaxialStressController( maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth) finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth) thickness=0, stressMask=7, internalCompaction=True, # If true the confining pressure is generated by growing particles ) newton = NewtonIntegrator(damping=damp) O.engines = [ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax, newton ] #Display spheres with 2 colors for seeing rotations better Gl1_Sphere.stripes = 0 if nRead == 0: yade.qt.Controller(), yade.qt.View() ### ### APPLYING CONFINING PRESSURE ### ### #the value of (isotropic) confining stress defines the target stress to be applied in all three directions triax.goal1 = triax.goal2 = triax.goal3 = -1 while 1: O.run(1000, True) ##the global unbalanced force on dynamic bodies, thus excluding boundaries, which are not at equilibrium unb = unbalancedForce() # print(f"unbalanced force:{unb},mean stress:{triax.meanStress}") print 'unbalanced force:',unb,' mean stress: ',triax.meanStress if unb < stabilityThreshold and abs(-1-triax.meanStress)/1 < 0.001: break O.save('confinedState'+key+'.yade.gz') print "### Isotropic state saved ###" ### ### REACHING A SPECIFIED POROSITY PRECISELY ### ### import sys #this is only for the flush() below while triax.porosity > targetPorosity: ## we decrease friction value and apply it to all the bodies and contacts compFricDegree = 0.95*compFricDegree setContactFriction(radians(compFricDegree)) print "\r Friction: ",compFricDegree," porosity:",triax.porosity, sys.stdout.flush() O.run(500,1) O.save('compactedState'+key+'.yade.gz') print "###Compacted state saved ###" ## ### DEVIATORIC LOADING ### ## triax.internalCompaction=False # Change contact friction (remember that decreasing it would generate instantaneous instabilities) setContactFriction(radians(finalFricDegree)) # set stress control on x and z, we will impose strain rate on y triax.stressMask = 5 # now
[Yade-users] [Question #684022]: What does dynCell = True mean in PeriTriaxController?
New question #684022 on Yade: https://answers.launchpad.net/yade/+question/684022 Hi, everybody! I am confused about something with the tutorial of Periodic triaxial test. To be specific, I don't understand that What does dynCell = True mean in PeriTriaxController? And why maxStrainrate takes the value of (10, 10, 10)? Here is the part codes in the tutorial. PeriTriaxController(label='triax', # specify target values and whether they are strains or stresses goal=(sigmaIso,sigmaIso,sigmaIso),stressMask=7, # type of servo-control dynCell=True,maxStrainRate=(10,10,10), # wait until the unbalanced force goes below this value maxUnbalanced=.1,relStressTol=1e-3, # call this function when goal is reached and the packing is stable doneHook='compactionFinished()' ), Thanks -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
[Yade-users] [Question #683642]: How to access the porosity once the compaction is finished in triaxial test?
New question #683642 on Yade: https://answers.launchpad.net/yade/+question/683642 Hello, everyboday! I am learning a tutorial of Periodic triaxial test (https://yade-dem.org/doc/tutorial-examples.html#periodic-triaxial-test). Here is the code: from __future__ import print_function sigmaIso=-1e5 #import matplotlib #matplotlib.use('Agg') # generate loose packing from yade import pack, qt, plot O.periodic=True sp=pack.SpherePack() if 0: ## uniform distribution sp.makeCloud((0,0,0),(2,2,2),rMean=.1,rRelFuzz=.3,periodic=True) else: ## create packing from clumps # configuration of one clump c1=pack.SpherePack([((0,0,0),.0),((.03,0,0),.017),((0,.03,0),.017)]) # make cloud using the configuration c1 (there could c2, c3, ...; selection between them would be random) sp.makeClumpCloud((0,0,0),(2,2,2),[c1],periodic=True,num=500) # setup periodic boundary, insert the packing sp.toSimulation() O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), PeriTriaxController(label='triax', # specify target values and whether they are strains or stresses goal=(sigmaIso,sigmaIso,sigmaIso),stressMask=7, # type of servo-control dynCell=True,maxStrainRate=(10,10,10), # wait until the unbalanced force goes below this value maxUnbalanced=.1,relStressTol=1e-3, # call this function when goal is reached and the packing is stable doneHook='compactionFinished()' ), NewtonIntegrator(damping=.2), PyRunner(command='addPlotData()',iterPeriod=100), ] O.dt=.5*PWaveTimeStep() def addPlotData(): plot.addData(unbalanced=unbalancedForce(),i=O.iter, sxx=triax.stress[0],syy=triax.stress[1],szz=triax.stress[2], exx=triax.strain[0],eyy=triax.strain[1],ezz=triax.strain[2], # save all available energy data Etot=O.energy.total(),**O.energy ) # enable energy tracking in the code O.trackEnergy=True # define what to plot plot.plots={'i':('unbalanced',),'i ':('sxx','syy','szz'),' i':('exx','eyy','ezz'), # energy plot ' i ':(O.energy.keys,None,'Etot'), } # show the plot plot.plot() def compactionFinished(): # set the current cell configuration to be the reference one O.cell.trsf=Matrix3.Identity # change control type: keep constant confinement in x,y, 20% compression in z triax.goal=(sigmaIso,sigmaIso,-.2) triax.stressMask=3 # allow faster deformation along x,y to better maintain stresses triax.maxStrainRate=(1.,1.,.1) # next time, call triaxFinished instead of compactionFinished triax.doneHook='triaxFinished()' # do not wait for stabilization before calling triaxFinished triax.maxUnbalanced=10 def triaxFinished(): print('Finished') O.pause() The triaxial consists of 2 stages, one of the stages is isotropic compaction. I want to know whether the porosity is accessed once the compaction is finished. If can, how to access the porosity once the compaction is finished in triaxial test? Or whether I can specify the porosity during the compaction? Thanks! -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
[Yade-users] [Question #683427]: I don not understand how to simulate triaxial-test in Yade.
New question #683427 on Yade: https://answers.launchpad.net/yade/+question/683427 Hello, everybody! Although Yade provides a tutorial of Periodic triaxial test, I still not understand the role of PeriTriaxController() in every step of DEM simulation. By documentation, I understand the role of ForceResetter() is to reset force, InsertionSortCollider([Bo1_Sphere_Aabb()]) to create potential interactions, InteractionLoop([Ig2_Sphere_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()][Law2_ScGeom_FrictPhys_CundallStrack()]) to make exact collision detection, compute interaction properties and determine force, which coresponds to the sequence of simulation loop respectively. So could you give me the role of played by PeriTriaxController() in the simulation loop. And what operation PeriTriaxController() in mumerical triaxial test does corespond to in a actual triaxial test? Here is the codes: from __future__ import print_function sigmaIso=-1e5 #import matplotlib #matplotlib.use('Agg') # generate loose packing from yade import pack, qt, plot O.periodic=True sp=pack.SpherePack() if 0: ## uniform distribution sp.makeCloud((0,0,0),(2,2,2),rMean=.1,rRelFuzz=.3,periodic=True) else: ## create packing from clumps # configuration of one clump c1=pack.SpherePack([((0,0,0),.0),((.03,0,0),.017),((0,.03,0),.017)]) # make cloud using the configuration c1 (there could c2, c3, ...; selection between them would be random) sp.makeClumpCloud((0,0,0),(2,2,2),[c1],periodic=True,num=500) # setup periodic boundary, insert the packing sp.toSimulation() O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()] ), PeriTriaxController(label='triax', # specify target values and whether they are strains or stresses goal=(sigmaIso,sigmaIso,sigmaIso),stressMask=7, # type of servo-control dynCell=True,maxStrainRate=(10,10,10), # wait until the unbalanced force goes below this value maxUnbalanced=.1,relStressTol=1e-3, # call this function when goal is reached and the packing is stable doneHook='compactionFinished()' ), NewtonIntegrator(damping=.2), PyRunner(command='addPlotData()',iterPeriod=100), ] O.dt=.5*PWaveTimeStep() def addPlotData(): plot.addData(unbalanced=unbalancedForce(),i=O.iter, sxx=triax.stress[0],syy=triax.stress[1],szz=triax.stress[2], exx=triax.strain[0],eyy=triax.strain[1],ezz=triax.strain[2], # save all available energy data Etot=O.energy.total(),**O.energy ) # enable energy tracking in the code O.trackEnergy=True # define what to plot plot.plots={'i':('unbalanced',),'i ':('sxx','syy','szz'),' i':('exx','eyy','ezz'), # energy plot ' i ':(O.energy.keys,None,'Etot'), } # show the plot plot.plot() def compactionFinished(): # set the current cell configuration to be the reference one O.cell.trsf=Matrix3.Identity # change control type: keep constant confinement in x,y, 20% compression in z triax.goal=(sigmaIso,sigmaIso,-.2) triax.stressMask=3 # allow faster deformation along x,y to better maintain stresses triax.maxStrainRate=(1.,1.,.1) # next time, call triaxFinished instead of compactionFinished triax.doneHook='triaxFinished()' # do not wait for stabilization before calling triaxFinished triax.maxUnbalanced=10 def triaxFinished(): print('Finished') O.pause() Thanks! -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #682799]: Can I intsall Yade in Arch Linux, a lightweight and flexible Linux® distribution.?
Question #682799 on Yade changed: https://answers.launchpad.net/yade/+question/682799 Status: Answered => Open Rong Zhao is still having a problem: How to install Yade in Arch Linux, a lightweight and flexible Linux® distribution.? -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
[Yade-users] [Question #682799]: Can I intsall Yade in Arch Linux, a lightweight and flexible Linux® distribution.?
New question #682799 on Yade: https://answers.launchpad.net/yade/+question/682799 I am using Arch Linux, a lightweight and flexible Linux® distribution. Can I intsall Yade in Arch Linux? -- 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 : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp