Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ venv.bak/

# mypy
.mypy_cache/

# Editors
.idea/
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ Reference Book on CPT techniques and analysis: T. Lunne , J.J.M Powell, P.K. Rob
Three Python scripts have been created to perform the calculations and data visualisation based on the techniques provided by Lunne et al
and according to Geotechnical industry practice (British Standard: BS EN ISO 22476-1:2012)

The Raw data is loaded into Python from *.xls files*, with four columns of data representing the required datasets. The first row of each of the columns saved within the excel files assumes a header with the standard [AGS4](https://www.ags.org.uk/) headers.
The Raw data is loaded into Python from `.xls` files, with four columns of data representing the required datasets. The first row of each of the columns saved within the excel files assumes a header with the standard [AGS4](https://www.ags.org.uk/) headers.
1) Test Depth (SCPT_DPTH).
2) Tip Resistance (SCPT_RES).
3) Cone Sleeve Friction (SCPT_FRES).
4) Measured Pore Pressure (U2 position, behind the tip) (SCPT_PWP2).

Calculations:
This is performed within the *calcs.py* script. The user should satisfy themselves that the assumptions used for the calculations are repreentative of the ground conditions.
This is performed within the `calcs.py` script. The user should satisfy themselves that the assumptions used for the calculations are repreentative of the ground conditions.

Graphing:
The *raw_grapher.py* script has been setup to import the requried parameters for producing the standard tip resistance, sleeve friction and pore pressure plots. The resuting plots will be saved as a *.png file* within the specified root folder.
The `raw_grapher.py` script has been setup to import the requried parameters for producing the standard tip resistance, sleeve friction and pore pressure plots. The resuting plots will be saved as a *.png file* within the specified root folder.

Soil Behaviour Type Index:
The *sbt_index.py* script reads the calculated *Ic - Soil Behavior Type Index* arrays and plots the data with the representative descriptions based on the industry standard guidance and Lunne et al. Two plots are saved as a *.png file* within the specified root folder, illustrating the test trace as well as an _interpreted_ soil column.
The `sbt_index.py` script reads the calculated *Ic - Soil Behavior Type Index* arrays and plots the data with the representative descriptions based on the industry standard guidance and Lunne et al. Two plots are saved as a *.png file* within the specified root folder, illustrating the test trace as well as an _interpreted_ soil column.
116 changes: 72 additions & 44 deletions calcs.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,73 @@
import pandas as pd
# -*- coding: utf-8 -*-

import numpy as np
from tkinter import Tk
from tkinter.filedialog import askopenfilename
##########################################################################################################################################################################
Tk().withdraw()
file = askopenfilename(filetypes=[('EXCEL Files','*.xls')])
data_source = pd.read_excel(file,header=0,true_values=True)
#data_source
##########################################################################################################################################################################
#Data_Source
z = data_source['SCPT_DPTH'] #Depth
qc = data_source['SCPT_RES'] #Cone Resistance
fs = data_source['SCPT_FRES'] #Sleeve Friction
u2 = data_source['SCPT_PWP2'] #U2 pore pressure
##########################################################################################################################################################################
#Assumptions
title = 'CPT01' #CPT test number
gwl = 3.5 #ground water level
soil_den = 18 #soil density
max_depth = 30 #Maximum depth to display plots
##########################################################################################################################################################################
#Calculations
u0 = [0] #Hydrostatic water pressure
for i in np.arange(len(z)):
if z[i] < gwl:
u0.append(0)
elif z[i] > gwl:
u0.append((z[i] - gwl)*10)

udl = (u2 - u0) #U_delta
sig_vo = z * soil_den #Total Vertical Stress
sig1_vo = sig_vo - u0 #Effective Vertical Stress
np.seterr(divide='ignore') #Ignore math errors
Rf = (fs/qc) * 100 #Friction Ratio
qt = (qc*1000) + (0.21+u2) #qt kPa
qn = qt - sig_vo #net qc
Bq = udl/(qn) #Pore pressure ratio
qtm = qt/1000 #qt MPa
Su_15 = qn / 15 #Su Nkt = 15
Su_15 = qn / 20 #Su Nkt = 20
qt_norm = qn / sig1_vo #normalised qc
fr_norm = ((fs * 1000) / qn) * 100 #normalised fs
ic = np.sqrt(np.power(((3.47-(np.log10(qc/0.1)))),2) + np.power(((np.log10(Rf)+1.22)),2)) #Soil Behaviour Type Index
##########################################################################################################################################################################

class CPTViz:

def __init__(self, z=None, qc=None, fs=None, u2=None,
title='CPT01', # CPT test number
gwl = 3.5, # ground water level
soil_den = 18, # soil density
max_depth = 30 # Maximum depth to display plots
):

# Hydrostatic water pressure
u0 = [0]
for i in np.arange(len(z)):
if z[i] < gwl:
u0.append(0)
elif z[i] > gwl:
u0.append((z[i] - gwl)*10)

# U_delta
self.udl = (u2 - u0)

# Total Vertical Stress
sig_vo = z * soil_den

# Effective Vertical Stress
sig1_vo = sig_vo - u0

np.seterr(divide='ignore') # Ignore math errors

# Friction Ratio
Rf = (fs/qc) * 100

# qt kPa
qt = (qc * 1000) + (0.21 + u2)

# net qc
qn = qt - sig_vo

# Pore pressure ratio
self.Bq = self.udl / (qn)

# qt MPa
qtm = qt / 1000

Su_15 = qn / 15 #Su Nkt = 15
Su_15 = qn / 20 #Su Nkt = 20

# normalised qc
qt_norm = qn / sig1_vo

# normalised fs
fr_norm = ((fs * 1000) / qn) * 100

# Soil Behaviour Type Index
self.ic = np.sqrt(np.power(((3.47-(np.log10(qc/0.1)))),2) + np.power(((np.log10(Rf)+1.22)),2))

@property
def pore_pressure_ratio(self):
return self.udl / (qn)

# def read_data_source():
# Tk().withdraw()
# file = askopenfilename(filetypes=[('EXCEL Files','*.xls')])
# data_source = pd.read_excel(file,header=0,true_values=True)
#
#
# z = data_source['SCPT_DPTH'] #Depth
# qc = data_source['SCPT_RES'] #Cone Resistance
# fs = data_source['SCPT_FRES'] #Sleeve Friction
# u2 = data_source['SCPT_PWP2'] #U2 pore pressure
1 change: 1 addition & 0 deletions raw_grapher.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import matplotlib.pyplot as plt
from calcs import max_depth, z, qc, fs, u2, u0, Rf, Bq

##########################################################################################################################################################################
#Initialise Figures
fig = plt.figure(1,figsize=(20,20),dpi=300)
Expand Down
5 changes: 5 additions & 0 deletions sbt_index.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# -*- coding: utf-8 -*-

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches

from calcs import ic, max_depth, z


##########################################################################################################################################################################
#Check Soil Behaviour Type
sbt = []
Expand Down