CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   Ghost cell location for inclined cavity flow (

zonexo September 6, 2005 01:51

Ghost cell location for inclined cavity flow

I am trying to solve the inclined (skewed) cavity flow using fractional step cell centered FVM collocated grid.

I need to use ghost cells but I'm not sure how they should be located. Should they be reflection of the boundary cells? Or do I just extend the grid lines for the ghost cells?


Luca September 6, 2005 03:00

Re: Ghost cell location for inclined cavity flow
Im'not an expert but I saw the ghost cell are found by reflecting the boundary cell using the wall boundary as simmetry axis.Luca

Jim_Park September 6, 2005 09:19

Re: Ghost cell location for inclined cavity flow
I'll bet you're using a colocated grid. "Collocated" (or collocation) refers to a class of special interpolation techniqes. The extra "l" changes the meaning drastically.

zonexo September 6, 2005 11:39

Re: Ghost cell location for inclined cavity flow
oh thanks for pointing out my mistake. btw, can someone confirm Luca's answer?


Mani September 6, 2005 16:25

Re: Ghost cell location for inclined cavity flow
Luca's answer makes sense, but you should realize that there is no "right" or "wrong" answer to this question. The ghost cell technique is only a concept that helps you write your code in a more uniform fashion, especially considering the flux and gradient evaluation. How you design the geometry of virtual cells outside of the domain has a lot to do with the question: "How do you use those coordinates?" That will depend on the particular scheme. You want to make sure that you get an accurate evaluation of gradients at the boundary. So if that means you should mirror the internal cells, or extrapolate them, or something else, really depends on your own algorithm and your own personal judgement and experience with your code.

To entertain the spelling police ;-) I think "collocation" is the correct term, and the only correct term. I believe, the other one (colocation) is just misspelled, but it's possible that it's been floating around long enough to adopt a meaning in the CFD community. The confusion is similar with the terms "collinear" and "colinear", where again, the first one is correct and the second only exists (and is now accepted) because of consistently wrong usage. Probably not many of us took Latin in high-school. But, then again, I could be wrong... :)

zxaar September 6, 2005 20:16

Re: Ghost cell location for inclined cavity flow
usually, these ghost cells have volume = 0, and their center xc,yc,zc shall be same as face center xfc, yfc, zfc, that they share with live cell. In other words then it is values at face centers, and that is what we need for solver to apply boundary conditions. The gradient at these cells will be taken as same as the live cell they are attached to. (these is how, Fluent and other softwares work). Best of luck.

zonexo September 6, 2005 20:33

Re: Ghost cell location for inclined cavity flow
hello zxaar,

i'm not very clear what you are trying to say.

supposed i've a skewed (inclined) lid-driven cavity problem, to be solved using cell centered FV with fractional step. I need to solve the poisson pressure eqn, hence i need to evaluate the gradient. So at the left wall and bottom wall, what is the most appropriate way to position the ghost cell, since mani said that it depends on situation ?


Jim_Park September 6, 2005 21:23

Re: Ghost cell location for inclined cavity flow
If you put 'collocation superposition' into Google you'll find a whole wealth of methods for solving differential equations.

Simply put, using the term 'collocation' to describe a CFD technique for which all the variables for a volume, cell, node are located at the same spot is misleading to someone not really familiar with CFD (like an applied mathematician who's wandered into fluids). And collocation in the mathematical context is in fact used as a tool to solve differential equations. Maybe even boundary layer equations?

The two words describe entirely different things in a mathematical context. They both appear in my dictionary with just about the same (non-technical) definition.

Now about the spelling: I'll be glad to use co-locate and admit I should have all along if that'll bring peace to the discussion. However, my dictionary (Merriam Webster) does contain the word 'colocate.'

I did in fact take Latin, then French, then Russian. And, as you can tell, they didn't help. I still have trouble with English - remember virtually nothing about the others.


zxaar September 6, 2005 21:29

Re: Ghost cell location for inclined cavity flow
When you make the mesh, all the cells are made up of vertices and faces those enclose the cell. Now all the faces that make up the cell, they are shared by other cells if the cell is live cell (or the cell through which flow goes). But at the boundary there are some faces which have only one live cell, the other cell is not there (say the bottom wall of your case). So we need to put some ghost cells there. That is we imagien that there are cells but in reality no cells. Such cells have zero volume and cell centers same as face center they share.

So the interpolations usually breaks to this:

phi_face = wt * phi_1 + (1-wt) *phi_0,

when phi_1 is of ghost cell , wt = 1 and face value is same as phi_1. Which is logical.

now ghost cells are present at each boundary type. that is for wall, inlet outflow etc.

so for wall, example for lid driven cavity phi_1 = wall vel, and hence for all gradient calculations, phi_face = phi_1 (wall vel).

for inlet, they are fixed for contant velocity inlet, or caluclated by mass flow for mass flwo inlet.

for outflow, they are etxrapolated by interier cells.

Mani September 7, 2005 02:20

Re: Ghost cell location for inclined cavity flow
I think you could have learned one thing about English, especially American English: Not every word that is in use is accurate in both spelling and meaning. Take, for example, the simple word aluminum. Somehow, a letter got lost when the original "aluminium" crossed the Atlantic. A lot of words earn entry to dictionaries, not because they are correct, but because they have been so persistently used that it makes no sense correcting them. I suspect, colinear and colocate belong to that group. New (incorrect) spelling sometimes furnish new meaning, if the original spelling survives as well. No doubt that you are not the only one using "colinear", and that makes it legitimate in some sense. However, since dictionaries allow both spellings for the same meaning, we shouldn't make a big fuss about spelling it either way... and that was my subtle point.

Peace, indeed... as nobody ever declared war :D ... but I still wouldn't rely on google as a source of wisdom (just teasing) ;)

But seriously: Did you have anything to say regarding the actual question?

zxaar September 7, 2005 03:32

Re: Ghost cell location for inclined cavity flow
american english, humm, one thing though, on microsft word, i feel very bad when it shows spelling mistake for : colour and many other such words. Is there a way to switch british spellings rather than americans (at least to me it sucks).

Mani September 7, 2005 14:32

Re: Ghost cell location for inclined cavity flow
zxaar has described one possibility to treat the boundary. As I understand it, to assume zero volume and the center right on the boundary essentially means you are not using the ghost cell. That's equivalent to extrapolating the gradients from the interior domain to the boundary and is certainly one possibility which saves you the headache of thinking about ghost cell geometry.

But let me ask you, zonexo, how do you use ghost cells currently? I am assuming they are already implemented and used (in the evaluation of fluxes), because you seem so certain on using the ghost cell approach as if you had no other choice...?

zonexo September 8, 2005 22:14

Re: Ghost cell location for inclined cavity flow
hi mani,

in the past i'm using cartesian grid hence the position of ghost cells are easily implemented. however with skewed cavity, the position of the ghost cells becomes uncertain.

i can certainly use extrapolation and i've used it before. i'm just thinking of implementing ghost cells and see if there's any difference in accuracy.

Mani September 9, 2005 02:00

Re: Ghost cell location for inclined cavity flow
anything you can do with ghost cells, you can also do without. the ghost cell concept may help you in writing more concise code, but it doesn't add physical content. in other words: any ghost cell approach can be compared to an exactly equivalent extrapolation or interpolation method.( your ghost cell approach essentially is an extrapolation method.) you cannot expect it to be more accurate than other extrapolation methods of the same order. if you already have a working extrapolation method, there is little reason to switch to ghost cells. however, if you want do, all you need to implement is an extrapolation method for the grid coordinates to define ghost cell geometries. then you can apply the ghost cell approach in a similar way as you did on the cartesian grid.

All times are GMT -4. The time now is 22:34.