Re: [Yade-users] [Question #700743]: Errors during step-by-step particle deletion of consolidated specimen

2022-03-03 Thread Zheng
Question #700743 on Yade changed:
https://answers.launchpad.net/yade/+question/700743

Status: Answered => Solved

Zheng confirmed that the question is solved:
Thanks Bruno Chareyre, that solved my question.

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

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


Re: [Yade-users] [Question #700743]: Errors during step-by-step particle deletion of consolidated specimen

2022-02-27 Thread Zheng
Question #700743 on Yade changed:
https://answers.launchpad.net/yade/+question/700743

Status: Answered => Open

Zheng is still having a problem:
Hi Karol,

Thanks for your kind reply. My Yade version is Yade
20200613-3983~91b2a7a~xenial1, and the system is Ubuntu 16.04 LTS.

Yes as you mentioned, what disturbed me is why the simulation speed goes
down to zero without any error information.  It stopped at:

"8.0 % fines loss!
Current stress before deletion,  Matrix3(-99946.60764593209,10074.2958308337,0, 
10029.02119989909,-100044.9913662341,0, 0,0,0)
The amount of fines loss by number,  56
Current stress after deletion =  
Matrix3(-96483.58712874983,9117.338292722712,0, 
9256.196881197535,-95272.93317511432,0, 0,0,0)"

>From the output packing, there still exists some fine particles and the
simulation should maintaining running until all fine particles are
deleted. So strange.

Best,
Zheng

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

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


[Yade-users] [Question #700743]: Errors during step-by-step particle deletion of consolidated specimen

2022-02-25 Thread Zheng
New question #700743 on Yade:
https://answers.launchpad.net/yade/+question/700743

Hi all,

I am simulating the step-by-step fine particle deletion process of a 
consolidated gap-graded specimen in 2D case. The confining pressure is 
maintained constant during the deletion process. The initial fine content by 
mass is FC = 25%, and the 1% of fine particles are randomly deleted at each 
loop. After 25 loops, all fine particles should be deleted as expected. 

At the first several loop of my case, fine particles can be deleted correctly. 
However, the simulation suspend after fine loss = 8% though there still many 
fines in the specimen. It seems that the confining pressure cannot be 
re-achieved after several particle deletions?  Attached please see a simple 
case to reproduce the ERROR. Could you please help to see where is the problem. 
 

Many thanks and best regards,
Zheng

 Code below 

from yade import pack,plot,export
import matplotlib.pyplot as plt
import numpy as np
import random

O.materials.append(FrictMat(young=6.e8,poisson=.8,frictionAngle=.0))

sigmaIso=-1e5
sp = pack.SpherePack()
size = 0.24
# 25% fines in 2d case.
sp.makeCloud(minCorner=(0,0,.05),maxCorner=(size,size,.05),psdSizes=[0.001,0.0012,0.005,0.006],
 
psdCumm=[0,0.0625,0.0625,1.0],periodic=True,seed=1,distributeMass=True,num=1500)
 

maxFine = 0.0012 # maximum diameter of fine particles
sp.toSimulation()
O.cell.hSize = Matrix3(size,0,0, 0,size,0, 0,0,.1) # used for periodic 
boundaries.
massAll = 0
massEroded = 0

for p in O.bodies:
   p.state.blockedDOFs = 'zXY' 
   p.state.mass = 2650 * 0.1 * pi * p.shape.radius**2 # 0.1 = thickness
   inertia = 0.5 * p.state.mass * p.shape.radius**2
   p.state.inertia = (.5*inertia,.5*inertia,inertia)
   massAll += p.state.mass # mass of all particles

O.dt = utils.PWaveTimeStep()

O.engines = [
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb()]),
   InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
   ),
   PeriTriaxController(
  dynCell=True,
  goal=(-1e5,-1e5,0),
  stressMask=3,
  relStressTol=.001,
  maxUnbalanced=.1,
  maxStrainRate=(.5,.5,.0),
  doneHook='delFine()',
  label='biax'
   ),
   NewtonIntegrator(damping=.1),
]


delperc = range(1,25,1)
delperc = [x/100 for x in delperc]
n = 0
def delFine():
   global delperc,n,massEroded
   #global n
   #global massEroded 
   if  n < len(delperc):
  print('Current stress before deletion, ',getStress())
  setContactFriction(0.5)
  bodyRadius=[]
  for b in O.bodies:
if b.shape.radius<=maxFine/2: 
 bodyRadius.append([b.id,b.shape.radius,b.state.mass])
  bodyRadius.sort(key=lambda x:x[1]) 
  i = 0  
  for b in bodyRadius:
if massEroded <= delperc[n]*massAll: 
   global massEroded
   massEroded += b[2]
   O.bodies.erase(b[0]) 
   i+=1
else: 
   break 
  print('The amount of fines loss by number, ',i)
  print('Current stress after deletion = ',getStress())
  # when the simulation finish?
  if i == 0:
print(delperc[n]*100,'% fines loss!')
O.save(str(int(delperc[n]*100))+'.yade.gz')
n += 1
   if n == len(delperc):
  biax.doneHook='Finished()'  

def Finished():
   print('Test Finished')
   O.pause()

O.run()
O.wait()

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

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


Re: [Yade-users] [Question #699565]: Obtain the contact number of each particles in the primary fabric (only consider large contact force pairs)

2021-11-21 Thread Zheng
Question #699565 on Yade changed:
https://answers.launchpad.net/yade/+question/699565

Status: Answered => Solved

Zheng confirmed that the question is solved:
Thanks Karol Brzezinski, that solved my question.

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

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


[Yade-users] [Question #699565]: Obtain the contact number of each particles in the primary fabric (only consider large contact force pairs)

2021-11-20 Thread Zheng
New question #699565 on Yade:
https://answers.launchpad.net/yade/+question/699565

Hi all,

In my simulation, I want to calculate the contact number of each particles in 
the primary fabric (only consider the contact pairs larger than the average 
contact force).

 To obtain the average contact force (avgForce), I use the following and it 
works OK:  
   for i in O.interactions:
  fn = i.phys.normalForce.norm()
  forceInact.append([i,fn])
  forceInact=np.array(forceInact)
  avgForce=sum(forceInact[:,1]/len(forceInact[:,1]) 

To get the contact number of each particles , I use:
 for b in O.bodies:
len(b.intrs())

However, as my question above, how to give a criteria to obtain the contact 
number of each particles by considering the contact pairs with large contact 
forces only?

Thanks,

Zheng





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

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


Re: [Yade-users] [Question #692152]: Output packing of all gauss points using FEMxDEM

2020-08-09 Thread Zheng
Question #692152 on Yade changed:
https://answers.launchpad.net/yade/+question/692152

Status: Open => Solved

Zheng confirmed that the question is solved:
Thanks for your attention. The command 'Omega().tag['d.id']' will indeed
output the long file names. The reason for the limted file numbers may
be due to the same file names while outputing the packings. I have made
some modifications and output the Gauss point IDs in 'msFEM2D.py' file
to solve this.

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

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


[Yade-users] [Question #692153]: Output packing of all gauss points using FEMxDEM

2020-07-30 Thread Zheng
New question #692153 on Yade:
https://answers.launchpad.net/yade/+question/692153

Hi all,

I just moved to a new workstation and reinstalled my Yade, Escript and Python 
from the old python 2.x to python 3.x. The new versions are Python 3.5, Escript 
5.5 and the newest YADE-source, respectively.

When I run the FEMxDEM example, i..e 'biaxialSmooth.py' and tried to output the 
current DEM packing at each gauss points, I found the output files are named, 
'packing_20200731T111611p38210_1.yade.gz' ... and there are totally 32 files in 
the folder 'result/packing'. However, in the tested case, there are totally 
8*16 FEM meshes, and should be totally 8*16*4 = 512 gauss points. What do these 
32 files represent? How to output all 512 DEM packing?

In the older version using python 2.x (I installed last year in an old 
workstation), everything goes well and all 512 packings can be outputted 
directly. What has been changed in the new version of YADE? 

Thanks for your help.

Best,
Zheng

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

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


[Yade-users] [Question #692152]: Output packing of all gauss points using FEMxDEM

2020-07-30 Thread Zheng
New question #692152 on Yade:
https://answers.launchpad.net/yade/+question/692152

Hi all,

I just moved to a new workstation and reinstalled my Yade, Escript and Python 
from the old python 2.x to python 3.x. The new versions are Python 3.5, Escript 
5.5 and the newest YADE-source, respectively.

When I run the FEMxDEM example, i..e 'biaxialSmooth.py' and tried to output the 
current DEM packing at each gauss points, I found the output files are named, 
'packing_20200731T111611p38210_1.yade.gz' ... and there are totally 32 files in 
the folder 'result/packing'. However, in the tested case, there are totally 
8*16 FEM meshes, and should be totally 8*16*4 = 512 gauss points. What do these 
32 files represent? How to output all 512 DEM packing?

In the older version using python 2.x (I installed last year in an old 
workstation), everything goes well and all 512 packings can be outputted 
directly. What has been changed in the new version of YADE? 

Thanks for your help.

Best,
Zheng

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

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


Re: [Yade-users] [Question #683384]: After deletion of particles, why the output of particle number remains unchanged

2019-09-17 Thread zheng
Question #683384 on Yade changed:
https://answers.launchpad.net/yade/+question/683384

Status: Answered => Solved

zheng confirmed that the question is solved:
Thanks Robert Caulk, that solved my question.

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

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


[Yade-users] [Question #683384]: After deletion of particles, why the output of particle number remains unchanged

2019-08-26 Thread zheng
New question #683384 on Yade:
https://answers.launchpad.net/yade/+question/683384

Hi all,

In my case, I want to simulate the progressive loss of fine particles in the 
soil assembly, the code for this case is attached as follows. After running 
1000 steps, we can see the fines indeed get lost from the visualization. 
However, when using command "len(O.bodies)" in the terminal, we get the 
particle number remains unchanged. i.e. n=400. How can I monitor and output the 
instaneous particle number during simulation? Thanks very much!

Best,
Zheng

# the code as follows  

from yade import pack,plot,qt,export
import matplotlib.pyplot as plt
import numpy as np
import random

#O.materials.append(FrictMat(young=6.e8,poisson=.8,frictionAngle=.0))
O.materials.append(CohFrictMat(young=1e9,poisson=.8,frictionAngle=.0,normalCohesion=1e6,shearCohesion=1e6,momentRotationLaw=False,etaRoll=.1,label='spheres'))

sigmaIso=-1e5
sp = pack.SpherePack()
size =0.24
sp.makeCloud(minCorner=(0,0,.05),maxCorner=(size,size,.05),rMean=.005,rRelFuzz=.4,num=400,periodic=True,seed=1)
 # initial 400
#sp.makeCloud(minCorner=(0,0,.05),maxCorner=(size,size,.05),psdSizes=[0.006,0.0068,0.0072,0.0084,0.0092,0.01,0.0108,0.0116,0.0124,0.0132,0.014],
 psdCumm=[0,0.1,0.2, 
0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0],periodic=True,seed=1,distributeMass=False)#num=400,
# if minCorner[k]=maxCorner[k] for one coordinate, it means 2D case;
sp.toSimulation()
O.cell.hSize = Matrix3(size,0,0, 0,size,0, 0,0,.1) # used for periodic 
boundaries.
#print len(O.bodies)
for p in O.bodies:
   p.state.blockedDOFs = 'zXY' # a sphere can be made to move only in xy plane
   p.state.mass = 2650 * 0.1 * pi * p.shape.radius**2 # 0.1 = thickness of 
cylindrical particle
   inertia = 0.5 * p.state.mass * p.shape.radius**2
   p.state.inertia = (.5*inertia,.5*inertia,inertia)

O.dt = utils.PWaveTimeStep()
print O.dt

O.engines = [
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb()]),
   InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom6D()],
  [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
  [Law2_ScGeom6D_CohFrictPhys_CohesionMoment(always_use_moment_law=False)]
   ),
   PeriTriaxController(
  dynCell=True,
  goal=(sigmaIso,sigmaIso,0),
  stressMask=3,
  relStressTol=.001,
  maxUnbalanced=.001,
  maxStrainRate=(.5,.5,.0),
  doneHook='shear()',# function to run when finished
  label='biax'
   ),
   NewtonIntegrator(damping=.1),
   PyRunner(command='delByNum()',iterPeriod=100),
   PyRunner(command='addPlotData()',iterPeriod=100),
   #PyRunner(command='deleteFines()',iterPeriod=100),
   #PyRunner(command='delBelowPerc()',iterPeriod=1),
   #PyRunner(command='print ')
]

plot.live=True
plot.plots={'iter':('sxx','syy'),'iter_':('exx','eyy'),'iter':('poros')}

def addPlotData():
   plot.addData(
iter=O.iter,iter_=O.iter,
sxx=biax.stress[0],syy=biax.stress[1],
exx=biax.strain[0],eyy=biax.strain[1],
Z=avgNumInteractions(),
Zm=avgNumInteractions(skipFree=True),
poro=porosity(),
unbalanced=utils.unbalancedForce(),
t=O.time
   )
   
plot.saveDataTxt('results',vars=('t','exx','eyy','sxx','syy','Z','Zm','poro'))

"""
# delete fines by percent
def delBelowPerc():
   bodyRadius=[]
   for b in O.bodies:
 if b.shape.radius<=0.005:
 #if isinstance(b.shape,Sphere):
  bodyRadius.append([b,b.shape.radius])
   bodyRadius.sort(key=lambda x:x[1])
   if len(bodyRadius)>1:
maxRad=np.percentile(bodyRadius,10)
for b in bodyRadius:
 if b[0].shape.radius<=maxRad:
  O.bodies.erase(b[0].id)
"""

def delByNum():
   setContactFriction(0.5)   
   bodyRadius=[]
   for b in O.bodies:
 if b.shape.radius<=0.005: # define fine particles
 #if isinstance(b.shape,Sphere):
  bodyRadius.append([b,b.shape.radius])
   bodyRadius.sort(key=lambda x:x[1])
   l=len(bodyRadius) # how many fine particles
   perc=0.1
   delNum=int(l*perc) # how many number to be deleted
   list=random.sample(bodyRadius,delNum) # list to be deleted   
   for b in list:
O.bodies.erase(b[0].id) 
   print 'delete fines'   
   #biax.doneHook='shear()' 

"""
def deleteFines():
   #new added here by Zheng 0422
   bodiesToBeDeleted=[]
   for b in O.bodies:
if b.shape.radius<=0.004:
 bodiesToBeDeleted.append(b)
   for b in bodiesToBeDeleted:
O.bodies.erase(b.id)
   #new added here by Zheng 0422

def term0():
   print getStress()
   biax.goal=(-10,-10,0)
   biax.doneHook='term()'

def term1(): # delete a determined percent of fines after consolidation and 
then reconsolidation
   bodyRadius=[]
   for b in O.bodies:
 if b.shape.radius<=0.005: # define fine particles
 #if isinstance(b.shape,Sphere):
  bodyRadius.append([b,b.shape.radius])
   bodyRadius.sort(key=lambda x:x[1])
   l=len(bodyRadius) # how many fine particles
   perc=0.3
   delNum=int(l*perc) # how many number to be deleted
   list=

Re: [Yade-users] [Question #462863]: Cohesive triaxial

2019-05-28 Thread zheng
Question #462863 on Yade changed:
https://answers.launchpad.net/yade/+question/462863

zheng posted a new comment:
Hi all,

I am a little confused on cohesion setting of particles. As I read the
above code, does it mean:

1. when we use: [Laws_ScGeom6D_CohFrictPhys_CohesionMoment()], the cohesion 
between particles is not activated;
2. the cohesion is only activated when we use 
"O.engines[2].phyDispatcher.functors[0].setCohesionNow = True"

Am I correct? Please correct me if I make a mistake. Thanks so much.

Best,
Zheng

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

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


Re: [Yade-users] [Question #680375]: How to delete 10% percent of small particles?

2019-04-24 Thread zheng
Question #680375 on Yade changed:
https://answers.launchpad.net/yade/+question/680375

Status: Answered => Solved

zheng confirmed that the question is solved:
Thanks Robert Caulk, that solved my question.

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

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


Re: [Yade-users] [Question #680375]: How to delete 10% percent of small particles?

2019-04-23 Thread zheng
Question #680375 on Yade changed:
https://answers.launchpad.net/yade/+question/680375

Status: Answered => Open

zheng is still having a problem:
Thanks Caulk and Jan, this solved most of my question. However, deleting
particles by sizes may not be suitable for all cases. For example, how
to delete 10% of particles by number if I only have one particle size?
This time the "percentile(a,q)” may not work. Could you please give me
any clues? Thanks so much.

Best regards,
Zheng

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

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


[Yade-users] [Question #680375]: How to delete 10% percent of small particles?

2019-04-22 Thread zheng
New question #680375 on Yade:
https://answers.launchpad.net/yade/+question/680375

Dear all,

I am very new in Yade. In my simulation, I have a polydisperse particle size 
distribution, from size 0.2~1.0mm. Thanks to this poster: 
https://answers.launchpad.net/yade/+question/211937, I now know how to delete 
all particles with a certain diameter or position.

Now I need to delete 10% of the smallest particles (d=0.2mm) every 100 steps, 
but I cannot figure out how to realize this function? Could anyone please give 
me any clues? Thanks so much!

Best regards,
Zheng

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

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