4/30/2021 Python Code for the Determination of Equivalent Horizontal and Vertical Hydraulic Conductivity of the Stratified Soil
localhost:8888/nbconvert/html/Python Code for the Determination of Equivalent Horizontal and Vertical Hydraulic Conductivity of the Stratified Soil.ipynb?download=false 1/1
n, number of layers = 3
unit of length = meter
Hydraulic conductivity For layer1:
0.003
Depth of layer1:
3.0
Hydraulic conductivity For layer2:
0.065
Depth of layer2:
2.0
Hydraulic conductivity For layer3:
0.0007
Depth of layer3:
4.0
Equivalent Horizontal Hydraulic Conductivity is given as, kx = (Keq)h = (k1H1 + k2H2 + k3H3 + ....KnHn)/H
Putting all values, kx = [0.003*3.0 + 0.065*2.0 + 0.0007*4.0]/9.0 = 0.016* 10^(-4) meter/s
Equivalent Vertical Hydraulic Conductivity is given as, (Keq)v = H / [H1/k1 + H2/k2 + ... + Hn/kn]
hence, ky = 9.0/[3.0/0.003+2.0/0.065+4.0/0.0007] = 0.001 meter/s
In [ ]: #Python Code for the Determination of Equivalent Horizontal and Vertical Hydraulic Conductivity of the Stratified Soil
#Python Codes for Civil Engineering Software/Programs, Soil Mechanics and Geotechnical Engineering by Joyson Parmar.
#Soil can have different hydraulic conductivity in its different layers, because different layers can have different sizes of soil particles,and different structure.
#The soil permeability formulae used to find out the equivalent horizontal and vertical hydraulic conductivity are as given below.
#kx = (Keq)h = (k1H1 + k2H2 + k3H3 + ....KnHn)/H (For horizontal Conductivity)
#ky = H / [H1/k1 + H2/k2 + ... + Hn/kn] (ForVertical hydraulic Conductivity)
In [ ]: #These formulas are used to form the Python code given below. It doesn’t use any module, hence there is no need to import anything into this program.
#However, do take care while entering the units.Make sure that hydraulic conductivity units are in same system as that of the length,
#for example m/s and m are in same format.
In [1]: n = int(input('n, number of layers = '))
u_length = input('unit of length = ')
u_hc = str(u_length) + '/s'
HC = []
D = []
for i in range(n):
print(f' Hydraulic conductivity For layer{i+1}: ')
hc = float(input())
HC.append(hc)
print(f' Depth of layer{i+1}: ')
di =float(input())
D.append(di)
H = sum(D)
kh = float()
kv = float()
khex = str()
kvex = str()
for i in range(n):
kh = kh + HC[i] * D[i]
kv = kv + D[i]/HC[i]
if i == 0:
khex = khex + str(HC[i]) + '*' + str(D[i])
kvex = kvex + str(D[i]) + '/' + str(HC[i])
else:
khex = khex + ' + ' + str(HC[i]) + '*' + str(D[i])
kvex = kvex + '+' + str(D[i]) + '/' + str(HC[i])
khex = '['+ khex + ']'+ '/' + str(H)
kvex = str(H) + '/' +'[' + kvex + ']'
kx = kh / H
ky = H/kv
print(f' Equivalent Horizontal Hydraulic Conductivity is given as, kx = (Keq)h = (k1H1 + k2H2 + k3H3 + ....KnHn)/H n'
f'Putting all values, kx = {khex} = {round(kx, 3)}* 10^(-4) {u_hc} n')
print(f' Equivalent Vertical Hydraulic Conductivity is given as, (Keq)v = H / [H1/k1 + H2/k2 + ... + Hn/kn] n'
f'hence, ky = {kvex} = {round(ky, 3)} {u_hc} n')
In [ ]:

Python code for the determination of equivalent horizontal and vertical hydraulic conductivity of the stratified soil

  • 1.
    4/30/2021 Python Codefor the Determination of Equivalent Horizontal and Vertical Hydraulic Conductivity of the Stratified Soil localhost:8888/nbconvert/html/Python Code for the Determination of Equivalent Horizontal and Vertical Hydraulic Conductivity of the Stratified Soil.ipynb?download=false 1/1 n, number of layers = 3 unit of length = meter Hydraulic conductivity For layer1: 0.003 Depth of layer1: 3.0 Hydraulic conductivity For layer2: 0.065 Depth of layer2: 2.0 Hydraulic conductivity For layer3: 0.0007 Depth of layer3: 4.0 Equivalent Horizontal Hydraulic Conductivity is given as, kx = (Keq)h = (k1H1 + k2H2 + k3H3 + ....KnHn)/H Putting all values, kx = [0.003*3.0 + 0.065*2.0 + 0.0007*4.0]/9.0 = 0.016* 10^(-4) meter/s Equivalent Vertical Hydraulic Conductivity is given as, (Keq)v = H / [H1/k1 + H2/k2 + ... + Hn/kn] hence, ky = 9.0/[3.0/0.003+2.0/0.065+4.0/0.0007] = 0.001 meter/s In [ ]: #Python Code for the Determination of Equivalent Horizontal and Vertical Hydraulic Conductivity of the Stratified Soil #Python Codes for Civil Engineering Software/Programs, Soil Mechanics and Geotechnical Engineering by Joyson Parmar. #Soil can have different hydraulic conductivity in its different layers, because different layers can have different sizes of soil particles,and different structure. #The soil permeability formulae used to find out the equivalent horizontal and vertical hydraulic conductivity are as given below. #kx = (Keq)h = (k1H1 + k2H2 + k3H3 + ....KnHn)/H (For horizontal Conductivity) #ky = H / [H1/k1 + H2/k2 + ... + Hn/kn] (ForVertical hydraulic Conductivity) In [ ]: #These formulas are used to form the Python code given below. It doesn’t use any module, hence there is no need to import anything into this program. #However, do take care while entering the units.Make sure that hydraulic conductivity units are in same system as that of the length, #for example m/s and m are in same format. In [1]: n = int(input('n, number of layers = ')) u_length = input('unit of length = ') u_hc = str(u_length) + '/s' HC = [] D = [] for i in range(n): print(f' Hydraulic conductivity For layer{i+1}: ') hc = float(input()) HC.append(hc) print(f' Depth of layer{i+1}: ') di =float(input()) D.append(di) H = sum(D) kh = float() kv = float() khex = str() kvex = str() for i in range(n): kh = kh + HC[i] * D[i] kv = kv + D[i]/HC[i] if i == 0: khex = khex + str(HC[i]) + '*' + str(D[i]) kvex = kvex + str(D[i]) + '/' + str(HC[i]) else: khex = khex + ' + ' + str(HC[i]) + '*' + str(D[i]) kvex = kvex + '+' + str(D[i]) + '/' + str(HC[i]) khex = '['+ khex + ']'+ '/' + str(H) kvex = str(H) + '/' +'[' + kvex + ']' kx = kh / H ky = H/kv print(f' Equivalent Horizontal Hydraulic Conductivity is given as, kx = (Keq)h = (k1H1 + k2H2 + k3H3 + ....KnHn)/H n' f'Putting all values, kx = {khex} = {round(kx, 3)}* 10^(-4) {u_hc} n') print(f' Equivalent Vertical Hydraulic Conductivity is given as, (Keq)v = H / [H1/k1 + H2/k2 + ... + Hn/kn] n' f'hence, ky = {kvex} = {round(ky, 3)} {u_hc} n') In [ ]: