def calc_percolation_flux(unsatStore, unsatStore_max, fieldCap, k_sat, beta):
    ' Calculate the percolation flux from the unsaturated to the saturated zone\n\n    Parameters\n    ----------\n    unsatStore : int or float\n        Storage in the unsaturated zone [mm]\n    unsatStore_max : int or float\n        Maximum storage in the unsaturated zone [mm]\n    fieldCap : int or float\n        Field capacity [mm]\n    k_sat : int or float\n        Maximum percolation rate [mm day^-1]\n    beta : int or float\n        Parameter to account for percolation non-linearity\n\n    Returns\n    -------\n    percolation : int or float\n        Percolation flux [mm day^-1]\n    '
    if (unsatStore < fieldCap):
        percolation = 0.0
    else:
        percolation = (k_sat * (((unsatStore - fieldCap) / (unsatStore_max - fieldCap)) ** beta))
    return percolation
Calculate the percolation flux from the unsaturated to the saturated zone

Parameters
----------
unsatStore : int or float
    Storage in the unsaturated zone [mm]
unsatStore_max : int or float
    Maximum storage in the unsaturated zone [mm]
fieldCap : int or float
    Field capacity [mm]
k_sat : int or float
    Maximum percolation rate [mm day^-1]
beta : int or float
    Parameter to account for percolation non-linearity

Returns
-------
percolation : int or float
    Percolation flux [mm day^-1]
def calc_percolation_flux(unsatStore, unsatStore_max, fieldCap, k_sat, beta):
    ' Calculate the percolation flux from the unsaturated to the saturated zone\n\n    Parameters\n    ----------\n    unsatStore : int or float\n        Storage in the unsaturated zone [mm]\n    unsatStore_max : int or float\n        Maximum storage in the unsaturated zone [mm]\n    fieldCap : int or float\n        Field capacity [mm]\n    k_sat : int or float\n        Maximum percolation rate [mm day^-1]\n    beta : int or float\n        Parameter to account for percolation non-linearity\n\n    Returns\n    -------\n    percolation : int or float\n        Percolation flux [mm day^-1]\n    '
    if (unsatStore < fieldCap):
        percolation = 0.0
    else:
        percolation = (k_sat * (((unsatStore - fieldCap) / (unsatStore_max - fieldCap)) ** beta))
    return percolation