Distance between particles

Post here anything related to RealFlow that doesn't specifically belong in any of the forums below
Post Reply
duke3d
Posts: 18
Joined: Wed Aug 24, 2016 12:15 am

Distance between particles

Post by duke3d » Mon Feb 05, 2018 7:21 am

Hello!

According to the Help of Realflow distance between particles can be found like this: radius = 1.0 / (1000.0 · Resolution^1/3) (in meters)
So, for resolution 1.0 distance is 0.001. For the resolution 2.0 distance is 0.000794.

Emitter is a square, 1m*1m.
When I calculate the distance with a script like this:

dom = scene.get_PB_Emitter("Square01")

p_1 =dom.getParticle(1)
p_2 =dom.getParticle(2)

pPos_1 = p_1.getPosition()
pPos_2 = p_2.getPosition()
Dist = pPos_1 - pPos_2

d = Dist.module()
print (str(d))

scene.setGlobalVariableValue("defDist", d)

(or if I use just d = pPos_1.distance(pPos_2))

the result is always 100 times more then it should be. instead of 0.001 for resolution 1.0 I get 0.1. For resolution 2.0 I get 0.0794 instead of 0.000794, and so on. I've tried it with Dyverso particles and I got the same results.
Am I doing something wrong?

Thomas Schlick
Posts: 178
Joined: Tue Aug 29, 2017 12:35 pm

Re: Distance between particles

Post by Thomas Schlick » Mon Feb 05, 2018 8:44 am

Just an idea, but what's your scene scale?

duke3d
Posts: 18
Joined: Wed Aug 24, 2016 12:15 am

Re: Distance between particles

Post by duke3d » Mon Feb 05, 2018 9:02 am

Thomas Schlick wrote:
Mon Feb 05, 2018 8:44 am
Just an idea, but what's your scene scale?
Scale is default, 1.0 ;)

Thomas Schlick
Posts: 178
Joined: Tue Aug 29, 2017 12:35 pm

Re: Distance between particles

Post by Thomas Schlick » Mon Feb 05, 2018 11:02 am

Argh... Wanted to add another note, but deleted the post by accident :D

Ok, the result of 0.1 m is correct. In a square of 1m x 1m and a resolution of 1.0 you have exactly 100 particles. So, the distance between each particle is 0.1 m.

You've compared distance with radius. It's true that resolution affects radius and distance, but this doesn't mean that radius == distance. Otherwise the particles wouldn't be able to collapse under the influence of gravity, and parameters like Int/Ext Pressure wouldn't have any effect. And you can see that particles can get very close in a fluid with resolution = 1.0.

duke3d
Posts: 18
Joined: Wed Aug 24, 2016 12:15 am

Re: Distance between particles

Post by duke3d » Mon Feb 05, 2018 12:56 pm

Oh I feel a bit shame now :))) I misunderstood the particle radius term :)))) Thanks for clarification ;)
By the way I was looking of some way to get initial distance between particles before the simulation is lunched :) Zero frame usually has no particles (unless Emitter's volume parameter is set to something more then 0) and I can't find distance between particles. Do you have any suggestions?

Thank you for helping :D
Andrey

Thomas Schlick
Posts: 178
Joined: Tue Aug 29, 2017 12:35 pm

Re: Distance between particles

Post by Thomas Schlick » Mon Feb 05, 2018 12:59 pm

Well, you can simply create an initial state from frame 1 or 2 or whatever. Then you'll have particles at frame 0.

duke3d
Posts: 18
Joined: Wed Aug 24, 2016 12:15 am

Re: Distance between particles

Post by duke3d » Mon Feb 05, 2018 1:54 pm

Thomas Schlick wrote:
Mon Feb 05, 2018 12:59 pm
Well, you can simply create an initial state from frame 1 or 2 or whatever. Then you'll have particles at frame 0.
Oh, it make sense :D

Thank you :)

Post Reply