Hi, Vaclav!

I want to ask you to look at my script.
I have spent a lot of hours to define what is wrong there, but it seems I am
not be able to do it without your help.

It is a simple press-test. When it starts "at once", at the end of the
pressing specimen explodes. It is not normal for me.
But when I press "reload" button, It works as I await.

Could you not give me an advice, why is it happen? I think it is connected
with distanceFactor and my not clear understanding the issue.

Thank you for your help.

______________________________
[ENG] Best Regards
[GER] Mit freundlichen Grüßen
[RUS] С наилучшими пожеланиями
[UKR] З найкращими побажаннями

Anton Gladkyy
from yade import pack
from yade import utils
from math import *
import yade.plot

utils.readParamsFromTable(intRadiusInput=1.5,noTableOk=True)



#_______________________________________________________________________
PI = 3.14159265;
  
a = 50 #Size a, [mm] X
b = 50 #Size b, [mm] Y
h = 100 #Size h, [mm] Z

grainSize = 10 #Grain size, [mm]
distBetweenGrains = 0 #Distance between grains, [mm]

rho=2500 #Grain density, [kg/m^3]
poisson = 0.3 #Poisson coefficient
young = 37e9 #Young module
frictionAngle = 0.52 # Friction angle
stressCompressMax = 100e6
Brittleness = 0.07
intRadius = intRadiusInput

boxThick = 3 #Box thickness, [mm]
boxHeight = 10 #Box height, [mm]
boxCoef = 3 #In how many times box larger, than an example
pressCoef = 5 #In how many times press larger, than an example
#_______________________________________________________________________
a = 0.001*a
b = 0.001*b
h = 0.001*h
grainSize = 0.001*grainSize
radiusGrain = grainSize/2
distBetweenGrains = 0.001*distBetweenGrains
boxThick = 0.001*boxThick
boxHeight = 0.001*boxHeight
n2Mpa=PI*((a)**2)/4*1000000
predictedForce = n2Mpa/1000000*stressCompressMax


physClass = 'RpmMat'

#_______________________________________________________________________


kw={'density':rho,'young':young,'poisson':poisson,'frictionAngle':frictionAngle,'physParamsClass':physClass,'stressCompressMax':stressCompressMax,'Brittleness':Brittleness}

kw_facets={'frictionAngle':frictionAngle,'color':[0.98,0.984,0.576],'young':young,'dynamic':False,'physParamsClass':physClass}
kw_press={'frictionAngle':frictionAngle,'color':[0.757,0.278,0.976],'young':young,'dynamic':False,'physParamsClass':physClass, 'wire':False, 'exampleNumber':5}


ids_spheres=O.bodies.append(pack.regularHexa(pack.inCylinder((0,0,-boxHeight/2*boxCoef),(0,0,-boxHeight/2*boxCoef+h),a),radius=radiusGrain,gap=distBetweenGrains,color=(0.282,0.875,1),exampleNumber=1,initCohesive=True,**kw))



#Find the hihghest and the lowest sphere
maxHightSphere=O.bodies[ids_spheres[0]].phys.pos[2]
minHightSphere=O.bodies[ids_spheres[0]].phys.pos[2]
for i in ids_spheres:
	if (O.bodies[i].phys.pos[2]>maxHightSphere):
		maxHightSphere=O.bodies[i].phys.pos[2]
	if (O.bodies[i].phys.pos[2]<minHightSphere):
		minHightSphere=O.bodies[i].phys.pos[2]
	


minHight = minHightSphere-radiusGrain
maxHight = maxHightSphere+radiusGrain
realHight = maxHight-minHight

#box
O.bodies.append(utils.facetBox((0,0,(realHight/2+minHight)),(a*boxCoef,b*boxCoef,realHight/2),wallMask=31,exampleNumber=10,**kw_facets))

#press
id_press=O.bodies.append(utils.facet([[(1.5*a*pressCoef),0,maxHight],[(-a/2*pressCoef),(b*pressCoef),(maxHight)],[(-a/2*pressCoef),(-b*pressCoef),(maxHight)]],**kw_press))


#_______________________________________________________________________


try:
	from yade import qt
	qt.Controller()
except ImportError: pass

O.engines=[
	BexResetter(),
	BoundingVolumeMetaEngine([InteractingSphere2AABB(aabbEnlargeFactor=intRadius,label='is2aabb'),InteractingFacet2AABB(),MetaInteractingGeometry2AABB()]),
	InsertionSortCollider(),
	InteractionDispatchers(
		[ef2_Sphere_Sphere_Dem3DofGeom(distanceFactor=intRadius,label='ss2d3dg'),ef2_Facet_Sphere_Dem3DofGeom()],
		[Ip2_RpmMat_RpmMat_RpmPhys()],
		[Law2_Dem3DofGeom_RockPMPhys_Rpm()]
	),
  GravityEngine(gravity=[0,0,-9.81]),
	NewtonsDampedLaw(damping=0.15),
	PressTestEngine(translationAxis=[0,0,1],velocity=-0.1,subscribedBodies=[id_press], numberIterationAfterDestruction=300, predictedForce=predictedForce),
	PeriodicPythonRunner(iterPeriod=5,iterLim=10000,command='myAddPlotData()',label='plotDataCollector')

]

#______________________________________________________________________PLOT___________________________________________________

yade.plot.plots={'Eps':('Sigma')}


maxSigma=0
Eps_calcPrev=0

def myAddPlotData():
	## store some numbers under some labels
	global stressCompressMax
	global h
	global maxSigma
	global startPressRecordHight
	global Sigma_calcPrev
	global Sigma_calc
	global Eps_calc
	global Eps_calcPrev
	
	press=O.bodies[id_press]
	
	Sigma_calc=((O.bex.f(id_press)[2])/n2Mpa)

	
	if ((maxSigma==0)&(Sigma_calc>0)):
		startPressRecordHight = press.phys.pos[2]
		maxSigma=Sigma_calc
	
	if (maxSigma>0):
		Eps_calc=(startPressRecordHight-press.phys.pos[2])/h
		if (Eps_calc>Eps_calcPrev):
			yade.plot.addData(Eps=Eps_calc,Sigma=Sigma_calc)
			Sigma_calcPrev = Sigma_calc
			Eps_calcPrev = Eps_calc
			if (Sigma_calc>maxSigma):
				maxSigma=Sigma_calc
	
		

#______________________________________________________________________PLOT___________________________________________________

O.dt=utils.PWaveTimeStep()
#O.dt=0.000001
O.saveTmp('init')
from yade import qt
qt.Controller()

# to create initial contacts

O.step() 
O.step()

# now reset the interaction radius and go ahead
ss2d3dg['distanceFactor']=1.
is2aabb['aabbEnlargeFactor']=1.



# This is for multi-tasks
O.run()
qt.View()
O.wait()


file('multi.out','a').write('%s %g %g %g %g %g\n'%(O.tags['description'],intRadiusInput, maxSigma, O.iter, O.realtime, (O.iter/O.realtime)))
yade.plot.saveGnuplot(O.tags['description'])


_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : yade-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to