Post on 12-Jun-2020
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Yade: Past, Present, Future
Václav �milauer
CTU Prague & UJF Grenoble
12 March 2010 (updated 3 January 2011)
� marks advanced topics
contains clickable hyperlinks to documentation and websites
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Outline
1 Past
2 PresentPython introSimulation structureSimulation descriptionPreprocessProcessPostprocessFunctionality walkthrough
3 Future
4 Researchers using YadePast projectsPresent projects
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
DEM & (Pre)history
DEM: explicit dynamics ofparticles
Simple discontinuum models
Cundall 1979: nondeformablediscs, 2d, explicit dynamics,penalty contact function
Frédéric Donzé: SphericalDiscrete Element Code
Yade starts in 2004, ��exibleplatform� (J. Kozicki, O. Galizzi)
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
DEM & (Pre)history
DEM: explicit dynamics ofparticles
Simple discontinuum models
Cundall 1979: nondeformablediscs, 2d, explicit dynamics,penalty contact function
Frédéric Donzé: SphericalDiscrete Element Code
Yade starts in 2004, ��exibleplatform� (J. Kozicki, O. Galizzi)
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
DEM & (Pre)history
DEM: explicit dynamics ofparticles
Simple discontinuum models
Cundall 1979: nondeformablediscs, 2d, explicit dynamics,penalty contact function
Frédéric Donzé: SphericalDiscrete Element Code
Yade starts in 2004, ��exibleplatform� (J. Kozicki, O. Galizzi)
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
DEM & (Pre)history
DEM: explicit dynamics ofparticles
Simple discontinuum models
Cundall 1979: nondeformablediscs, 2d, explicit dynamics,penalty contact function
Frédéric Donzé: SphericalDiscrete Element Code
Yade starts in 2004, ��exibleplatform� (J. Kozicki, O. Galizzi)
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Yade beginnings
www.yade-dem.orglaunchpad.net/yade
Written in c++, running onLinux/Unix
Proof-of-conceptimplementations: DEM, FEM,mass-spring, lattice
No documentation
Sometimes functionallyquestionable
Demanding on programmingskills for �users�
Object-oriented design
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Sanitization period (2007-2010)
Motivated by our development ofconcrete model
Removing bad code
Enforcement of consistent names
Parallel computation
Documentation
Python scripting
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Outline
1 Past
2 PresentPython introSimulation structureSimulation descriptionPreprocessProcessPostprocessFunctionality walkthrough
3 Future
4 Researchers using YadePast projectsPresent projects
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Python
Scripting (non-compiled)object-oriented language
Large documented standardlibrary
Easy to interface withfortran/c/c++
Language of choice for manyscienti�c projects (similar tomatlab)
Z
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Python in Yade
c++ classes mirrored in python,with full attribute access
scripts e�cient for simulationsetup, postprocessing
compatible over many internalchanges
runtime control & debuggingfrom the command line
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Data components
Body (particle)
Shape Sphere, Facet, . . .
Material ElastMat, FrictMat, . . .
State position, orientation, velocity, . . .
Bound for approximate collision detection (Aabb)
Generalized forces
Interaction of 2 bodies
IGeom di�erent for Sphere+Sphere, Facet+Sphere, . . .
IPhys internal state of interaction (plasticity variables, damage,history)
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Functional components
Engines
GlobalEngine act on all bodies/interactions
PartialEngine act on some bodies/interactions
Dispatchers calls functions based on classes of arguments:e.g. Facet+Sphere needs di�erent function thanSphere+Sphere collision
Functors
Callable function-like objects. Accept only certain classes andare called by Dispatchers.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Simulation structure
bodiesShapeMaterialStateBound
interactions
geometry collision detection pass 2 strain evaluation
physics properties of new interactions
constitutive law compute forces from strainsforces
(generalized)
updatebounds
collisiondetectionpass 1
other forces(gravity, BC, ...)
miscillaneous engines(recorders, ...)
reset forces
forces → acceleration
velocity update
position update
simulationloop
incrementtime by Δt
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
What it looks like in python I.
Simulation loop in codeO.engines=[ForceResetter(),InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),InteractionLoop(
[Ig2_Sphere_Sphere_L3Geom(), Ig2_Facet_Sphere_L3Geom()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_L3Geom_FrictPhys_ElPerfPl()],
),GravityEngine(gravity=(0,0,-9.81)),NewtonIntegrator()
]
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Functor names explained
Ig2_Facet_Sphere_L3Geom
Ig2 2-ary functor creating IGeom
Facet accepting a Facet as �rst argument
Sphere and Sphere as second argument
L3Geom returning L3Geom instance
Sphere+SphereFacet+Sphere Dem3DofGeom
FrictMat+FrictMatFrictPhys
Shape
Material
Ig2_Sphere_Sphere_Dem3DofGeom
Ig2_Facet_Sphere_
Dem3DofGeom
Ip2_FrictMat_FrictMa
t_FrictPhys
BodyInteraction
Interaction
Geometry
Interaction
Physics
Law2_Dem3DofGeom_FrictPhys_Basic
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
� 4 types of functors
BoundFunctor (Bo1)
approximate volume representation (hidden inside Collider)
IGeomFunctor (Ig2)
resolves geometry of interaction (e.g. displacement, shear),based on Shapes of bodies
IPhysFunctor (Ip2)
derives properties of interaction, i.e. creates IPhys for givenparticles' Materials
LawFunctor (Law2)
resolves forces on particles, using IGeom and IPhys of sometypes, created by previous functors.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
What it looks like in python II.
Simulation data in codeO.materials.append(FrictMat(young=30e9,poisson=.3,density=3000,frictionAngle=.5)
)O.bodies.append([utils.sphere((0,0,3),radius=1),utils.facet([(-1,-1,0),(1,0,0),(0,1,0)])
])
O.dt=.5*utils.PWaveTimeStep()
Running simulationO.run(10000); O.wait() # Basic simulation controlO.save('/tmp/a.yade.gz')print O.bodies[3].state.vel # inspection of (c++) dataprint O.interactions[0,2].geom.normalprint O.materials[0].youngquit()
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
�Meshing� volumes with spheres
See horse (surface import), mill (�by hand�)
Volume representation
Boundary: triangulated surface; imported (STL, GTS,gmsh) / created �by hand� (possibly parametric)
Volume: constructive solid geometry, boolean composition
Sphere packing generators (decoupled from volume)
Import packing (text, LSMGenGeo)
Dynamic: triax compression/decompression, gravity
Geometric: from tetrahedron mesh (SpherePadder), fromboundary speci�cation (LSMGenGeo)
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
� �Meshing� volumes with spheres (2)
Solid representation
predicate=pack.inSphere((0,0,0),1)
Boundary representation
predicate=pack.inGtsSurface(gts.read(open('horse.coarse.gts')))
Boolean composition (intersection &, union |, di�erence -)
predicate=pack.inSphere((0,0,0),1) & pack.inCylinder((.5,0,-1),(.5,0,1),.5)
Call packing generator with arbitrary predicatespheres=pack.randomDensePack(pack.inHyperboloid(
(0,0,-.1),(0,0,.1),.05,.085),spheresInCell=2000,radius=3.5e-3)
O.bodies.append(spheres)
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Sphere falling through funnel
source script, movie
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
� Running, controlling, collecting
Collecting dataO.engines=[. . . ,PyRunner(command='addPlotData()',iterPeriod=100),PyRunner(command='checkPostpeak()',realPeriod=3),
]def addPlotData():
plot.addData(eps=strainer.strain,sigma=strainer.avgStress)plot.plots={'eps':('sigma',)} # de�ne what to plot
Controlling simulation from within the loopdef checkPostpeak():
maxSigma=max(maxSigma,strainer.sigma)if strainer.sigma<.5*maxSigma: # check some condition
print "Damaged, exiting. Peak stress was", maxSigmaplot.saveGnuplot('damaged') # save curves for postprocessingimport sys; sys.exit(0)
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Postprocessing
-4e+07
-3.5e+07
-3e+07
-2.5e+07
-2e+07
-1.5e+07
-1e+07
-5e+06
0
5e+06
-0.003 -0.0025 -0.002 -0.0015 -0.001 -0.0005 0 0.0005
sig
ma
eps
� sigma(eps)
1d yade.plot module:matplotlib; Gnuplot
2d yade.post2d module
3d built-in OpenGL view;VTKRecorder, withParaview (slices, movieexport, . . . )
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Postprocessing
0.05 0.00 0.050.04
0.03
0.02
0.01
0.00
0.01
0.02
0.03
0.04
0.0
40
0.0
40
0.0
80
0.0
80
0.1
20
0.1
20
0.1
60
0.2
00
0.00 0.03 0.06 0.09 0.12 0.15 0.18 0.21 0.24
smooth damage
0.05 0.00 0.050.04
0.03
0.02
0.01
0.00
0.01
0.02
0.03
0.04
sigma
1d yade.plot module:matplotlib; Gnuplot
2d yade.post2d module
3d built-in OpenGL view;VTKRecorder, withParaview (slices, movieexport, . . . )
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Postprocessing
1d yade.plot module:matplotlib; Gnuplot
2d yade.post2d module
3d built-in OpenGL view;VTKRecorder, withParaview (slices, movieexport, . . . )
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Yade landscape
Community
website, wiki, bugs and speci�cations tracking
responsive mailing lists for users and developers, ≈ 10messages/day
used at multiple institutes, mostly research
Code
central code repository with history
documented code structure (in progress)
documentation of c++/python classes and pythonmodules
Linux/Unix only
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Generalities
Performance
Shared-memory parallelism using OpenMP; speedupdepending on scenario & machine, ≈ 5× on 8 cores.
Pro�ling tools (yade.timing)
Usability
Batch scheduling and execution (parametric studies)
Remote watching and control over http and telnet
Debugging tools (yade.log), embedded debugger
Embedded ipython shell
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Engines
Loading control
TriaxialStressController (stress/strain rate), PeriTriaxEngine(periodic boundary conditions), UniaxialStrainer (straincontrol), PeriIsoCompressor (periodic iso-stress).
Applying conditions
GravityEngine (constant gravity �eld), ForceEngine,RotationEngine, TranslationEngine, . . .
Algorithms
InsertionSortCollider (collision detection), NewtonIntegrator(2nd order central-di�erences explicit integration scheme),GlobalSti�nessTimeStepper (adjust timestep based onpacking sti�ness)
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Particles and interactions
Shapes
Sphere, Facet, Wall, Box. (Tetra, polyhedral grains, . . . ).
Handling collisions (IGeom)
Handling collisions of 2×Sphere, Facet+Sphere,Box+Sphere, Wall+Sphere.
Contact laws
Dry friction (classical DEM), Mindlin's contact, Plassiard'sformulation, Cohesive-frictional model, rock model,concrete model, capillary e�ects between grains. (moreoutside source tree or undocumented)
Coupling
OpenFOAM, Comsol, �uids.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
What a contact law looks like
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Outline
1 Past
2 PresentPython introSimulation structureSimulation descriptionPreprocessProcessPostprocessFunctionality walkthrough
3 Future
4 Researchers using YadePast projectsPresent projects
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Future
Continue maintenance
Documentation
Code cleanup
Improve performance
Becoming reference platform for discrete models
Reusable common functionality (e.g. deformationcomputation, collision detection, integrator, . . . )
Encourage cooperation via python (numpy).
Integrate couplings with external software (OpenFOAM,. . . ).
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Outline
1 Past
2 PresentPython introSimulation structureSimulation descriptionPreprocessProcessPostprocessFunctionality walkthrough
3 Future
4 Researchers using YadePast projectsPresent projects
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Jan Kozicki, Grenoble
3d lattice model oftensile concretefracture.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Luc Scholtès, Grenoble
Behavior ofgranular mediawith capillarye�ects betweengrains.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Wenjie Shiu, Grenoble
Missile impact onconcretestructures.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Wenjie Shiu, Grenoble
Missile impact onconcretestructures.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Emanuele Catalano, Grenoble
A �nitevolumes-DEMcoupledformulation for�uid-solidinteractions ingranular media.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Benoît Charlas, Grenoble
Hydride metalpowders inhydrogen storagetanks � swelling& shrinking due tochemical reactionswith hydrogen,creatingmechanical e�ects.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Sergei Dorofeenko, Moscow
CouplingComputationalFlow Dynamics(CFD) and DEM� OpenFOAMand Yade.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Anton Gladky, Freiberg
Mineral processing� analyzing rockdestruction in themachine.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Anton Gladky, Freiberg
Mineral processing� analyzing rockdestruction in themachine.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Alsidqi Hasan, Grenoble
Modeling snowgrains based onCT scans, aspolyhedra whichcan deform alongcrystallographicplanes.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Franck Lominé, Nantes
InteractionbetweenDEM-modeledsolid and LatticeBoltzmannMethod (LBM)modeled �uid.(Started by LucScholtès)
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Luc Scholtès, Brisbane
Fractured rockmass with smoothcontactdiscontinuities;discontinuities canbe imported fromDiscrete FractureNetwork Modelers.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Luc Scholtès, Brisbane
Fractured rockmass with smoothcontactdiscontinuities;discontinuities canbe imported fromDiscrete FractureNetwork Modelers.
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Václav �milauer, Prague/Grenoble
Particle model ofconcrete, based oncontinuousformulation(plasticity,rate-dependence,damage).
Yade: Past,Present,Future
Václav�milauer
Past
PresentPython intro
Simulationstructure
Simulationdescription
Preprocess
Process
Postprocess
Functionalitywalkthrough
Future
Researchersusing YadePast projects
Presentprojects
Thanks for attention
Got questions
?Ask them at
answers.launchpad.net/yade/