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 % ``\partial_u f(x,u) = \frac{\lambda_w
'(u)}{\lambda_w(u)+\lambda_n(u)} + \frac{\lambda_w(u)(\lambda_w'(u)+\lambda_n
'(u))}{\left(\lambda_w(u)+\lambda_n(u)\right)^2} \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`
18 % See also conv_flux_brooks_corey_simple().
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 ) )
41 ld = params.bl_lambda;
45 lambda1 = (U(:).^3)/mu1;
46 lambda2 = ((1-U(:)).^3)/mu2;
48 mobility = lambda1 + lambda2;
50 lambda1d = 3*(U(:).^2)/mu1;
51 lambda2d = -3*((1-U(:)).^2)/mu2;
53 mobilityd = lambda1d + lambda2d;
55 flux = lambda1d ./ mobility + lambda1.*mobilityd./mobility.^2;
57 flux = [ flux, flux ] .* [ones(size(flux)), zeros(size(flux))];
59 if max(abs(imag(flux)))> 0
63 lambda = 1/max(flux(:));
65 if params.debug && ( max(U)-eps > 1 || min(U) + eps < 0 )
66 error('U is outside admissable bounds [0,1]
');
69 if params.decomp_mode>0
70 error('function is nonlinear and does not support affine decomposition!
');
function [ flux , lambda ] = conv_flux_brooks_corey_simple_derivative(glob, U, params)
convective flux for Buckley-Leverett problem with Brooks-Corey functions