[Yade-users] [Question #684130]: local variable 'compFricDegree' referenced before assignment

2019-09-22 Thread Rong Zhao
New question #684130 on Yade:
https://answers.launchpad.net/yade/+question/684130

Hello, everyone!
I am trying to specify porosity value after the compaction in periodic triaxial 
test base on the following codes, but there is something wrong with it. 
First, I am not sure whether porosity can be specified after the compaction in 
a periodic triaxial test like the example of the triaxial test using 
TriaxialStressController. 

Second, when I try to realize it in the periodic triaxial test using 
PeriTriaxController(), there is something wrong with it( local variable 
'compFricDegree' referenced before assignment). Here is my conde.
# Specify the porosity in periodic triaxial test

from yade import pack, qt, plot

sigmaIso=-1e5
targetPorosity = 0.3
compFricDegree = 30
young = 5e6
num_spheres = 1000
mn, mx = Vector3(0,0,0), Vector3(1,1,1)

# generate loose packing

O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
O.periodic=True
sp=pack.SpherePack()
sp.makeCloud(mn,mx,-1,0.,num_spheres,False, 0.95,seed=1) 
sp.toSimulation()

# Set simulation loop
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
PeriTriaxController(label='triax',
# specify target values and whether they are strains or stresses
goal=(sigmaIso,sigmaIso,sigmaIso),stressMask=7,
# type of servo-control
dynCell=True,maxStrainRate=(10,10,10),
# wait until the unbalanced force goes below this value
maxUnbalanced=.1,relStressTol=1e-3,
# call this function when goal is reached and the packing is 
stable
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=.2),
]

O.dt=.5*PWaveTimeStep()

def compactionFinished():
print('Compaction Finished')
O.pause()
pc = utils.porosity()
print("Porosity after compaction: " + str(pc))
# Reach a Specified Porosity precisely
import sys #this is only for the flush() below
while pc > targetPorosity:
# we decrease friction value and apply it to all the bodies and 
contacts
compFricDegree = 0.95*compFricDegree
setContactFriction(radians(compFricDegree))
pc = utils.porosity()
print "\r Friction: ",compFricDegree," porosity:",utils.porosity()
sys.stdout.flush()
O.run(500,1)
return pc

Thanks!


-- 
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 #684126]: Calculate micro strain field in 2D using TesselationWrapper

2019-09-22 Thread JIPEIQI
Question #684126 on Yade changed:
https://answers.launchpad.net/yade/+question/684126

JIPEIQI gave more information on the question:
sym_grad_u_total_g (wrong averaged strain):
0 0 0 
0 0 0 
0 0 0 

Total volume = 0, grad_u = 
0 0 0 
0 0 0 
0 0 0 

sym_grad_u (true average strain): 
0 0 0 
0 0 0 
0 0 0 

Macro strain : 
0 0 0 
0 0 0 
0 0 0 

here is the result when you use computeDeformations().   The strange
thing is that the total volume is zero.  but the volume of each cell is
not (when you get the volume of each cell using TW.volume(b.id), for
example)

-- 
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 #684126]: Calculate micro strain field in 2D using TesselationWrapper

2019-09-22 Thread JIPEIQI
New question #684126 on Yade:
https://answers.launchpad.net/yade/+question/684126

I want to calculate the micro strain field in a 2D simulation, but the results 
of micro strain seems to be zero because the volume of each voronoi cell is 
zero. Any advice?

-- 
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 #683427]: I don not understand how to simulate triaxial-test in Yade.

2019-09-22 Thread Rong Zhao
Question #683427 on Yade changed:
https://answers.launchpad.net/yade/+question/683427

Status: Answered => Open

Rong Zhao is still having a problem:
Thanks for your reply, Bruno Chareyre! I almost understand the code of
Periodic Triaxial Test in the tutorial.  But there is something I don't
understand.  When the function of compactionFinished() being called,
this virtually is to make loading, but why is triax.maxUnbalanced is
specified to 10  after calling the function of triaxFinished()?

-- 
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 #684027]: How to use MatchMaker for two Ip2

2019-09-22 Thread Leonard
Question #684027 on Yade changed:
https://answers.launchpad.net/yade/+question/684027

Status: Answered => Open

Leonard is still having a problem:
Thanks Robert, this indeed simplifies the code.
Follow your suggestion, like below:
sand=O.materials.append(CohFrictMat(isCohesive=False,..., label='sand'))
cement=O.materials.append(CohFrictMat(isCohesive=True,...,label='cement'))

I wonder, is there any cohesion for sand-cement contact since only one
of them is cohesive?

Leonard

-- 
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 #684117]: Bug in Calculating getSaturation in TwoPhaseFlow Engine

2019-09-22 Thread Saeed
Question #684117 on Yade changed:
https://answers.launchpad.net/yade/+question/684117

Status: Solved => Open

Saeed is still having a problem:
hi there,
I am adding these codes to the loading section also made no difference and 
degree of saturation not changed!

for i in arange(0,len(loadingMatrix),1):
 triax.goal2=loadingMatrix[i]
 O.run(2000,True)
 unsat.invasion()
 unsat.computeCapillaryForce()
 for b in O.bodies:
O.forces.setPermF(b.id, unsat.fluidForce(b.id))
 print 'Load:',loadingMatrix[i],' Sw:',unsat.getSaturation(False),' 
VoidVolume:',triax.porosity*triax.boxVolume

-- 
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 #684117]: Bug in Calculating getSaturation in TwoPhaseFlow Engine

2019-09-22 Thread Saeed
Question #684117 on Yade changed:
https://answers.launchpad.net/yade/+question/684117

Saeed gave more information on the question:
hi there,
I am adding some codes to the loading section also made no difference and 
degree of saturation not changed!

loadingMatrix=[-500e3,-1000e3,-1500e3,-2000e3,-2500e3,-3000e3]
for i in arange(0,len(loadingMatrix),1):
 triax.goal2=loadingMatrix[i]
 O.run(2000,True)
 unsat.invasion()
 unsat.computeCapillaryForce()
 for b in O.bodies:
O.forces.setPermF(b.id, unsat.fluidForce(b.id))
 print 'Load:',loadingMatrix[i],' Sw:',unsat.getSaturation(False),' 
VoidVolume:',triax.porosity*triax.boxVolume

-- 
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 #684117]: Bug in Calculating getSaturation in TwoPhaseFlow Engine

2019-09-22 Thread Saeed
Question #684117 on Yade changed:
https://answers.launchpad.net/yade/+question/684117

Status: Open => Solved

Saeed confirmed that the question is solved:
hi there,
I am adding these codes to the loading section also made no difference and 
degree of saturation not changed!

for i in arange(0,len(loadingMatrix),1):
 triax.goal2=loadingMatrix[i]
 O.run(2000,True)
 unsat.invasion()
 unsat.computeCapillaryForce()
 for b in O.bodies:
O.forces.setPermF(b.id, unsat.fluidForce(b.id))
 print 'Load:',loadingMatrix[i],' Sw:',unsat.getSaturation(False),' 
VoidVolume:',triax.porosity*triax.boxVolume

-- 
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 #684117]: Bug in Calculating getSaturation in TwoPhaseFlow Engine

2019-09-22 Thread Saeed
New question #684117 on Yade:
https://answers.launchpad.net/yade/+question/684117

hi,
I had a problem using "TwoPhaseFlow Engine" in 'Yadedaily 
2018.02b-290bf6a54e~xenial' and 'Yade-2019.01a'.
The value of Saturation Degree 'getSaturation(False)' was shown properly while 
doing drainage,but after the dry completed, I close the pressure related to 
water in bottom of box by 'bndCondIsPressure=[0,0,0,1,0,0]' . I provide 
Oedometer conditions for the loading.

According to the formula:
Porosity=VolumeOfVoids/BoxVolume
VoidVolumes=Porosity*BoxVolume

The volume of Voids containing the air and Water.
We have blocked the way out water by 'bndCondIsPressure=[0,0,0,1,0,0]' While 
Loading, So Volume of Water while loading is Constant.
And only the volume of air in the ٰVoid decreases by increasing loading.

According to the formula:
DegreeOfSaturation=VolumeOfWater/VolumeOfVoids

while Oedometer loading:
VolumeOfWater > Constant
VolumeOfVoids > Decresed

So DegreeOfSaturation must be Increased that The same is true with the 
laboratory results and the literature
but in TwoPhaseFlow Engine Degree of Saturation No changed  while loading!!!
---
CODE:

import matplotlib; matplotlib.rc('axes',grid=True)
from yade import pack
import pylab
from numpy import *

compFricDegree = 30.0
confiningS=-1e5
psdSizes,psdCumm=[.599,0.6,0.849,0.85,1.0,1.40],[0.,0.35,0.35,0.70,.70,1.]
sp=pack.SpherePack()
mn,mx=Vector3(0,0,0),Vector3(10,10,10)
sp.makeCloud(minCorner=mn,maxCorner=mx,psdSizes=psdSizes,psdCumm=psdCumm,distributeMass=True,num=1000,seed=1)

O.materials.append(FrictMat(young=15e7,poisson=.4,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
O.materials.append(FrictMat(young=15e7,poisson=.4,frictionAngle=0,density=0,label='frictionless'))

walls=aabbWalls((mn,mx),thickness=0,material='frictionless')
wallIds=O.bodies.append(walls)

O.bodies.append([utils.sphere(center,rad,material='spheres') for center,rad in 
sp])

triax=TriaxialStressController(
 internalCompaction=True,
 goal1=confiningS,
 goal2=confiningS,
 goal3=confiningS,
 max_vel=10,
 label="triax"
)

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),
 triax,
 NewtonIntegrator(damping=0.4,label="newton"),
 TwoPhaseFlowEngine(label="unsat")
]

while 1:
  O.run(1000,True)
  unb=unbalancedForce()
  if unb<0.01 and abs(triax.goal1-triax.meanStress)/abs(triax.goal1)<0.01:
break

##
## Drainage Test under oedometer conditions #
##
triax.stressMask=2
triax.goal1=triax.goal3=0
goalTop=triax.stress(3)[1]
triax.goal2=goalTop
triax.wall_bottom_activated=0

meanDiameter=(O.bodies[-1].shape.radius + O.bodies[6].shape.radius) / 2.
unsat.bndCondIsPressure=[0,0,1,1,0,0]
unsat.bndCondValue=[0,0,-1e8,0,0,0]
unsat.isPhaseTrapped=True
unsat.initialization()
unsat.surfaceTension = 10

for pg in arange(1.0e-5,5.0,0.1):
  unsat.bndCondValue=[0,0,(-1.0)*pg*unsat.surfaceTension/meanDiameter,0,0,0]
  unsat.invasion()
  unsat.computeCapillaryForce()
  for b in O.bodies:
O.forces.setPermF(b.id, unsat.fluidForce(b.id))
  while 1:
O.run(1000,True)
unb=unbalancedForce()
if unb<0.01:
  break
  print 'Drainage:::','PC:',-unsat.bndCondValue[2],' 
Sw:',unsat.getSaturation(False),' VoidVolume:',triax.porosity*triax.boxVolume

print '--LOADING--'
## Oedometer conditions
unsat.bndCondIsPressure=[0,0,0,1,0,0]
triax.stressMask=2
triax.goal1=triax.goal3=0
goalTop=triax.stress(3)[1]
triax.goal2=goalTop
triax.wall_bottom_activated=False
loadingMatrix=[-500e3,-1000e3,-1500e3,-2000e3,-2500e3,-3000e3]
for i in arange(0,len(loadingMatrix),1):
 triax.goal2=loadingMatrix[i]
 O.run(2000,True)
 print 'Load:',loadingMatrix[i],' Sw:',unsat.getSaturation(False),' 
VoidVolume:',triax.porosity*triax.boxVolume
-
-
-
end of code
-

The results I see is wrong:

Load: -50.0  Sw: 0.268726543553  VoidVolume: 436.590507582
Load: -100.0  Sw: 0.268726543553  VoidVolume: 433.836864791
Load: -150.0  Sw: 0.268726543553  VoidVolume: 431.014178921
Load: -200.0  Sw: 0.268726543553  VoidVolume: 428.158278656
Load: -250.0  Sw: 0.268726543553  VoidVolume: 425.283191863
Load: -300.0  Sw: 0.268726543553  VoidVolume: 422.394919453
-

It is observed that due to the closure of the water outlet, the volume of Voids 
decreased but the amount

Re: [Yade-users] [Question #684115]: Some basic concepts in FrictPhys.cpp

2019-09-22 Thread gaoxuesong
Question #684115 on Yade changed:
https://answers.launchpad.net/yade/+question/684115

Status: Solved => Open

gaoxuesong is still having a problem:
Can i change the status of this question? I make a mistake to set it as
solved. :(

-- 
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 #684115]: Some basic concepts in FrictPhys.cpp

2019-09-22 Thread gaoxuesong
Question #684115 on Yade changed:
https://answers.launchpad.net/yade/+question/684115

Status: Open => Solved

gaoxuesong confirmed that the question is solved:
The source code website is:
https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/FrictPhys.cpp

-- 
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 #684115]: Some basic concepts in FrictPhys.cpp

2019-09-22 Thread gaoxuesong
New question #684115 on Yade:
https://answers.launchpad.net/yade/+question/684115

Hi. Now i am studying the source code of FrictPhys.cpp. I am confused about 
some concepts even after i check the programmer manual.  My questions are 
mainly about these codes, 

1. const shared_ptr& mat1 = YADE_PTR_CAST(b1); 

 1.1  Is the shared_ptr a template class and will instantiate a 
pointer to FricMat? I have checked the definition of shared_ptr but it is too 
complicated for a c++ newer to understand. 

 1.2  The YADE_PTR_CAST will do change the b1 type to FrictMat? But if b1 
is not a pointer to FrictMat, like a CohFrictMat, will it cause a material type 
mismatch between the particle material and the IPhysFunctor?   
  
2. Ra=sphCont->refR1>0?sphCont->refR1:sphCont->refR2; 
Rb=sphCont->refR2>0?sphCont->refR2:sphCont->refR1;

2.1  The Ra, Rb here are the stiffness related particle size?  Why these 
two values could be negative? 
 
3. interaction->phys = shared_ptr(new FrictPhys());  
const shared_ptr& contactPhysics = 
YADE_PTR_CAST(interaction->phys);
contactPhysics->kn = Kn;   contactPhysics->ks = Ks;

3.1 Also the conversion of interaction->phys to FrictPhy type. Another is 
that since the reference  contactPhysics has decoration of const, why it is 
able to change the value of its pointing memory?  

4. Real Kn = (!kn) ? 2*kna*knb/(kna+knb) : (*kn)(mat1->id,mat2->id,kna,knb);

4.1 I understand the true part of this expression. What does the false part 
means? (*kn) is a function?  

Thanks for your patience to look through all my questions. 

Xuesong  

-- 
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 #684103]: How to solve the problem of particles penetrating through boundary in triaxial test?

2019-09-22 Thread Rong Zhao
Question #684103 on Yade changed:
https://answers.launchpad.net/yade/+question/684103

Status: Answered => Open

Rong Zhao is still having a problem:
Hello, Jan Stránský (honzik) .  I try to the solution you provided for
me to increase the stiffness of walls up to young=1e50*young, but it
doesn't work,  particles still penetrate through the boundary in
triaxial test.

-- 
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 #683238]: Memory usage is too high

2019-09-22 Thread Robert Caulk
Question #683238 on Yade changed:
https://answers.launchpad.net/yade/+question/683238

Status: Expired => Answered

Robert Caulk changed the question status:
The janitor cleaned this up but it should remain in the forum.

-- 
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 #684106]: How to increase porosity

2019-09-22 Thread Robert Caulk
Question #684106 on Yade changed:
https://answers.launchpad.net/yade/+question/684106

Status: Open => Answered

Robert Caulk proposed the following answer:
Consider the geometry of the packing when you constrain the system so
that the spheres must touch one another (i.e. adding confining
pressure). Given this constraint, do you believe there should be upper
and lower limits to the random dense packing porosity? I leave the rest
to you :-)

-- 
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 #684106]: How to increase porosity

2019-09-22 Thread Leonard
Question #684106 on Yade changed:
https://answers.launchpad.net/yade/+question/684106

Status: Answered => Open

Leonard is still having a problem:
Hi Robert,
Thanks for your answer. 
If I understand correctly about your hint, it is related to the confining 
pressure, so I changed the confining pressure (e.g. from 10kPa to30kpa, and 
100kPa), but the porosity after compacting is still around 0.44.
Could you please give more details about the hint? 

Leonard

-- 
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 #684008]: aabb walls don't move after apply a force

2019-09-22 Thread Robert Caulk
Question #684008 on Yade changed:
https://answers.launchpad.net/yade/+question/684008

Status: Open => Answered

Robert Caulk proposed the following answer:
Whether you meant to or not, python is reading a $\mu$ character in that
line. Try retyping it to make sure you aren't inadvertently adding any
special characters.

-- 
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 #684027]: How to use MatchMaker for two Ip2

2019-09-22 Thread Robert Caulk
Question #684027 on Yade changed:
https://answers.launchpad.net/yade/+question/684027

Status: Open => Answered

Robert Caulk proposed the following answer:
Consider simplifying your approach by using isCohesive [1].

[1]https://yade-
dem.org/doc/yade.wrapper.html#yade.wrapper.CohFrictMat.isCohesive

-- 
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 #684106]: How to increase porosity

2019-09-22 Thread Robert Caulk
Question #684106 on Yade changed:
https://answers.launchpad.net/yade/+question/684106

Status: Open => Answered

Robert Caulk proposed the following answer:
It is not possible with the method you've chosen. Hint: exerting
pressure on boundaries requires spheres to be touching.

-- 
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