Relative velocity for DragEngine()

Asked by Nicolas Godet

Dear all,

What I would like to do is accelerating or decelerating spheres using the relative velocity between the spheres and a fluid media moving at fixed velocity (velocity that I can compute and update in my script). This value of velocity could be a float or Vector3(vx,vy,vz).

Currently, DragEngive() compute the drag force as if the spheres are moving in a resting media, it uses the absolute velocity of the spheres.

I was not able to find the C++ file on github to check the current code and try to implement what I need...

Regards,
Nicolas

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Nicolas Godet
Solved:
Last query:
Last reply:
Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#1
Revision history for this message
Nicolas Godet (nicolas.godet) said :
#2

Thank you Klaus !

I will have a look but it seems that the only solution is to modify the C code.

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#3

To start with, you could also do it in Pyhton, simply create your own
engine and run it as a PyRunner, e.g.

O.engines=[ # define your engines first
        ForceResetter(),
        InsertionSortCollider(...), # define
        InteractionLoop(...)

PyRunner(initRun=True,iterPeriod=1,command='myDragEngine()',label='mydrag'),
# this is your drag engine defined below
        NewtonIntegrator(),
]

#### define myDragEngine here:
def myDragEngine():
    b = 6.*pi*viscosity*radius # defene relevant equations here
    drag = -b*O.bodies[someid].state.vel
    O.forces.addF(someid,drag) # add the force

Note that this will be fine if you don't have many particles.

HTH Klaus

On Mon, May 14, 2018 at 9:27 PM, Nicolas Godet <
<email address hidden>> wrote:

> Question #668998 on Yade changed:
> https://answers.launchpad.net/yade/+question/668998
>
> Status: Answered => Solved
>
> Nicolas Godet confirmed that the question is solved:
> Thank you Klaus !
>
> I will have a look but it seems that the only solution is to modify the
> C code.
>
> --
> You received this question notification because your team yade-users 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
>