Is it a bug ? mass won't update after desity changing

Asked by Lin Zhang

hi,
I found it kind of unreasonable about the mass calculation of body(sphere and box). I don't know whether it have been posted. If yes, plz ignore this.
I am trying to increase the timestep by assigning a large density to particles, so-called density-scale. However, I found the mass of body won't update when a new density assigned. Maybe it is a bug, at least unreasonable.

As far as I found, the mass of body is calculated only in Shop.cpp, saying only available in the initialize of body. So the calculated mass is right only if the body is declared with given materials. Otherwise, it will be calculated according to the default value(1000. in my current version) and won't update even if you change the density.

regards,
Lin ZHANG

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Lin Zhang
Solved:
Last query:
Last reply:
Revision history for this message
Anton Gladky (gladky-anton) said :
#1

Do you need to change a density during simulation?

Anton

On Tue, May 31, 2011 at 9:21 AM, Lin Zhang
<email address hidden> wrote:
> New question #159705 on Yade:
> https://answers.launchpad.net/yade/+question/159705
>
> hi,
> I found it kind of unreasonable about the mass calculation of body(sphere and box). I don't know whether it have been posted. If yes, plz ignore this.
> I am trying to increase the timestep by assigning a large density to particles, so-called density-scale. However, I found the mass of body won't update when a new density assigned. Maybe it is a bug, at least unreasonable.
>
> As far as I found, the mass of body is calculated only in Shop.cpp, saying only available in the initialize of body. So the calculated mass is right only if the body is declared with given materials. Otherwise, it will be calculated according to the default value(1000. in my current version) and won't update even if you change the density.
>
> regards,
> Lin ZHANG
>
> --
> 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     : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#2

If you want to change mass, you can change mass directly.
You are right: if you change density of a material it will no affect
existing bodies.
I think the current behaviour is reasonable.

Bruno

Revision history for this message
Jérôme Duriez (jduriez) said :
#3

Hello,

I understand your surprize, but I have the feeling that such things are quite common in Yade.
Let say you have a simulation with bodies and interactions, and at one time you decide to change frictionAngle of (material of) bodies, which should change frictionAngle of interactions also. But existing interactions will *not* be updated... Because their properties are computed only once, when they are created. The choice is surely to not compute all the things (that are supposed not to change) at each time step.

So, if you meet such cases, you have to do the job by yourself (as in TriaxialCompressionEngine for the previous example of frictionAngle). In your case, you'll have to do a loop on the bodies to recompute their mass according to their (new) density.

Revision history for this message
Lin Zhang (xtss-0002) said :
#4

hi Anton,
I want to increase the density to get a higher timestep. In fact, I solved it by updating mass and inertia manually. but consider the py script below:

sp=pack.SpherePack()
sp.load('sample.spheres')
sp.toSimulation()

it is a common method to load sample into simulation. the particles' mass will be initialized with default density value and won't change if the density is modified later.

Lin

Revision history for this message
Lin Zhang (xtss-0002) said :
#5

Thank you, Anton, Bruno and jduriez.
I should have read all your posts before my last post.

Thank you all.

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#6

> it is a common method to load sample into simulation. the particles'
> mass will be initialized with default density value and won't change if
> the density is modified later.
In case it's still not clear: you don't need a loop after that to change
all masses. Simply define density _before_ loading the spheres.

Revision history for this message
Yade Guide (yade-guide) said :
#7

Hi there! As a helpful automated assistant, I've scanned through relevant threads and condensed their content into summaries for your convenience. Feel free to explore these topics further by clicking on the provided links.

Title: "mass after simulation"
The user is using Yade to simulate material deposition in a cylinder, calculating mass and porosity with gravity set at (0,0,-9.81). They use a check function for unbalanced forces and have provided links to resources on filtering particles, calculating volume, and determining porosity.
https://answers.launchpad.net/yade/+question/688955

Title: "Update interaction physics after changing material of spheres"
Alex encounters issues with interaction updates due to code in Ip2-Functor[1]. Jerome suggests manually looping over interactions for improved performance, which causes the sphere packing to explode during simulation possibly due to stiffnesses being multiplied by 1000 leading to excessive contact forces. Alexander Eulitz speculates that it might be impossible to fill a bowl with soft particles due to their larger overlaps at higher stiffness levels. To avoid explosions, the calm() function can be used, setting velocities of all bodies to zero. A PyRunner can also be helpful in managing iterations and preventing excessive contact forces. Alex uses a PyRunner to call settleRealPacking(), which clears interactions, introduces high numerical damping, checks for unbalanced force, resets damping if the force is less than 0.1, and goes on with simulated process. Klaus suggests increasing stiffness more progressively to preserve history, while Bruno agrees and proposes updating contact properties manually and preventing explosions by increasing gravity. The user questions whether a progressive change of contact stiffness will be faster than using real material from the beginning, and suggests an approach with HertzMindlin constitutive law.
https://answers.launchpad.net/yade/+question/238797

Revision history for this message
Yade Guide (yade-guide) said :
#8
Revision history for this message
Yade Guide (yade-guide) said :
#9

Hi there! As an automated bot, I've gone through your question and found a few relevant threads that might interest you. Feel free to explore these topics further by checking out the links provided below.

Title: "problem replacing TriaxialStressController with PeriTriaxController"
Jesse discusses using PeriTriaxController for simulating gravity with cloud of clumps or periodic packing, addressing issues with makeclumpcloud and changing the periodic controller. Jan suggests increasing maxStrainRate to speed up compression, which worked after setting it to 1e10 and running 500,000 steps. Bruno offers further suggestions like decreasing 'compressor.mass' and checking if O.dt=PWaveTimeStep() is accurate for clumps.
https://answers.launchpad.net/yade/+question/656214

Title: "Changing properties of spheres causing problems."
The user encounters slow deposition and compression when modifying sphere properties (density, Young's modulus, Poisson's ratio, friction angle) in a gravity deposition followed by uniaxial compression example. The issue occurs when using non-default material properties, causing the compression to start at 80,000 iterations or more. Jan Stránský suggested checking the time step (O.dt), which depends on material stiffness.
https://answers.launchpad.net/yade/+question/248023