← Back to team overview

yade-users team mailing list archive

Re: [Question #660590]: Loading and manipulating a saving file

 

Question #660590 on Yade changed:
https://answers.launchpad.net/yade/+question/660590

amir posted a new comment:
Hello Bruno,


>>I don't understand the details of this discussion (it is especially unclear to me why one needs to "save/load", then "erase/append", when the objective seems to be just "append").
 
 
Why "save/load" ?
 
In my multiscale FEM/DEM model, DEM supply initial data (porosity, permeability, the flux of small particles) for selected nodes in the continuum model for each global time step. So, simulation from previous time step in Yade is loaded at the beginning of the next time step.
 
For more details, you can read my paper here: https://drive.google.com/open?id=1Vkl5lb89BXlxzaj44N3kPDMfy_a8cQDr
 
 
Why "erase/append"?
 
The reason is that the FEM model extrapolates porosity value (received from DEM) for longer time step. The new value of the porosity has to be implemented in DEM for at the beginning of the next time step. So, a specific number of particles are added to the simulation.
 
To add a new particle to the aggregate of particles and to avoid overlapping with the existing particles, positions of existing particles were taken, the new particles were added and then existing particles was erased (to delete physical body) and cleared ( to remove ids). Finally, all particles were added to the simulation.
 
#########################################################
sp=SpherePack(); sp.fromSimulation()
sp.makeCloud((0,0,0.011),(0.01,0.01,.03),rMean=r,num=?)
 
for b in O.bodies:
if isinstance (b.shape,Sphere): O.bodies.erase(b.id)
O.bodies.clear()
sp.toSimulation()
O.bodies.append(utils.geom.facetBox((1,1,1),(1,1,1),wallMask=31))
 
 
* I have shown this codes does not work properly by the single sphere test. I could not realize what the problem is. The particle is created at the same position. The same gravity force is applied on it but forces and interaction are not correct. You can run two simple scripts, tst1.py and tst2.py.
 
 
Why “clear”?
 
The number of bodies in my simulation is around 15000. It means everytime Yade loads and reinserts simulation, 15000 empty bodies are added to the O.bodies list. In Yade, empty bodies in the list cannot be removed unless using the 'clear' command.
 
Furthermore, I have to get rid of the particles reached to the container (Fig 1)(the area under the mesh) to keep the lowest number of particles in the simulation.
 
 
>>> However I do think O.reset() is not the solution. It is supposed to wipe out the simulation completely (engines, materials, interactions, ... not only bodies). So of course an empty simulation in which you insert a few bodies is not crashing but it is also not doing anything (no movement). I'm not sure it is very interesting.
 
It is true if there were no engine. If the same gravity force is applied to the particle at the same position. It gives the same resultant force. I have verified the resultant force, position and normal force with the last iteration of the 1st simulation.
 
It also gave the same resultant forces for my simulation containing 15000 particles.

Bests

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.