← Back to team overview

yade-users team mailing list archive

Re: [Question #701783]: How to assign material properties?

 

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

William posted a new comment:
the second script

#########################################
### Defining parameters and variables ####
#########################################

### Matrix material
Density1 = 2600
PoissonRatio1 = 0.5
frictionangle1 = 10
Young1 = 10e7
Num1 = 9000
Damp = 0.25

#Wall constants
WDensity = 0
WFrictionAngle = 0.0
WPoissonRatio = 0.5
WYoung = 50e9

#Packing variables
Size = 0.05
mn = Vector3(0, 0, 0)
mx = Vector3(Size, Size, Size)

#Confining variables
ConfPress = -190e3
ConfPress1 = ConfPress*0.9	# Pre-Compressure

########################################
#import necessary packages
from yade import pack,plot,os,timing
import matplotlib; matplotlib.rc('axes',grid=True)
import pylab

########################################
### Sample Preparing ###################
########################################


mat1 = O.materials.append(FrictMat(young=Young1,poisson=PoissonRatio1,frictionAngle=radians(frictionangle1),density=Density1,label='Matrix'))

#Create materials for spheres and plates
WallMat = O.materials.append(FrictMat(young = WYoung , poisson = WPoissonRatio , frictionAngle = radians(WFrictionAngle) , density = WDensity))
wallIds = O.bodies.append(aabbWalls([mn,mx] , thickness = 0.001 , material = WallMat))

sp = pack.SpherePack()
sp.makeCloud(minCorner=mn, maxCorner=mx, rMean=0.0001, rRelFuzz=0, num=Num1)
sp.toSimulation()

for b in O.bodies:
    if isinstance(b.shape,Sphere):
        if b.shape.radius==0.0001:
            b.shape.color = (0, 0, 1)
            b.mat=O.materials[mat1]

O.usesTimeStepper=True

O.trackEnerty=True

#################################
##### Defining triaxil engines ##
#################################

###First step: Compression#######
triax1 = TriaxialStressController(
	thickness = 0.001,
	internalCompaction = False,
	stressMask = 7,
	computeStressStrainInterval = 10,
	goal1 = ConfPress1,
	goal2 = ConfPress1,
	goal3 = ConfPress1,
)

newton = NewtonIntegrator(damping = Damp)

### engine ###
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()]
	),
	GlobalStiffnessTimeStepper(active = 1 , timeStepUpdateInterval = 100 , timestepSafetyCoefficient = 0.8 , defaultDt = 4*utils.PWaveTimeStep()),
	triax1,
	newton,
	PyRunner(realPeriod = 10 , command = 'checkUnbalanced()' , label = 'check'),
]

# Simulation stop conditions defination
def checkUnbalanced():
	unb = unbalancedForce()
	mStress = (triax1.stress(triax1.wall_right_id)[0] + triax1.stress(triax1.wall_top_id)[1] + triax1.stress(triax1.wall_front_id)[2])/3
	if unb<0.001 and abs(ConfPress1-mStress)/abs(ConfPress1)<0.01:
		print('----------1 Finished----------')
		print('----------Time:'+ str((time.time()-time0)/60) + 'min----------')
		O.save('1.yade.bz2')
		O.pause()

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