# Physically based rain

## Recommended Posts

Hey guys,

I am trying to create a physically based rain simulation. I am updating these acting forces on every frame: Gravity, wind and drag. The formulae themselves should be correct, but I am clearly overseeing something. The velocity should not exceed 15m/s, but currently it is going way past that point.

Any help is greatly appreciated.

Thanks,
Manu

PBRain_tmp_v0002_nocomment_mko_.hip

##### Share on other sites

I'm bamboozled by all the formulea.....but just a quick observation...shouldn't there be a Trail in there to compute velocity ?

##### Share on other sites

Your projected area is many orders of magnitude smaller than everything else in your calculations, unless you put the drag into the 10^4 magnitude, everything else is irrelevant because of that

##### Share on other sites

1 minute ago, vtrvtr said:

Your projected area is many orders of magnitude smaller than everything else in your calculations, unless you put the drag into the 10^4 magnitude, everything else is irrelevant because of that

yeah I found the same. The value of your drag has to be really high to make an impact at all.

26 minutes ago, Noobini said:

I'm bamboozled by all the formulea.....but just a quick observation...shouldn't there be a Trail in there to compute velocity ?

Noobini the velocity is generated by the first wrangle node in pops, where gravity is created.

##### Share on other sites

1 minute ago, Jesper Rahlff said:

Noobini the velocity is generated by the first wrangle node in pops, where gravity is created.

ah ok...so trail is really only for when you are manually manipulating the geo (like a mountain/noise) i guess....so it finds the diff between frames and make that the vel...

So now the gravity is doing the work instead of the mountain/noise.....Thanks Jesper

##### Share on other sites

30 minutes ago, Noobini said:

ah ok...so trail is really only for when you are manually manipulating the geo (like a mountain/noise) i guess....so it finds the diff between frames and make that the vel...

So now the gravity is doing the work instead of the mountain/noise.....Thanks Jesper

anytime

##### Share on other sites

You guys are right. All the variable calculations should be physically correct though:

float waterDensity = 1000; //http://www.sengpielaudio.com/calculator-densityunits.htm
float airDensity = 1.225; //https://en.wikipedia.org/wiki/Density_of_air
float mass = Volume*waterDensity; //should be a given
float dragCoefficient = 0.3; //https://www.grc.nasa.gov/www/k-12/VirtualAero/BottleRocket/airplane/shaped.html
float drag = 0.5*dragCoefficient*airDensity*pow(velocity,2)*projectedArea; //https://www.grc.nasa.gov/www/k-12/VirtualAero/BottleRocket/airplane/drageq.html

I am so very sure, that I am just missing a tiny thing.

##### Share on other sites

at one points I wrote something stupid here....

R.I.P Jesper

Edited by Jesper Rahlff
I was wrooooongg
##### Share on other sites

same same innit ? you divide by 2 while the OP mults by 0.5

##### Share on other sites

14 minutes ago, Noobini said:

same same innit ? you divide by 2 while the OP mults by 0.5

except he mults everything with 0.5 I only divide power(velocity,2) with 2

##### Share on other sites

but............the net effect, it's the same...unless I need to go back to see my high school math teacher....

(she's very beautiful btw, so I don't mind at all...)

Edited by Noobini
##### Share on other sites

4 minutes ago, Noobini said:

but............the net effect, it's the same...unless I need to go back to see my high school math teacher....

I think I gotta forfeit this one.. Scratch whatever I said.

##### Share on other sites

Just now, Jesper Rahlff said:

I think I gotta forfeit this one.. Scratch whatever I said.

haha...detention for you young man !!!

##### Share on other sites

Just now, Noobini said:

haha...detention for you young man !!!

I guess sometimes I want to find errors even when there are none

I actually had to get out a piece of paper and quickly assign each variable  a generic value and then do the math for both equations to assure myself you are correct.

##### Share on other sites

Thanks for the link Jesper! Shows some really cool stuff.

Unfortunately, it shows the same equations that I used, so no real solution in sight.

##### Share on other sites

waiiiiiiiiiit just a minute....my math teacher said....sphere vol should be 4/3 PI  r CUBED !!! you forgot the CUBED !!! (not that it's gonna fix the problem tho...but let's get this right first)

##### Share on other sites

Correcting what Noobini has found, and then adjusting the drag coefficient to .7 returns a terminal velocity of 10.15 m/s.

That seems fairly realistic!

Now you just have to implement a dynamically adjusting drag coefficient based on velocity and drop size http://journals.ametsoc.org/doi/pdf/10.1175/1520-0450(1969)008<0249:TVORA>2.0.CO%3B2

##### Share on other sites

1 hour ago, Noobini said:

not that it's gonna fix the problem tho...

hang about...it DID fix it.....even using the current coeff of 0.3...terminal velocity is 'reasonable'...I gotta visit my math teacher more often !!!

##### Share on other sites

Just now, Noobini said:

hang about...it DID fix it.....even using the current coeff of 0.3...terminal velocity is 'reasonable'...I gotta visit my math teacher more often !!!

wait you know math now?! ... *throws the towel*

##### Share on other sites

Just now, Jesper Rahlff said:

wait you know math now?! ... *throws the towel*

well anything that's got pi in it...I'm in....

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×