Putra
Putra

Reputation: 67

Fluid Simulation using Smooth Particle Hydrodynamics

Actually, I'm developing an SPH simulator using C++ and openGL. There are several problem I've encountered right now,

I make initiation fluid particles on one side of the box (I make box as boundary volume), shape them like box, and give them initial velocity equal zero. Then I start the main loop, viola, the fluids start moving, and there's a weird phenomena here. The fluids start spreading over all direction.

Please look at the picture :

enter image description here http://i278.photobucket.com/albums/kk86/anggytrisnawan/Screenshot-UntitledWindow-2.png

That picture taken after several seconds from the beginning of simulation. It's seems weird for me. Here is the parameter I used for the simulation:

#define H                   0.040   // Smoothing Length
#define Rho0            1000    // (kg/m^3) water particle rest density
#define Mass                    0.012       // (kg)
#define DT                  0.001       // time step
#define TotalParticles      5000        // total number of particle

Note : currently I don't calculate surface tension force yet.

SOLVED : My fault here..they overlapping each other at the beginning..so pressure force make them spread..

Upvotes: 0

Views: 2314

Answers (2)

datenwolf
datenwolf

Reputation: 162164

What are the boundary conditions' values, i.e. at which numerical coordinates are the box limits? I assume, that your simulation runs off into a certain direction due to systematic rounding errors.

If I look at the picture I get the impression I'm looking down along -Z direction and the lower left corner of the box is at (0, 0, 0). If that's the case, then your particle simulation is not conservative, i.e. tends to push the particles towards to numerical 0, like if there was a force field.

Upvotes: 1

janneb
janneb

Reputation: 37188

From the image you provided it seems that the simulation started with all the particles in one corner. Since the particles presumably must have some repulsive potential in order to not overlap each other, once the simulation starts this repulsion will force the particles apart.

Then again, you haven't shown any code, so the above is just a qualified guess.

Upvotes: 1

Related Questions