tunabrain / incremental-fluids Goto Github PK
View Code? Open in Web Editor NEWSimple, single-file fluid solvers for learning purposes
Simple, single-file fluid solvers for learning purposes
double factor = scale*_v->volume(x, y + 1)/_vDensity[_u->idx(x, y + 1)];
should be replaced with
double factor = scale*_v->volume(x, y + 1)/_vDensity[_v->idx(x, y + 1)];
Hi,
Just wanted to point out that there is a memory leak in the FluidSolver. The constructor allocates _d, _u, _v, _r and _p but there is no destructor that deallocates them. This is in 0-MatrixLess project thats where I have started at the moment. There should be a destructor for FluidSolver like so
~FluidSolver() { delete _d; delete _u; delete _v; delete [] _r; delete [] _p; }
I know this is old code , any chance you would fix this or advise me? I know the focus is on heat and its awesome..
Thanks for what you made.. I think i found fast flip solvers, but the multidensity one seems perfect for my sky and volcano.
I was thinking to apply drag to the immersed boundary , using a drag model like this viiscosity * ( 1/ vel *vel * the panel dot product).. ( flux in the travel direction)... the wikipedia drag model.. ideally the immersed boundary solve... or something that produces the drag. But if it moves gas about of the way on the front, and smoke bends around it ( that would be a pressure solve towards the cavity the object left by moving ...,equation , then push the fluid away from the normals of the immersed thing from the front. Or, i'd rather do it that way CBatty did. in variation methods.. ( or like the Cohen/Jeroen Molemaker paddle through smoke paper) . i have some of that Variational code, code, they posted 3 samples, all 2d.. ...
i can put the link.. its on a big page on Variational methods.. it gives away 2d code for gas ( with 3 circles... with mods, I could move those.. and it pushes away the liquid.. with a one frame delay, it seems.. but the shape is nice, and it does not miss any of the fluid... I see code that mentions forward Eulear.. so i was hoping you know something about it.. ..
I looked at the java port of your code on github, and I see he gave it some attention... a forward euler solve...anda different rotate method..
https://github.com/noSoulApophis/incremental-fluids-java/
my code is in c#.. i am open to any 2d methods that handle gas and heat and stratified dust.
I would try the latest but can't use open GL shaders. for my project. thanks even if you dont want fix it.. but i hope so... or take out the velocity fields... it made me sad cos things always have a missing something... and i have been hunting 4 months. :) and .. the methods are so numerous... but CFD is a great field...
setBoundaryCondition() simply sets the velocity of SOLID cells to the velocity of the solid body. However, this does not enforce the correct boundary condition which is: dotprod(velocity,solid_boundary_normal)=0.
Solution: setBoundaryCondition() should replace the normal component of the given velocity (extrapolated from the fluid) with the normal component of the solid body velocity.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.