CN103425849A - Simulation method for dynamic barrier to influence lower fluid - Google Patents
Simulation method for dynamic barrier to influence lower fluid Download PDFInfo
- Publication number
- CN103425849A CN103425849A CN2013103960342A CN201310396034A CN103425849A CN 103425849 A CN103425849 A CN 103425849A CN 2013103960342 A CN2013103960342 A CN 2013103960342A CN 201310396034 A CN201310396034 A CN 201310396034A CN 103425849 A CN103425849 A CN 103425849A
- Authority
- CN
- China
- Prior art keywords
- fluid
- barrier
- texture
- boundary
- equation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Processing Or Creating Images (AREA)
- Image Generation (AREA)
Abstract
The invention relates to a simulation technology imitating a dynamic barrier to influence lower fluid behaviors on the basis of a physical mode. The technology comprises the steps of sequentially calculating the convective term, the outer force term and the pressure term in a hydrodynamic equation (Navier-Storkes equation); upgrading physical quantities, such as speed and pressure, of fluid; finishing the simulation calculation of the fluid. When the pressure term is calculated, mutual influence of the fluid and the barrier is considered, and a coupled linear equation between the fluid and the barrier is set up according to the Lagrange's equation of motion of the barrier and the uncompressed conditions of the fluid. The pressure term is upgraded through solving the linear equation. Due to the fact that the simulation calculation of the fluid is realized in a GPU, and the simulation of the barrier is executed in a CPU, in order to make the fluid to be coupled with the barrier, a voxelization process is conducted on the dynamic barrier in the simulation process according to the simulation technology, the dynamic barrier is is mapped onto a simulation grid of the fluid, and the calculation of fluid pressure is finished through the combination of the CPU and the GPU.
Description
Technical field
The invention belongs to the virtual reality technology field, relate in particular to combine with the GPU emulation mode of the lower fluid of dynamic barrier based on physics mode impact of CPU.
Background technology
In actual life, about the phenomenon of fluid, can be found everywhere, such as the kitchen smoke risen up slowly, the rivers that flow ahead fast ceaselessly, flame of blazing etc.In fluid, exist various barriers toward the contact meeting, having also has staticly dynamically, and such as free-swimming fish in river, smog passes through forest etc.In spontaneous phenomenon computer simulation field, fluid emulation is one of them important research direction, and it similarly is a kind of useful building puzzle, is the basis of a lot of spontaneous phenomenons of emulation.Yet, due to its huge assessing the cost, it all only belongs to the field that the high-quality off-line is played up all the time.In application in real time, the effect of 3D fluid is all often to depend on particIe system to realize, although particIe system can produce very attractive result, but they also do not meet true outward appearance and the behavior of fluid, the emulation of fluid in real time remains a kind of challenge, especially in fluid, also exists the analogue simulation of various barriers.
Summary of the invention
For the real motion behavior that shows the lower fluid of dynamic barrier impact that can be real-time, the invention provides the emulation mode of the lower fluid of a kind of dynamic barrier impact.The present invention adopts the physical message of 3D texture storage fluid, as speed, pressure etc., uses the 3D texture to make simulation calculation to realize on GPU fully, has improved greatly simulation efficiency.Carry out two in the advection process in the middle of, the semi-Lagrange step adds two-way error compensation and aligning step, and the advection precision is brought up to second order by single order, has reduced the numerical dissipation in the advection process.Improved the method for solving of pressure term in the fluid motion equation, consider influencing each other of fluid and dynamic barrier, dynamic barrier is carried out to voxelization process, be mapped in the fluid grid, set up the coupling linear equation between barrier and fluid according to the lagrange equation of motion of barrier and the incompressibility of fluid, combine with the GPU pressure of Fluid Computation of CPU, synchronously upgrade the motion state of fluid and barrier, improved the authenticity of the lower fluid motion of dynamic barrier impact.When computing velocity divergence and pressure gradient, sampled point is offset in GPU, utilizes the account form of MAC grid to be sampled to the 3D texture, reduced the error in computation process, improved computational accuracy.
The behavior emulation mode of the lower fluid of a kind of dynamic barrier impact of the present invention, the method comprises the following steps:
Step 3, all dynamic barriers of voxelization, obtain 3D barrier texture and 3D boundary position texture.When dynamic barrier is carried out to voxelization, can further comprise again:
Step 3.1, utilize the decrement operations that increases progressively of template buffer memory to carry out inside and outside voxelization to all dynamic barriers, and mark barrier unit is SOLID, and element of fluid is FLUID, is saved in 3D barrier texture;
Step 3.2, the barrier model is played up in each grid section one time, in geometric coloration, (Geometry Shader) carries out the crossing operation of cutting into slices with grid to each triangle surface in barrier, use bilinear interpolation to calculate the position of intersecting point coordinate, and unit, corresponding intersection point place is labeled as to BOUNDARY, mean the boundary element of barrier.In pixel coloring device, label information is rendered in the barrier texture, corresponding position of intersecting point is rendered in the boundary position texture.
Step 4, according to 3D barrier texture, dyscalculia thing boundary normal, be kept in 3D boundary normal texture.For boundary element, judge the label information of its neighbours unit according to the barrier texture, normal is calculated in the place adjacent with element of fluid at boundary element, is saved in corresponding boundary normal texture.Wherein, normal direction is pointed to boundary element from element of fluid.
Step 5, read 3D barrier texture, records the index position of obstacles borders in texture.
Step 6, the index position according to obstacles borders in texture, extract boundary position and boundary normal and be saved in corresponding list of locations and normal list.
Step 7, according to the incompressibility of the barrier equation of motion and fluid, set up the coupling linear equation between fluid and barrier.The coupling linear equation of setting up according to the incompressibility of the equation of motion of barrier and fluid is as shown in Equation (1):
(1)
Wherein,
For the transition matrix between generalized coordinate system and cartesian coordinate system,
(
kThe boundary element number);
Mass matrix for barrier;
For the speed under generalized coordinate before barrier and fluid coupling.
Step 8, CPU is combined with the GPU item, solves the coupling linear equation, the pressure field of Fluid Computation.When solving the coupling linear equation, the method that adopts GPU to combine with CPU, order
,
, first according to the lagrange equation of motion of barrier, in CPU, calculate
AWith
B, then according to the obstacles borders index, respectively will
AWith
BWrite in each self-corresponding 3D texture, complete the calculating of terminal pressure in GPU.When Fluid Computation pressure, no matter what solve is coupling linear equation or Poisson equation, all need the divergence of computing velocity in advance.
Step 9, according to the gradient of pressure field, go on the midrange speed field of projection fluid is long without divergence to it, obtains the final speed field of fluid.In this step, need to carry out projection calculating to middle velocity field according to the gradient of pressure field.Adopt MAC grid (a kind of staggered-mesh when computing velocity divergence and pressure gradient, corresponding with central gridding) account form the 3D texture is sampled, being offset separately 0.5 unit on three directions of 3D texture is sampled, can reduce the error in computation process, improve computational accuracy.
The invention has the beneficial effects as follows: the physical message of fluid is kept in the middle of the 3D texture, makes emulation be achieved on GPU, improved simulation efficiency, simultaneously the mutual corresponding simulation calculation process of also having simplified of 3D texture and Eulerian mesh.When computing velocity divergence and pressure gradient, improve the sample mode of 3D texture, on three directions of 3D texture, sampled point has been offset respectively to 0.5 unit, utilized the account form of MAC grid to be sampled to the 3D texture, reduce the error in computation process, improved computational accuracy.Improve the voxelization process of dynamic barrier, add a boundary voxel process, the crossing operation with target slice to each triangle surface execution in barrier in geometric coloration, calculate intersection point (intersection point is the obstacles borders position) by bilinear interpolation, these points are outputed to pixel coloring device, be labeled as BOUNDARY by pixel coloring device and output in the middle of 3D barrier texture, the position of these intersection points is saved in the 3D border texture simultaneously.Because the motion of barrier is simulated in CPU, and the motion of fluid is simulated in GPU, at fluid and barrier, be coupled while calculating, CPU is combined with GPU, according to the resulting boundary information of barrier voxelization, the pressure of boundary is calculated, upgrade the motion state of fluid and barrier by this Simultaneous Pressure, not only improve the efficiency of emulation, also improved the authenticity of the lower fluid motor behavior of barrier impact.
The accompanying drawing explanation
Fig. 1 shows the emulation mode process flow diagram of the lower fluid behavior of a kind of dynamic barrier impact of the present invention.
Fig. 2 shows semi-Lagrange advection method.
Fig. 3 shows the semi-Lagrange advection step after improvement.
Fig. 4 shows advection error analysis and rectification building-out.
Fig. 5 shows the storage mode of MAC grid in the present invention.
Fig. 6 shows the derivation of coupling linear equation between fluid and barrier.
Specific embodiments
Below in conjunction with accompanying drawing and embodiment, the preferential embodiment of the present invention is further illustrated:
Process flow diagram shown in Fig. 1 has provided the detailed process of the whole enforcement of the present invention:
Step 3, carry out voxelization process to all dynamic barriers, is mapped on the fluid grid, and concrete process is as follows:
Step 3.1, carry out inside and outside voxelization to dynamic barrier.This embodiment adopts rectangular projection that the barrier model of input is played up once in each section of purpose 3D texture structure.When rendering model, utilize the decrement operations that increases progressively of template buffer memory (identical with the dimension of section), the back side increases progressively, and successively decrease in front.So, all voxels that are positioned at model inside will obtain the stencil value of a non-zero, and outside all voxels are still zero.Finally, do once finally traversal, stencil value is copied in the 3D texture, wherein the barrier unit is labeled as SOLID, and element of fluid is labeled as FLUID.
Step 3.2, to the voxelization of dynamic barrier exercise boundary, the boundary position of dyscalculia thing.In this embodiment, the boundary voxel process is similar with inside and outside voxelization, model is played up in each grid section one time, but this time do not use the template buffer memory, but judge the intersection point of each triangle surface with target slice in geometrical processor, bilinear interpolation is calculated position of intersecting point, and this position is boundary position.At pixel coloring device, active cell is labeled as to BOUNDARY and outputs in 3D barrier texture, export the active cell position simultaneously in corresponding 3D border texture.
Step 4, play up the fluid grid one time, judges according to 3D barrier texture whether current cell is boundary element (marking whether as BOUNDARY) in pixel coloring device, dyscalculia thing boundary normal.The computing method of boundary normal are as follows: detecting the neighbours unit of current cell before and after up and down according to 3D barrier texture is barrier unit (SOLID), obstacles borders unit (BOUNDARY) or element of fluid (FLUID).Such as, if its left neighbours (x negative direction) are element of fluid, the normal of active cell points to barrier for the 1(normal direction by fluid on directions X so).Do same operation on other direction, finally normal information is outputed in corresponding 3D boundary normal texture.
Step 5, create the addressable 3D texture of CPU, by the information reproduction in 3D barrier texture in the texture just created.The access texture, record the index of position in the cell place texture that is labeled as BOUNDARY, is saved in the boundary position index.
Step 6, equally create the addressable 3D texture of CPU with step 5, and the information in boundary position texture and boundary normal texture is copied in respective texture respectively.The access texture, the index of trying to achieve according to step 5 reads corresponding boundary position and boundary normal is saved in boundary position list and boundary normal list.
Step 7 is set up the coupling linear equation according to the lagrange equation of motion of barrier and the incompressibility of fluid on normal direction.The lagrange equation of motion of barrier is as shown in Equation (2):
Wherein,
The mass matrix that means barrier,
Mean suffered coriolis force;
With
Mean the inside and outside generalized force of barrier.
The incompressibility of fluid, the divergence of fluid velocity field is zero, as shown in Equation (3):
The process of establishing of coupling linear equation is as shown in figure (6), and the coupling linear equation of foundation is as formula (4)
Shown in:
Wherein,
SBe selection matrix, for selecting the boundary element of barrier, the coupling linear equation is just for boundary element normal direction.
Step 8, the pressure field of Fluid Computation, can be further divided into two kinds of situations.
The mode that solves of Poisson equation as shown in formula (8), formula (9),
Wherein, adding and subtracting 1/2 is illustrated on corresponding coordinate or to negative or to 1/2 unit of positive dirction skew, the 3D texture is sampled, as shown in figure (5).
Step 9, the required pressure field according to previous step, calculate its Grad, and (any vector field can be decomposed into two other vector field sums: one is without the divergence vector field to adopt the Helmholtz-Hodge decomposition theorem, another is the gradient of scalar field, sees shown in formula (10).) the midrange speed field of fluid is projected to it get on without Divergence Field, obtain the final speed field of fluid, guarantee before and after emulation all to meet the incompressibility of fluid.
Claims (5)
1. the emulation mode of the lower fluid of dynamic barrier impact, is characterized in that, the method comprising the steps of:
Step 1, the physical quantity of initialization fluid, be stored in the middle of the 3D texture;
Step 2, the midrange speed field of Semi Lagrangian scheme advection Fluid Computation;
Step 3, all dynamic barriers of voxelization, obtain 3D barrier texture and 3D boundary position texture;
Step 4, according to 3D barrier texture, the computation bound normal, be kept in the 3D normal map;
Step 5, read 3D barrier texture, records the index position of obstacles borders in texture;
Step 6, the index position according to obstacles borders in texture, extract corresponding boundary position and boundary normal and be saved in corresponding list of locations and normal list;
Step 7, according to the incompressibility of the barrier equation of motion and fluid, set up the coupling linear equation between fluid and barrier;
Step 8, CPU combines with GPU, solves the coupling linear equation, the pressure field of Fluid Computation;
Step 9, according to the gradient of pressure field, the midrange speed field of projection fluid without on Divergence Field, obtains the final speed field of fluid to it.
2. dynamic barrier according to claim 1 affects the emulation mode of lower fluid, it is characterized in that, the midrange speed field of Semi Lagrangian scheme advection Fluid Computation in described step 2, be specially: by semi-Lagrange advection step in the middle of carrying out in advance two, a forward advection and a reverse advection, then carry out two-way error compensation and aligning step, obtain more high-precision advection value.
3. dynamic barrier according to claim 1 affects the emulation mode of lower fluid, it is characterized in that all dynamic barriers of voxelization in described step 3 are specially:
Step 3.1, utilize the decrement operations that increases progressively of template buffer memory to carry out inside and outside voxelization to all dynamic barriers, and mark barrier unit is SOLID, and element of fluid is FLUID, is saved in 3D barrier texture;
Step 3.2, the barrier model is played up in each grid section one time, in geometric coloration, each triangle surface in barrier is carried out to the crossing operation of cutting into slices with grid, use bilinear interpolation to calculate the position of intersecting point coordinate, and unit, corresponding intersection point place is labeled as to BOUNDARY, mean the boundary element of barrier; In pixel coloring device, label information is rendered in the barrier texture, corresponding position of intersecting point is rendered in the boundary position texture.
4. the emulation mode of the lower fluid of dynamic barrier according to claim 1 impact, is characterized in that, the coupling linear equation of setting up according to the incompressibility of the equation of motion of barrier and fluid in described step 7 as shown in Equation (1):
5. dynamic barrier according to claim 1 affects the emulation mode of lower fluid, it is characterized in that, in described step 9, according to the gradient of pressure field, middle velocity field is carried out to projection calculating, when computing velocity divergence and pressure gradient, adopt the account form of MAC grid to be sampled to the 3D texture, on three directions of 3D texture, be offset separately 0.5 unit and sampled.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310396034.2A CN103425849B (en) | 2013-09-04 | 2013-09-04 | The emulation mode of the lower fluid of a kind of dynamic barrier impact |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310396034.2A CN103425849B (en) | 2013-09-04 | 2013-09-04 | The emulation mode of the lower fluid of a kind of dynamic barrier impact |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103425849A true CN103425849A (en) | 2013-12-04 |
CN103425849B CN103425849B (en) | 2016-05-18 |
Family
ID=49650580
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310396034.2A Expired - Fee Related CN103425849B (en) | 2013-09-04 | 2013-09-04 | The emulation mode of the lower fluid of a kind of dynamic barrier impact |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103425849B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104299265A (en) * | 2014-10-22 | 2015-01-21 | 电子科技大学 | Group behavior control technology under fluid environment influence |
CN111931364A (en) * | 2020-07-29 | 2020-11-13 | 华北电力大学(保定) | Thermal power generating unit bidirectional simulation system based on model inverse operation |
CN114492088A (en) * | 2022-04-02 | 2022-05-13 | 国家超级计算天津中心 | Material appearance state display method and system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1585040A1 (en) * | 2004-04-06 | 2005-10-12 | Athanasios Dimas | A numerical method for simulating the interaction between fluid flow and moving or deformable structures |
CN101542487A (en) * | 2006-07-24 | 2009-09-23 | Ati科技公司 | Physical simulations on a graphics processor |
-
2013
- 2013-09-04 CN CN201310396034.2A patent/CN103425849B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1585040A1 (en) * | 2004-04-06 | 2005-10-12 | Athanasios Dimas | A numerical method for simulating the interaction between fluid flow and moving or deformable structures |
CN101542487A (en) * | 2006-07-24 | 2009-09-23 | Ati科技公司 | Physical simulations on a graphics processor |
Non-Patent Citations (2)
Title |
---|
张漫遥: "中尺度流体与固体耦合动画模拟研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
柳有权 等: "基于 GPU 带有复杂边界的三维实时流体模拟", 《软件学报》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104299265A (en) * | 2014-10-22 | 2015-01-21 | 电子科技大学 | Group behavior control technology under fluid environment influence |
CN104299265B (en) * | 2014-10-22 | 2017-07-25 | 电子科技大学 | A kind of group behavior control method under the influence of fluid environment |
CN111931364A (en) * | 2020-07-29 | 2020-11-13 | 华北电力大学(保定) | Thermal power generating unit bidirectional simulation system based on model inverse operation |
CN111931364B (en) * | 2020-07-29 | 2022-10-21 | 华北电力大学(保定) | Thermal power generating unit bidirectional simulation system based on model inverse operation |
CN114492088A (en) * | 2022-04-02 | 2022-05-13 | 国家超级计算天津中心 | Material appearance state display method and system |
Also Published As
Publication number | Publication date |
---|---|
CN103425849B (en) | 2016-05-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105354355B (en) | A kind of Design of Simulation System and implementation method based on three-dimensional motion what comes into a driver's | |
CN103914868B (en) | Method for mass model data dynamic scheduling and real-time asynchronous loading under virtual reality | |
CN103279980B (en) | Based on the Leaf-modeling method of cloud data | |
CN102722859B (en) | Method for rendering computer simulation scene | |
CN102117497B (en) | Method and system for three-dimensional terrain modeling | |
CN101930622B (en) | Realistic modeling and drawing of shallow water wave | |
CN106683189B (en) | A method of the rendering type in three-dimensional scenic | |
CN101853162B (en) | Method for rendering editable webpage three-dimensional (Web3D) geometric modeling | |
CN102831275B (en) | A kind of emulation mode of 3D fluid and system | |
US20200043230A1 (en) | Liquid simulation method, liquid interaction method and apparatuses | |
CN104570077B (en) | Method for extracting offset domain common imaging gathers based on reverse time migration | |
CN103679802A (en) | Method for drawing surface of SPH (smoothed particle hydrodynamics) fluid in real time on basis of screen spaces | |
CN103425849B (en) | The emulation mode of the lower fluid of a kind of dynamic barrier impact | |
CN102867336B (en) | Method for simulating solid combustion process based on thermodynamic model | |
Kellomäki | Fast water simulation methods for games | |
Qi | Computer aided design simulation of 3D garden landscape based on virtual reality | |
CN106600698B (en) | A kind of fast drawing method of threedimensional model | |
CN106548505B (en) | Model of place fast triangulation method for 3-D ray-tracing | |
CN109741428A (en) | A kind of three rank high-precision convection current interpolation algorithms suitable for two dimensional fluid simulation | |
Jie et al. | LOD methods of large-scale urban building models by GPU accelerating | |
KR20110088041A (en) | System and method for shape controllable fluid simulation | |
Zhou et al. | Eulerian-Lagrangian Fluid Simulation on Particle Flow Maps | |
Li | Study on Virtual Scene Technology and Motion Simulation | |
Gan et al. | Design and Implementation of Collision Module in Virtual Reality Scene | |
Shao et al. | Lagrangian particle‐based simulation of fluid–solid coupling on graphics processing units |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160518 Termination date: 20190904 |