ctu-geoforall-lab / rain

http://rain.fsv.cvut.cz Apps and OGC OWS
GNU General Public License v2.0
0 stars 2 forks source link

novy nastroj cn-rain6h #34

Closed landam closed 1 year ago

landam commented 1 year ago

Vstup:

Vystup:

Postup vypoctu:

landam commented 1 year ago
#Inpute

CN2 = 60 # [-]user value
area = 100 # [ha] - user value, value from 0.1 to 100
Lambda = 0.2 # user value defalut, value from 0.1 to 0.3
H_s = 35 #[mm] from precipitation raster, based on return period and location
qAPI_A = 0.35# from qAPI_A and based on location
qAPI_B = 0.65# from qAPI_B and based on location

shapeA = 0.25#probabylity of rainshape A, based on return period and location
shapeB = 0.65#probabylity of rainshape B, based on return period and location
# ... shapeF

CN3  = 23*CN2/(10 + 0.13*CN2)

def scs_cn_volume(CN, Lambda, H_s, area):
    # cn is the curve number
    # i is the rainfall (mm)
    # in [ha]
    # return V [m3]
    #Lambda = 0.2

    A = 25.4 * ((1000/CN) - 10)
    I_a = Lambda * A
    if H_s > I_a:
        H_O = ((H_s - I_a) * (H_s - I_a))/(H_s - I_a + A)
    else:
        H_O = 0

    V = H_O * area

    return V

if qAPI_A < 0.2:
    nsa = 1
elif qAPI_A >=0.2 and qAPI_A < 0.4:
    nsa = 0.75
elif qAPI_A >= 0.4 and qAPI_A < 0.6:
    nsa = 0.5
elif qAPI_A >= 0.6 and qAPI_A < 0.8:
    nsa = 0.25
else:
    nsa = 0

VCN2 = scs_cn_volume(CN2, Lambda, H_s, area)
VCN3 = scs_cn_volume(CN3, Lambda, H_s, area)

V = nsa*shapeA*VCN2 + (1-nsa)*shapeA*VCN3 + nsa*shapeB*VCN2 + (1-nsa)*shapeB*VCN3
print(V) # prints the runoff volume in [m3] - toto se vrátí