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

gradient calculation of cell centered finite volume method

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

Like Tree1Likes
  • 1 Post By praveen

Reply
 
LinkBack Thread Tools Display Modes
Old   May 3, 2011, 06:06
Default gradient calculation of cell centered finite volume method
  #1
New Member
 
Jianguo
Join Date: May 2011
Posts: 9
Rep Power: 6
zhengjg is on a distinguished road
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 least-square 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 least-square method, three neighboring cells are needed.

Any one can give some suggestion.
Your help is greatly appreciated.
zhengjg is offline   Reply With Quote

Old   May 3, 2011, 06:41
Default
  #2
Super Moderator
 
praveen's Avatar
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 249
Blog Entries: 6
Rep Power: 9
praveen is on a distinguished road
You have to add other cells to the stencil. For example, find all cells which share a vertex with the boundary cell and use them also for least squares.
praveen is offline   Reply With Quote

Old   November 5, 2012, 03:38
Default I have a same question
  #3
Member
 
Dokeun, Hwang
Join Date: Apr 2010
Posts: 71
Rep Power: 7
dokeun is on a distinguished road
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)
dokeun is offline   Reply With Quote

Old   November 6, 2012, 02:06
Default one source
  #4
Member
 
Dokeun, Hwang
Join Date: Apr 2010
Posts: 71
Rep Power: 7
dokeun is on a distinguished road
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.
dokeun is offline   Reply With Quote

Old   November 6, 2012, 03:31
Default
  #5
Super Moderator
 
praveen's Avatar
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 249
Blog Entries: 6
Rep Power: 9
praveen is on a distinguished road
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.
dokeun likes this.
praveen is offline   Reply With Quote

Old   November 6, 2012, 05:58
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 1,600
Rep Power: 23
FMDenaro will become famous soon enough
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 6-node Lagrangian simplex.

I don't know if I was of some help...
FMDenaro is offline   Reply With Quote

Old   November 10, 2012, 17:20
Default
  #7
Senior Member
 
Join Date: Aug 2011
Posts: 251
Rep Power: 6
leflix is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
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.

I don't know if I was of some help...
Hi Filippo
What you advise would be a kind of mixed CV-FEM 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...
leflix is offline   Reply With Quote

Old   November 10, 2012, 17:24
Default
  #8
Senior Member
 
Join Date: Aug 2011
Posts: 251
Rep Power: 6
leflix is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
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.
I don't know if I was of some help...

Hi Filippo
What you advise would be a kind of mixed CV-FEM 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...
leflix is offline   Reply With Quote

Old   November 10, 2012, 17:32
Default
  #9
Senior Member
 
Join Date: Aug 2011
Posts: 251
Rep Power: 6
leflix is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
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.
I don't know if I was of some help...

Hi Filippo
What you advise would be a kind of mixed CV-FEM 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...
leflix is offline   Reply With Quote

Old   November 10, 2012, 18:22
Default
  #10
New Member
 
Mijail Febres
Join Date: May 2010
Posts: 4
Rep Power: 7
Mijail is on a distinguished road
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.
Mijail is offline   Reply With Quote

Old   November 12, 2012, 00:13
Default Green Gauss Method...
  #11
New Member
 
Vinayender
Join Date: Jul 2009
Location: India
Posts: 24
Rep Power: 8
vinayender is on a distinguished road
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:
Originally Posted by zhengjg View Post
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 least-square 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 least-square method, three neighboring cells are needed.

Any one can give some suggestion.
Your help is greatly appreciated.
Attached Images
File Type: jpg Green Gauss.jpg (42.0 KB, 55 views)
__________________
Thanks ,
Vinayender
vinayender is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


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


All times are GMT -4. The time now is 11:39.