← Back to team overview

yade-users team mailing list archive

Re: [Question #703948]: change density and roughness over time

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
> 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

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