Re: [Yade-users] [Question #688195]: permeability model

2020-01-23 Thread Othman Sh
Question #688195 on Yade changed:
https://answers.launchpad.net/yade/+question/688195

Description changed to:
Hello,

I'm trying to simulate 1-D flow through a cylindrical sphere packing
using the PFV model (FlowEngine) in Yade to mimic water flow through
porous concrete . So I want the spheres position to be fixed. I want to
impose a pressure on the top surface of the cylinder and get the flux at
the bottom surface. There should be no flux on the sides of the cylinder
(insulated, flow only in z direction). I have the following questions:

1- should the cylindrical sphere packing be inside a box? If I do the
simulation without the box I get a message like "Vh==NULL!! id=6
Point=0.08606 0.0994361 0.0201042 rad=0.0048993" which is repeated for
almost all body ids.

if the packing should be bounded by walls then I should have the packing
in a cylindrical wall, not in a box?

2- I don't know if my boundary conditions are correct for the case I'm trying 
to model. based on my understanding from the Yade documentation:
flow.bndCondIsPressure=[Xmin,Xmax,Ymin,Ymax,Zmin,Zmax] is that accurate?

so if I want my packing to have pressure on the top surface I should
have: flow.bndCondIsPressure=[0,0,0,0,0,1]. Correct?

In my code below (which I wrote it based on the Oedometer code by B.
Chareyre), the reason I have my boundary like this:
flow.bndCondIsPressure=[0,0,0,0,1,1] is that in the documentation it
says: "bndCondIsPressure: defines the type of boundary condition for
each side. True if pressure is imposed, False for no-flux". So if I want
water to pass the bottom surface (zmin) and to get the flux at zmin I
think I should have zmin turned to 1 in the  "flow.bndCondIsPressure
[]", correct?

I appreciate any help.

Thank you,
Othman

-
# -*- coding: utf-8 -*-


from yade import pack, ymport, plot

num_spheres=3000# number of spheres
young=1e6
radiuscyl=.05
heightcyl=.203
compFricDegree = 3 # initial contact friction during the confining phase
finalFricDegree = 30 # contact friction during the deviatoric loading
mn,mx=Vector3(0,0,0),Vector3(0.101,0.101,0.2035) # corners of the initial 
packing

O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls'))
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

sp=pack.SpherePack()
sp.makeCloud(mn,mx,rMean=0.0049,rRelFuzz=0.002,seed=1)

##  
 cylinder extraction

pred=pack.inCylinder((.05,.05,0),(.05,.05,heightcyl),radiuscyl) 

spFilter=filterSpherePack(pred,sp,returnSpherePack=True)

spFilter.toSimulation(material='spheres')

yade.qt.View()
for i in O.bodies:
i.state.blockedDOFs='xyzXYZ'


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()],label="iloop"
),
FlowEngine(dead=1,label="flow"),#introduced as a dead engine for the 
moment, see 2nd section

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
NewtonIntegrator(damping=0.2)

]


flow.dead=0
flow.defTolerance=0.3
flow.meshUpdateInterval=200
flow.useSolver=3
flow.permeabilityFactor=1
flow.viscosity=10
flow.bndCondIsPressure=[0,0,0,0,1,1]
flow.bndCondValue=[0,0,0,0,0,10]
flow.boundaryUseMaxMin=[0,0,0,0,1,1]
O.dt=0.1e-3
O.dynDt=False


O.run(1,1)
Qin = flow.getBoundaryFlux(5)# 5 is top wall 
Qout = flow.getBoundaryFlux(4)
Qxmin=flow.getBoundaryFlux(0)
Qxmax=flow.getBoundaryFlux(1)
Qymin=flow.getBoundaryFlux(2)
Qymax=flow.getBoundaryFlux(3)


NewtonIntegrator(damping=0)

O.engines=O.engines+[PyRunner(iterPeriod=200,command='history()',label='recorder')]
## a function saving variables
def history():

plot.addData(Qin=Qin,Qout=Qout,t=O.time,p=flow.averagePressure(),Qxmin=Qxmin,Qxmax=Qxmax,Qymin=Qymin,Qymax=Qymax)
plot.saveDataTxt('1.txt')


plot.plots={'t':('p')}
plot.plot()

-- 
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 #688156]: How to create a regular prism in Yade

2020-01-23 Thread Huang peilun
Question #688156 on Yade changed:
https://answers.launchpad.net/yade/+question/688156

Status: Answered => Solved

Huang peilun confirmed that the question is solved:
Thank you, Jan!
I'll do better next time.

-- 
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 #688174]: Definition of table with zeros arrays

2020-01-23 Thread ladynelsonchildcare
Question #688174 on Yade changed:
https://answers.launchpad.net/yade/+question/688174

ladynelsonchildcare posted a new comment:
Hi, I also have the same question and find the solution.https://ladynelsonchildcare.com.au/;>early learning

-- 
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 #688174]: Definition of table with zeros arrays

2020-01-23 Thread paintball chice
Question #688174 on Yade changed:
https://answers.launchpad.net/yade/+question/688174

paintball chice posted a new comment:
I also agree with Robert. Thanks Robert and Przemek. Here see that:
https://paintballchoice.com/barrel/

-- 
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 #688203]: Simulation blocked after O.run in a conditional translation motion

2020-01-23 Thread Rioual
Question #688203 on Yade changed:
https://answers.launchpad.net/yade/+question/688203

Status: Needs information => Open

Rioual gave more information on the question:
...Here is the code:

#Start

import time
from yade import qt 
from yade import ymport

#Import packing in the cylinder from prepare-packing.py
O.load('init_Final_state_packing.yade')

###
## PhysicalParameters 
Density=2400
frictionAngle=radians(35)
tc = 0.001
en = 0.05
et = 0.05

## Import wall's geometry
facetMat=O.materials.append(ViscElMat(frictionAngle=frictionAngle,tc=tc, en=en, 
et=et)) # **params sets kn, cn, ks, cs
sphereMat=O.materials.append(ViscElMat(density=Density,frictionAngle=frictionAngle,tc=tc,en=en,et=et))
from yade import ymport
#**
global TransEngload2
#**
# Importation de la roue Warren-Spring

global fctIdsWS
fctIdsWS=O.bodies.append(ymport.stl('WS-FR-1.stl',color=(1,0,0),material=facetMat))


#fctIdscylinder=O.bodies.append(ymport.stl('PotN.stl',color=(1,0,0),material=facetMat))


## Timestep 
O.dt=.2*tc

## Engines
O.engines=[
## Resets forces and momenta the act on bodies
ForceResetter(),
## Associates bounding volume to each body.
#BoundDispatcher([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
## Using bounding boxes find possible body collisions.
#InsertionSortCollider(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
## Interactions
InteractionLoop(
# the loading plate is a facet, we need to handle 
sphere+sphere, sphere+facet

[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),  
## Apply gravity
GravityEngine(gravity=[0,0,-9.81]),
## Cundall damping must been disabled!
NewtonIntegrator(damping=0),


## Apply kinematics to wheel
PyRunner(command='kinematics_WS()',realPeriod=1,label='kine'),
]

from yade import qt
qt.View()


def kinematics_WS():


h_WS = calc_h()[0]
hmaxSpheres = calc_h()[1]


print 'test0','h_WS=',h_WS,'hmaxSpheres=',hmaxSpheres

TransEngload2 =
TranslationEngine(ids=fctIdsWS,translationAxis=[0,-1,0],velocity=10)

O.engines=O.engines+[TransEngload2]


while h_WS > hmaxSpheres: 

print 'test01'

TransEngload2.dead = False

print 'test02'

O.run(1,True)

#   O.engines=O.engines+[PyRunner(command='calc_h()')]


print 'test03'

h_WS = calc_h()[0]
hmaxSpheres = calc_h()[1]

print 'test1','h_WS=',h_WS,'hmaxSpheres=',hmaxSpheres

TransEngload2.dead = True

else:

amTOT = sum((O.bodies[facetid].state.angMom)[1] for
facetid in fctIdsWS)


while (amTOT< 1e-10):


O.engines=O.engines+[PyRunner(command='addTorque()',iterPeriod=1)] 

amTOT = sum((O.bodies[facetid].state.angMom)[1] for 
facetid in fctIdsWS)

else:

# Stop simulation et measurement of the shear torque and cohesion

C_WS = 3* (imposed_T)/(2*Pi*(R0^3-R1^3))
print 'C_WS=',C_WS

print 'End of the calculation for 
Cohesion***' #
O.pause()

#*
#This function calculate the height of the boundary h_WS and the maximum height 
of the packing hmax_Spheres
def calc_h():

###
#Calculate h_WS 

minY = 1e99
maxY = -1e99

for facet in fctIdsWS:
#   print 'facet=', facet
facet= O.bodies[facet]  
vs = [facet.state.pos + facet.state.ori * v for v in 
facet.shape.vertices] # vertices in global coord system
#   print 'vs=',vs 

minY = min(minY,min(v[1] for v in vs))
maxY = max(maxY,max(v[1] for v in vs)) ###  


#   print 'maxY=',maxY,'minY=',minY

h_WS = maxY

###
#Calculate hmax_Spheres

idHMax=0# on definit une variable pour 
identifier quel corps a la hauteur la plus haute
hMax=0.0# initialisation de la hauteur 
a zero
for i in O.bodies:  # on parcours tout les corps du 
systeme
h=i.state.pos[1]# on extrait la position selon 
l'axe y
if (type(i.shape).__name__ == 'Sphere' and h>hMax): #si le 
solide est une sphere et sa position est plus haut 

Re: [Yade-users] [Question #688203]: Simulation blocked after O.run in a conditional translation motion

2020-01-23 Thread Jan Stránský
Question #688203 on Yade changed:
https://answers.launchpad.net/yade/+question/688203

Status: Open => Needs information

Jan Stránský requested more information:
Hello,
please provide a complete script [1], otherwise the best we can do is guessing..
thanks
Jan

[1] https://www.yade-dem.org/wiki/Howtoask

-- 
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 #688203]: Simulation blocked after O.run in a conditional translation motion

2020-01-23 Thread Rioual
New question #688203 on Yade:
https://answers.launchpad.net/yade/+question/688203

Hello,

This mistake may be obvious but I can't get it.
I am studying the translation motion of a boundary WS (using TranslationEngine) 
as long as an conditional statement is fulfilled
(the height of the boundary h_WS must be smaller than the maximum height of the 
packing hmaxSpheres).
I use O.run(1,True) to let the engine work for one time step but the simulation 
seems to be frozen at the "O.run(1,True)" statement.


 

[...
PyRunner(command='kinematics_WS()',realPeriod=1,label='kine'),
...
]

def kinematics_WS():

h_WS = calc_h()[0]
hmaxSpheres = calc_h()[1]


print 'test0','h_WS=',h_WS,'hmaxSpheres=',hmaxSpheres

TransEngload2 = 
TranslationEngine(ids=fctIdsWS,translationAxis=[0,-1,0],velocity=10)

O.engines=O.engines+[TransEngload2]


while h_WS > hmaxSpheres: 

print 'test01'

TransEngload2.dead = False

print 'test02'

O.run(1,True) ***frozen 
here!***

#   O.engines=O.engines+[PyRunner(command='calc_h()')]


print 'test03'

h_WS = calc_h()[0]
hmaxSpheres = calc_h()[1]

print 'test1','h_WS=',h_WS,'hmaxSpheres=',hmaxSpheres

TransEngload2.dead = True

else:
.


Output:
test0 h_WS= 130.0 hmaxSpheres= 100.369406791
test01
test02
...frozen
The boundary does not seem to move even if i put a higher step number in O.run()
*

Thank you for your Help,

Best

Vincent


-- 
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 #688156]: How to create a regular prism in Yade

2020-01-23 Thread Jan Stránský
Question #688156 on Yade changed:
https://answers.launchpad.net/yade/+question/688156

Jan Stránský proposed the following answer:
> Here's another question

in that case, next time please open a new question [1]

> I want ... this cylinder ... have contact with spheres, what kind of
IGeomFunctor and LawFunctor should I use?

that is the point, currently there is none..
Use an approximation of cylinder made of facets or boxes (for facets there is 
facetCylinder function [2])

cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask
[2] https://yade-dem.org/doc/yade.geom.html#yade.geom.facetCylinder

-- 
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 #688156]: How to create a regular prism in Yade

2020-01-23 Thread Huang peilun
Question #688156 on Yade changed:
https://answers.launchpad.net/yade/+question/688156

Huang peilun posted a new comment:
Thank you, Jan!
That solved my problem.

I'll post what I have tried and why/how it went wrong. 
This time I just use
O.bodies.append(Cylinder(length=1, radius=1))
I didn't figure out what type does the Cylinder class have.

I want to make a penetration test, and I want a cylinder shaped rod to
do this.

Here's another question, I want to apply gravity to this cylinder and
have contact with spheres, what kind of IGeomFunctor and LawFunctor
should I use? Now the current script is as followed. The cylinder just
disappeared at the beginning of the simulation.

from yade import pack

O.bodies.append(geom.facetBox((.5,.5,.5),(.5,.5,.5),wallMask=31))

rod=Body()
rod.shape=Cylinder()
rod.shape.length=.5
rod.shape.radius=.2
rod.state.pos=(.5,.5,1.8)
O.bodies.append(rod)

sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),rMean=.05,rRelFuzz=.3)
sp.toSimulation()

O.engines=[
ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Cylinder_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(

[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Sphere_ChainedCylinder_CylScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],

[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_CylScGeom_FrictPhys_CundallStrack()]
),
# update position using Newton's equations
NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
# call the checkUnbalanced function (defined below) every 2 seconds
PyRunner(command='checkUnbalanced()',realPeriod=2),
]
O.dt=.2*PWaveTimeStep()

def checkUnbalanced():
if O.forces.f(rod.id)[2]==0: return
ball.state.blockedDOFs='xyXYZ'
ball.state.vel=(0,0,2)
if unbalancedForce()<.05:
O.pause()

O.saveTmp()

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 #688156]: How to create a regular prism in Yade

2020-01-23 Thread Jan Stránský
Question #688156 on Yade changed:
https://answers.launchpad.net/yade/+question/688156

Status: Needs information => Answered

Jan Stránský proposed the following answer:
> I want to create a body shaped as a prism.

use box [1]

> I tried couple of times, I can't create a body shaped as a cylinder by
this class.

next time please post also what you have tried and why/how it went wrong.
E.g. you can try something like:
###
b=Body()
b.shape=Cylinder()
b.shape.length=1
b.shape.radius=1
O.bodies.append(b)
###

What do you want to do with the cylinder? just that Yade currently
(AFAIK) is not able to work reasonably with "pure" cylinders..

cheers
Jan

[1] https://yade-dem.org/doc/yade.utils.html#yade.utils.box

-- 
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 #688156]: How to create a regular prism in Yade

2020-01-23 Thread Huang peilun
Question #688156 on Yade changed:
https://answers.launchpad.net/yade/+question/688156

Huang peilun posted a new comment:
I want to create a body shaped as a prism. 
By "not round cylinder" I mean not the cylinder for yade.gridpfacet module, I 
see from the yade book that there is a class yade.wrapper.Cylinder. However, I 
tried couple of times, I can't create a body shaped as a cylinder by this class.

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 #687836]: Is there a way to assign joint properties to a pack of clumps but not using the JCfpm material?

2020-01-23 Thread Launchpad Janitor
Question #687836 on Yade changed:
https://answers.launchpad.net/yade/+question/687836

Status: Needs information => Expired

Launchpad Janitor expired the question:
This question was expired because it remained in the 'Needs information'
state without activity for the last 15 days.

-- 
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 #688197]: Shear loading

2020-01-23 Thread Jan Stránský
Question #688197 on Yade changed:
https://answers.launchpad.net/yade/+question/688197

Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

> uniaxial force

usually it is called normal (force, direction, component...) rather than
uniaxial

1) because Ig2_Sphere_Sphere_ScGeom computes normal force according to 
penetration depth, which is
penetrationDepth = radius1 + radius2 - distanceOfCenters
and since distance of centers changes, penetrationDepth and thus normal force 
changes

3+4) your Matlab model is probably "more simple" (does not take into
account the actual centers' distance, only its normal projection),
basically based on different assumptions/formulation. Therefore you get
different results.

> I read [1], but I want something with more detail.

read not only a short part, but rather the whole section Kinematic variables 
[3]. IMO there is enough details. I am not sure if some papers give more 
details.
Anyway, the source code is the best source how to investigate what really is 
computed :-) normal component [4] and shear components [5] (not only the 
referenced line, but also the code around).

cheers
Jan

[3] https://yade-dem.org/doc/formulation.html#kinematic-variables
[4] 
https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/Ig2_Sphere_Sphere_ScGeom.cpp#L39
[5] https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/ScGeom.cpp#L52

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