change density and roughness over time

Asked by Daizong Meng

Hello,

I am going to simulate a sphere settling process in seawater and want to change the density and roughness over time. I am wondering how to achieve it. Is GlobalStiffnessTimeStepper suitable for my simulation? Are there any related examples like my simulation?

Any help would be appreciated.

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hi,

Mass density is stored in
b.mat.density # with b a Body

Please note that a manual update of density (after the body has already been created) does not directly reflect onto b.state.mass or b.state.inertia. You also have to manually update those accordingly

GlobalStiffnessTimeStepper is something to automatically compute and assign a suitable time step, I can not think of a relation with what I understand from your question.

For more details, please precise your question (which roughness are you speaking about, for instance ?)

Revision history for this message
Daizong Meng (mdz950103) said :
#2

Hi, jduriez,

Thanks for your response.

I found the roughness in Yade did not have a unit. Is it roughness ratio (k/d)? I want to control the variation of roughness over time based on the surface-covering ratio. I mean there is a kind of material attached to the sphere and this process change with time. In this process, the k/d is a constant but the surface-covering ratio increases. I am wondering if is it possible to achieve it by Yade? Do I need to alter the source code?

Any response would be highly appreciated

Revision history for this message
Daizong Meng (mdz950103) said :
#3

Hi,

I am new user for programming with yade. The help is significant for me to start my project.

Any response would be highly appreciated.

Sincerely,

DZ

Revision history for this message
Daizong Meng (mdz950103) said :
#4

I am wondering whether it is possible to change drag coefficient with time, which means drag coefficient becomes a function of time.

Revision history for this message
Jan Stránský (honzik) said :
#5

Hello,

> I am new user for programming with yade. The help is significant for me to start my project.

Then follow previous instructions, mainly Jerome's:
>> For more details, please precise your question (which roughness are you speaking about, for instance ?)

Provide (much) more information.
What is "k", "d", "surface-covering ratio", ...?
So far given information are scattered (density, roughness, GlobalStiffnessTimeStepper, ...) with some terms ambiguous (roughness, k, d).

> I am wondering whether it is possible to change drag coefficient with time

Please be more specific on what "drag coefficient" is. Give some context, etc..

Anyway, consider opening a new question for a new problem ([1], point 5)

Cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask

Revision history for this message
Daizong Meng (mdz950103) said :
#6

Hi Jan,

>>For density, jduriez's answer is helpful for me but like he said

Mass density is stored in
b.mat.density # with b a Body and I also need to manually update mass.

I want to know how to alter it with time step. I would highly appreciate it if you can write a small piece of code or give me a related example to show how to achieve that.

>> Drag coefficient is used to calculate the drag force, a kind of fluid force on the particles. You can find the in the description of HydroForceEngine from https://yade-dem.org/doc/Yade.pdf, page 360-361. it is influenced by the roughness of particle.

Roughness is expressed as eps(=0.00001) defined as a fraction of particles size in the Yade document https://yade-dem.org/doc/Yade.pdf. that is what I mean for k/d because d is the size of particle and for sphere it is diameter (d).

For surface-covering ratio, you can image a sphere that part of its surface is smooth and part is rough and surface-covering ratio is rough surface area/total surface area.

I want to control the variation of roughness over time based on the surface-covering ratio. I mean there is a kind of material attached to the sphere and this process change with time. In this process, for the rough part surface the eps is a constant but the surface-covering ratio increases, i.e. rough surface area increases. However, I did not find the definition of surface-covering ratio in Yade document. Do you know some related expression of that?

Because roughness can influence the drag coefficient so I want to set drag coefficient directly and let it change with time. Can you give me some coding inspiration?

Sincerely,

DZ

Revision history for this message
Best Jan Stránský (honzik) said :
#7

> Mass density is stored in
> b.mat.density # with b a Body and I also need to manually update mass.

b.state.mass = whatever # [2]

> I want to know how to alter it with time step. I would highly appreciate it if you can write a small piece of code or give me a related example to show how to achieve that.

e.g. using PyRunner [3,4]:
###
b = sphere((0,0,0),1)
b.state.mass = 1e-6

O.engines = [
    PyRunner(iterPeriod=1,command="changeMass()"),
]
O.dt = 0.4

def changeMass():
    b.state.mass = 2.5 * O.time # or any other relation
    print(O.iter, O.time, b.state.mass)

O.run(10,True)
###

> Drag coefficient ...

maybe [5]?

I am not using liquid-related stuff myself, so I cannot help much to the specifics of your question..

> I want to control the variation of roughness over time ...
> I mean there is a kind of material attached to the sphere and this process change with time. In this

using PyRunner, you change whatever (material itself, material parameters, ......) at any time using PyRunner and iterPeriod or realPeriod

Cheers
Jan

[2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.State.mass
[3] https://yade-dem.org/doc/user.html#running-python-code
[4] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.PyRunner
[5] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.HydroForceEngine.roughnessPartScale

Revision history for this message
Daizong Meng (mdz950103) said :
#8

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