Can the modeling method of 'randonDensePack' be used in PFV model?

Asked by Liu Changdong

Hello everyone:
I am a beginner in PFV, i have a bit of problem with modeling in PFV. I changed the modeling method (makeCLoud to randomDensePack) in [1], but this caused an error in my program, and i do not know what caused it. Whether the 'randomDensePack' method cannot be used in the PFV .

There is my code:
############################
from yade import pack, ymport
import numpy as np
import time

radiuscyl=.05
heightcyl=.25
dP=4.347e3 #Pa
visc=1e-3 #Pa.sec - taken from Catalano, Chareyre, Bathelemy (2014)
density=1000 #kg/m3
g=9.81 #m/s2
spheresRadius = 0.05
young=1e6

O.materials.append(FrictMat(young=young,poisson=0.2,density=1900,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls'))
pred=pack.inAlignedBox((0,0,0),(1,1,1))
sp=pack.randomDensePack(pred,radius=spheresRadius,memoizeDb='/tmp/wall.splite',returnSpherePack=True)
sp.toSimulation(color=(0.6,0.5,0.15),material='spheres')
mn,mx=utils.aabbExtrema() # corners of the box that contain the packign. Obtained from aabbExtrema
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

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),
 #triax,
 #PyRunner(dead=1,iterPeriod=2000,command='radiuswelling()',label='swell'),
 #PyRunner(dead=1,iterPeriod=2000,command='degradation()',label='degrada'),
 #SnapshotEngine(iterPeriod=400000,fileBase='Video',label='snapshooter'),
 newton
]

flow.dead=0
flow.defTolerance=0.3
flow.meshUpdateInterval=200
flow.useSolver=3
flow.permeabilityFactor=1
flow.viscosity=10
flow.bndCondIsPressure=[0,0,0,1,0,0]
flow.bndCondValue=[0,0,0,1,0,0]
flow.boundaryUseMaxMin=[0,0,0,0,0,0]
#O.engines=O.engines+[PyRunner(iterPeriod=200,command='flow.saveVtk()')]
O.dt=0.1e-8
O.dynDt=False
############################

[1]oedometer.py file (the example file for PFV)

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Liu Changdong
Solved:
Last query:
Last reply:
Revision history for this message
Robert Caulk (rcaulk) said :
#1

>Can the modeling method of 'randonDensePack' be used in PFV model?

Yes.

> but this caused an error in my program

Please share the error. And please review our posting guidelines if you wish to receive meaningful help [1].

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

Revision history for this message
Liu Changdong (changdong) said :
#2

I have an other question. At first,i thought the particles were too dense, which led to the following error:
8 : Vh==NULL!! id=8 Point=0.881284 0.807211 0.362774 rad=0.04
11 : Vh==NULL!! id=11 Point=0.614212 0.870149 0.271682 rad=0.04
12 : Vh==NULL!! id=12 Point=0.206067 0.420286 0.118061 rad=0.04
13 : Vh==NULL!! id=13 Point=0.203263 0.742324 0.805541 rad=0.04
14 : Vh==NULL!! id=14 Point=0.244499 0.250985 0.357206 rad=0.04
...........................
But I read question [2] and [3], they used ympoty method to model, i found these model is also very dense. My question is :1.in question [2] and [3], how is the 'txt' file obtained. 2. is there something wrong with my code.

[2]https://answers.launchpad.net/yade/+question/689117
[3]https://answers.launchpad.net/yade/+question/691351

Revision history for this message
Liu Changdong (changdong) said :
#3

hello Robert Caulk:
thanks for answering my questions. My version of yade is 2019.01a, and the code runs with the following error:
8 : Vh==NULL!! id=8 Point=0.881284 0.807211 0.362774 rad=0.04
11 : Vh==NULL!! id=11 Point=0.614212 0.870149 0.271682 rad=0.04
12 : Vh==NULL!! id=12 Point=0.206067 0.420286 0.118061 rad=0.04
13 : Vh==NULL!! id=13 Point=0.203263 0.742324 0.805541 rad=0.04
14 : Vh==NULL!! id=14 Point=0.244499 0.250985 0.357206 rad=0.04
15 : Vh==NULL!! id=15 Point=0.197834 0.32146 0.593825 rad=0.04
18 : Vh==NULL!! id=18 Point=0.722981 0.344864 0.421231 rad=0.04
20 : Vh==NULL!! id=20 Point=0.26775 0.739037 0.873687 rad=0.04
21 : Vh==NULL!! id=21 Point=0.459422 0.200842 0.6276 rad=0.04
23 : Vh==NULL!! id=23 Point=0.679726 0.265577 0.249523 rad=0.04
......................
1142 : Vh==NULL!! id=1142 Point=0.732356 0.703194 0.116765 rad=0.04
1143 : Vh==NULL!! id=1143 Point=0.882203 0.77525 0.877986 rad=0.04
1144 : Vh==NULL!! id=1144 Point=0.333918 0.487187 0.427067 rad=0.04

Could you tell me how to model using the 'randomDensePack' method. Thanks very much.

Revision history for this message
Robert Caulk (rcaulk) said :
#4

It is important to look at all changes that you make to your script with respect to the working example script. In this case, with oedometer.py, you said the only change was that you replaced makeCloud with randomDensePack. That is not true, I see many other changes, including the removal of TriaxalStressController, rearrangement of material and body assignments, change of body sizes, changes to timestep, etc. etc.

I think it will help you more if I simply tell you that one of the changes you made led to your problem, please try to narrow it down yourself.

Hints:
1/ the problem change does not have to do with makeCloud vs randomDensePack.

2/ The documentation indicates the importance of wall ID numbers [1]

3/ You can compare two scripts easily using diff:
diff -y myNewScript.py oedometer.py

Good luck, let me know if you cannot still find which change led to your error.

[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.FlowEngine.idOffset

Revision history for this message
Liu Changdong (changdong) said :
#5

hello Robert Caulk:
Thank you very much for your prompt. I will try to find out the problem and reply to you.

Revision history for this message
Liu Changdong (changdong) said :
#6

hello Robert Caulk:
thanks very much. Your suggestion solved my problem on FrictMat material, and I will further simulate PFV model with JCFpmMat and DFNEngine.

Revision history for this message
Robert Caulk (rcaulk) said :
#7

You're welcome. Please add the solution here so others can use this thread effectively.

Revision history for this message
Liu Changdong (changdong) said :
#8

when you use FlowEngine, you must make wallsId [0,1,2,3,4,5]. Otherwise, you will run into the problem I encountered