# Arbitrary rigid bodies in coarse grid

 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 23, 2012, 18:12 Arbitrary rigid bodies in coarse grid #1 New Member   Join Date: Apr 2012 Posts: 3 Rep Power: 6 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 fixed-grid algorithm (based on this and this article) and it works as expected. 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 (free-slip) or the whole velocity vector (no-slip) 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? 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. 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!

 April 23, 2012, 19:17 #2 Senior Member   Chris DeGroot Join Date: Nov 2011 Location: Canada Posts: 388 Rep Power: 7 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.

 April 23, 2012, 19:19 #3 Senior Member   Chris DeGroot Join Date: Nov 2011 Location: Canada Posts: 388 Rep Power: 7 Of course you can also use unstructured grids, but this would require some reworking of your code.

 April 24, 2012, 02:59 #4 Senior Member   Rami Ben-Zvi Join Date: Mar 2009 Posts: 148 Rep Power: 9 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.

April 25, 2012, 20:22
#5
Senior Member

Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 490
Rep Power: 13
Quote:
 Originally Posted by Rami 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.

Do not agree.

When there is motion in solids the unstructured grids are more hinderance than help.

April 26, 2012, 05:09
#6
New Member

Join Date: Apr 2012
Posts: 3
Rep Power: 6
Quote:
 Originally Posted by arjun When there is motion in solids the unstructured grids are more hinderance than help.
Why is that? Because it's difficult and/or time consuming to automatically set up a grid? I was thinking that since I wanted to achieve real time performance anything that included changing the grid at every frame wouldn't be fast enough.

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.

Last edited by DrummerB; April 26, 2012 at 05:28.

April 26, 2012, 09:42
#7
Senior Member

Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 490
Rep Power: 13
Quote:
 Originally Posted by DrummerB Why is that? Because it's difficult and/or time consuming to automatically set up a grid? I was thinking that since I wanted to achieve real time performance anything that included changing the grid at every frame wouldn't be fast enough.
Yes.
I understand you are not overly interested in ultra accuracy. What you want is real time type performance.

Quote:
 Originally Posted by DrummerB 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.
My experience is that Cartesian grid and immersed boundary would be fastest if the Cartesian grid is uniform.
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.

 April 26, 2012, 09:58 #8 New Member   Join Date: Apr 2012 Posts: 3 Rep Power: 6 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.

April 26, 2012, 10:09
#9
Senior Member

Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 490
Rep Power: 13
Quote:
 Originally Posted by DrummerB 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.

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 cfd-online i made a explanatory comment about it long back.

 Tags body, boundary, grid, rigid, smoke

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Greg Lewin Main CFD Forum 0 December 1, 2006 10:39 David FLUENT 4 June 8, 2005 16:20 Arnab CD-adapco 1 February 22, 2005 13:27 Art Stretton Phoenics 5 April 2, 2002 05:59 Chuck Leakeas Main CFD Forum 2 May 26, 2000 11:18

All times are GMT -4. The time now is 06:32.