Arbitrary rigid bodies in coarse grid
Hi!
I'm trying to implement a realtime smoke simulation in 2D. I spent the last two weeks experimenting with different approaches in the CFD field. I successfully implemented an Eulerian fixedgrid algorithm (based on this and this article) and it works as expected. http://i.imgur.com/s9IsV.png Now I'm trying to figure out how to include rigid bodies to the simulation. I think I understand the theory: The velocity at the boundaries has to be updated. Either the normal component of the velocity (freeslip) or the whole velocity vector (noslip) has to be set to 0. The pressure gradient has to be zero at the boundaries. I could easily implement this if the rigid bodies would fit exactly into the grid. But what if that's not the case? http://i.imgur.com/XnkQp.png Imagine an upstream airflow in the above situation. At the rectangle's bottom edge, in which cells would I set the velocity to zero? The ones that are completely outside (below) the rectangle, the ones on the edge or the ones inside? None of these seem to be a good idea, because either the smoke would be redirected early (making it look like the rectangle had some repellent force on it), or the smoke would go inside of the box. At least that's how I see it. And it just gets more complicated once I start to rotate the objects. http://i.imgur.com/wgOJy.png Is there a way to prevent staircase artifacts in this case and make the smoke flow smoothly around the box (beside increasing the resolution)? I was thinking about using dynamic resolution (higher around bodies) or dynamic meshes. What do you think? Is there a better solution? I also looked into vortex based approaches instead of fixed grids. But I couldn't yet figure out how to implement rigid bodies in that method either. Thanks for reading. Any help would be very appreciated! 
I believe what you want to use is the "immersed boundary method". I am no expert on this, so I can't offer you any good references.

Of course you can also use unstructured grids, but this would require some reworking of your code.

Unstuctured grid is indeed the most flexible option. However, maybe you can solve your problem using a structured BFC (body fitted coordinates) grid aligned with your objects, while still retaining a single block topological structure.

Quote:
Do not agree. When there is motion in solids the unstructured grids are more hinderance than help. 
Quote:
EDIT: Body fitted grid's seem to have the same problem. EDIT 2: Do you think SPH would be a good approach for smoke? I've not seen anything but water simulations with SPH and I'm not sure how much vorticity would be conserved. 
Quote:
I understand you are not overly interested in ultra accuracy. What you want is real time type performance. Quote:
Use finite difference and extend the stencil till the body surface. This is fastest way to represent general body and that would allow fast movement too. (even in non uniform cartesian mesh one can mark body very very fast.) If the flow viscosity is large enough than lattice boltzman would be the fastest approach to this problem. And good thing with lattice boltzman is that you could program it in GPU too. SPH would be bad approach as it asks you to mark neighbors after every step. This means doing nearest neighbor search, which will slow you down very much. Not worth the effort. 
Thanks very much. I will look into Immersed Boundary Methods.
Do you know any good resource where I could read about it? Most of the things I find with Google are either restricted (pay to view) or too math based. Now, both wouldn't be a problem (I'm happy to pay for a good article) but I'd rather not buy something without knowing if it's what I'm looking for. And the math heavy papers generally don't care a lot about performance and aim for accuracy. 
Quote:
Nothing special is needed for immersed boundary. The velocity field is supposed to follow velocity of solid in the region where solid lies. This you could force by many methods. If you are using Gauss Seidel type iterations then you can just keep replacing velocity to be equal to that of solid even during the iterations. Otherwise a matrix based approach can force the velocity (i will write down tomorrow how i did few years back). Rest of the algorithm is same. Solve the pressure equation etc exactly the way you do otherwise. Just force the velocity field. PS: If you are interested in very accurate results then things do get complicated. By accuracy I mean say , want to predict lift and drag on a rotating body. (In this case you will need ghost cell based immersed boundary). Please search cfdonline i made a explanatory comment about it long back. 
All times are GMT 4. The time now is 16:37. 