3 %
function computing the convective flux of a Burgers problem.
5 %
'flux' is a
'2xnpoints' matrix, representing the
'x'/
'y'-coordinates of the
6 % velocity in the edge midpoints.
8 % required fields of params:
9 % flux_vx : x coordinate of flux vector
10 % flux_vy : y coordinate of flux vector
11 % flux_pdeg : exponent `e` in Burgers term `f(u) = v \cdot u^e`
15 if ~isempty(glob) && size(glob,1) < size(glob,2)
16 warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
23 % i.e. constant velocity v = (params.flux_vx, params.flux_vy) times u^pdeg
24 % u is assumed to be bounded by 1, such that lambda can be
25 % specified in advance
26 Upower = real(U(:).^params.flux_pdeg);
27 flux = [ params.flux_vx * ones(size(U(:))) .* Upower, ...
28 params.flux_vy * ones(size(U(:))) .* Upower ];
31 i = find(abs(U)>1.5,1);
32 if ~isempty(i) && params.
verbose >=10
33 disp(['U not bounded by 1 as assumed by flux, lambda may be ',...
36 vmax = sqrt(params.flux_vy^2 + params.flux_vx^2);
37 lambda = 1/ (vmax * 2 * umax^(params.flux_pdeg-1));
function r = verbose(level, message, messageId)
This function displays messages depending on a message-id and/or a level. Aditionally you can set/res...
function [ flux , lambda ] = conv_flux_burgers(glob, U, params)
function computing the convective flux of a Burgers problem.