[Yade-users] [Question #253117]: force displacement curve
New question #253117 on Yade: https://answers.launchpad.net/yade/+question/253117 Hello All, I was trying to obtain force displacement curve between two particles in contact but I wasn't sure how to do this. I have some scenarios here. What if I fixed one particle can I applied external force to the other particle? or if I fixed one particle and gave the other particle the command to move towards the other particle either by : moving with constant velocity, or to move directly to specific overlap location? Would any of these method give me correct force displacement results? Many thanks, Hasan -- You received this question notification because you are a member of yade-users, which 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 #253112]: memory leakage when passing a variable from python to C++
New question #253112 on Yade: https://answers.launchpad.net/yade/+question/253112 Hi all, I modified the source code of yade to have an engine applying drag and lift force on each particle at each time step in function of a given average velocity field. The fluid flow is turbulent so that I determine every dt_f also randomly a fluid velocity fluctuation associated to each particle. (dt_f~100 dt) To evaluate the drag and lift, I need then to pass the value of the fluctuation associated to each particles from the python script to the C++ engine. This takes the form of a vector of size len(O.bodies) and should then be given to the C++ engines every dt_f However, when the number of particle is high (~50 000), the simulation stops after about 60s and it is written : "processus arrêté" (processus stopped in french). This is most probably due to the fact the process is taking too much memory. For example a simulation of 83000 particles after 60s of virtual time simulated takes 14GB of memory and 10GB of SWAP. I made a test script and I found that the increase in memory consumption with time is due to the number of time I am passing the vector with the fluctuation associated to the particle from the python script to the C++ engine. I have possibilities to pass a smaller vector to the C++ engine, or to evaluate the turbulent fluctuation inside the C++ engine, however it does not seem normal to me to have memory leakage when passing a variable from python to C++. Any idea of what it is due to ? Is there a way to fix this problem ? Thanks for your help ! Raphaël Yade version : 2014-06-29.git-de4c01a linux version : Ubuntu 12.04 Hereafter the modification of the C++ code I made. ForceEngine.cpp : void HydroForceEngine::action(){ FOREACH(Body::id_t id, ids){ Body* b=Body::byId(id,scene).get(); if (!b) continue; if (!(scene->bodies->exists(id))) continue; const Sphere* sphere = dynamic_cast(b->shape.get()); if (sphere){ Vector3r posSphere = b->state->pos;//position vector of the sphere int p = floor((posSphere[2]-zRef)/deltaZ); //cell number in which the particle is if ((p0)) { Vector3r liftForce = Vector3r::Zero(); Vector3r dragForce = Vector3r::Zero(); Vector3r vFluid(vxFluid[p]+vxFluct[id],0.0,vzFluct[id]); //fluid velocity at this point (including fluctuations) Vector3r vPart = b->state->vel; Vector3r vRel = vFluid - vPart; //Drag force calculation Real Rep = vRel.norm()*sphere->radius*2*rhoFluid/viscoDyn; Real A = sphere->radius*sphere->radius*Mathr::PI; //Crossection of the sphere if (vRel.norm()!=0.0) { Real hindranceF = pow(1-phiPart[p],-expoRZ); //hindrance function Real Cd = (0.44 + 24.4/Rep)*hindranceF; //drag coefficient dragForce = 0.5*rhoFluid*A*Cd*vRel.squaredNorm()*vRel.normalized(); } //lift force calculation due to difference of pressure (Saffman lift) int intRadius = floor(sphere->radius/deltaZ); if ((p+intRadius0)&&(lift==true)) { Real vRelTop = vxFluid[p+intRadius] - vPart[0]; // relative velocity of the fluid wrt the particle at the top of the particle Real vRelBottom = vxFluid[p-intRadius] - vPart[0]; // same at the bottom liftForce[2] = 0.5*rhoFluid*A*Cl*(vRelTop*vRelTop-vRelBottom*vRelBottom); } //Archimedes force calculation Vector3r archimedesForce = -4.0/3.0*Mathr::PI*sphere->radius*sphere->radius*sphere->radius*rhoFluid*gravity; //add the force to the particle scene->forces.addForce(id,dragForce+liftForce+archimedesForce); } } } } ForceEngine.hpp : class HydroForceEngine: public PartialEngine{ public: virtual void action(); YADE_CLASS_BASE_DOC_ATTRS(HydroForceEngine,PartialEngine,"Apply drag and lift force (and Archimedes force) due to a fluid flow vector (1D) to each sphere. The applied force reads\n\n.. math:: F_{d}=\\frac{1}{2} C_d A\\rho|\\vec{v_f - v}| vec{v_f - v} \n\n where $\\rho$ is the medium density (:yref:`density`), $v$ is particle's velocity, $v_f$ is the velocity
[Yade-users] [Question #253105]: How to visualize bonds/cohesion using intr recorder and Paraview?
New question #253105 on Yade: https://answers.launchpad.net/yade/+question/253105 Hi, I am attempting to create a visualization of active bonds on a Cpm material sphere packing. Here is a link to my current result: http://i.imgur.com/ZdPTqJF.png I used the intr recorder and the documentation states that intr, "Store interactions as lines between nodes at respective particles positions. Additionally stores magnitude of normal (forceN) and shear (absForceT) forces on interactions (the geom)". I am currently presuming that other interactions could be contained in my visualization and thus this is not a proper representation of the bonds. For example, this packing eventually gets collides with facets that are FrictMat. How would I be able to only have the cohesive/bonding interactions for my visualization? Thank You, Colin Power -- You received this question notification because you are a member of yade-users, which 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 #253097]: Imposing constant velocity on clumps on single axis
New question #253097 on Yade: https://answers.launchpad.net/yade/+question/253097 Hi, I am trying to make several clumps move on the x-axis at a constant velocity. I have written a function that will be used by PyRunner to repeatedly spawn these clumps every so many iterations. My function currently works if I just append the packing as spheres but when I change them into clumps they remain static on the x-axis. However, the clumps do move if I use NewtonIntegrator and apply an acceleration on the x-axis. Here is my function: def moreSpheres(i=1): y_shift = 0 for n in xrange(0,i): geoFile = 'ice_blocks/ice_block_'+str(random.randint(1,1000))+'.geo' y_shift+= random.uniform(10, 15) x_shift = random.uniform(0, 20) packing = yade.ymport.gengeoFile(fileName=geoFile, shift=Vector3(-99+x_shift, -99+y_shift, 2), scale=1.0, orientation=Quaternion((1, 0, 0), 0),color=sphereColor, material=ice, wire=False) for b in packing: b.state.blockedDOFs='xYZ' b.state.vel = Vector3(50,0,0) #O.bodies.appendClumped(packing) O.bodies.append(packing) Thank you, Colin Power -- You received this question notification because you are a member of yade-users, which 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