% Convection - Diffusion; 2D; variable coeffisients
%
% flag = 0 - no convection
% flag = 1 - rotating wind
% flag = 2 - nonlinear convection
% flag = 3 - horizontal wind
% flag = 4 - vertical wind

function [coefx,coefy,sgnx,sgny]=cd_coeff(xi,yi,flag,tita)

switch flag
    case 1
        st = sin(tita); ct = cos(tita);
        coefx = (1-xi*ct)*ct; sgnx = sign(coefx); 
        coefy = (1-yi*st)*st; sgny = sign(coefy);
   case 2 
        coefx = tita*(1+xi^3); sgnx = sign(coefx); 
        coefy = yi^3; sgny  = sign(coefy);
   case 3 
        coefx = 1; sgnx = sign(coefx); 
        coefy = 0; sgny = sign(coefy);
   case 4 
        coefx = 0; sgnx = sign(coefx); 
        coefy = 1; sgny = sign(coefy);
    otherwise       
        coefx = 0; sgnx = sign(coefx); 
        coefy = 0; sgny = sign(coefy);   
end

 return
%
