
[Sponsors] 
May 3, 2011, 06:06 
gradient calculation of cell centered finite volume method

#1 
New Member
Jianguo
Join Date: May 2011
Posts: 9
Rep Power: 8 
I am solving Euler equations using cell centered finite volume MUSCL method.
The computational domain is discretized into a triangular mesh. I need to calculate the flow variable gradient at cell center of each triangular element using leastsquare method. I don't know how to calculate the gradient in cell which has one or two edges on physical boundary, such as solid wall, inflow or outflow boundary. For a cell which has two edges on boundary, how can I calculate the gradient? There is only one cell which has a common edge with this cell. For leastsquare method, three neighboring cells are needed. Any one can give some suggestion. Your help is greatly appreciated. 

November 5, 2012, 03:38 
I have a same question

#3 
Member
Dokeun, Hwang
Join Date: Apr 2010
Posts: 71
Rep Power: 9 
Now I'm writing a code to calculate a gradient on a cell which contacts physical boundary such as wall, in/outlet.
Question is Do I have to use dummy(ghost) cells to calculate the gradient on a cell? For example a cell is near by wall at its one face. Then ghost cell is defined as mirrored with the cell at the contact face and has a value according to the wall(temp, pressure and so on) 

November 6, 2012, 02:06 
one source

#4 
Member
Dokeun, Hwang
Join Date: Apr 2010
Posts: 71
Rep Power: 9 
I found a source code using least squares approach for a reconstruction in www.cfdbooks.com(ossan2deuler). In this code, dummy cell data wasn't involved for computing lsq matrix.


November 6, 2012, 03:31 

#5 
Super Moderator

Some people do use dummy cell data in the least squares. It can improve the accuracy, since the stencil is more centered by including ghost cells. If you dont include the ghost cells, the stencil is one sided and it will have less accuracy.


November 6, 2012, 05:58 

#6 
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 3,354
Rep Power: 37 
I am not sure to get the real question...
At second order of accuracy you can use the linear shape function in a 2D triangle of vertex i,j,k, hence: f(x,y) = Ni *fi + Nj* fj + Nk*fk then you can calculate df/dx df/dy analytically. If you are close to a frontier where Dirichlet values are not prescribed but Neumann condition are in effect then you can prescribe the components of the gradient and always solve for the shape functions. Second degre shape function can be built by sequential application of linear function on 6node Lagrangian simplex. I don't know if I was of some help... 

November 10, 2012, 17:20 

#7  
Senior Member
Join Date: Aug 2011
Posts: 251
Rep Power: 8 
Quote:
What you advise would be a kind of mixed CVFEM method mix between FVM and FEM.One can indeed tackle the problem like that,but I'm not sure it is what they want to do.. In a simpler way,one can also use Gauss theorem to compute the gradientin cell center....In this case no need of ghost cells... 

November 10, 2012, 17:24 

#8  
Senior Member
Join Date: Aug 2011
Posts: 251
Rep Power: 8 
Quote:
Hi Filippo What you advise would be a kind of mixed CVFEM method mix between FVM and FEM.One can indeed tackle the problem like that,but I'm not sure it is what they want to do.. In a simpler way,one can also use Gauss theorem to compute the gradientin cell center....In this case no need of ghost cells... 

November 10, 2012, 17:32 

#9  
Senior Member
Join Date: Aug 2011
Posts: 251
Rep Power: 8 
Quote:
Hi Filippo What you advise would be a kind of mixed CVFEM method mix between FVM and FEM.One can indeed tackle the problem like that,but I'm not sure it is what they want to do.. In a simpler way,one can also use Gauss theorem to compute the gradientin cell center....In this case no need of ghost cells... 

November 10, 2012, 18:22 

#10 
New Member
Mijail Febres
Join Date: May 2010
Posts: 4
Rep Power: 9 
You may use vertex neighbours to increase the stencil for gradient calculation.
In my implementation, on bc's cella, i use bc's faces as they were actual neighbours for gradient calculations. I'm pretty sure that someone more experienced may have another opinion, but for me, at least on bc's, faces values must be included. 

November 12, 2012, 00:13 
Green Gauss Method...

#11  
New Member
Vinayender
Join Date: Jul 2009
Location: India
Posts: 24
Rep Power: 10 
In general, for gradients computations, two popular methods used are least square and Greeen Gauss Method. Green Gauss Method is aways more robust than Least Square ( to best of my knowledge)
In Green Gauss Method, you may calculate the gradients of a cell at its cell center by using the variable values on its faces. Attached picture is self explainator for implementing this method. But for theory behid that you can always refer any good Engineering Mathematics book. Quote:
__________________
Thanks , Vinayender 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Chorin's Projection Method for Finite Volume  Scott2  Main CFD Forum  1  August 16, 2010 20:24 
BlockMesh FOAM warning  gaottino  OpenFOAM Native Meshers: blockMesh  7  July 19, 2010 14:11 
Axisymmetrical mesh  Rasmus Gjesing (Gjesing)  OpenFOAM Native Meshers: blockMesh  10  April 2, 2007 14:00 
Finite Volume method  prapanj  Main CFD Forum  3  November 28, 2006 18:11 
Finite volume method vs finite difference method?  superfool  Main CFD Forum  4  October 21, 2006 14:37 