Tips & Tricks

Codes and more that we use often

January 27, 2020 by

Soil Hydraulic Functions in Matlab

Water Retention Functions

The van Genuchten (1980) model is the most widely used water retention curve function:

where the effective saturation is defined as:

The hydraulic conductivity function is defined using Mualem Model.

The hydraulic capacity function.

The following function takes a scalr or vector of u as input: test

function [q,k,c] = Mualem_vanGenuchten(x,u,qr,por,a,n,ks)
mu = 0.5;
m  = 1-1/n;

UZ = u<0;

Q  = (1-UZ)*1   +   UZ .* ((1+(-a.*u).^n).^(-m));

q  = qr+(por-qr)*Q;
k  = ks*(Q.^mu).*(1-(1-Q.^(1/m)).^m).^2 ;
c  = (1-UZ)*0+ UZ.*(((por-qr)*n*m*a.*(-a.*u).^(n-1))./((1+(-a.*u).^n).^(m+1)));

end