Jump to content
  • Advertisement
Sign in to follow this  
trs79

Confusion about SPH simulation scale vs game world units scale

This topic is 2568 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All,

I'm trying to create a simulation where SPH particles are filling a small jar with roughly the same circumference as a glass mason jar (about 10cm). I'm currently using Nvidia PhysX as the simulation, but as the particles fill the jar they jitter uncontrollably. My understanding from research is that SPH is calculated at real world scales, or roughly a grid cell size of 1cm^3. My mason jar is about 10 cm^3, and my game world units are in meters, so I figured I should get the particle positions back at simulation scale without scaling them up.

The problem is I can't seem to get a stable simulation until I pass much larger values into PhysX, i.e. it has 0.02 as a rest distance default unit (docs define as "the typical particle distance of particles in the rest state (relaxed). Defines the particle resolution of the fluid. "), but until I go all the way up to 0.8 I can't get the particles to be stable. And by the time the rest distance is that large the particles seem to move very slowly, i.e slower then real-time (I assume because of the larger scale) plus the mason jar is many meters in circumference!

Other code I've seen also seems to greatly scale up the SPHsimulation, i.e. http://www.rchoetzle...hics/fluids.htm (250 times greater in world units). I appreciate any clarification, thanks

Share this post


Link to post
Share on other sites
Advertisement
I'll try to clarify, I've stopped using physx and am now using a general purpose fluid library from here: http://www.rchoetzlein.com/eng/graphics/fluids.htm Can anyone help me understand some of what the author says on that page:

The size of the simulation is based on the smoothing radius:
Smoothing radius = 0.01 meters = 1 centimeter
So, this says, the fluid particles push on each other across a distance of 1 centimeter (in fluid scale). Beyond 1 cm, fluid particles do not interact with one another. This is quite small.. but it represents the real size of the fluid we can simulate.
So far, most fluid simulations cannot do a real fluid much larger than 10 cm ^ 3.[/quote]

How can a fluid simulation with thousands of particles with a 1 centimeter smoothing radius all fit within a 10 cm^3 area? Also:

In our graphics world, we might want this tiny fluid to be an ocean, so we scale up the fluid to match our world. However, the fluid must simulate at the real-world, physically correct fluid scale. The simulation_scale constant is used to change between simulation scale and world scale.
Simulation scale = 0.004
This says the fluid we render is 250 times bigger than the simulation scale. (1/.004)[/quote]

In my case, I don't want to scale up the graphics world because my graphics and other physics units are in meters so I'd like everything to be the same. However, when I try a scale of 1 in the code the program crashes for some reason. Since I just want to simulate filling a small glass with water, it seems like the default scale of 1 cm^3 should already be fine without scaling, but I could be wrong about that, thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!