[Yade-users] [Question #700738]: create a 2d modle to get the data about stress and strain
New question #700738 on Yade: https://answers.launchpad.net/yade/+question/700738 I would like to use YADE to create a 2D model to simulate the stress-strain data obtained by applying pressure or tension to the upper and lower boundaries. Do you have any guidance for me? For example, what kind of guidance documents should I go through first? -- 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 #700738]: create a 2d modle to get the data about stress and strain
Question #700738 on Yade changed: https://answers.launchpad.net/yade/+question/700738 Status: Answered => Solved Xifan Li confirmed that the question is solved: Thanks Karol Brzezinski, 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
[Yade-users] [Question #700872]: how to set flexible boundaries?
New question #700872 on Yade: https://answers.launchpad.net/yade/+question/700872 I want to set the flexible boundary in Yade. >From the answer https://answers.launchpad.net/yade/+question/254339 I found that there are several options to achieve this. Such as the bonded particles, and the flexible membrane by woo. But I want to try another way: [1] finish the same task in Fig.9 as this paper: https://ascelibrary.org/doi/full/10.1061/(ASCE)GM.1943-5622.0001001 [2] In the below paper, the author set the boundary as the bonded particles, But I want to import velocity (stress) on each particle. [3]Maybe we can try to set the moving rigid boundary so that So we can look at it approximately as a flexible boundary? I do not know which way is the best and achievable. Any reply would be a grateful appreciate. My Yade code is as followed, which was modified from the Oedemetric Test from the Examples, and I do not know how to modify it. # # load parameters from file if run in batch # default values are used if not run from batch readParamsFromTable(rMean=.03,rRelFuzz=0,maxLoad=1.5e4,minLoad=1e1) # make rMean, rRelFuzz, maxLoad accessible directly as variables later from yade.params.table import * # create box with free top, and ceate loose packing inside the box from yade import pack, plot O.bodies.append(geom.facetBox((1,0,1),(1,.03,1),wallMask=31)) #O.bodies.append(geom.facetBox((0,0,0),(.5,.03,.5),wallMask=31)) sp=pack.SpherePack() sp.makeCloud((0,0,0),(2,0.03,2),rMean=rMean,rRelFuzz=rRelFuzz) #sp.makeCloud((0,0,0),(-0.5,0.03,-0.25),rMean=rMean,rRelFuzz=rRelFuzz) sp.toSimulation() 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=1,label='checker'), ] O.dt=.5*PWaveTimeStep() # the following checkUnbalanced, unloadPlate and stopUnloading functions are all called by the 'checker' # (the last engine) one after another; this sequence defines progression of different stages of the # simulation, as each of the functions, when the condition is satisfied, updates 'checker' to call # the next function when it is run from within the simulation next time # check whether the gravity deposition has already finished # if so, add wall on the top of the packing and start the oedometric test 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, -.05) # start plotting the data now, it was not interesting before O.engines = O.engines + [PyRunner(command='addPlotData()', iterPeriod=50)] # next time, do not call this function anymore, but the next one (unloadPlate) instead checker.command = 'unloadPlate()' def unloadPlate(): # if the force on plate exceeds maximum load, start unloading if abs(O.forces.f(plate.id)[2]) > maxLoad: plate.state.vel *= -1 # next time, do not call this function anymore, but the next one (stopUnloading) instead checker.command = 'stopUnloading()' def stopUnloading(): if abs(O.forces.f(plate.id)[2]) < minLoad: # O.tags can be used to retrieve unique identifiers of the simulation # if running in batch, subsequent simulation would overwrite each other's output files otherwise # d (or description) is simulation description (composed of parameter values) # while the id is composed of time and process number plot.saveDataTxt(O.tags['d.id'] + '.txt')
Re: [Yade-users] [Question #700872]: how to set flexible boundaries?
Question #700872 on Yade changed: https://answers.launchpad.net/yade/+question/700872 Description changed to: I want to set the flexible boundary in Yade. >From the answer https://answers.launchpad.net/yade/+question/254339 I found that there are several options to achieve this. Such as the bonded particles, and the flexible membrane by woo. But I want to try another way: [1] finish the same task in Fig.9 as this paper: https://ascelibrary.org/doi/full/10.1061/(ASCE)GM.1943-5622.0001001 [2] In the above paper, the author set the boundary as the bonded particles, But I want to import velocity (stress) on each particle. [3]Maybe we can try to set the moving rigid boundary so that So we can look at it approximately as a flexible boundary? I do not know which way is the best and achievable. Any reply would be a grateful appreciate. My Yade code is as followed, which was modified from the Oedemetric Test from the Examples, and I do not know how to modify it. # # load parameters from file if run in batch # default values are used if not run from batch readParamsFromTable(rMean=.03,rRelFuzz=0,maxLoad=1.5e4,minLoad=1e1) # make rMean, rRelFuzz, maxLoad accessible directly as variables later from yade.params.table import * # create box with free top, and ceate loose packing inside the box from yade import pack, plot O.bodies.append(geom.facetBox((1,0,1),(1,.03,1),wallMask=31)) #O.bodies.append(geom.facetBox((0,0,0),(.5,.03,.5),wallMask=31)) sp=pack.SpherePack() sp.makeCloud((0,0,0),(2,0.03,2),rMean=rMean,rRelFuzz=rRelFuzz) #sp.makeCloud((0,0,0),(-0.5,0.03,-0.25),rMean=rMean,rRelFuzz=rRelFuzz) sp.toSimulation() 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=1,label='checker'), ] O.dt=.5*PWaveTimeStep() # the following checkUnbalanced, unloadPlate and stopUnloading functions are all called by the 'checker' # (the last engine) one after another; this sequence defines progression of different stages of the # simulation, as each of the functions, when the condition is satisfied, updates 'checker' to call # the next function when it is run from within the simulation next time # check whether the gravity deposition has already finished # if so, add wall on the top of the packing and start the oedometric test 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, -.05) # start plotting the data now, it was not interesting before O.engines = O.engines + [PyRunner(command='addPlotData()', iterPeriod=50)] # next time, do not call this function anymore, but the next one (unloadPlate) instead checker.command = 'unloadPlate()' def unloadPlate(): # if the force on plate exceeds maximum load, start unloading if abs(O.forces.f(plate.id)[2]) > maxLoad: plate.state.vel *= -1 # next time, do not call this function anymore, but the next one (stopUnloading) instead checker.command = 'stopUnloading()' def stopUnloading(): if abs(O.forces.f(plate.id)[2]) < minLoad: # O.tags can be used to retrieve unique identifiers of the simulation # if running in batch, subsequent simulation would overwrite each other's output files otherwise # d (or description) is simulation description (composed of parameter values) # while the id is composed of time and process number plot.saveDataTxt(O.
Re: [Yade-users] [Question #700872]: how to set flexible boundaries?
Question #700872 on Yade changed: https://answers.launchpad.net/yade/+question/700872 Xifan Li gave more information on the question: I have tried to set the confining pressure into this model. But it didn't work. An error occurred while running. The following is my modified code: from __future__ import print_function sigmaIso = -1e5 # load parameters from file if run in batch # default values are used if not run from batch readParamsFromTable(rMean=.03,rRelFuzz=0,maxLoad=1.5e4,minLoad=1e1) # make rMean, rRelFuzz, maxLoad accessible directly as variables later from yade.params.table import * # create box with free top, and ceate loose packing inside the box from yade import pack, qt, plot O.periodic = True O.bodies.append(geom.facetBox((2,0,2),(2,.03,2),wallMask=31)) #O.bodies.append(geom.facetBox((0,0,0),(.5,.03,.5),wallMask=31)) sp=pack.SpherePack() sp.makeCloud((1,0,0),(3,0.03,3.5),rMean=rMean,rRelFuzz=rRelFuzz, periodic = True) #sp.makeCloud((0,0,0),(-0.5,0.03,-0.25),rMean=rMean,rRelFuzz=rRelFuzz) sp.toSimulation() triax=TriaxialStressController( ## TriaxialStressController will be used to control stress and strain. It controls particles size and plates positions. thickness = 0, stressMask = 2, internalCompaction=True, # If true the confining pressure is generated by growing particles ) 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()]), PeriTriaxController( label='triax', # specify target values and whether they are strains or stresses goal=(sigmaIso, sigmaIso, sigmaIso), stressMask=2, # type of servo-control dynCell=True, maxStrainRate=(10, 10, 10), # wait until the unbalanced force goes below this value maxUnbalanced=10, relStressTol=1e-3, ), 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=1,label='checker'), ] triax.goal1=triax.goal2=triax.goal3=-1 O.dt=.5*PWaveTimeStep() # the following checkUnbalanced, unloadPlate and stopUnloading functions are all called by the 'checker' # (the last engine) one after another; this sequence defines progression of different stages of the # simulation, as each of the functions, when the condition is satisfied, updates 'checker' to call # the next function when it is run from within the simulation next time # check whether the gravity deposition has already finished # if so, add wall on the top of the packing and start the oedometric test 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, -.05) # start plotting the data now, it was not interesting before O.engines = O.engines + [PyRunner(command='addPlotData()', iterPeriod=50)] # next time, do not call this function anymore, but the next one (unloadPlate) instead checker.command = 'unloadPlate()' def unloadPlate(): # if the force on plate exceeds maximum load, start unloading if abs(O.forces.f(plate.id)[2]) > maxLoad: plate.state.vel *= -.5 # next time, do not call this function anymore, but the next one (stopUnloading) instead checker.command = 'stopUnloading()' def stopUnloading(): if abs(O.forces.f(plate.id)[2]) < minLoad: # O.tags can be used to retrieve unique identifiers
Re: [Yade-users] [Question #700872]: how to set flexible boundaries?
Question #700872 on Yade changed: https://answers.launchpad.net/yade/+question/700872 Status: Needs information => Solved Xifan Li confirmed that the question is solved: Thank you so much Jan. -- 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 #700931]: How to colour in the particles in my own specific way (sequence)
New question #700931 on Yade: https://answers.launchpad.net/yade/+question/700931 Hi, I'm a new Yader. Since I wanted to paint the deformation of the specimen in Figure 11 of this article, the idea I came up with was to use a different colour on the diagonal than the other areas so that I could see the result I wanted after the deformation. Of course by paraview. Here is the paper: https://ascelibrary.org/doi/full/10.1061/(ASCE)GM.1943-5622.0001001 I want to ask your opinions about: [1] Is the idea correct? If so, how can I use the different colours on the diagonal of my sample? [2] If not, could you please give some suggestions? I will be very grateful to wait for your answers and many thanks for your help! -- 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 #700957]: How to simulate the cyclic loading during the biaxial test?
New question #700957 on Yade: https://answers.launchpad.net/yade/+question/700957 I took the triaxial compression code (3d) and modified it to end up with the biaxial compression simulation (2d), but now I want to go a step further and get cyclic loading while doing biaxial compression (which means to allow the sigmaIsoCompaction and sigmaLateralConfinement are not constantly). Here is the code (The code works fine and completes the biaxial compression test, but it doesn't load the loop, so I'd like to know what the problem is.): from yade import pack sp=pack.SpherePack() ## corners of the initial packing mn,mx=Vector3(0,0,0),Vector3(10,10,.1) ## box between mn and mx, avg radius ± ½(20%), 2k spheres sp.makeCloud(minCorner=mn,maxCorner=mx,rRelFuzz=0,num=2000) ## create material #0, which will be used as default O.materials.append(FrictMat(young=15e6,poisson=.4,frictionAngle=radians(30),density=2600,label='spheres')) O.materials.append(FrictMat(young=15e6,poisson=.4,frictionAngle=0,density=0,label='frictionless')) ## copy spheres from the packing into the scene ## use default material, don't care about that for now O.bodies.append([sphere(center,rad,material='spheres') for center,rad in sp]) ## create walls around the packing walls=aabbWalls(thickness=1e-10,material='frictionless') wallIds=O.bodies.append(walls) triax=TriaxialCompressionEngine( wall_bottom_id=wallIds[2], wall_top_id=wallIds[3], wall_left_id=wallIds[0], wall_right_id=wallIds[1], wall_back_id=wallIds[4], wall_front_id=wallIds[5], internalCompaction=True, ## define the rest of triax params here ## see in pkg/dem/PreProcessor/TriaxialTest.cpp:524 etc ## which are assigned in the c++ preprocessor actually sigmaIsoCompaction=-5e4, sigmaLateralConfinement=-5e4, max_vel=10, strainRate=0.01, label="triax" ) 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, TriaxialStateRecorder(iterPeriod=100, file='Stresses(d.id).txt'), NewtonIntegrator(damping=.4), PyRunner(command='checkUnbalanced()',realPeriod=1,label='checker'), ] O.dt=.5*PWaveTimeStep() def checkUnbalanced(): if O.iter < 5000: return if unbalancedForce() > .1: return checker.command ='unload' def unload(): if triax.stress(2)[1] > 6e4: sigmaIsoCompaction /= 2 sigmaLateralConfinement /= 2 checker.command = 'load' def load(): if triax.stress(2)[1] < 3e4: sigmaIsoCompaction *= 2 sigmaLateralConfinement *= 2 from yade import plot O.engines=O.engines[0:5]+[PyRunner(iterPeriod=20,command='history()',label='recorder')]+O.engines[5:7] def history(): plot.addData(e11=triax.strain[0], e22=-triax.strain[1], s11=-triax.stress(0)[0], s22=-triax.stress(2)[1], i=O.iter) plot.plots={'e11': ('s11',),'e22': ('s22',)} O.saveTmp() plot.plot() # Many thanks for your help. -- 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 #700931]: How to colour in the particles in my own specific way (sequence)
Question #700931 on Yade changed: https://answers.launchpad.net/yade/+question/700931 Status: Answered => Solved Xifan Li 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 #700957]: How to simulate the cyclic loading during the biaxial test?
Question #700957 on Yade changed: https://answers.launchpad.net/yade/+question/700957 Xifan Li gave more information on the question: Perhaps I have not been particularly clear and I will now add some information about the problems I have encountered. Method 1: I am trying to run my model in such a way that the moving wall can be paused after the stress on one of the axes(x or y) has reached a certain value when the confining pressure is applied, at which point the stress will definitely change as the model is paused, and the stopped wall can be restarted when this stress value changes to another specific value. Method 2: In order to achieve the cyclic loading I need, I wonder if it is possible to change (swap) the axes of applied stress and applied strain during the run of this model (when state 3 STATE_TRIAX_LOADING in TriaxialCompressionEngine is reached), for example changing the axis of applied stress to the axis of applied strain and the axis of applied strain to the axis of applied stress. Is the method achievable? -- 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 #700980]: How to change the strainRate value of TriaxialCompressionEngine during the simulation period?
New question #700980 on Yade: https://answers.launchpad.net/yade/+question/700980 The problem I have got: [1]https://answers.launchpad.net/yade/+question/700957 In the last two days of trial and error and thinking, I have discovered that the strain rate in TriaxialCompressionEngine can be changed when the stress loading axis becomes negative, [2] so what I want to know is whether I can have a situation in the simulation where the strain rate can become negative when the stress in a certain axis reaches a certain value. [3] However, I have found that once the simulation is started, it seems that the preset code in the engine cannot be changed later in the code (i.e. the strainRate set in the engine is constant at the beginning), so I would like to know if there is a way to make the strainRate change during a process? [4] I have also noticed that there is a code that can be used for making an engine temporarily deactivated and only resurrect it at a later point---dead(=false). So I want to know how to apply this code to my simulation code. Cheers -- 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 #700980]: How to change the strainRate value of TriaxialCompressionEngine during the simulation period?
Question #700980 on Yade changed: https://answers.launchpad.net/yade/+question/700980 Description changed to: The problem I have got: [1]https://answers.launchpad.net/yade/+question/700957 In the last two days of trial and error and thinking, I have discovered that the strain rate in TriaxialCompressionEngine can be changed when the stress loading axis becomes negative, [2] so what I want to know is whether I can have a situation in the simulation where the strain rate can become negative when the stress in a certain axis reaches a certain value. [3] However, I have found that once the simulation is started, it seems that the preset code in the engine cannot be changed later in the code (i.e. the strainRate set in the engine is constant at the beginning), so I would like to know if there is a way to make the strainRate change during a process? [4] I have also noticed that there is a code that can be used for making an engine temporarily deactivated and only resurrect it at a later point ---dead(=false). So I want to know how to apply this code to my simulation code. [5] I have put the code 'dead = True' to my simulation code, yes the simulation did not run at all. But regarding to the demonstration of the code: ' can be used for making an engine temporarily deactivated and only resurrect it at a later point.' How can I activate this engine 'at a later point'? And How to define the 'later point'? Cheers -- 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 #700980]: How to change the strainRate value of TriaxialCompressionEngine during the simulation period?
Question #700980 on Yade changed: https://answers.launchpad.net/yade/+question/700980 Xifan Li posted a new comment: Thank you Robert, I have changed the engine I use from TriaxialCompressionEngine to TriaxialStressController, My code is below. This code can run normally, but it still cannot make the cyclic loading realizable. [1] So I would like to know how to change the parameters in the TriaxialStressController engine while the simulation is running? (Like change the triax.goal1 and tiax.goal2 and the stressMask? ### from yade import pack # 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(10,10,.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(minCorner=mn,maxCorner=mx,rRelFuzz=0,num=2000) sp.toSimulation(material='spheres') triax=TriaxialStressController( maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth) finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth) thickness = 0, internalCompaction=False, stressMask = 1, goal1=-2e5, goal2=rate, ) 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, TriaxialStateRecorder(iterPeriod=100, file='WallStresses.txt'), NewtonIntegrator(damping=damp), PyRunner(command='triaxload()',iterPeriod=1, label='triaxload'), #PyRunner(command='triaxload()',realPeriod=2, label='triaxload') ] triax.stressMask = 1 triax.goal1=-2e5 triax.goal2=rate def triaxload(): O.triax.goal1=-3e5 if abs(O.triax.stress(triax.wall_top_id)[1])> 15: O.triax.stressMask = 1 O.triax.goal1=-3e5 O.triax.goal2=rate triaxload.command=('triaxunload') def triaxunload(): if abs(triax.stress(triax.wall_top_id)[1])< 5e4: triax.stressMask = 1 triax.goal1=-1e5 triax.goal2=rate from yade import plot O.engines=O.engines[0:5]+[PyRunner(iterPeriod=20,command='history()',label='recorder')]+O.engines[5:7] def history(): plot.addData(e11=-triax.strain[0], e22=-triax.strain[1], s11=-triax.stress(triax.wall_right_id)[0], s22=-triax.stress(triax.wall_top_id)[1], i=O.iter) plot.plots={'e11': ('s11',),'e22': ('s22',)} O.saveTmp() plot.plot() -- 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 #700957]: How to simulate the cyclic loading during the biaxial test?
Question #700957 on Yade changed: https://answers.launchpad.net/yade/+question/700957 Status: Answered => Open Xifan Li is still having a problem: Thank you Jérôme, I have changed the engine I use from TriaxialCompressionEngine to TriaxialStressController, My code is below. This code can run normally, but it still cannot make the cyclic loading realizable. [1] So I would like to know how to change the parameters in the TriaxialStressController engine while the simulation is running? (Like change the triax.goal1 and tiax.goal2 and the stressMask? ### from yade import pack # 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(10,10,.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(minCorner=mn,maxCorner=mx,rRelFuzz=0,num=2000) sp.toSimulation(material='spheres') triax=TriaxialStressController( maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth) finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth) thickness = 0, internalCompaction=False, stressMask = 1, goal1=-2e5, goal2=rate, ) 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, TriaxialStateRecorder(iterPeriod=100, file='WallStresses.txt'), NewtonIntegrator(damping=damp), PyRunner(command='triaxload()',iterPeriod=1, label='triaxload'), #PyRunner(command='triaxload()',realPeriod=2, label='triaxload') ] triax.stressMask = 1 triax.goal1=-2e5 triax.goal2=rate def triaxload(): O.triax.goal1=-3e5 if abs(O.triax.stress(triax.wall_top_id)[1])> 15: O.triax.stressMask = 1 O.triax.goal1=-3e5 O.triax.goal2=rate triaxload.command=('triaxunload') def triaxunload(): if abs(triax.stress(triax.wall_top_id)[1])< 5e4: triax.stressMask = 1 triax.goal1=-1e5 triax.goal2=rate from yade import plot O.engines=O.engines[0:5]+[PyRunner(iterPeriod=20,command='history()',label='recorder')]+O.engines[5:7] def history(): plot.addData(e11=-triax.strain[0], e22=-triax.strain[1], s11=-triax.stress(triax.wall_right_id)[0], s22=-triax.stress(triax.wall_top_id)[1], i=O.iter) plot.plots={'e11': ('s11',),'e22': ('s22',)} O.saveTmp() plot.plot() -- 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 #701030]: Why is my pyrunner command not being called?
New question #701030 on Yade: https://answers.launchpad.net/yade/+question/701030 I want to use pyrunner's command to control the loading and unloading process, but it doesn't work. So I was wondering maybe there's something wrong with the engine code, so I add the "print ('hello')", and it did work. But the pyrunner command still doesn't work. I do not know what is going wrong. Here is my code, could you please help me to check about it? Many thanks for your help. ## from yade import pack # 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(10,10,.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(minCorner=mn,maxCorner=mx,rRelFuzz=0,num=2000) sp.toSimulation(material='spheres') triax=TriaxialStressController( maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth) finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth) thickness = 0, internalCompaction=False, stressMask = 1, goal1=-2e5, goal2=rate, ) 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, TriaxialStateRecorder(iterPeriod=100, file='WallStresses.txt'), NewtonIntegrator(damping=damp), PyRunner(command='triaxload()',iterPeriod=1, label='triaxload'), ] triax.stressMask = 1 triax.goal1=-2e5 triax.goal2=rate print('hello') def triaxload(): if abs(O.triax.stress(triax.wall_top_id)[1])> 15: triax.stressMask = 1 triax.goal1=-3e5 triax.goal2=rate triaxload.command=('triaxunload') def triaxunload(): if abs(triax.stress(triax.wall_top_id)[1])< 5e4: triax.stressMask = 1 triax.goal1=-1e5 triax.goal2=rate from yade import plot O.engines=O.engines[0:5]+[PyRunner(iterPeriod=20,command='history()',label='recorder')]+O.engines[5:7] def history(): plot.addData(e11=-triax.strain[0], e22=-triax.strain[1], s11=-triax.stress(triax.wall_right_id)[0], s22=-triax.stress(triax.wall_top_id)[1], i=O.iter) plot.plots={'e11': ('s11',),'e22': ('s22',)} O.saveTmp() plot.plot() -- 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 #701030]: Why is my pyrunner command not being called?
Question #701030 on Yade changed: https://answers.launchpad.net/yade/+question/701030 Status: Answered => Open Xifan Li is still having a problem: Thank you Robert, But the point is not the print function, I mean that the above code can run the print() command, but cannot run the triaxload() and triaxunload() command. I add the print() command in order to confirm that my code can run normally, but my main objective is to run the triaxload() & triaxunload() command during the simulation. -- 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 #700957]: How to simulate the cyclic loading during the biaxial test?
Question #700957 on Yade changed: https://answers.launchpad.net/yade/+question/700957 Status: Answered => Solved Xifan Li confirmed that the question is solved: https://answers.launchpad.net/yade/+question/701030 I just solved this problem. Thank you all guys. -- 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 #701030]: Why is my pyrunner command not being called?
Question #701030 on Yade changed: https://answers.launchpad.net/yade/+question/701030 Status: Open => Solved Xifan Li confirmed that the question is solved: Thank you all guys. I just fixed the problem. I called the pyrunner command succesfully! I realize that if we want to use the existing engine (like TriaxStressController, TriaxCompressionEngine) to call the pyrunner command to change the simulation proceed. We cannot simply add the pyrunner in the O.engines, we have to add the pyrunner command in this line: O.engines=O.engines[0:5]+[...]+O.engines[5:7] in the middle between O.engines[0:5] and O.engines[5:7], after adding the pyrunner command, so we can def the command as we want in the following part. Many thanks to Jan who gave me the inspiration and Rober as well and other people who take their time to look at my problem. Cheers -- 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 #700980]: How to change the strainRate value of TriaxialCompressionEngine during the simulation period?
Question #700980 on Yade changed: https://answers.launchpad.net/yade/+question/700980 Status: Answered => Solved Xifan Li confirmed that the question is solved: https://answers.launchpad.net/yade/+question/701030 I just solved this problem. -- 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