Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is function cap_inf_rate() misused? #100

Open
wanghai1988 opened this issue Mar 8, 2021 · 0 comments
Open

Is function cap_inf_rate() misused? #100

wanghai1988 opened this issue Mar 8, 2021 · 0 comments

Comments

@wanghai1988
Copy link

in function cap_inf_rate(float dt_h, float h, float infrate),The unit of Parameter “dt_h” should be hours,but in function inf_ga(), call cap_inf_rate() use "dt" instead of "dt_h", is this misused?

def inf_ga(DTYPE_t [:, :] arr_h, DTYPE_t [:, :] arr_eff_por,
        DTYPE_t [:, :] arr_pressure, DTYPE_t [:, :] arr_conduct,
        DTYPE_t [:, :] arr_inf_amount, DTYPE_t [:, :] arr_water_soil_content,
        DTYPE_t [:, :] arr_inf_out, float dt):
    '''Calculate infiltration rate using the Green-Ampt formula
    '''
    cdef int rmax, cmax, r, c
    cdef float dt_h, infrate, avail_porosity, poros_cappress, conduct
    rmax = arr_h.shape[0]
    cmax = arr_h.shape[1]
    for r in prange(rmax, nogil=True):
        for c in range(cmax):
            dt_h = dt / 3600.  # dt from sec to hours
            conduct = arr_conduct[r, c]
            avail_porosity = arr_eff_por[r, c] - arr_water_soil_content[r, c]
            poros_cappress = avail_porosity * arr_pressure[r, c]
            infrate = conduct * (1 +
                            (poros_cappress / arr_inf_amount[r, c]))
            # cap the rate
            infrate = cap_inf_rate(dt, arr_h[r, c], infrate)
            # update total infiltration amount
            arr_inf_amount[r, c] += infrate * dt_h
            # populate output infiltration array
            arr_inf_out[r, c] = infrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant