def calc_dDdc_fn(c, dc, D_fn):
    """
    Computes dD/dc given a functional form to estimate D(c).
    """
    # computes diffusivity at given concentration and one step size away [m^2/s]
    D1 = D_fn(c)
    D2 = D_fn(c + dc)
    # computes dD/dc using forward difference formula [m^2/s / kg/m^3]
    dDdc = (D2 - D1) / dc

    return dDdc