function A = A( Pe ) % ======================= % calculates the upwinding weight as a function of Peclet number % I am using Patankar's Power Law scheme (page 95) % max[ 0, (1 - 0.1 |Pe|)^5 ] % A = (1 - 0.1 * abs( Pe ) ).^5; index = find( A < 0); A(index) = zeros( size(index ) ); % % % % %