In this article, we are going to learn how to start learning Python programming in the field of geotechnical engineering. We will be validating our hand calculation of bulk unit weight, dry unit weight and effective unit weight of soil using a Python library called Groundhog.
It is defined as the total weight of a soil mass with its natural water content divided by the total volume it occupies. It is also known as the total unit weight.
Formula: Bulk unit weight(γ)=Gsγw(1+w)/1+e
It is the unit weight of soil when it is completely in dry state which means no water is present in its pores.
Formula: dry unit weight(γd)=(Gs/1+e)γs
Lets now validate the accuracy of our bulk unit weight, dry unit weight and effective unit weight using Groundhog.
Groundhog is a Python library developed with the intention to support students and educators in the field of geotechnical engineering automation. This gives you the power to analyze and validate your geotechnical calculations using Python. Functionality for onshore and offshore geotechnical problems is included.
Let’s put the Groundhog to the test to check the validity of its answers as compared to the result from the example calculation we are using
pip install groundhog
s import bulkunitweight, dryunitweight_watercontent
# saturation (S)
S=1
#Weight of sample and container(Weight_sample_container) in newwton(N)
Weight_sample_container=6
#weight of dr sample and container(weight_dry_container)
weight_dry_container=5
#weight of container(weight_container)
weight_container=1
#specific gravity(Gs)
Gs=2.7
#unit weight of water(Yw) in kN/m3
Yw=9.8
# The bulkunitweight function takes saturation(S) and void ratio(e) as positional, specific gravity(Gs) and unitweight keyword argument
# It returns a dictionary of bulkuinitweight and effective unit weight as the answer
bulkunitweight(1, 0.675, specific_gravity=2.7, unitweight_water=9.8)
#output
{'bulk unit weight [kN/m3]': 19.746268656716417,
'effective unit weight [kN/m3]': 9.946268656716416}
The bulkunitweight function returns a dictionary containing the bulk unit weight and the effective unit which is consistent with our hand calculation above.
#The drunitweight_watercontent function takes watercontent(w) and bulkunitweight as positional argument
#it returns a dictionary of dry unit weight
dryunitweight_watercontent(0.25,19.7)
#output
{'dry unit weight [kN/m3]': 15.76}
We will be going in-depth and building more useful applications that you will be able to deploy in platforms like Viktor.
Also published here.