# Spheres swelling

Hi,

I want simulate the swelling of the particles by using Eq. 9 from this paper https://www.sciencedirect.com/science/article/pii/S0032591017304722#!.

How can I do it, is there any in-built function in Yade. Can I use the TriaxialStressController and maxmultiplier.

Best,
Mithu

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:

## This question was reopened

 Revision history for this message Jan Stránský (honzik) said on 2021-06-10: #1

Hello,

please provide what is the problem (changing size of particles, computing dri from eq.9, ...).

In general, you can arbitrarily modify b.shape.radius, b.state.mass, b.state.inertia to match your needs.

There used to be a function to scale a sphere including mass (might not be what you want), but I don't remember its name cannot find it at the moment.

Cheers
Jan

 Revision history for this message Mithushan Soundaranathan (mithushan93) said on 2021-06-10: #2

Hi Jan,

I want to change radius (dri) over time of the spheres.

Best,
Mithu

 Revision history for this message Mithushan Soundaranathan (mithushan93) said on 2021-06-10: #3

The scale method, can we use different scale or does it need to be constant?

 Revision history for this message Jan Stránský (honzik) said on 2021-06-10: #4

> I want to change radius (dri) over time of the spheres.
> b.shape.radius=dri at different time point.

Instant replay:
please provide what is the problem.

> The scale method, can we use different scale or does it need to be constant?

Cheers
Jan

 Revision history for this message Robert Caulk (rcaulk) said on 2021-06-10: #5

As Jan says, we really need to know what your problem is before we can give you any real advice. In general, you could do it like this from the yade input script:

for b in O.bodies:

But if you need it to be a function of saturation, you could look at PartialSatClayEngine [1]. In that engine, the swelling of particles is an exponential function that depends on saturation level.

Another example of particle "swelling" is in ThermalEngine where it thermally expands particles according to their temperature [2].

 Revision history for this message Robert Caulk (rcaulk) said on 2021-06-10: #6

edit: the for loop on the body container would need to be put into a PyRunner FYI.

 Revision history for this message Mithushan Soundaranathan (mithushan93) said on 2021-06-10: #7

Hi Both,

Thank you very much, the problem is that I do not how implement the swelling model in Yade and different option I have to implement it.

I am thinking of something similar to:

for b in O.bodies:

would be great.

Best,
Mithu

 Revision history for this message Jan Stránský (honzik) said on 2021-06-10: #8

> I do not how implement the swelling model in Yade and different option I have to implement it.

you can:
- use python and PyRunner and update particles regularly
- implement new Engine in C++
- ...

###
O.engines = [
...
PyRunner(command="swell()",iterPeriod=1), # or iterPeriod=someOtherNumber, or virtPeriod instead of iterPeriod
]

def swell():
for b in O.bodies:
# test if body is sphere?
swell1(b)
def swell1(body):
rNew = ... # eq. (9) using rCurrent
# mass and inertia does change or not?
###

Cheers
Jan

 Revision history for this message Mithushan Soundaranathan (mithushan93) said on 2021-06-11: #9

Thanks Jan Stránský, that solved my question.

 Revision history for this message Mithushan Soundaranathan (mithushan93) said on 2021-06-27: #10

Hi Jan,

How do I update the mass and inertia for each iteration?

Best,
Mithu

 Revision history for this message Jan Stránský (honzik) said on 2021-06-28: #11

body.state.mass = value
body.state.inertia = (x,y,z) # 3 principal values

> each iteration?

set iterPeriod to 1

Cheers
Jan