Saturday, December 6, 2014

Discretization at the boundaries for the Burgers’ eqn.



More on the Burgers’ equation! The process of discretization mentioned earlier works at the interior points in the grid. However, at the boundaries, the as-presented format fails to perform a numerical approximation. Revisiting the discretized form, 
 


The highlighted term in the above representation clearly does not work at i=1, since the term u(i-1) does not exist! To avoid this contradiction, the forward difference formulation is used at i=1, while the backward difference is used at i=N.

The forward difference formulation becomes

And the backward difference formulation becomes

 
The above reformulations facilitate a complete ODE representation of the Burgers’ PDE. From a computational perspective, however, one is better off treating the boundaries as algebraic representations with the actual values for the independent variable as opposed to the discrete formulations mentioned above. Where these forward and backward representations come in handy is when boundary conditions themselves are a partial differential equation. A good example is adiabatic boundary conditions for the heat equation.
 

Tuesday, November 25, 2014

Upwind Discretization



The Burgers’ equation was previously discretized using the MOL approach, to convert the PDE’s to a set of ODE’s. This process of discretization utilized the central difference method for the first order partial differential term. More specifically, the Burger’s equation was written as: 



The highlighted term in the above representation is the central difference approximation. For flow-related PDE’s (especially for ones with high Re’s) the central difference approximation results in numerical errors during the integration process. An alternative approach is to apply the forward difference or Upwind approximation.

The Upwind descretized format for the Burgers’ equation then becomes: 




What looks like a seemingly minor change has profound implications. Plotted below is a comparison of the Burgers’ equation solved using the central difference and the Upwind methods, for 60 elements. The equations were “stiffened” up by using a Reynolds number of 10000.

One can observe from the plots that the central difference formulation results in a “less-smooth” output for the numerical solutions. For the same number of elements (60 in this case), not only is the central difference less accurate but also does it take more computational time (i.e, more number of iterations) to arrive at the (less accurate) solution! A compromise is to increase the number of elements in the central difference method to reach a more accurate solution. Or, one can resort to the Upwind method with less number of elements.