← Back to team overview

yade-users team mailing list archive

Re: [Question #269491]: TriaxialStressController cohesive

 

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

    Status: Answered => Open

Luis Barbosa is still having a problem:
Ok, thanks Bruno, I'll follow those instructions.

The message of error is:

Running script triax1.py
python: /tmp/buildd/yadedaily-1.14.0-57-77e7f1d~trusty/pkg/common/InteractionLoop.cpp:116: virtual void InteractionLoop::action(): Assertion, `!swap' failed.
Aborted (image of the core recorded)

This is happening in the first O.engines of the script bellow (short
version):

#!/usr/bin/python
# -*- coding: utf-8 -*-

############################################
### DEFINING VARIABLES AND MATERIALS ###

nRead=readParamsFromTable(
	num_spheres=1000,
	compFricDegree = 30,
	key='_triax_base_',
	unknownOk=True
)
from yade.params import table
from yade import plot

num_spheres=table.num_spheres
key=table.key
targetPorosity = 0.50
compFricDegree = table.compFricDegree
finalFricDegree = 30
rate=0.01
damp=0.2
stabilityThreshold=0.01
young=5e5
mn,mx=Vector3(-0.08,0.32,-0.08),Vector3(0.08,0.49,0.08)

## create materials for spheres and plates
O.materials.append(CohFrictMat(young=5e5,poisson=0.4,density=2600,frictionAngle=radians(30),isCohesive=False,normalCohesion=1e6,shearCohesion=1e6,momentRotationLaw=True,etaRoll=0.1,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.03333,num_spheres,False, 0.9,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,
	finalMaxMultiplier=1.+2e3/young,
	thickness = 0,
	stressMask = 7,
	internalCompaction=False,
)

newton=NewtonIntegrator(damping=damp)

O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D()],
		[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=False,label="cohesiveIp")],
		[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=False,always_use_moment_law=False,label='cohesiveLaw')],
  	),
	GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
	triax,
#	TriaxialStateRecorder(iterPeriod=100,file='WallStresses'+table.key),
	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=-10000
while 1:
	O.run(1000, True)
#the global unbalanced force on dynamic bodies, thus excluding boundaries, which are not at equilibrium
	unb=unbalancedForce()
	print 'unbalanced force:',unb,' mean stress: ',triax.meanStress
	if unb<stabilityThreshold and abs(-10000-triax.meanStress)/10000<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()
	# while we run steps, triax will tend to grow particles as the packing
	# keeps shrinking as a consequence of decreasing friction. Consequently
	# porosity will decrease
	O.run(500,1)

O.save('compactedState'+key+'.yade.gz')
print "### Compacted state saved ###"

##############################
### DEVIATORIC LOADING ###
##############################

triax.internalCompaction=False

setContactFriction(radians(finalFricDegree))
triax.stressMask = 0
#now goal2 is the target strain rate
triax.goal2=0
triax.goal1=0
triax.goal3=0

from yade import ymport

mesh = 'coneplanosimulationmeters'
rod = O.bodies.append(ymport.stl('rod-'+mesh+'.stl',wire=False,material='walls'))

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Box_Aabb()]),
   InteractionLoop(
      # handle sphere+sphere and facet+sphere collisions
	[Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D()],
	[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,label="cohesiveIp")],
	[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True,label='cohesiveLaw')]
   ),
   NewtonIntegrator(gravity=(0,-9.81,0),damping=0.1),
   PyRunner(iterPeriod=100,command='myAddPlotData()'),
   GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
   triax,
   TriaxialStateRecorder(iterPeriod=100,file='pe'+table.key),

]

Thank you!
Luis

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.