using TriAxialstressController obtain volume origin and size

Asked by rhaven

Hi There,
I am using the TriAxialStressController to compress a packing of particles. Once the compression is complete id like to get the size and origin of the volume
I found compressor.width / height / depth which i believe corresponds to the X/Y/Z length of the volume? What is width0/height0 and depth0?

However, how do I get the origin or center of this volume?

many thanks in advance
Jesse

Code shown below:

%%%%%%%%%%%
 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()]
    ),
    TriaxialStressController(
    thickness = 0,
    stressMask = 7,
    internalCompaction = False,
    label = 'compressor',
    ),
    NewtonIntegrator(damping=.6),
 ]
 factor = .5
 O.dt = factor * PWaveTimeStep()

 #print(compressor.height)
 compressor.goal1 = compressor.goal2 = compressor.goal3 = -1e-3
 #compressor.goal1 = compressor.goal2 = compressor.goal3 = -1e-5
 O.run(50000,True)
 print compressor.goal1
 print compressor.boxVolume

 print('width_x: ',compressor.width)
 print('height_y: ',compressor.height)
 print('depth_z: ',compressor.depth)
 print('width0_x: ',compressor.width0)
 print('height0_y: ',compressor.height0)
 print('depth0_z: ',compressor.depth0)

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Robert Caulk
Solved:
Last query:
Last reply:
Revision history for this message
Best Robert Caulk (rcaulk) said :
#1

Hello,

I think you are right, X/Y/Z = width/height/depth [1]. height0 is the reference height used for strain calculation [2].

>However, how do I get the origin or center of this volume?

So you want the center of the box defined by the locations of the triaxial walls? The user defines the geometry and position of the walls explicitly. In most triaxial loading conditions, the center should not change. If for some reason you are expecting unsymmetric deformation or specimen translation, you can you use the position of the walls to determine where the center is. O.bodies[1].state.pos provides access to this information.

Cheers,

Robert

[1]https://github.com/yade/trunk/blob/e4e757f2e98a620e3177b7a36a1d10f69f6a6a28/pkg/dem/TriaxialStressController.cpp#L122
[2]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.TriaxialStressController.height0

Revision history for this message
rhaven (rhavenj) said :
#2

Thanks Robert Caulk, that solved my question.

Revision history for this message
rhaven (rhavenj) said :
#3

Hi Robert,
thank you for your reply.
I was able to get the bottom corner of the volume using:
x = min(O.bodies[0].state.pos[0],O.bodies[1].state.pos[0])
y = min(O.bodies[2].state.pos[1],O.bodies[3].state.pos[1])
z = min(O.bodies[4].state.pos[2],O.bodies[5].state.pos[2])
in my case I know the wallIds because I generate walls in a previous step, but i guess ids 0,1,2,3,4,5 might not always be the walls..

thanks
Jesse

Revision history for this message
Robert Caulk (rcaulk) said :
#4

Hello Jesse,

They will always be 0,1,2,3,4,5 if the are the first bodies appended to the simulation :-).

Cheers,

Robert

Revision history for this message
Luc Scholtès (luc) said :
#5

Hey,

You might also use this function:

https://yade-dem.org/doc/yade.utils.html?highlight=aabbextrema#yade._utils.aabbExtrema

Then you can get the coordinates of the min and max corners of your simulation (it works with or without walls)

dim=utils.aabbExtrema()
xinf=dim[0][0]
xsup=dim[1][0]
yinf=dim[0][1]
ysup=dim[1][1]
...

Cheers

Luc