CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   How to construct the variable on faces of control volume (https://www.cfd-online.com/Forums/main/143889-how-construct-variable-faces-control-volume.html)

fengyunmanbu November 5, 2014 04:19

How to construct the variable on faces of control volume
 
Hello CFD-Onliners~
I am currently studying to program a finite volume solver in cell centered scheme. When calculate the gradient in cell by the method metioned as below.
http://www.cfd-online.com/Wiki/Gradient_computation
It's need to know the variables on the faces of control cell.

May I ask how?
ps: Is there any books or someting else can be recommended

Parth04 November 5, 2014 07:26

advection schemes are used for finding values at face from values at cell centers . . .

referances - book of anderson, book of patnakar

fengyunmanbu November 5, 2014 20:53

Quote:

Originally Posted by Parth04 (Post 517485)
advection schemes are used for finding values at face from values at cell centers . . .

referances - book of anderson, book of patnakar

thank you for your reply
I find two method
First: set the average of values at two adjacent cell centers as the values at their interface.

Second: calculate the values at grid point by weighted mean of central values, then average the values at points of face as the value of the face.

The first one seems simply, but which one is better?

Parth04 November 6, 2014 04:11

there are many mathods, cental differencing (the first u said that) , first order upwind , second order upwind, QUICK, it depends on your problem and solver to select the method

sbaffini November 6, 2014 14:04

There is a clear difference between computing the face values for the convective fluxes and for the gradients. Simply because the former usually require the latter.

Thus, we speak here for the gradients (and not the fluxes).

According to the Fluent references, the second method (node based) is superior to using a simple average of adjacent cell values. Actually, i tested this one on my own and found it also inconsistent on some tetrahedral grids.

If you don't want to go node based (which indeed is quite involved), you can iterate on the cell based one. You add to the simple mean the contribution of the gradients from both cells. At the first iteration such contributions are null. Then they build up with the iterations. This does not necessarily converge (because the resulting computational stencil is growing) but 2-3 iterations will improve the basic method.

My personal experience is to use:

- least-squares with two cell layers (or maybe one by carefully playng with a weighted least squares)
- Radial Basis Functions. Interpolate one or two cell layers around your cell with a RBF and take its analytical derivative. Its simpler than the least squares (once you have everything set up) and can give you much higher accuracy with, possibly, only a minor overhead (they both use matrices to compute the final derivative).


All times are GMT -4. The time now is 04:57.