# Do you really need image or ghost cells ?

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

 July 8, 2015, 14:53 Do you really need image or ghost cells ? #1 New Member   sam Join Date: Jan 2011 Posts: 20 Rep Power: 14 If you are coding up a 2D finite volume Euler solver on a structured grid, image or phantom or ghost or aux cells are often used to apply the boundary conditions. My question is - Is this absolutely necessary ? Why not just go to the boundary faces and set the value of the normal flux on that boundary there. One reason I can think of is perhaps you want to compute the flux using a Riemann solver even on the boundary faces. If this is so, then you need some data on the other side and hence ghost cells. But, do you have to use a Riemann solver even on the boundary faces ? why ? Any questions/comments ? Thanks M

July 8, 2015, 16:15
#2
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,398
Rep Power: 67
Quote:
 Originally Posted by mczero57 If you are coding up a 2D finite volume Euler solver on a structured grid, image or phantom or ghost or aux cells are often used to apply the boundary conditions. My question is - Is this absolutely necessary ? Why not just go to the boundary faces and set the value of the normal flux on that boundary there. One reason I can think of is perhaps you want to compute the flux using a Riemann solver even on the boundary faces. If this is so, then you need some data on the other side and hence ghost cells. But, do you have to use a Riemann solver even on the boundary faces ? why ? Any questions/comments ? Thanks M

indeed FV requires to prescribe the flux at the face of a boundary... however, ghost cell are nothing else than extrapolation formula therefore you get similar results with backward/forward formula at the boundary.

However, for Euler you have no derivative to specify at the boundary

July 8, 2015, 16:56
#3
Member

Mianzhi Wang
Join Date: Jan 2015
Location: Columbus, IN
Posts: 34
Rep Power: 10
Hi,
I've been through the same debate in my mind when I was inplementing this (http://www.cfd-online.com/Forums/mai...uler-code.html)

It turned out that applying Riemann solver on boundary makes it very easy to apply BCs of all kinds.
The characteristics are just taken care of automatically by the Riemann solver.

What I did was following the BC strategies of Fluent (https://www.sharcnet.ca/Software/Flu...ug/node203.htm) and calculating the ghost cell state accordingly.
Then my Riemann solver would just work it out.

For data storage, in my case all BC related data and "ghost" state are on "facet", instead of in actual "ghost cells".
And the "facets" are included in the neighbour table, so that my Riemann solver can treat it just like a cell.
I'm not sure what is the simplest approach in your structured project, but either way should work.

Quote:
 Originally Posted by mczero57 If you are coding up a 2D finite volume Euler solver on a structured grid, image or phantom or ghost or aux cells are often used to apply the boundary conditions. My question is - Is this absolutely necessary ? Why not just go to the boundary faces and set the value of the normal flux on that boundary there. One reason I can think of is perhaps you want to compute the flux using a Riemann solver even on the boundary faces. If this is so, then you need some data on the other side and hence ghost cells. But, do you have to use a Riemann solver even on the boundary faces ? why ? Any questions/comments ? Thanks M

 July 9, 2015, 03:47 #4 Senior Member     Paolo Lampitella Join Date: Mar 2009 Location: Italy Posts: 2,093 Blog Entries: 29 Rep Power: 38 I don't know how much debate there is on this topic but, in my opinion, there are serious advantages in NOT using ghost cells: 1) Ghost cells require extrapolation. The state in the extrapolated cells might require some trick to keep the thermodynamics consistent (if using it). 2) Most b.c. do not require any Riemann problem to be solved (e.g., walls). You just know the fluxes on the faces. 3) Storage for ghost cells can explode more easily than you think, especially if your scheme requires 2 cells per side (for a given face). Imagine a wall resolved viscous simulation; having ghost cells means having two more cells in wall normal direction without any special advantage.

 July 10, 2015, 16:24 #5 New Member     Alma Join Date: Feb 2015 Location: Iran Posts: 1 Rep Power: 0 hi all I am a beginner at CFD And I study on the 1 quasi of eular equation with shock (chapter of 12 of computational of fluid dynamics hoffmann) Who has worked previously on this topic? Please Help me Thank you . . . and i Apologize from starter of the thread that I asked my question here. Sorry.

 Tags boundary conditions, ghost cells, riemann solvers