I'm implementing basic fluid flow simulator using SPH method basing on e.g. https://www10.informatik.uni-erlangen.de/Publications/Theses/2010/Staubach_BA10.pdf.
So far I've implemented:
uniform grid constructing
density and pressure field calculating
- pressure force and viscosity force calculating
- velocity damping force calculating
- surface tension force (surface normal and curvature value) calculating
- acceleration and velocity calculating (basing on these forces and gravity force)
Unfortunately I have a problem with calibrating parameters to avoid particles clustering or spreading them in every possible direction.
Is there a way other than random to calculate proper values of simulation parameters?
My parameters are:
- particle radius - (I'd like it to be 0.3 and to set other parameters corresponding to this one)
- smoothing radius - 4*particle radius = 1.2
- particle mass - decides about everything
- stiffness - decides about value of pressure force (k in 2.19 equation)
- rest density - decides about pressure field (ρ0 in 2.19 equation)
- dynamic viscosity - decides about value of viscosity force (μ in 2.25 equation)
- gravity force - (0.0, -9.81, 0.0)
- velocity damping - decides about value of damping force (F = -velocity damping * velocity)
- tension coefficient - decides about value of surface tension force (σ in 2.30 equation)
- tension treshold - minimal length of surface normal to calculate surface tension force (l in 2.31 equation)
- time step
I'm pretty sure that my calculations are fine. Unfortunately example values from this or other documents don't work for me and I probably need to calculate them on my own.
I'll be glad to answer any questions about my implementation to help you help me. :)
Oh, almost forgot, I'm using CUDA 6.0.