3 % convective flux
for Buckley-Leverett problem with Brooks-Corey functions
5 %
function computing the nonlinear convective flux of a Buckley-Leverett with Brooks-Corey approximation
7 % ``f(x,u) = \frac{\lambda_w(u)}{\lambda_w(u)+\lambda_n(u)} \quad 0\leq u \leq 1``.
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},``
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`
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');
34 ld = params.bl_lambda;
38 lambda1 = U(:).^((2+3*ld)/ld)/mu1;
39 lambda2 = (1-U(:)).^2.*(1-U(:).^(2/ld+1))/mu2;
41 flux = lambda1 ./ (lambda1 + lambda2);
44 flux = [ flux, flux ] .* [0.3*ones(size(flux)),zeros(size(flux))];
46 lambda = 1/max(flux(:));
48 if params.debug && ( max(U)-eps > 1 || min(U) + eps < 0 )
49 error('U is outside admissable bounds [0,1]');
52 if params.decomp_mode>0
53 error('function is nonlinear and does not support affine decomposition!');
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