← Back to team overview

yade-users team mailing list archive

Re: [Question #453606]: Capillary model

 

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

Amiya Prakash Das posted a new comment:
# generate loose packing
from yade import pack, qt, plot

#some parameters:
young_modulus=5e6
friction		= 0.5
angle			= atan(friction)
local_damping 	= 0.01
viscous_normal	= 0.021
viscous_shear	= 0.8*viscous_normal
lowercorner		= Vector3(0,0,0)
uppercorner		= Vector3(.05,.05,.05)
key ='_triax_base_',

#creating a material (FrictMat):
O.materials.append(FrictMat(young=young_modulus,poisson=0.5,frictionAngle=angle,density=2600,label='spheres'))

#SphereMat=O.materials[id_SphereMat]
O.materials.append(FrictMat(young=young_modulus,poisson=0.5,frictionAngle=0,density=0,label='walls'))

#generate boundary:
walls=aabbWalls([lowercorner,uppercorner],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

#generate particles:
sp=pack.SpherePack()

sp.makeCloud(lowercorner,uppercorner,.002,rRelFuzz=.3)
O.bodies.append([sphere(c,r,material='spheres') for c,r in sp])


triax=TriaxialStressController(thickness = 0,
			       stressMask = 7,
			       internalCompaction=False, # If true the confining pressure is generated by growing particles
        		       goal1=-1e06,
                               goal2=-1e06,
                               goal3=-1e06,
                               max_vel=0.01,
        
)

#define engines:

O.engines=[
		ForceResetter(),
		InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
		InteractionLoop(
			[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
			[Ip2_FrictMat_FrictMat_CapillaryPhys()],	#for linear model only
			[Law2_ScGeom_FrictPhys_CundallStrack()],	#for linear model only
		),
		Law2_ScGeom_CapillaryPhys_Capillarity(capillaryPressure=10000),#for linear model only
		GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
                triax,
		NewtonIntegrator(damping=local_damping),
                PyRunner(command='addPlotData()',iterPeriod=100)
]


def addPlotData():
   plot.addData(
      i=O.iter,
      s11=-triax.stress(triax.wall_right_id)[0],s22=-triax.stress(triax.wall_top_id)[1],s33=-triax.stress(triax.wall_front_id)[2],
      e11=-triax.strain[0],e22=-triax.strain[1],e33=-triax.strain[2], poro=utils.porosity(), stress=-triax.meanStress,
               )

#set time step and run simulation:
O.dt=0.5*PWaveTimeStep()

plot.plots={'i ':('s11','s22','s33'),' i':('e11','e22','e33'),
'stress':('poro')}

#show the plot
plot.plot()

#save the plot
plot.saveDataTxt('Porosity.txt',vars=('i','s11','s22','s33','e11','e22','e33','poro','stress'))

from yade import qt
qt.View()
print('Press PLAY button')

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