Jump to content
fatboYYY

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

  • Like 1

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 Volume = 4/3*pi*radius; //https://en.wikipedia.org/wiki/Sphere#Enclosed_volume
float mass = Volume*waterDensity; //should be a given
float projectedArea = pi*pow((2*radius),2)/4; //http://www.mne.psu.edu/cimbala/me325web_Spring_2012/Labs/Drag/intro.pdf
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 this post


Link to post
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 this post


Link to post
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
  • Haha 1

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 :P

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 this post


Link to post
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.  

image.png

Share this post


Link to post
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)

  • Thanks 1

Share this post


Link to post
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 :Phttp://journals.ametsoc.org/doi/pdf/10.1175/1520-0450(1969)008<0249:TVORA>2.0.CO%3B2

 

  • Thanks 1

Share this post


Link to post
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 !!!

  • Thanks 1

Share this post


Link to post
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 this post


Link to post
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....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×