简介:ThispaperextendstheSPHmethodtogassimulation.TheSPH(SmoothedParticlesHydrodynamics)methodisthemostpopularmethodofflowsimulation,whichiswidelyusedinlarge-scaleliquidsimulation.However,itisnotfoundtoapplytogassimulation,sincethosemethodsbasedonSPHcan’tbeusedinreal-timesimulationduetotheirenormousparticlesandhugecomputation.ThispaperproposesamethodforgassimulationbasedonSPHwithasmallnumberofparticles.Firstly,themethodcomputesthepositionanddensityofeachparticleineachpoint-in-time,andoutlinestheshapeofthesimulatedgasbasedonthoseparticles.Secondlythemethodusesthegridtechniquetorefinetheshapewiththediffusionofparticle’sdensityunderthecontrolofgrid,andgetmorelifelikesimulationresult.Eachgridwillbeassigneddensityaccordingtotheparticlesinit.Thedensitydeterminesthefinalappearanceofthegrid.Forensuringthenaturaltransitionofthecolorbetweenadjacentgrids,wegiveadiffuseprocessofdensitybetweenthesegridsandassignappropriatevaluestovertexesofthesegrids.Theexperimentalresultsshowthattheproposedmethodcangivebettergassimulationandmeettherequestofreal-time.