CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

How to find the ghost cells in the immersed boundary methods?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By arjun

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 1, 2011, 00:29
Default How to find the ghost cells in the immersed boundary methods?
  #1
New Member
 
cyou
Join Date: Nov 2011
Posts: 15
Rep Power: 14
cyou is on a distinguished road
I am now studying the immersed boundary methods
Do anyone know the ways to define the ghost cells?
Could you recommend me some papers?

Thx
cyou is offline   Reply With Quote

Old   December 5, 2011, 21:23
Default
  #2
New Member
 
cyou
Join Date: Nov 2011
Posts: 15
Rep Power: 14
cyou is on a distinguished road
nobody knows?...
cyou is offline   Reply With Quote

Old   December 5, 2011, 21:51
Default
  #3
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,272
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by cyou View Post
nobody knows?...

I definitely know as I have written immersed boundary based codes.

Before I answer your question, could you answer mine. Do you know what role ghost cells play in immersed boundary method. Do you understand the purpose of ghost cells?
arjun is offline   Reply With Quote

Old   December 5, 2011, 22:58
Default
  #4
New Member
 
cyou
Join Date: Nov 2011
Posts: 15
Rep Power: 14
cyou is on a distinguished road
Quote:
Originally Posted by arjun View Post
I definitely know as I have written immersed boundary based codes.

Before I answer your question, could you answer mine. Do you know what role ghost cells play in immersed boundary method. Do you understand the purpose of ghost cells?
To arjun

Thank you very much for your reply
Yes, I have read numbers of papers about the immersed boundary.
And I have did some simple simulation with the immersed boundary.
But the identification of the boundary and the interpolation are big problems for me now, especially the part of coding.

First, I want to define the marker points on the boundary
Then, find the ghost cells or the forcing cells
And then, find the image cells
Last, use the marker points, ghost cells(or forcing cells), and image cells to do the interpolation to add the body force

Is that right?

Thx

Last edited by cyou; December 6, 2011 at 01:05.
cyou is offline   Reply With Quote

Old   December 5, 2011, 23:34
Default
  #5
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,272
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by cyou View Post
To arjun

Thank you very much for your reply
Yes, I have read numbers of papers about the immersed boundary.
And I have did some simple simulation with the immersed boundary.
But the identification of the boundary and the interpolation are big problems for me now, especially the part of coding.

First, I want to define the maker points on the boundary
Then, find the ghost cells or the forcing cells
And then, find the image cells
Last, use the maker points, ghost cells(or forcing cells), and image cells to do the interpolation to add the body force

Is that right?

Thx

Yes and no.

Now at this moment, lets leave the concept of ghost cells aside. Assume that the solver does not use ghost cells, only uses immersed boundary method.

First of all understand that forcing is applied to momentum equation so that the regions of mesh where solid lies , the velocity is same as that of the solid.

This takes care of momentum equation. Second thing we have is continuity equation, that decides the pressure in the calculation domain.

This pressure equation is solved in whole domain , that is fluid and solid, just as it would be solved for normal solver. Nothing special here.

This shall work fine as a normal immersed boundary solver.


Now the question arises, why do we need ghost cell method at all , if that all could work fine?

The reason is that there are some errors remaining in momentum equation. Lets look at the errors that could be there.

When you apply descretization, you go through all the cells and calculate diffusional and convection terms based on u,v,w values of cell and neightbour cells.

what happens if neighbour cell happen to be a solid cell?? What happens with the solid-fluid interface lies somewhere between this fluid and solid cell??

In this situation the diffusional term for momentum equation would be wrong. Because diffusional term is equal to K(u_neigh - u_self) / d, where d is distance between cell centers.

If solid boundary lies between cell centers then correct diffusional term is K(u_neigh - u_self) / d_actual)

This d_actual < d , that means diffusional term as calculated by solver is lower than the exact value that shall be used.


Further it shall be noticed that (u_neigh - u_self)/d_actual is nothing but velocity gradient.

Now lets call

D_correct = K(u_neigh - u_self) / d_actual)
D_solver = K(u_neigh - u_self) / d

NOW HERE IS CRUX OF GHOST CELL METHOD:

Change u_neigh to u_neigh_ghost such that

D_solver = K(u_neigh_ghost - u_self) / d = D_correct

That is just change the value of velocity at cell center of solid cell to a value such that when solver calculates the gradient or diffusion term it comes out to be correct value.

Now lets come to your question: How to find ghost cells?


To find ghost cells loop through all the cells in mesh, if the cell is fluid cell, then check its neighours. If any of its neighbour is inside solid then this solid cell is ghost cell. Find the new velocity values for this ghost cell such that when gradients are calculated they are correct ones.

How to mark solids in whole domain is different question. It could be done by various methods. I won't mention how I am doing it because I am not allowed to discuss it.
Radaei and utkunun like this.
arjun is offline   Reply With Quote

Old   December 6, 2011, 00:51
Default
  #6
New Member
 
cyou
Join Date: Nov 2011
Posts: 15
Rep Power: 14
cyou is on a distinguished road
Quote:
Originally Posted by arjun View Post
Yes and no.

Now at this moment, lets leave the concept of ghost cells aside. Assume that the solver does not use ghost cells, only uses immersed boundary method.

First of all understand that forcing is applied to momentum equation so that the regions of mesh where solid lies , the velocity is same as that of the solid.

This takes care of momentum equation. Second thing we have is continuity equation, that decides the pressure in the calculation domain.

This pressure equation is solved in whole domain , that is fluid and solid, just as it would be solved for normal solver. Nothing special here.

This shall work fine as a normal immersed boundary solver.


Now the question arises, why do we need ghost cell method at all , if that all could work fine?

The reason is that there are some errors remaining in momentum equation. Lets look at the errors that could be there.

When you apply descretization, you go through all the cells and calculate diffusional and convection terms based on u,v,w values of cell and neightbour cells.

what happens if neighbour cell happen to be a solid cell?? What happens with the solid-fluid interface lies somewhere between this fluid and solid cell??

In this situation the diffusional term for momentum equation would be wrong. Because diffusional term is equal to K(u_neigh - u_self) / d, where d is distance between cell centers.

If solid boundary lies between cell centers then correct diffusional term is K(u_neigh - u_self) / d_actual)

This d_actual < d , that means diffusional term as calculated by solver is lower than the exact value that shall be used.


Further it shall be noticed that (u_neigh - u_self)/d_actual is nothing but velocity gradient.

Now lets call

D_correct = K(u_neigh - u_self) / d_actual)
D_solver = K(u_neigh - u_self) / d

NOW HERE IS CRUX OF GHOST CELL METHOD:

Change u_neigh to u_neigh_ghost such that

D_solver = K(u_neigh_ghost - u_self) / d = D_correct

That is just change the value of velocity at cell center of solid cell to a value such that when solver calculates the gradient or diffusion term it comes out to be correct value.

Now lets come to your question: How to find ghost cells?


To find ghost cells loop through all the cells in mesh, if the cell is fluid cell, then check its neighours. If any of its neighbour is inside solid then this solid cell is ghost cell. Find the new velocity values for this ghost cell such that when gradients are calculated they are correct ones.

How to mark solids in whole domain is different question. It could be done by various methods. I won't mention how I am doing it because I am not allowed to discuss it.
Thank you very much for your detailed instruction.
I have come to understand something I have never thought before. Thank you very much...

It is not appropriate to ask you to introduce your methods in details now. But could you please recommend some useful papers or codes which can be shared on the internet?
cyou is offline   Reply With Quote

Old   December 6, 2011, 01:25
Default
  #7
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,272
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by cyou View Post
Thank you very much for your detailed instruction.
I have come to understand something I have never thought before. Thank you very much...

It is not appropriate to ask you to introduce your methods in details now. But could you please recommend some useful papers or codes which can be shared on the internet?

Search for Muzaferija S and Peric's paper for Ghost cells it covers in detail how it is implemented.

Or just search ghost cell method and read the paper while remembering the outline as I said. Now that you know the basic of it the papers will make sense to you.
arjun is offline   Reply With Quote

Old   December 6, 2011, 01:30
Default
  #8
New Member
 
cyou
Join Date: Nov 2011
Posts: 15
Rep Power: 14
cyou is on a distinguished road
Quote:
Originally Posted by arjun View Post
Search for Muzaferija S and Peric's paper for Ghost cells it covers in detail how it is implemented.

Or just search ghost cell method and read the paper while remembering the outline as I said. Now that you know the basic of it the papers will make sense to you.
Thx!!!
Hope everything goes well with your research!
cyou is offline   Reply With Quote

Old   December 6, 2011, 01:49
Default
  #9
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,272
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
i forgot to add, if you visit www.inavier.com you could download the inavier demo version that supports basic immersed boundary method on unstructured mesh.

I am going to improve it further in future when i get time, but for time being it is not bad.
arjun is offline   Reply With Quote

Old   December 6, 2011, 01:54
Default
  #10
New Member
 
cyou
Join Date: Nov 2011
Posts: 15
Rep Power: 14
cyou is on a distinguished road
Thx

And one more question: do you code the programm to do the simulation or make some modification on the commercial CFD programm? Which way do you recommend?
cyou is offline   Reply With Quote

Old   December 6, 2011, 01:54
Default
  #11
New Member
 
cyou
Join Date: Nov 2011
Posts: 15
Rep Power: 14
cyou is on a distinguished road
Quote:
Originally Posted by arjun View Post
i forgot to add, if you visit www.inavier.com you could download the inavier demo version that supports basic immersed boundary method on unstructured mesh.

I am going to improve it further in future when i get time, but for time being it is not bad.
Thx

And one more question: do you code the programm to do the simulation or make some modification on the commercial CFD programm? Which way do you recommend?
cyou is offline   Reply With Quote

Old   December 6, 2011, 02:13
Default
  #12
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,272
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by cyou View Post
Thx

And one more question: do you code the programm to do the simulation or make some modification on the commercial CFD programm? Which way do you recommend?

As far as I am concerned, I have written the in house code so I control it fully.

The code that I asked you to download is not the in house code, it is written as a part of hoby just for fun and learning. since inavier is also written by me, I can add models into it easily as I control the full source code.

Modifying commercial code is difficult but not impossible.

The major difficulty is the part where you mark the part of mesh as solid. I call it solid marking algorithm. It involves 3d range or nearest neighbor search. Because of this reason it could kill the efficiency of algorithm.

If you could do that by using external program and couple it with commercial code then modifying the commercial code is not difficult.


in iNavier the 3d search algorithm library is written by me, which is slightly different than other 3d search algorithm. normally people use kd - tree search for this purpose. I use Hyper-kd tree search algorithm that I developed. It is much faster than normal method.


My advise, do not hurry, sit down and think and think and think. weigh your options if you could really do it with commercial codes.
arjun is offline   Reply With Quote

Old   December 6, 2011, 02:26
Default
  #13
New Member
 
cyou
Join Date: Nov 2011
Posts: 15
Rep Power: 14
cyou is on a distinguished road
Quote:
Originally Posted by arjun View Post
As far as I am concerned, I have written the in house code so I control it fully.

The code that I asked you to download is not the in house code, it is written as a part of hoby just for fun and learning. since inavier is also written by me, I can add models into it easily as I control the full source code.

Modifying commercial code is difficult but not impossible.

The major difficulty is the part where you mark the part of mesh as solid. I call it solid marking algorithm. It involves 3d range or nearest neighbor search. Because of this reason it could kill the efficiency of algorithm.

If you could do that by using external program and couple it with commercial code then modifying the commercial code is not difficult.


in iNavier the 3d search algorithm library is written by me, which is slightly different than other 3d search algorithm. normally people use kd - tree search for this purpose. I use Hyper-kd tree search algorithm that I developed. It is much faster than normal method.


My advise, do not hurry, sit down and think and think and think. weigh your options if you could really do it with commercial codes.
Thank you very much for your suggestion!!!
cyou is offline   Reply With Quote

Old   July 12, 2012, 03:17
Default
  #14
New Member
 
cyou
Join Date: Nov 2011
Posts: 15
Rep Power: 14
cyou is on a distinguished road
Quote:
Originally Posted by arjun View Post
As far as I am concerned, I have written the in house code so I control it fully.

The code that I asked you to download is not the in house code, it is written as a part of hoby just for fun and learning. since inavier is also written by me, I can add models into it easily as I control the full source code.

Modifying commercial code is difficult but not impossible.

The major difficulty is the part where you mark the part of mesh as solid. I call it solid marking algorithm. It involves 3d range or nearest neighbor search. Because of this reason it could kill the efficiency of algorithm.

If you could do that by using external program and couple it with commercial code then modifying the commercial code is not difficult.


in iNavier the 3d search algorithm library is written by me, which is slightly different than other 3d search algorithm. normally people use kd - tree search for this purpose. I use Hyper-kd tree search algorithm that I developed. It is much faster than normal method.


My advise, do not hurry, sit down and think and think and think. weigh your options if you could really do it with commercial codes.

Long time no "see".
Hope you everything goes well

I have tried to write some codes with IB methods.
But there are few questions need your help.

1, If I simulate a 2D square whose boundary is coincide with mesh grid. Then there is no need to do any interpolation. Using IB method means define the velocity zero at the grids which are located in the square, after solving momentum equations and before solving the poisson equations. Am I right?

2, When the boundary is not coincide with the mesh grid. We need to do interpolation at the "ghost cell"( one layer grids between solid and liquid). But How about the grids in the model which means solid. Do we just define the velocity at the solid grid zero? Or we do not have to do anything to do with them?

Waiting for your kind reply
cyou is offline   Reply With Quote

Old   January 2, 2013, 12:52
Default ghost cell method
  #15
New Member
 
shaafi
Join Date: Apr 2012
Posts: 4
Rep Power: 14
calvinhobbes is on a distinguished road
i am trying to write a solver based on ghost cell method proposed by Mittal 2008 for incompressible viscous flow usingg matlab for time being which will be converted in C later.i coupled the ghost nodes and fluid nodes while solving the matrix. In doing so, u- momentum and v- momentum pose no problem. but solving pressure poisson equation is becoming extremely dificult. No iterative solvers that comes with MATLAB can solve the matrix. I checked the conditional number of PPE which is around e^16. Any suggestion for this problem????And why this is happening?
calvinhobbes is offline   Reply With Quote

Old   January 2, 2013, 14:53
Default
  #16
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,272
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Sorry long time and I did not see your post.

Quote:
Originally Posted by cyou View Post
Long time no "see".
Hope you everything goes well

I have tried to write some codes with IB methods.
But there are few questions need your help.

1, If I simulate a 2D square whose boundary is coincide with mesh grid. Then there is no need to do any interpolation. Using IB method means define the velocity zero at the grids which are located in the square, after solving momentum equations and before solving the poisson equations. Am I right?

Yes. Indeed you do not need any interpolation as you can close momentum eq. terms exactly.


Quote:
Originally Posted by cyou View Post
2, When the boundary is not coincide with the mesh grid. We need to do interpolation at the "ghost cell"( one layer grids between solid and liquid). But How about the grids in the model which means solid. Do we just define the velocity at the solid grid zero? Or we do not have to do anything to do with them?

Waiting for your kind reply

Understand this part that for any live or flow cell whose any neighbor is a solid cell, you can not close the momentum equation. If you are in a finite volume code then you will need convection term and diffusional term.

You can set the convectional term to zero (or really compute from interpolated value such that normal flux is zero). What really very important is that the diffusional term is set correctly.

This is what ghost cell method does. It sets the velocity in ghost cell such that when the diffusional term is calculated it gives you right value accounting for the surface of solid.

We noticed that this becomes very very important in flows with high Reynolds number with solids rotating. For example if this term is not correct your lift forces will be way off.
arjun is offline   Reply With Quote

Old   January 2, 2013, 14:54
Default
  #17
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,272
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by calvinhobbes View Post
i am trying to write a solver based on ghost cell method proposed by Mittal 2008 for incompressible viscous flow usingg matlab for time being which will be converted in C later.i coupled the ghost nodes and fluid nodes while solving the matrix. In doing so, u- momentum and v- momentum pose no problem. but solving pressure poisson equation is becoming extremely dificult. No iterative solvers that comes with MATLAB can solve the matrix. I checked the conditional number of PPE which is around e^16. Any suggestion for this problem????And why this is happening?

You matrix may be all Neurmann BC and thus singular. Check this part.
arjun is offline   Reply With Quote

Old   January 2, 2013, 23:45
Default
  #18
New Member
 
shaafi
Join Date: Apr 2012
Posts: 4
Rep Power: 14
calvinhobbes is on a distinguished road
Quote:
Originally Posted by arjun View Post
You matrix may be all Neurmann BC and thus singular. Check this part.
But for fractional step method proposed by Von Neumann boundary condition is imposed on all boundaries. Does this mean the PPE may hav more than one solution? Also how to solve PPE in this kind of situation where Neumann boundary condition is applied?
calvinhobbes is offline   Reply With Quote

Old   January 3, 2013, 00:03
Default
  #19
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,272
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by calvinhobbes View Post
But for fractional step method proposed by Von Neumann boundary condition is imposed on all boundaries. Does this mean the PPE may hav more than one solution? Also how to solve PPE in this kind of situation where Neumann boundary condition is applied?

Yes indeed. You might have to check the documentation of matlab as to how this is done. I have used matlab exactly 2 times in life so do not know much about it.
arjun is offline   Reply With Quote

Old   April 14, 2013, 23:00
Default
  #20
Member
 
Osman
Join Date: Oct 2012
Location: Japan
Posts: 53
Rep Power: 13
o_mars_2010 is on a distinguished road
Hello Mr. Arjun

I have developed a code to simulate a flow past a circular cylinder using Immersed Boundary Method.
I used the interpolation method by Balaras (2004).
However, the recirculation length L/D at Re=40 is around 2, however, from literature i found that it is in the range 2.2~2.4.
Could you please tell me what could be the reason??
(I used different grid size, however i got the same results)
In addition, i am using Tecplot to calculate the drag coefficient.
For example: If the Cylinder radius is for example R=0.05 & the grid size is dx=0.01
I could not get accurate results for the drag coefficient if the the calculation is taking place with the same radious.
But, i get accurate results for the drag coefficient if i used a radious smaller than the actual radious such as R=0.0485.
What could be the reason????
o_mars_2010 is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] SnappyHexMesh for internal Flow vishwa OpenFOAM Meshing & Mesh Conversion 24 June 27, 2016 08:54
OpenFOAM 1.6-ext git installation on Ubuntu 11.10 x64 Attesz OpenFOAM Installation 45 January 13, 2012 12:38
[snappyHexMesh] snappyHexMesh aborting Tobi OpenFOAM Meshing & Mesh Conversion 0 November 10, 2010 03:23
Reflected ghost values of a solid boundary quarkz Main CFD Forum 1 July 25, 2007 07:33


All times are GMT -4. The time now is 21:00.