25 8 2013 8 Vol25No8 JournalofComputer-AidedDesign & ComputerGraphics Aug2013 1) 1)* 2) 3) 2) 1) ( 100190) 2) ( 100190) 3) ( 100190) (xpzhang@nlpriaaccn) SPH TP391 InteractiveSimulationforWaterDropEffects XuShibiao 1) ZhangXiaopeng 1) * ChenYanyun 2) Yu Haitao 3) and WuEnhua 2) 1) (NationalLaboratoryof Patern RecognitionInstituteof AutomationChinese Academyof SciencesBeijing 100190) 2) (State Key Laboratoryof ComputerScienceInstituteof SoftwareChinese Academyof SciencesBeijing 100190) 3) (Science ArtCentreInstituteof AutomationChinese Academyof SciencesBeijing 100190) AbstractInordertoefectivelysimulatethephenomenonofdynamicwaterdrops withgravityand otherexternalforcesthispaperpresentsaninteractivesimulation methodfor waterdropefects FirstlyanaccurateSPH modelistakentosimulatesmal-scalewaterdropphenomenonthemethod includesaccuratepressurestrengthcalculationandartificialvelocityfieldcorrectiontoensurethe accuracystabilityandconvergenceoffluidequationssecondlyasurfacetensionmodelispresented basedonmeancurvatureandfluiddensityfieldforeficientlysimulatingthesurfacetensionofwater dropsfinalyasimplifiedray-tracing methodbasedonanew shader modelispresentedforthe waterdroprenderingtheray-tracing methodincludessimplifiedfluiddensitydistributionfunction fluidsurfacejudgmentbasedondichotomyandfresnelcalculationforovercomingtheproblemsinthe traditionalfluidrenderingmethodwithlitleconsiderationofcamerasandintensivecalculationsthe resultsshowthatthenewalgorithmisefectiveandeficientsuitabletothesimulationofbothwater bodyandsmal-scalewaterdrops Keywordswaterdropinteractiveray-tracingsurfacetension 2012-08-27 2012-11-06 (608330076090207861172104) (4112061) (1986 ) (1963 ) (1971 ) (1981 ) (1947 ) CCF
1160 25 GPU [16] ( ) GPU [17] GPU GPU Stam [1] 2 [2] Wang [18] Thürey [19] Zhang [20] 2 (smoothed Kim [21] particlehydrodynamicssph) [3] SPH [4] SPH MarchingCubes [5-6] Desbrun [11] SPH SPH Müler [4] SPH SPH SPH SPH Sussman [22] 1 MarchingCubes [5-6] Foster [7] [23] MarchingCubes [8-10] [11-12] [13-15] [24]
8 1161 MarchingCubes m A i = A j j W (r i -r j h) j i ρj Wojtan [25] A i h W 2 W (-r)=w (r) W (r)dr=1 Kruger [26] Müler [4] SPH Step1 ρ i = m jw poly6 (ri -r j h) (2) j i Step2 Fi pressure pi +pj =- m ( j Wspiky ri -r j h) j i p = K( ρ -ρ ) 0 Step3 dv dt =Fexternal +F pressure +F viscosity =g- p 2 ρ +μ v ρ (1) 2m j (v j -v i ) v ρ Δv i = j i ρ i + W ρj p μ ε [01] (1) XSPH 23 21 SPH F viscosity i SPH 2ρj =μ j i m j v j -vi ρj 2 Wviscosity ( ri -r j h) SPH 2 22 [27] SPH [28-29] Monaghan [30] (correctedand dρ dt =- ρ v smoothedparticlehydrodynamicsxsph) dv i dt =vi +εδvi
1162 25 Kruger [26] 075 133 3 n i 133 n t 1 <1 n t 2 1 3 31 SPH 21 SPH SPH 24 c=cos(θi) ni n t =-(I n) ni n t 2 n( ) t [ 1-R(0 )] (1-cosθi) 5 (4) [32] 1 n 1 i 075 n t 2 n 2 i ΔP n t n i ( ) Mathias [31] F pressure pi i =- m j + pj W j i ρ 2 i ρ 2 spiky (r i -r j h) j XSPH F = R(θi)= 1 2 c(g+c)- g-c ( ) n( ) ni 2 2 烄熿燄烌 SPH t 1+ 2 g+ c 烅 c(g-c)+ n( ) ni 2 烍 烆燀 t 燅烎 (3) SPH XSPH Fi xsph W poly6 v g= 1+c 2 - 槡 ni = 2m j -v i j j i ρ i + ρj Mathias (3) SPH 32 R(θi) Ra (θi)= R(0)+ 31 1 2
8 1163 SPH Step4 SPH Step5 SPH 2 Step6 κi=ρ i ρ i ρ i (2) 4 κ - κi +κj i = m j W poly6 (r i -r j h) j i 2ρj F surface i =σκ - i ρ i σ discard (2) 33 GPU NVIDIA CUDA SPH 41 GPU (2) 3a CUDA Particles Demo [33] GPU 3b Step1 Step2 Step3 Step4 Step5 GPU [34] 3c I O Step1 A Step2 SPH Step3 SPH ray-casting A I C 3
1164 25 42 4a 4 1 1) r=a+b =ai+bn (5) 5 a=1b=2(n I) 4b 2) t=a+b =ai-bn (6) a=sinθt?sinθi=n i?n t b=1-x-yx=cosθi sinθt?sinθi=-(n I)n i?n t y= -n - 槡 1-sin 2 DirectXCUDA HLSL θt = GPU 1- 槡 1-(n i?n t ) 2 (1-(n I) 2 ) 4c 1 1 GPU 075??s 133 10000 100 Step2 (5)(6) 1 2 1 2 IntelCorei728GHzCPU 4GB NVIDA GTX460 1GB 700MHz 10000 80 Kinect 5000 30 Step1 SPH 42 Step3 2 2 Step4 (3) 51 5 Step5 Step3~Step4 1 1= 2+ 2 Step6 (4) Step7 Step5~Step6 1 100?s = 1+ 1
8 1165 6 52 1 7 80?s 7 53 Kinect Kinect Kinect
1166 25 2 Kinect OpenNISDK (OpenNI OpenNIAPI 8 Kinect30?s ) 5000 Kinect 30?s 8 54 9c 9a 7b7c 9b 7d7e [20] 9d 1 [20] 80?s 30?s 9
8 1167 6 4 1) New YorkACM Press1995129-136 SPH SPH 2) 2003154-159 3) SPH YorkACM Press2002167-174 4) 483 New YorkASMEPress20032003 45144 ( ) ( ) (References) 2589) [3]Stam J Fiume E Depicting fire and other gaseous phenomenausingdifusionprocesses[c]?computergraphics ProceedingsAnnualConferenceSeriesACM SIGGRAPH [4]Müler M Charypar D Gross M Particle-based fluid simulationforinteractiveapplications[c]?proceedingsofthe ACM SIGGRAPH?Eurographics Symposium on Computer AnimationAire-la-VileEurographics Association Press [5]Carlson MMuchaPJvan Horn IR BetalMelting andflowing [C]?Proceedings ofthe ACM SIGGRAPH? Eurographics Symposium on Computer Animation New [6]GénevauxOHabibiADischlerJM Simulatingfluid-solid interaction[c]?proceedingsofgraphicsinterfacehalifax Canadian Human-Computer CommunicationsSociety Press 200331-38 ( [J] 200517(12)2581- [7]FosterN Metaxas DRealisticanimation ofliquids [J] GraphicalModelsandImageProcessing199658(5)471- [8]ZhouShizheManJiajuRealtimefluidsimulationbasedon multigridmethod[j]journalofcomputer-aideddesign & ComputerGraphics200719(7)935-940 (inchinese) ( [J] 200719(7)935-940) [9]EnrightDNguyen DGibou FetalUsingtheparticle levelset method and a second order accurate pressure boundaryconditionforfreesurfaceflows[c]?proceedingsof the4th ASME-JSME JointFluidsEngineering Conference [10]LosassoFGibouFFedkiw RSimulatingwaterandsmoke with an octree datastructure [J]ACM Transactions on Graphics200423(3)457-462 [11]Desbrun M Gascuel M P Smoothed particlesa new approach for animating highly deformable bodies [C]? Proceedings of the Eurographics Workshop on Computer AnimationandSimulationBerlinSpringer199661-76 [12]PremozeSTasdizen TBiglerJetalParticles-based simulationoffluids[j]computergraphicsforum200322 (3)401-410 [1]StamJStablefluids[C]?ComputerGraphicsProceedings AnnualConferenceSeriesACM SIGGRAPHNew York ACM Press1999121-128 [2]Liu YouquanLiu XuehuiZhu HongbinetalPhysicaly basedfluidsimulationincomputeranimation [J]Journalof Computer-Aided Design & Computer Graphics200517 (12)2581-2589 (inchinese) [13] Wojtan CThürey N Gross MetalPhysics-inspired topology changes for thin fluid features [J] ACM TransactionsonGraphics201029(4)ArticleNo50 [14]LosassoFTaltonJKwatra NetalTwo-waycoupled SPH and particle level set fluid simulation [J]IEEE TransactionsonVisualizationandComputerGraphics2008 14(4)797-804
1168 25 [15]Xu S B Mei X Dong W MetalInteractive visual simulationofdynamicinkdifusionefects[c]?proceedings ofthe 10th International Conference on Virtual Reality Continuum and Its Applicationsin Industry New York ACM Press2011109-116 405) [18] WangH MMilerGTurkGSolvinggeneralshalow wave equations on surface [C]?Proceedings of the ACM SIGGRAPH?Eurographics Symposium on Computer AnimationAire-la-VileEurographics Association Press 2007229-238 [19]ThüreyNWojtanCGrossMetalA multiscaleapproach tomesh-basedsurfacetensionflows[j]acm Transactions ongraphics201029(4)articleno48 [20]ZhangY ZWang H MWangS AetalA deformable surfacemodelforreal-timewaterdropanimation [J]IEEE TransactionsonVisualizationandComputerGraphics2012 18(8)1281-1289 [21]Kim BMulti-phasefluidsimulationsusingregionallevelsets [J]ACM TransactionsonGraphics201029(6)Article No175 [16]LiuYouquanLiu XuehuiWu EnhuaReal-time3Dfluid [J]Monthly Noticesofthe Royal AstronomicalSociety simulationon GPU withcomplexobstacles [J]Journalof 1977181(1)375-389 Software200617(3)568-576 (inchinese) [25] WojtanCMüler-Fischer MBrochu TLiquidsimulation ( GPU with mesh-basedsurfacetracking [C]?Computer Graphics [J] 200617(3)568-576) ProceedingsAnnualConferenceSeriesACM SIGGRAPH [17]Chen Xi Wang Zhangye HeJianetalAnintegrated New YorkACM Press2011ArticleNo8 algorithmofreal-timefluidsimulationongpu [J]Journalof [26]Kruger J Westermann R Acceleration techniques for Computer-AidedDesign & ComputerGraphics201022(3) GPU-basedvolumerendering [C]?Proceedingsofthe14th 396-405 (inchinese) IEEE Visualization Washington D C IEEE Computer ( GPU SocietyPress2003Page38 [J] 201022(3)396- [27]Liu DaozhiComputationalfluid dynamics [M]Beijing [22]Sussman MOhta M A stableand eficient methodfor treatingsurfacetensioninincompressibletwo-phaseflow [J] SIAMJournalonScientificComputing200931(4)2447-2471 [23]FosterNFedkiw RPracticalanimationofliquids [C]? ComputerGraphicsProceedingsAnnualConferenceSeries ACM SIGGRAPHNew YorkACM Press200123-30 [24]Gingold R A Monaghan J J Smoothed particles hydrodynamics theoryandapplicationtonon-sphericalstars BeihangUniversityPress1989 (inchinese) ( [M] 1989) [28]Monaghan J J An introduction to SPH [J] Computer PhysicsCommunications198848(1)89-96 [29]MonaghanJJLatanzioJCArefinedparticlemethodfor astrophysicalproblems [J] Astronomy and Astrophysics 1985149(1)135-143 [30]MonaghanJJSimulatingfreesurfaceflowswithSPH [J] JournalofComputationalPhysics1994110(2)399-406 [31]Mathias W Fresnel reflection technical report [R] ShanghaiNVIDIA Corporation2002 [32]Enright D Marschner S Fedkiw R Animation and renderingofcomplexwatersurfaces[j]acm Transactions ongraphics200221(3)736-744 [33]GreenSParticlesimulation using CUDA [R]Shanghai NVIDIA Corporation2010 [34]MilerGPearceAGlobulardynamicsaconnectedparticle system for animating viscous fluids [J] Computers and Graphics198913(3)305-309