The present invention claims priority of Korean Patent Application No. 10-2008-0125522, filed on Dec. 10, 2008, which is incorporated herein by reference.
The present invention relates to incompressible fluid simulations, and more particularly, to a method, apparatus and system for Smoothed Particle Hydrodynamics (SPH) simulations satisfying the incompressibility condition of a fluid, and a storage medium storing a program for executing the method.
A fluid is defined as an amorphous substance such as water, fire, cloud, smoke or the like and there have been studies on fluid animation which concerns simulation and visualization of natural phenomena by fluids such as liquids or gases.
The fluid simulation for such fluid animation is based on the Navier-Stokes equations. These equations rewrite Newton's equation of motion (F=ma) for a fluid, and describe the relationship among acceleration of a fluid, forces acting on the fluid motion, pressure, external force, and viscosity of the fluid. It is known that, in a broad view, the Navier-Stokes equations very accurately define the motion of most fluids.
Originally, the Navier-Stokes equations are defined in continuous space, and a crucial issue herein is that which method should be used to calculate the same in a computer. Two calculation methods are largely used: grid-based method and particle-based method.
The grid-based method is a method for dividing space into grids of a same size and calculating characteristics of a fluid in each grid. It is known to be suitable for describing a smooth surface of water. The particle-based method describes a fluid in terms of particles that interact via forces with each other. The final form of a fluid is calculated by tracing the motion of particles, and thus, it is suitable to calculate an intensive motion of the fluid.
There are also several techniques used for the particle-based fluid simulation. One of them, which has recently drawn the attention, is a Smoothed Particle Hydrodynamics (SPH) technique. The SPH technique describes a smooth and continuous space formed of numerous molecules of a fluid with a relatively very small number of particles.
The typical fluid simulation method shown in
However, this fluid simulation method using the SPH technique had a problem in that the method cannot satisfy the incompressibility condition of a fluid due to the absence of a process of keeping the fluid in an incompressible state.
Therefore, the present invention provides a method for incompressible fluid simulations based on an SPH technique that satisfies the incompressibility condition of a fluid.
The present invention further provides a storage medium which stores a program for executing the method for incompressible fluid simulations on a computer.
The present invention further provides an apparatus for incompressible fluid simulations that can perform the method for incompressible fluid simulations.
The present invention further provides a system for incompressible fluid simulations employing a computer which executes a program read out from a storage medium, in which the method for incompressible fluid simulations is stored in a program format.
The objects and features of the present invention will become apparent from the following description of preferred embodiments, given in conjunction with the accompanying drawings, in which:
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings which form a part hereof.
The fluid simulation apparatus shown in
The incompressibility condition calculating unit 120 is configured with a temporary velocity calculator 121 for calculating a temporary velocity of a particle free of compression based on the force calculated by the particle attribute calculating unit 110; a pressure calculator 123 for calculating pressure that satisfies the incompressibility condition of a particle based on the calculated temporary velocity; and an incompressible velocity calculator 125 for calculating velocity that satisfies the incompressibility condition of the particle by applying the pressure calculated in the pressure calculator 123.
A fluid simulation process carried out by the apparatus for incompressible fluid simulations having the above configuration will now be explained with reference to
In the present invention, an approach for the numerical approximation of the Navier-Stokes equations was made to simulate a real fluid motion. For the sake of illustration, let a velocity field of a fluid at time t be u=u(x,t), and let its differentiation with respect to time t be ut. Then, the Navier-Stokes equations that satisfy the incompressibility condition of a fluid can be expressed as Eqs. 1 and 2 below:
ρ(ut+u·∇u)=−∇p+ρg+μ∇2u Eq. 1
∇·u=0 Eq. 2
wherein, p=p(x,t) is a kinetostatic pressure of a fluid, g indicates gravity, and μ indicates a viscosity coefficient of a fluid. Further, Eq. 1 is a Navier-Stokes equation defining a fluid flow, and Eq. 2 relates to volume conservation of a fluid.
f=−∇p+ρg+μ∇V
2
v Eq. 3
As illustrated in Eq. 3, a force f acting on a particle can be written as a sum of pressure (−∇p), gravity (ρg), and viscosity (μ∇2v).
Substituting Eq. 3 in Eq. 1 yields Eq. 4 below:
ρ(ut+v·∇v)=f Eq. 4
Eq. 4 is a momentum equation of a real particle. Through Eq. 4, acceleration of an ith particle can be calculated as follows:
With the acceleration of the ith particle obtained by Eq. 5, it becomes possible to calculate velocity and location of the ith particle.
In the present invention, the Navier-Stokes equations, which are equations for fluids, were subject to the numerical approximation through the SPH technique that is suggested by Lucy, Gingold and Monaghan for astrophysics simulation. A scholar value Ai for the ith particle forming a fluid can be written as follows:
wherein mj is mass of the jth particle, ρj indicates density, W(r,h) indicates a smoothing kernel function for radius h, r indicates the location of the ith particle, rj indicates the location of the jth particle, and Aj indicates a scalar value of the jth particle.
The smoothing kernel function W(r,h) needs to satisfy Eq. 7 below:
W(r,h)=W(−r,h) Eq. 7
Based on Eq. 6, density of the ith particle is defined as Eq. 8 below:
Similar to the above, viscosity, surface tension and the like acting on the ith particle can be calculated based on Eq. 6 above.
Although it is possible to perform SPH simulation by using Eqs. 1 and 8, the incompressibility condition of a fluid cannot be obtained because there is no proper solution to satisfy Eq. 2.
In this present invention, a temporary velocity u* of the ith particle with no pressure acting thereto is defined as in Eq. 9 below to satisfy the incompressibility condition of a fluid:
u*=u
n
+Δt(ρg+μ∇2v+fsurface) Eq. 9
wherein fsurface indicates surface tension of water, un indicates velocity when t=n, and Δt indicates time displacement.
In the fluid simulation, velocity when t=n+1 needs to be provided. Therefore, in Eq. 10 below, the velocity when t=n+1 is calculated by applying pressure that is not applied to Eq. 9.
To make the velocity un+1 satisfy the incompressibility condition, the pressure p satisfying the incompressibility condition needs to be incorporated in u* calculated without considering the incompressibility condition. In this manner, the present invention can keep a fluid in an incompressible state.
The pressure p satisfying the incompressibility condition is obtained by substituting u* calculated from Eq. 9 into Eq. 2 to derive Eq. 11 below:
After solution of the linear equation Eq. 11 is obtained, the solution is then substituted into Eq. 10 to perform SPH simulation that satisfies the incompressibility condition of a fluid.
The fluid simulation method of the present invention includes step S301 of calculating a force acting on each particle that forms a fluid, steps S303 to S307 of calculating a velocity field satisfying the incompressibility condition of the fluid based on the calculated force, step S309 of moving particles in the calculated velocity field, and step S311 of calculating density of particles for applying it to step S301 of calculating the forces after moving the particles.
To be more specific, first, the particle attribute calculating unit 110 calculates the force, i.e., viscosity, surface tension and gravity, acting on each particle in an initial state, by using Eq. 6 or its transformation(s) in step S301. Here, density calculated by the density calculating unit 140 in step S311 is used for calculating the force acting on the particle.
Next, in step S303, the temporary velocity calculator 121 in the incompressibility condition calculating unit 120 calculates a temporary velocity of a particle free of compression, by using Eq. 9 or its transformation(s).
Subsequently, in step S305, the pressure calculator 123 in the incompressibility condition calculating unit 120 calculates pressure that satisfies the incompressibility condition of a particle, by using Eq. 11 or its transformation(s) based on the temporary velocity calculated by the temporary velocity calculator 121.
In a following step S309, the incompressible velocity calculator 125 in the incompressibility condition calculating unit 120 calculates the velocity satisfying the incompressibility condition of a particle, by using Eq. 10 or its transformation that applies the pressure calculated by the pressure calculator 123.
Thereafter, a velocity field satisfying the incompressible condition is calculated by the incompressible condition calculating unit 120 based on the velocity calculated by using the temporary velocity and pressure to satisfy incompressible condition in this manner. The obtained velocity field is then provided to the moving unit 130. Thereafter, the moving unit 130 moves particles in the velocity field from the incompressible condition calculating unit 120. Finally, in step S311, the density calculating unit 140 calculates a density value of particles after their movement, by using Eq. 8 or its transformation(s), and provides the calculated density value to the particle attribute calculating unit 110 to use it for calculating the force acting on the particle in step S301.
Meanwhile, the method for incompressible fluid simulations in accordance with the present invention explained so far with reference to
As shown, the fluid simulation system in accordance with the another embodiment of the invention includes a computer-readable storage medium 210 that stores an incompressible fluid simulation program 211 to execute, on a computer, a series of steps of calculating force acting on each particle forming a fluid, calculating a velocity field satisfying the incompressibility condition of the fluid based on the calculated force, and moving particles in the velocity field. The system further may include a computer 220 for reading out the incompressible fluid simulation program 211 from the storage medium 210 to execute it; and a display 240 for visually displaying results executed by the computer 220.
The incompressible fluid simulation program 211 stored in the storage medium 210 is built by implementing a computer program with the method for incompressible fluid simulations in accordance with the present invention. Codes and code segments of the incompressible fluid simulation program 211 can easily be inferred by skilled computer programmer in the related art.
The storage medium 210 is a computer-readable medium, so that the computer 220 can reads out the incompressible fluid simulation program 211 from the storage medium 220 and executes it to realize the method for incompressible fluid simulations in accordance with the present invention. The storage medium 210 includes various storage devices that store data readable by the computer 220. The computer-readable devices include, e.g., ROMs, RAMs, CD-ROMs, DVD-ROMs, magnetic tapes, floppy disks, hard disks, optical data storage devices and the like. In addition, such computer-readable storage medium can be distributed in a networked computer unit and stored in a form of computer-readable code of distribution system to be executed.
As mentioned above, the computer 220 reads out the incompressible fluid simulation program 211 stored in the storage medium 210 and executes it. To this end, the computer 220 includes a reading unit 221 for reading out the incompressible fluid simulation program 211 stored in the recording medium 210, and an execution unit 223 for executing the read-out program. The reading unit 221 may be a magnetic head, an optical pickup device, a flash memory reader or the like. The execution unit 223 may be a microprocessor, a firmware-driven chip, a memory or the like.
The interface 230 delivers information on the results of simulations executed by the execution unit 223 to the display 240.
The display 240 then visually displays the results executed on the computer. The display 240 may be a CRT monitor, an LCD monitor, a PDP display, a projector or the like.
As described above, unlike a typical SPH-based fluid simulation incapable of keeping a fluid in an incompressible state, the SPH-based fluid simulation in accordance with the present invention satisfies the incompressibility condition of a fluid, thereby providing more realistic fluid simulation effects.
While the invention has been shown and described with respect to the particular embodiments, it will be understood by those skilled in the art that various changes and modification may be made without departing from the scope of the invention as defined in the following claims.
Number | Date | Country | Kind |
---|---|---|---|
10-2008-012552 | Dec 2008 | KR | national |