# 1st or 2nd order gradients approach？

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

 September 13, 2014, 09:26 1st or 2nd order gradients approach？ #1 New Member   huang yu Join Date: Jul 2012 Posts: 2 Rep Power: 0 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

 September 17, 2014, 15:30 #2 Senior Member   duri Join Date: May 2010 Posts: 130 Rep Power: 7 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.

 September 18, 2014, 08:07 #3 Senior Member     Paolo Lampitella Join Date: Mar 2009 Location: Italy Posts: 531 Blog Entries: 14 Rep Power: 17 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?