# uniform discretization scheme on non-uniform grid

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

 March 27, 2019, 12:02 uniform discretization scheme on non-uniform grid #1 New Member   Theo Join Date: Mar 2009 Posts: 26 Rep Power: 17 imagine using a discretization scheme for a uniform grid, e.g. (x_(i+1) + x_(i-1) - 2*x_i)/h² for a second derivative, even if the grid is not uniform, i.e. h_(i+1), h(i-1) and h_i are not equal. Does that introduce a significant error? or is there a certain grid stretching below which it is acceptable? Reason for this question is that uniform schemes are obviously much easier to implement and faster to compute.

March 27, 2019, 12:06
#2
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,831
Rep Power: 73
Quote:
 Originally Posted by holgerbre imagine using a discretization scheme for a uniform grid, e.g. (x_(i+1) + x_(i-1) - 2*x_i)/h² for a second derivative, even if the grid is not uniform, i.e. h_(i+1), h(i-1) and h_i are not equal. Does that introduce a significant error? or is there a certain grid stretching below which it is acceptable? Reason for this question is that uniform schemes are obviously much easier to implement and faster to compute.

Of course the answer is that you have a wrong formula on non uniform grid. To check this try to expand the local truncation error.
The correct formula is very easy to write, you can write the lagrangian polynomial of second degree on three non equidistant nodes. The second derivative is constant in such interval.

 March 27, 2019, 12:49 #3 New Member   Theo Join Date: Mar 2009 Posts: 26 Rep Power: 17 sure, but i wonder if there is a limit up to which this error is acceptable?

March 27, 2019, 12:53
#4
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,831
Rep Power: 73
Quote:
 Originally Posted by holgerbre sure, but i wonder if there is a limit up to which this error is acceptable?

Compute the local truncation and compare the two formula. Check what happens for vanishing mesh size. Remember that to hope in a physically relevant solution you need consistence and stabilty when you perform a discretization of an equation.
Have also a look to the book of Peric and Ferziger about the discretization on non uniform grids

March 27, 2019, 13:39
#5
Senior Member

-
Join Date: Jul 2012
Location: Germany
Posts: 184
Rep Power: 14
Quote:
 Originally Posted by holgerbre sure, but i wonder if there is a limit up to which this error is acceptable?
For constant problems the error is acceptable. For anything else, dont do it.
__________________
Check out my side project:

A multiphysics discontinuous Galerkin framework: Youtube, Gitlab.