how to fix pfacets

Asked by Hanying Zhang

hi all,

i want to simulate a 2D rectangular made of pfacets in which exist many sparse spheres, i need to add gravity so that they can fall down to a dense pack, the problem is that the pfacets fall down too...is there any way to fix these pfacets?

#------------------------------------------------how to fix pfacets--------------------------------------------------
#!/usr/bin/python
# -*- coding: utf-8 -*-
"Beam-like behaviour with cylinderConnections for roots interaction with spheres."
from yade.gridpfacet import *
from yade import pack, plot
from random import random
import numpy as np
from numpy import *
import math
import os

#parameters
mi,ma = (-500e-3,0.,0.),(500e-3,0,250e-3)
width = int(1000e-3),
height = int(250e-3),

#=============================meterials========================================
O.materials.append(FrictMat(young=4.0e6,poisson=.3,frictionAngle=30,density=2630e+6,label='sphereMat'))#for sphere

O.materials.append( CohFrictMat( young=3e8,poisson=0.15,density=910e6,frictionAngle=20,normalCohesion=3e100,shearCohesion=3e100,momentRotationLaw=True,label='gridNodeMat' ) )#for gridNodes
#O.materials.append(CohFrictMat(young=3e9,poisson=.15,density=910e6,frictionAngle=20,normalCohesion=1e40,shearCohesion=1e40,momentRotationLaw=True,label='gridNodeMat'))#for gridNodes
O.materials.append(FrictMat(young=4e6,poisson=0.3,density=10e1000,frictionAngle=20,label='pFacetMat')) #for pfacet

#==============================Engines=========================================
O.engines=[
 ForceResetter(),
 InsertionSortCollider([
  Bo1_Box_Aabb(),
  Bo1_Sphere_Aabb(),
  Bo1_GridConnection_Aabb(),
  Bo1_PFacet_Aabb(),
 ]),
 InteractionLoop([
  Ig2_Sphere_Sphere_ScGeom(),
  Ig2_Box_Sphere_ScGeom(),
  Ig2_GridNode_GridNode_GridNodeGeom6D(),
  Ig2_Sphere_GridConnection_ScGridCoGeom(),
  Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
  Ig2_GridConnection_PFacet_ScGeom(),
  Ig2_PFacet_PFacet_ScGeom(),
  Ig2_Sphere_PFacet_ScGridCoGeom()
 ],
 [
  Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False), # internal cylinder physics
  Ip2_FrictMat_FrictMat_FrictPhys() # physics for external interactions, i.e., cylinder-cylinder, sphere-sphere, cylinder-sphere
 ],
 [
  Law2_ScGeom_FrictPhys_CundallStrack(), # contact law for sphere-sphere
  Law2_ScGridCoGeom_FrictPhys_CundallStrack(), # contact law for cylinder-sphere
  Law2_ScGeom6D_CohFrictPhys_CohesionMoment(), # contact law for "internal" cylinder forces
  Law2_GridCoGridCoGeom_FrictPhys_CundallStrack() # contact law for cylinder-cylinder interaction
 ]
 ),
 GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.1,label='ts'),
 NewtonIntegrator(gravity=(0,0,-9.81),damping=0.5,label='newton'),
]

#=======================================pfacet=================================================
color=[255./255.,102./255.,0./255.]
r=0.002

O.bodies.append( gridNode([-500e-3, 5e-3,0],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([ 500e-3, 5e-3,0],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([ 500e-3,-5e-3,0],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([-500e-3,-5e-3,0],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([-500e-3, 5e-3,250e-3],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([ 500e-3, 5e-3,250e-3],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([ 500e-3,-5e-3,250e-3],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([-500e-3,-5e-3,250e-3],r,wire=False,fixed=True,material='gridNodeMat',color=color) )

O.bodies.append( gridConnection(0,1,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(2,3,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(2,1,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(2,0,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(3,0,r,color=color,material='gridNodeMat') )
O.bodies.append( pfacet(2,1,0,wire=False,material='pFacetMat',color=color) )
O.bodies.append( pfacet(2,0,3,wire=False,material='pFacetMat',color=color) )

O.bodies.append( gridConnection(4,5,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(5,6,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(6,7,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(7,4,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(4,6,r,color=color,material='gridNodeMat') )
O.bodies.append( pfacet(4,5,6,wire=False,material='pFacetMat',color=color) )
O.bodies.append( pfacet(4,6,7,wire=False,material='pFacetMat',color=color) )

O.bodies.append( gridConnection(1,5,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(2,6,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(1,6,r,color=color,material='gridNodeMat') )
O.bodies.append( pfacet(1,2,6,wire=False,material='pFacetMat',color=color) )
O.bodies.append( pfacet(1,6,5,wire=False,material='pFacetMat',color=color) )

O.bodies.append( gridConnection(0,4,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(3,7,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(0,7,r,color=color,material='gridNodeMat') )
O.bodies.append( pfacet(0,3,7,wire=False,material='pFacetMat',color=color) )
O.bodies.append( pfacet(0,7,4,wire=False,material='pFacetMat',color=color) )

#============================================Spheres==============================================================
#O.materials.append(FrictMat(young=4.0e6,poisson=0.5,frictionAngle=frictionAngle1,density=1600,label='spheremat'))
sp = yade.pack.SpherePack()
sp.makeCloud(mi,ma,porosity=0.7/1.7,psdSizes=[.00014,0.00016,0.00022,.0003,.00035],psdCumm=[0.,0.1,0.3,0.6,1.],num=3500)
spheres=sp.toSimulation(color=(0,0.5,0.7),material='sphereMat')
print "spheres"

#### Walls ####
O.materials.append(FrictMat(young=1.0e6,poisson=0.2,density=2.60e3,frictionAngle=20,label='wallmat'))
walls=aabbWalls((Vector3(-500e-3,-150e-3,-50e-3),Vector3(+500e-3,+150e-3,+250e-3)),thickness=.5e-3,material='wallmat')

for i in O.bodies:
        if isinstance(i.shape,Sphere):
         i.state.blockedDOFs="yXZ"
        if isinstance(i.shape,GridNode):
         i.state.blockedDOFs="yXZ"

#### For viewing ####
from yade import qt
qt.View()
Gl1_Sphere.stripes=True
#-------------------------------------------------------------------------------------------------------------------------

thanks.

Question information

Language:
English Edit question
Status:
Expired
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

this?
###
for i in O.bodies:
        if isinstance(i.shape,Sphere):
         i.state.blockedDOFs="yXZ"
        if isinstance(i.shape,GridNode):
         i.state.blockedDOFs="xyzXYZ" # HERE!
###
cheers
Jan

Revision history for this message
Hanying Zhang (xxxe) said :
#2

right.......(i am truly an idiot!

but, since i set
###
for i in O.bodies:
        if isinstance(i.shape,Sphere):
         i.state.blockedDOFs="yXZ"
###
spheres should fall on lower pfacet, why does they all fall out of rectangular?

thanks
bean

Revision history for this message
Jan Stránský (honzik) said :
#3

Sorry, here I don't know (I don't use pfacets myself)..
good luck
Jan

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#4

Hi,
I don't see any bottom in the "box" (actually just a frame), so I'm unsure where you expect the spheres to be stopped.
There seems to be something missing.
Bruno

p.s. You may want to post python3-friendly scripts, or better upgrade yade version on your side

print "spheres"
                  ^
SyntaxError: Missing parentheses in call to 'print'

Revision history for this message
Hanying Zhang (xxxe) said :
#5

Hi,

In this case "bottom" is the "bottom line" of the frame. Image a section of a 3D-triax sparse specimen after consolidation.That's what I want. Is this workable?

thanks.

Revision history for this message
Launchpad Janitor (janitor) said :
#6

This question was expired because it remained in the 'Open' state without activity for the last 15 days.