New question #685005 on Yade:
https://answers.launchpad.net/yade/+question/685005

Hi,

I'm new with Yade and using it for my Ph.D. work in Geotechnics. I have coded a 
simple triaxial test but don't know how can I get micro-scale information such 
as fabric tensor, contact normal, branch vectors, interparticle forces, 
strains, etc.

My supervisor asked me to provide all of those in 2 days and I have no idea 
what should I do :-(

Would you please tell me how I can get that information? (and also if my code 
has any issue)

This is my code:
*********

# encoding: utf-8
# the script demonstrates a simple case of triaxial simulation using 
TriaxialCompressionEngine.

from yade import pack
sp=pack.Spherepack()

## corners of the initial packing
mn, mx=Vector3(0,0,0), Vector3(10,10,10)

## box between mn and mx, average radius -+ 1/2(20%) , 2k spheres
sp.makeCloud(minCorner=mn,maxCorner=mx,rRelFuzz=0.2,num=2000)   # it can be 
defined based on porosity instead of num or even use a range of radius instead 
of a fixed radius

## create material #0, which will be used as defult
O.materials.append(FrictMat(young=15e6,poisson=0.4,frictionAngle=radians(30),density=2600,label='spheres'))
     # for particles
O.materials.append(FrictMat(young=15e6,poisson=0.4,frictionAngle=0,density=0,label='frictionless'))
     # for walls # density is 0 because these walls are not exist in real and 
they ae kind of virtual to force particles to be in our virtual box (we want 
walls just to be as boundaries)

## Assign section, copy spheres from the packing into the scene
## use defult material, don't care about that for now
O.bodies.append([sphere(center,rad,material='spheres') for center, rad in sp])  
#assign material to particles
## create walls around the packing
walls=aabbWalls(thickness=1e-10,material='frictionless')        # assign 
material to walls      # aabb models a cube boundary for the problem and Walls 
defines that the square will be created as walls ,,, thickness is so small due 
to not existence of walls (walls are virtual)
wallIds=O.bodies.append(walls)  # assign ID to the 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=False,
        ## define the rest of triaxial parameters here, see in 
pkg/dem/PreProcessor/TriaxialTest.cpp:524 etc, which are assigned in the c++ 
preprocessor actually
        sigmaIsoCompaction=-50e3,
        sigmaLateralConfinement=-50e3,
        max_vel=10,
        strainRate=0.01,
        label="triax",
)


O.engines=[
        ForceResetter(),        # reset forces on boundaries in each step
        InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),      # first 
arugemnt is a radisu which defines a certain lentgh to define collision between 
2 particles, this lentgh consider as a          spherical space or a circle and 
that's why we need a radius here
        InteractionLoop(
        [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],   # interaction 
between 2 particles or a particle and box
        [Ip2_FrictMat_FrictMat_FrictPhys()],    # FrictPhys is the Linear 
Elastic-Plastic Interaction 
        [Law2_ScGeom_FrictPhys_CundallStrack()] # # CundallStrack is the Linear 
Elastic-Plastic Interaction
        ),
        
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
        triax,
        # you can add TriaxialStateRecorder and such here...
        NewtonIntegrato(damping=0.4)
]


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],e33=-triax.strain[2],
        s11=-triax.stress(0)[0],
        s22=-triax.stress(2)[1],
        s33=-triax.stress(4)[2],
        i=O.iter)

plot.plots={'i':('e11','e22','e33',Non,'s11','s22','s33')}

O.saveTmp()
plot.plot()

*********
Thankyou


-- 
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

Reply via email to