rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
conv_flux_burgers_parabola.m
Go to the documentation of this file.
1 function [flux, lambda] = conv_flux_burgers_parabola(glob, U, params)
2 % function [flux, lambda] = conv_flux_burgers_parabola(glob, params)
3 % convective flux of a Burgers problem
4 %
5 % function computing the convective flux of a Burgers problem with parabolic
6 % velocity field times `u^2` rotated by an arbitrary angle around the point
7 % '(0.5,0.5)'.
8 %
9 %
10 
11 % glob column check
12 if params.debug
13  if ~isempty(glob) && size(glob,1) < size(glob,2)
14  warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
15  if params.debug > 2
16  keyboard;
17  end
18  end
19 end
20 
21 
22 P = [glob(:,1)'-0.5; glob(:,2)'-0.5];
23 Rinv = [cos(-params.vrot_angle), - sin(-params.vrot_angle); ...
24  sin(-params.vrot_angle), cos(-params.vrot_angle) ];
25 RP = Rinv*P; % rotated coordinates as columns
26 RP(1,:) = RP(1,:) + 0.5;
27 RP(2,:) = RP(2,:) + 0.5;
28 V = zeros(size(RP));
29 V(1,:) = (1- RP(2,:)) .* RP(2,:) * params.vmax * 4;
30 V(2,:) = 0;
31 RV = Rinv^(-1) * V;
32 flux = [ RV(1,:)' .* U(:).^params.flux_pdeg, ...
33  RV(2,:)' .* U(:).^params.flux_pdeg ];
34 
35 umax = 1;
36 i = find(abs(U)>1.5,1);
37 if ~isempty(i)
38  disp(['U not bounded by 1 as assumed by flux, lambda may be ',...
39  'too large.']);
40 end;
41 
42 lambda = 1/(params.vmax * 2 * umax^(params.flux_pdeg-1));
43 
function [ flux , lambda ] = conv_flux_burgers_parabola(glob, U, params)
convective flux of a Burgers problem