BACKGROUND OF THE INVENTION
Modelling fluid flow dynamics is helpful for designing structures such as but not limited to ship hulls, pipelines and airfoils. Thus, three-dimensional (3D) animation of fluid flow dynamics is necessary to represent for example, the flow of water past a ship's hull, fluid in a pipeline, fluid flow of air past an airfoil, or fluid in blood vessels.
Further, the movie and advertising industries, military and commercial training systems, virtual reality games and entertainment, and scientific research have been increasingly turning to 3D modeling to obtain realistic visual simulations of physical phenomena.
Present computer graphic processes can be used to model some behavioral characteristics of fluid flow but cannot model the 3D dynamics of flow, and the effects caused by the internal and external boundaries of the fluid flow.
Real-time animation of fluids is not available in existing systems where the movement of fluids on a graphical computer is calculated and animated at the same time. Real-time animation is difficult to achieve where calculations are intensive. Where the simulation calculations take so much time to occur on a computer, they cannot be completed in regular intervals of time at the pace of the physical process that is being simulated. Ideally, each frame in animation must be calculated fast enough in order to achieve real-time animation.
Thus, no present systems are known to exist that produce realistic looking 3D modeling and simulation of fluid flows in realtime.
Another problem with creating 3D animation in prior art systems is that layers of 2D grids(x,y) in the --z- axis must be attached to form a 3D grid. Calculations for the third dimension must be calculated at each node on each 2D grid in the z direction. These calculations are numerous, extensive and time consuming.
A further problem is that no one has been able to actually solve Navier-Stokes equations for 3D simulation using numerical methods calculated by computer in realtime.
Additional problem is that there is not a present system available for simulating physically realistic looking, yet real-time, visible surface behavior for fluid flows.
SUMMARY OF THE INVENTION
Accordingly it is an object of this invention to calculate fluid flow pressures from a two-dimensional representation and use these pressures to simulate the height of the fluid field to achieve a realtime simulation and animation in the third dimension.
Another object of the invention is to use physical laws to model natural and artificial fluid phenomena in computer graphics and animation.
In accordance, it is an object of this invention to produce 3D realtime fluid animation by solving equations that model a two-dimensional (2D) process using for example, the 2D Navier-Stokes equations.
Another object of the invention is to use a calculator based numerical method based on the corresponding pressures and velocities of 2D coordinates to produce the coordinate value of the third dimension.
Another object of this invention is to use computer graphics to produce 3D displays of the realtime fluid animation.
Another object of this invention is to be able to simulate different kinds of fluids in a realtime graphics simulation.
Another object of the invention is to simulate different kinds of fluids in realtime by varying properties such as the Reynolds number.
Another object of this invention is to be able to show a 3D display of the animation of the fluid flow field, the streakline of the flow field and the blending of fluids of different colors.
Another object of this invention is to simulate specific applications such as the effects of a motorized boat on a river, and blood within a vessel.
The file of this patent contains at least two drawings executed in color. Copies of this patent with color drawings will be provided by the Patent and Trademark Office upon request and payment of necessary fee.
BRIEF DESCRIPTION OF THE FIGURES
FIG. 1 illustrates a staggered marker-cell mesh for the arrangement of a fluid flow field.
FIG. 2 illustrates an algorithm flow chart for calculating state-to-state calculations of current pressure and velocities.
FIG. 3 illustrates an algorithm flow chart for 3D realtime simulation of fluids.
FIG. 4 illustrates an algorithm flow chart of the process for initializing the 3D Graphics and boundary conditions.
FIG. 5 illustrates an algorithm flow chart for updating the parameters by user interface.
FIG. 6 illustrates an algorithm flow chart for the 3D drawing process.
FIG. 7 shows an animation frame of velocity vectors of the fluid flow field.
FIG. 8 shows an animation frame of a 3D fluid flow.
DETAILED DESCRIPTION OF THE INVENTION
Before explaining the disclosed embodiments of the present invention in detail it is to be understood that the invention is not limited in its application to the details of the particular arrangements shown since the invention is capable of other embodiments. Also the terminology used herein is for purpose of description and not of limitation.
Navier-Stokes Equations
A means of describing mathematically fluid flow at any point is by Navier-Stokes equations. These equations can be found in many fluid mechanics books such as Potter, M. C. and Wiggert, D. C., Mechanics of Fluids, Prentice Hall Inc. 1991. These equations are the equivalent of Newton's second law in fluid dynamics.
Navier-Stokes equations include: ##EQU1## is velocity in the direction of the x axis represented as meter per second=m/s. ##EQU2## is velocity in the direction of the y axis represented as meter per second=m/s. ##EQU3## is velocity in the direction of the z axis represented as meter per second=m/s.
.mu. is the viscosity of the fluid represented as newton-sec per square meter=N*S/m.sup.2.
p is the pressure of the fluid represented as newton per square meter=N/m.sup.2
.rho. is the density of the fluid represented as kilogram per cubic meter=kg/m.sup.3
gx, gy, gz are the gravity accelerations represented as meter per square second=m/s.sup.2.
The units given above are for example only and can be modified for particular uses.
The differential continuity equation is derived from the conservation of mass as follows: ##EQU4## Equation (1) is a compact form of the differential continuity equation.
.gradient. represents the rate of change along the three dimensions x, y, z.
v represents the vector form of the velocities along the x, y and z axes combined.
"." represents the scalar dot product.
v=u*i+v*j+w*k ##EQU5##
i represents the unit vector along the x-axis, j represents the unit vector along the y-axis, and k represents the unit vector along the z-axis.
The differential continuity equation is used together with Navier-Stokes equations to decide the relationships between motion and pressure.
Navier-Stokes equations can be rewritten into a dimensionless form, which is a form that has no units. The units are dropped by selecting characteristic quantities that best describe the particular problem of interest that is being modelled.
In fluid mechanics, Navier-Stokes equations are put into equation (2) as compact form: ##EQU6##
.gradient..sup.2 represents the rate of change of the rate of change. If we choose t'=t/(L/V), v'=v/V, p'=p/(.rho.V.sup.2), .gradient.'=L.gradient. where L, V and .rho. are constant and average length, velocity and density respectively. Then equation (2) becomes as follows: ##EQU7## that is: ##EQU8##
If we disregard the gravity g, drop the prime for simplicity and define Reynolds number as ##EQU9## which combined with the previous, reduces equation (2) to equation (3) as: ##EQU10## and, Re is the Reynolds number which is a parameter that indicates the flow regime of the fluid. The fluid flow regime is the nature of the fluid flow or the result of the properties that control the fluid flow. For example, the regime can be laminar or turbulent. The Reynolds number is a key parameter which controls the behavior of the fluid flow, thus it indicates the fluid flow regime.
Re is defined as = ##EQU11## where L and V are a characteristic length and velocity, respectively, and .nu. is the kinematic viscosity, i.e., ##EQU12## For example, given a fluid flow inside a pipe, then L can be the diameter of the pipe and V is the velocity of the fluid flow inside the pipe. If the Reynolds number is relatively small, the fluid is viscous and the flow regime is laminar; if it is large, the flow regime is turbulent.
In a laminar flow, the fluid flows with no significant mixing of neighboring fluid particles. If dye were injected into the flow, it would not mix with the neighboring fluid except by molecular activity. The appearance of the fluid surface is smooth when the flow is laminar. The contrary of laminar flow is turbulent flow.
Discretization
Discretization is the process of representing a continuous mathematical function by a collection of specific values of the function. For example, one can represent the function that describes the shape of a geodesic dome by the collection of nodal points in the triangulation for the dome.
Discretization is a common method used in the solutions of continuous differential equations by numerical computer procedures. A good descritization will result in numerically accurate results and stability of the computation.
Several approaches are known in Computational Fluid Dynamics to solve the Navier-Stokes equations. Peyret, R. and Taylor, T. D., Computational Methods for Fluid Flow, Springer-Verlag New York Inc. 1985, describes a finite-difference solution such as a penalization method that can be used to substitute for the divergence equation (1) listed above. The finite-difference solution is a method to discretize and calculate the quantities described by mathematical equations on computers. In this solution technique, derivatives are approximated by differences of the values at adjacent nodes that are a finite distance apart instead of being infinitesimally close. A penalization method is a method that when errors arise, certain numbers in the calculation are added, subtracted, multiplied or divided in order to correct the errors. This finite-difference solution makes use of equation (4).
Where .epsilon. is typically a very small number which is always greater than zero but smaller than 1.
The Peyret et al. publication states that the solution of equations (3) and (4) tends toward the solution of Navier-Stokes equations, i.e., (1) and (2), when e is a very small number. In our program we set .epsilon.=0.005. A smaller e may cause the calculations to be unstable.
The spatial discretization of equations (3) and (4) in two dimension(2D) makes use of the staggered marker-and-cell mesh grid illustrated in FIG. 1. FIG. 1 illustrates a staggered marker-cell mesh for the arrangement of a fluid flow field. The nodes of the mesh represent positions in the 2D map at which the fluid's behavior will be simulated. This mesh may be thought of as corresponding for example to points lying along horizontal plane. Using this mesh, the computation of taking derivatives is easy and is approximated by merely subtracting values for two or more adjacent nodes as needed.
An example of an explicit discretization is as follows: ##EQU13## where i, j are mesh coordinates, n represent current state and n+1 represent next state after .DELTA.t time slice. ".epsilon." is typically a small number which is always greater than zero but smaller than 1. The difference operators .DELTA..sup.1.sub.x, .DELTA..sup.1.sub.y, and .gradient..sup.2.sub.h are defined by ##EQU14## where f means either u, v or p referred in equations (5), (6) and (7) above. The terms l and m are arbitrary coordinates in 2D (two-dimensions) and can be for example i+1/2, j-1/2, etc.
The terms a.sup.n.sub.i+1/2;j and b.sup.n.sub.i;j+1/2 are the approximations of ##EQU15## as defined in equation (3). These are discretized as follows: ##EQU16##
The above approximations are of second-order accuracy. Second-order accuracy holds when given a continuous function f(x), the error involved in calculating ##EQU17## is no greater than (.DELTA.x).sup.2 multiplied by a constant, K, whose value may depend on the application.
The algorithm to compute the Navier-Stokes equations is illustrated in FIG. 2. The fluid flow field is the area representing the fluid flow. The field is usually composed of fluid velocity vectors and pressures. Sometimes the field is referred to as fluid field or velocity field. The known current state of the velocity vectors and pressures of the fluid flow field is represented by: u.sup.n.sub.i+1/2; j, v.sup.n.sub.i;j+1/2 and p.sup.n.sub.i;j,
The next state in the field is represented by: u.sup.n+1.sub.i+1/2;j, v.sup.n+1.sub.i;j+1/2 and p.sup.n+1.sub.i;j after .DELTA.t time is calculated by equations (5), (6), and (7).
Equations (5), (6) and (7) are implemented by employing functional equations (8) through (18) above. This process goes on and on from current state to next state, and from next state to next next state. FIG. 2 illustrates a program flow chart for the outline of these state calculations employing also internal and external boundary conditions.
The boundaries of the fluid flow field decide the behavior of the fluid flow and are divided into internal and external boundaries. External boundaries usually represent the borders holding the fluid such as but not limited to a riverbank or a flexible wall such as a flexible plastic gutter. Other external boundaries can be the walls of a blood vessel. Internal boundaries are usually types of obstructions in the fluid flow such as but not limited to islands or posts in the river flow, or moving obstacles such as a moving boat. Internal obstacles do not have to be rigid and can include such diverse elements as balloons or flexible tubing in the ocean and known obstacles in a blood vessel. Objects can be perceptable by any sense or possibly not, as long as the object is intelligible or peceptable by the mind such as air, electromagnetic radiation, etc.
FIG. 2 begins at 200 which is to start calculating the next state. Next, the external boundary conditions are calculated at block 210, by taking the current exiting fluid velocity vectors and pressures along the external boundary conditions which can be along the banks of the fluid. Next, the pressures (p) are calculated using the exiting fluid velocity vectors at block 220. Next, the velocity vectors u, v are calculated at block 230 by using the existing velocity vectors and pressures. The next step is to update the internal boundary conditions. For example, if a boat drifting in a river is to be simulated, then the position of the boat in the fluid flow field is update relative to the boundary. Finally, at step 240 the current state is finished being calculated.
The following simplified procedure is exerted from our program:
3D Real-time Animation
After calculating each state of the velocity vectors and pressures of the fluid flow field, the current frame of velocity field can be drawn. For a given grid (i, j) in the flow field, ##EQU18## a velocity vector from (i, j) to (i+ui;j, j+vi;j) can be drawn. By raising the grid (i, j) in the third dimension to the scale of pi;j, a 3D fluid surface can then be drawn. Therefore as the real-time calculation and drawing go on, we achieve an animation of velocity vectors of the fluid flow field. FIG. 3 illustrates our main program flow chart for 3D realtime animation.
FIG. 3 starts the fluid simulation at 300. The next step is to initialize graphics and parameters at 310 in order to start calculating and drawing fluids for the simulation. Step 310 is explained by FIG. 4. The next step in FIG. 3 occurs at block 320 to process any keyboard or other input information which might change the color, velocity, viscosity or any other parameters which might affect the simulation of the fluids. The details of step 320 are illustrated in FIG. 5. The next step in FIG. 3 occurs at block 330 to calculate the current fluid field velocities, pressures and boundaries, which was described in reference to FIG. 2. The next step in FIG. 3 occurs at block 340, which is to draw the current field by raising the heights of the 2D grids proportional to the corresponding pressures at the grids. The details of step 340 are described in FIG. 6. The next step in FIG. 3 is at block 350, where if more simulation is needed, then the program runs through steps 320, 330, and 340 again to stimulate the next state. The simulation program ends at block 360.
The following program is exerted from our program.
Initialize Graphics and Parameters
The graphics library initialization is a low level operation that is hardware dependent and often needs reference manuals to implement that are well known. For example, a silicon-graphics indigo or reality-engine are well known.
The program flow chart of the initialize process is illustrated in FIG. 4.
After starting at element 400 in FIG. 4, the 3D graphics are initialized at block 410 by calling system graphics initialize functions. For example, initialize 3D graphics drawings, etc. The next step is to initialize fluid boundary conditions at block 420 where boundary conditions of the fluid are set to the simulation desired. For example, if you input the velocity in the x- direction (u) to be one, and velocity in the y direction (v) to be zero, a channel flow appears in the x-direction. The next step in FIG. 4 occurs at block 430, where the user initializes the color of fluid desired, objects to be put into the fluid, etc. Finally, the flowchart ends at block 440.
Process the Input Information
The parameters Re, .epsilon., .DELTA.x, .DELTA.y, and .DELTA.t can be updated by user interface (keyboard). One can also tell the system to rotate the viewing direction to the fluid, to scale the height of the fluid, etc. The inputs in the user interface flowchart is illustrated in FIG. 5.
In FIG. 5, keyboard input is utilized to update Reynolds numbers simulation time slice, artificial parameter .epsilon., etc. For example, an Re value already exists at box 500. If you desire to change your Re value, then action to change the Re value is detected at box 510 and the new value is input at box 520. After input of the Reynolds number, then check next input at box 530. If you have no desire to change the Re value, then the control input checking will go from box 510 to 530. A similar action takes place for the other user inputs shown in boxes 530 through 570.
Draw Current Fluid Frame
FIG. 6 illustrates an algorithm flow chart for the 3D drawing process. FIG. 6 uses the pressure to draw the height of the fluid surface, which is the third dimension. Grid (i,j) is raised to a certain scale of the pressure which effects a realistic picture of the fluid flow surface.
The procedure segment which draws the 3D fluid surface is as follows:
Results of Two Step Simulations of a 5.times.5 Fluid Flow Field
A given boundary condition of a channel flow is simulated as follows: void initFluid() ##EQU19##
Several frames of the calculations of a 5.times.5 velocity u(i,j), v(i,j) and pressure field p(i,j) along two dimensions (i,j), are simulated as follows:
For example, given a boundary condition of a channel flow, a frame of the animation of the velocity field appears as shown in FIG. 7. In FIG. 7 the velocity vectors of the fluid flow field are shown. The vectors are raised to the height proportional to the pressure. Using color drawings,the yellow colors represent that the vector heights that are above zero. The blue colors represent the heights of the vectors that are below zero. Finally, white color which is rarely present, represents the heights equal to zero.
By shading and lighting the surface of the flow field, one can have a frame of the animation of the channel flow as shown in FIG. 8. Here, the shaded surface of the raised velocity vectors is shown which is the surface of the fluid flow. When the surfaces are animated in realtime, one can see the fluid flow in the channel.
The movie and advertising industries can use this invention to their advantage for very complex scenery and for fine grain resolution requirements because computational costs would be considerably reduced over present methods. It would be advantageous to use this invention when producing single picture snapshots of fluids, sequences of fluids or continuous depictions of fluids.
Simulated training systems in the military and commercial markets can use simulated fluid behavior for any educational purpose.
Likewise, virtual reality games and entertainment experiences are increasingly using 3D simulations of physical processes.
Scientific research and experimentation can find use for this invention to examine the surface behavior of fluids.
The units (such as newtons, meters, etc.) referred to in the above equations are merely for illustrative purposes only. The user can clearly modify these units according to the desired inputs and outputs.
While the invention has been described, disclosed, illustrated and shown in various terms of certain embodiments or modifications which it has presumed in practice, the scope of the invention is not intended to be, nor should it be deemed to be, limited thereby and such other modifications or embodiments as may be suggested by the teachings herein are particularly reserved especially as they fall within the breadth and scope of the claims here appended.