CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   1st or 2nd order gradients approach? (https://www.cfd-online.com/Forums/main/141675-1st-2nd-order-gradients-approach.html)

fireflies September 13, 2014 09:26

1st or 2nd order gradients approach?
 
hi every one
i have written a 3d unstructured(hybrid) NS solver using a cell-centered finite volume method. three methods of green, unweighted-LSQ and weighted LSQ have implemented to calculate the gradients.after a series of tests on a field which i know analytic solutions of gradients, i found

1)Compare the three methods result with analytic one on regular grid, the relatively error were about 1e-13(machine zero is 1e-14 on my system); and on iregualr grid, the relatively error were about 1e-3 to 1e-5. dose this mean my program works right?

2) on regular grid, all the three methods cannot achieve 2nd order accuracy, the green and unweighted-LSQ achieved 1st order and weighted LSQ was more than 1st; and on iregualr grid the green and unweighted-LSQ cannot achieved 1st order and weighted LSQ was 1st order. i am confused because some people said the three method are 1st order and some said they are 2nd order method, and i want to know dose the gradient accuracy less than 2nd order would have any affect on accuracy of spatial discretization, if i use a linear reconstruction of Barth

duri September 17, 2014 15:30

There is nothing called first order gradient and second order gradient. Gradient is always first order term. Accuracy of gradient calculation would affect the solution.

sbaffini September 18, 2014 08:07

The gradient accuracy order for an overall second order FV cell-centered code (linear reconstruction) just need to be first. However, it is important that it is first order on any grid. Still, for fully cartesian, uniform, meshes i expect some methods to return a second order accuracy.

How are you handling your boundary conditions? Is it possible that they are not treated consistently for the analytic solution?


All times are GMT -4. The time now is 07:18.