← Back to team overview

yade-users team mailing list archive

Re: [Question #702065]: How to set periodic boundary?

 

Question #702065 on Yade changed:
https://answers.launchpad.net/yade/+question/702065

Rahul R gave more information on the question:
>do not ask urgent questions on Saturday
I'm sorry

>Which examples?
https://gitlab.com/yade-dev/trunk/blob/master/doc/sphinx/tutorial/06-periodic-triaxial-test.py

>What is "the documentation"?
Yade documentation 3rd edition

>Please provide full error message.
This is the message: 'PeriTriaxController run on aperiodic simulation'

>Where / how did you get this understanding?
>From examples with tutorials in Yade documentation. I checked in the section in the documentation for periodic boundaries but I'm not quite sure how it is used. In most of the examples, it was seen that 'periodic= True' is used inside makeCloud class. This made me think that periodic boundaries can be set only when particles are generated. I'm new to Yade and programming, so it is a bit difficult for me to understand how all function work even if I read Yade documentation but now I understood how to do it.

>Please provide the code

# encoding: utf-8

# periodic triaxial test simulation
#
# The initial packing is either
#
# 1. random cloud with uniform distribution, or
# 2. cloud with specified granulometry (radii and percentages), or
# 3. cloud of clumps, i.e. rigid aggregates of several particles
#
# The triaxial consists of 2 stages:
#
# 1. isotropic compaction, until sigmaIso is reached in all directions;
#    this stage is ended by calling compactionFinished()
# 2. constant-strain deformation along the z-axis, while maintaining
#    constant stress (sigmaIso) laterally; this stage is ended by calling
#    triaxFinished()
#
# Controlling of strain and stresses is performed via PeriTriaxController,
# of which parameters determine type of control and also stability
# condition (maxUnbalanced) so that the packing is considered stabilized
# and the stage is done.
#

from __future__ import print_function
sigmaIso = -1e5

#import matplotlib
#matplotlib.use('Agg')

# generate loose packing
from yade import pack, qt, plot, ymport

O.periodic = True
sp= ymport.textExt('spheres',format='x_y_z_r',shift= Vector3(0,0,0), scale=1.0, color=(0,1,1))
spheres = O.bodies.append(sp)
# setup periodic boundary, insert the packing
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 = {
        'ezz ': ('szz')
}
# 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()

As I stated before, when I set periodic boundaries, all the particles are found to club together to form a clump. This is what the pack looks like when viewed in GUI: https://drive.google.com/file/d/1-7sihNlKJvkZ4RKy3KQODS1sxVyyJc69/view?usp=sharing
Here is the link to the sphere coordinates: https://drive.google.com/file/d/1tKnyZn9BcJasU523Jny9os6Gp3EMw1Ms/view?usp=sharing

Cheers,
Rahul

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.