Re: [Yade-users] [Question #693455]: addForce didnt work for facet

2020-10-14 Thread Jan Stránský
Question #693455 on Yade changed:
https://answers.launchpad.net/yade/+question/693455

Status: Open => Answered

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

1) please provide a MWE [1], W=working, reproducing your problem (but still 
keeping it M=minimal). Here, addForces is never called, so you do not apply the 
force actually and that is the reason why "it just doesnt work"...
There can be many reasons, hard even to guess without actual code:
- addForces / O.forces.addF is never used / is misused
- preStress is 0 (not defined in the provided code)
- it just works, just you wrongly interpret it (typically it is not "visible in 
GUI" but observable according to numerical results)
- ...

2) yes [2], in python it would be
normal = (v1-v0).cross(v2-v1).normalized() # vertices are v0,v1,v2
so the normal is "right-hand-ruled by v0,v1,v2"

cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask
[2] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/common/Facet.cpp#L36

-- 
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 #693459]: Python 3 - randomDensePack

2020-10-14 Thread Luis Barbosa
New question #693459 on Yade:
https://answers.launchpad.net/yade/+question/693459

Hi all,

This is a really silly question but I am banging my head in the wall :(

After an update in Yade, I am now migrating my codes to Python 3. So far so 
good.

When I use the function randomDensePack with pack.gtsSurface, it works fine. It 
is possible to see that the pack is dense due to Triaxial test.

However, when I use randomDensePack with pack.inSphere the pack I get is not 
dense

It seems to be a simple solution, perhaps due to changes in Python 3 (my guess).

=

#Forca normal lei de contato coesao e atrito
from yade import plot
from yade import pack
from yade import utils
from yade import bodiesHandling
import math
import random


O.materials.append(JCFpmMat(type=1,young=70e9,poisson=0.3,frictionAngle=radians(30),density=2500,tensileStrength=10.7e5,cohesion=10.7e5,jointNormalStiffness=1e5,jointShearStiffness=1e5,jointCohesion=10.7e5,jointFrictionAngle=radians(30),jointDilationAngle=0.0,label='spheres'))

O.materials.append(JCFpmMat(type=1,young=70e8,poisson=0.3,frictionAngle=radians(10),density=2000,tensileStrength=0,cohesion=0,jointNormalStiffness=0,jointShearStiffness=0,jointCohesion=0,jointFrictionAngle=radians(0),jointDilationAngle=0.0,label='plates'))

##Radius by 
Class##
size=1
if size==1:
rag=0.00238
#
rad=0.0003
r=rag
# Spheres
ag=O.bodies.append(
pack.randomDensePack(

(pack.inSphere((0,0,r),r)),radius=rad,color=(0,1,0),rRelFuzz=0,material='spheres')
)

if size==1:
n = 0 #number of spheres to exclude randomically
if size==2:
n = 96 #number of spheres to exclude randomically
if size==3:
n = 620 #number of spheres to exclude randomically
if size==4:
n = 1905 #number of spheres to exclude randomically
##Planes#
O.engines=[
  ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],

[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],#xSectionWeibullShapeParameter=4

[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False, 
Key="Wei", recordCracks=True)]
),

  
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=500,timestepSafetyCoefficient=0.5),
  NewtonIntegrator(damping=0.1,gravity=[0,0,-9.81]),

]

from yade import qt
qt.View()
qt.Controller()


-- 
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 #693462]: problem in uniaxial test of rocks

2020-10-14 Thread Chen Lifan
New question #693462 on Yade:
https://answers.launchpad.net/yade/+question/693462

Hello:
  I have some questions while using Yade to simulate the uniaxial test of rock 
material. I do the simulation in 2 steps. In the first step, the packing is 
formulated and the packing was sheared in the second step, where the problem 
appears. With the increase of the vertical strain, the horizontal stress (the 
third column in [3]) can not be well controlled to zero. I wonder what causes 
the phenomenon.

Here are the scripts and output results:

[1] scripts for generating the packing:
 
from yade import pack

O.materials.append(CohFrictMat(young=88.e9,alphaKr=2.0,alphaKtw=0.,poisson=.7,frictionAngle=.0,isCohesive=True,normalCohesion=3.e9,shearCohesion=3.e9,momentRotationLaw=True))

sp = pack.SpherePack()
size = .3
sp.makeCloud(minCorner=(0,0,.05),maxCorner=(size,size,.05),rMean=.005,rRelFuzz=0.2,num=400,periodic=True,seed=1)
sp.toSimulation()
O.cell.hSize = Matrix3(size,0,0, 0,size,0, 0,0,.1)
print len(O.bodies)
for p in O.bodies:
   p.state.blockedDOFs = 'zXY'
   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 = .5*utils.PWaveTimeStep()
print O.dt

O.engines = [
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb()]),
   InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom6D()],
  [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(
  label='cohesiveIp',
  setCohesionNow=False)],
  [Law2_ScGeom6D_CohFrictPhys_CohesionMoment( # contact law
  useIncrementalForm=False,
  always_use_moment_law=False,
  label='cohesiveLaw')]
   ),
   PeriTriaxController(
  dynCell=True,
  goal=(-1.e7,-1.e7,0),
  stressMask=3,
  relStressTol=.001,
  maxUnbalanced=.001,
  maxStrainRate=(.5,.5,.0),
  doneHook='term()',
  label='biax'
   ),
   NewtonIntegrator(damping=.2)
]

def term():
   #O.engines = O.engines[:3]+O.engines[4:]
   print getStress()
   print O.cell.hSize
   cohesiveIp.setCohesionNow = True
   cohesiveIp.setCohesionOnNewContacts = False # if False, only existing 
contacts can be cohesive and new contacts are only frictional
   cohesiveLaw.always_use_moment_law = False # if True, use bending/twisting 
moments at all contacts. If False, compute moments only for cohesive contacts 
   cohesiveLaw.useIncrementalForm = True # use the incremental formulation to 
compute bending and twisting moments
   setContactFriction(0.5)
   O.cell.trsf=Matrix3.Identity
   O.cell.velGrad=Matrix3.Zero
   area=0.
   for p in O.bodies:
  p.state.vel = Vector3.Zero
  p.state.angVel = Vector3.Zero
  p.state.refPos = p.state.pos
  p.state.refOri = p.state.ori
  area += pi*p.shape.radius**2
   areatol=O.cell.volume/O.cell.hSize[2,2]
   void=areatol-area
   voidratio=void/area
   print voidratio
   O.save('5mm_88_2_3g_3g.yade.gz')
   O.pause()

O.run();O.wait()

[2] scripts to shear

from minieigen import *
from yade import plot
import numpy as np
import math, random


O.load('5mm_88_2_3g_3g.yade.gz')
biax.doneHook='unaxshear()'

fout = file('5mm_88_2_3g_3g.dat','w')
fout.close()

def output():
   fout = open('5mm_88_2_3g_3g.dat','a')
   ss = -biax.stress/1.e6
   st = -biax.strain
   print>>fout,st[0],st[1],ss[0],ss[1]
   fout.close()

def unaxshear():
   print 'Stress:',utils.getStress()
   #print 'Void ratio',getVoidRatio2D()
   print 'Press start to shear\n'
   O.pause()
   biax.goal=(0.,-8.e-2,0.)
   biax.stressMask=1
   biax.doneHook=''
   biax.relStressTol=.001
   biax.maxUnbalanced=.001
   biax.maxStrainRate=(.5,.5,0)
   O.engines += 
[PyRunner(command='output()',iterPeriod=1000,label='outdata',dead = False)]

[3] the output results (the first to fourth columns correspond to strainx, 
strainy, stressx, stressy)

-7.52121482369e-07 7.52121482369e-07 9.99913851027 10.0008273603
-0.000752873321006 0.000752873886694 7.15926320142 12.837817399
-0.00150499452053 0.00150499565191 4.31219709936 15.6755667321
-0.00225711572006 0.00225711741712 1.45740355263 18.526142961
-0.00266968416804 0.00300923918233 0.0115157171184 21.5155486273
-0.00273771945847 0.00376136094755 0.00979896515048 24.6663406295
-0.00280666855613 0.00451348271276 0.0033719341489 27.8333521173
-0.00287633923431 0.00526560447797 -0.00654850390782 31.0103413953
-0.00294295053548 0.00601772624319 -0.00336711696265 34.1881098127
-0.00300797298852 0.0067698480084 0.00707226349218 37.3636314747
-0.00307533520998 0.00752196977361 0.00802915923236 40.5352437554
-0.00314524703698 0.00827409153882 -0.00183744269654 43.7050569085
-0.00321386989005 0.00902621330404 -0.00668459677995 46.8844730087
-0.00327917456332 0.00977833506925 0.00270472319407 50.0643941793
-0.00334556010797 0.0105304568345 0.00899177960859 53.2491342812
-0.00341557991373 0.0112825785997 0.001491789509 56.4419088315
-0.00348589116285 0.0120347003649 -0.00683417129809

Re: [Yade-users] [Question #693446]: How to have viscous damping for chainedCylinder

2020-10-14 Thread Bruno Chareyre
Question #693446 on Yade changed:
https://answers.launchpad.net/yade/+question/693446

Status: Open => Answered

Bruno Chareyre proposed the following answer:
Hi,

I have noticed those violent vibrations sometimes and I'm still not sure if it 
is a bug somewhere or just expected instability due to timestep issues.
Anyway, chainedCylinders are deprecated and will probably not interact properly 
with PFacets. You should use PFacets for both the object and the brush (PFacets 
include cylinders as a special case).

On viscosity: whether it is a bug or a legit numerical instability
viscosity will probably not help in solving it. It can make it only
worse. If you still want viscosity (because the real brush has some)
you'll have to dive and implement it. As you found out creep is really
creep: an irreversible Maxwell-kindof viscoplastic process.

I hope it helps.
Bruno

-- 
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 #693446]: How to have viscous damping for chainedCylinder

2020-10-14 Thread Rohit John
Question #693446 on Yade changed:
https://answers.launchpad.net/yade/+question/693446

Rohit John posted a new comment:
Thanks for you answer Bruno.

I have read that most of the constitutive laws do no have a velocity
base damping [1]. Is there a reason why velocity base damping  was not
implemented?

I apologise, I did use gridConnectio/gridNodes to make the brush. I used
CylinderConnections to do it. I always get it confused with
chainedCylinders.

 Could you please check if my proposal to implement damping is correct. 
  - Define a material class which includes a damping parameter. Since I am 
using CylinderConnections I can inherit the class CohFrictMat and name it, say, 
ViscCohFrictMat
  - Define a Iphys defining the interaction between two instances of this 
material class. I can inherit Ip2_CohFrictMat_CohFrictMat_CohFrictPhys() and 
lets call it Ip2_ViscCohFrictMat_ViscCohFrictMat_ViscCohFrictPhys()
  - Define a law to define the forces based on the ScGeom6D Igeom and 
ViscCohFrictPhys() Iphys, and inherit the 
Law2_ScGeom6D_CohFrictPhys_CohesionMoment()



[1] 
https://yade-dem.org/doc/formulation.html?highlight=damping#numerical-damping

-- 
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 #693469]: questions about plotDirections

2020-10-14 Thread Leonard
New question #693469 on Yade:
https://answers.launchpad.net/yade/+question/693469

Hi,
I have few questions about plotDirections[1] :

1. Every time I use utils.plotDirections() I can get a figure, my stupid 
question is how to save that figure automatically during the simulation?

2. There are two kinds of sphere particles in my model by using different 
materials (e.g., Mat1 and Mat2), the plotDirections() plots the distribution of 
overall contacts. What if I want to plot Mat1-Mat1, Mat1-Mat2 contacts 
distributions seperately?

3. Just a curiosity. Normally in fabric analysis, papers like to make the rose 
figure symmetric by plotting a pair of contact vectors for each interaction 
(i.e., one vector from sphere1 to sphere2 and another from sphere2 to sphere1). 
So I wonder if it can be done using plotDirections()?

4. May I ask yade developers what is the idea to plot the rose diagram of 3D 
vectors to a plane (let's say xy plane)? Project all vectors to the xy plane to 
gain the corresponding 2D vectors and draw the 2D rose diagram?
I am asking this because if question2 and 3 couldn't be solved using the 
build-in functions in yade, then I will output the contact vectors and draw 
these diagrams in python.


Thanks!
Leonard

[1]https://yade-dev.gitlab.io/trunk/yade.utils.html?highlight=plotdirections#yade.utils.plotDirections

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