rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
conv_flux_brooks_corey.m
Go to the documentation of this file.
1 function [flux, lambda] = conv_flux_brooks_corey(glob, U, params)
2 % function [flux, lambda] = conv_flux_brooks_corey(glob, U, params)
3 % convective flux for Buckley-Leverett problem with Brooks-Corey functions
4 %
5 % function computing the nonlinear convective flux of a Buckley-Leverett with Brooks-Corey approximation
6 % problem.
7 % ``f(x,u) = \frac{\lambda_w(u)}{\lambda_w(u)+\lambda_n(u)} \quad 0\leq u \leq 1``.
8 %
9 % ``\lambda_w(u) = \frac{u^{\frac{2+3\lambda}{\lambda}}}{\mu_1},``
10 % ``\lambda_n(u) = \frac{(1-u)^2 (1-u^{\frac{2+\lambda}{\lambda})}}{\mu_2},``
11 %
12 % required fields of params:
13 % bl_lambda : mobility factor `\lambda`
14 % bl_mu1 : viscosity of wetting phase `\mu_1`
15 % bl_mu2 : viscosity of non-wetting phase `\mu_2`
16 % information
17 %
19 %
20 
21 % glob column check
22 if params.debug
23  if ~isempty(glob) && size(glob,1) < size(glob,2)
24  warning('coordinates in variable glob are given row-wise, but expected them to be column-wise');
25  if params.debug > 2
26  keyboard;
27  end
28  end
29 end
30 
31 %X = glob(:,1);
32 %Y = glob(:,2);
33 
34 ld = params.bl_lambda;
35 mu1 = params.bl_mu1;
36 mu2 = params.bl_mu2;
37 
38 lambda1 = U(:).^((2+3*ld)/ld)/mu1;
39 lambda2 = (1-U(:)).^2.*(1-U(:).^(2/ld+1))/mu2;
40 
41 flux = lambda1 ./ (lambda1 + lambda2);
42 
43 
44 flux = [ flux, flux ] .* [0.3*ones(size(flux)),zeros(size(flux))];
45 
46 lambda = 1/max(flux(:));
47 
48 if params.debug && ( max(U)-eps > 1 || min(U) + eps < 0 )
49  error('U is outside admissable bounds [0,1]');
50 end
51 
52 if params.decomp_mode>0
53  error('function is nonlinear and does not support affine decomposition!');
54 end
55 
function [ flux , lambda ] = conv_flux_brooks_corey(glob, U, params)
convective flux for Buckley-Leverett problem with Brooks-Corey functions
function [ flux , lambda ] = conv_flux_brooks_corey_derivative(glob, U, params)
convective flux for Buckley-Leverett problem with Brooks-Corey functions