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^3}{\mu_1},``
10 % ``\lambda_n(u) = \frac{(1-u)^3}{\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 if params.newton_regularisation && ( ( max(U) > 1 )...%&& max(U)-1e7*eps < 1 )...
35 || ( min(U) < 0 ) )%&& min(U)+1e7*eps > 0 ) )
43 lambda1 = (U(:).^3)/mu1;
44 lambda2 = ((1-U(:)).^3)/mu2;
46 flux = lambda1 ./ (lambda1 + lambda2);
49 flux = [ flux, flux ] .* [0.3*ones(size(flux)),zeros(size(flux))];
51 if max(abs(imag(flux)))> 0
55 lambda = 1/max(flux(:));
57 if params.debug && ( max(U)-eps > 1 || min(U)+eps < 0 )
58 error('U is outside admissable bounds [0,1]');
61 if params.decomp_mode>0
62 error('function is nonlinear and does not support affine decomposition!');
function [ flux , lambda ] = conv_flux_brooks_corey_simple(glob, U, params)
convective flux for Buckley-Leverett problem with Brooks-Corey functions
function [ flux , lambda ] = conv_flux_brooks_corey_simple_derivative(glob, U, params)
convective flux for Buckley-Leverett problem with Brooks-Corey functions