Finite Element For Tunnel Excavation

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Finite Element Analysis for Tunnel Excavation

Advanced Manufacturing Technology


Name: Yasin Fanus
Student ID LY2022045
import numpy as np
from scipy.sparse import lil_matrix
from scipy.sparse.linalg import spsolve
import matplotlib.pyplot as plt

# Input Parameters
length = 20 # Length of the tunnel (in meters)
width = 5.0 # Width of the tunnel (in meters)
depth = 3.0 # Depth of the tunnel (in meters)
num_elements = 10 # Number of finite elements
material_properties = {'E': 1e6, 'nu': 0.3} # Elastic modulus and Poisson's ratio

# Derived Parameters
element_length = length / num_elements
# Assembling Global Stiffness Matrix
K = lil_matrix((num_elements+1, num_elements+1))

for element in range(num_elements):


element_nodes = [element, element + 1]
x = np.linspace(element_length * element, element_length * (element + 1), 2)

# Element Stiffness Matrix


Ke = np.zeros((2, 2))
# Compute the element stiffness matrix using material properties and element dimens
Ke[0, 0] = material_properties['E'] * width * depth / element_length
Ke[1, 1] = 0.5 * Ke[0, 0]
Ke[0, 1] = -Ke[0, 0]
Ke[1, 0] = Ke[0, 1]

# Assemble the element stiffness matrix into the global stiffness matrix
for i in range(2):
for j in range(2):
K[element_nodes[i], element_nodes[j]] += Ke[i, j]

# Applying Boundary Conditions


# Assuming fixed boundary conditions at both ends (nodes 0 and num_elements)
K[0, 0] = 1.0
K[0, 1:] = 0.0
K[num_elements, num_elements] = 1.0
K[num_elements, :num_elements] = 0.0

# Applying Load
# Assuming a distributed load along the tunnel
load = np.ones(num_elements+1) * 100.0 # Load magnitude (in Newtons)

# Solving the System of Equations


displacements = spsolve(K.tocsr(), load)

# Post-processing: Calculate Stresses


stresses = np.zeros(num_elements)
for element in range(num_elements):
element_nodes = [element, element + 1]
x = np.linspace(element_length * element, element_length * (element + 1), 2)

# Compute stress using the displacement values and element dimensions


stress = material_properties['E'] * (displacements[element_nodes[1]] - displacement
stresses[element] = stress

# Print Displacements and Stresses


print("Displacements:")
print(displacements)
print("Stresses:")
print(stresses)

Displacements:
[ 100. 108.77193216 63.15788491 -14.03511813 -84.21057544
-112.28075836 -84.21057544 -14.03511813 63.15788491 108.77193216
100. ]
Stresses:
[ 4385966.08187134 -22807023.62573099 -38596501.52046783
-35087728.65497075 -14035091.46198831 14035091.46198829
35087728.65497075 38596501.52046783 22807023.625731
-4385966.08187133]

The code uses special tools to analyze a tunnel's structure and understand how it behaves. It considers things like
the tunnel's length, width, and depth, as well as the properties of the materials it's made of. The code divides the
tunnel into smaller parts and calculates how stiff each part is. It then combines all these stiffness values to gure
out how the whole tunnel behaves.

The code also looks at the ends of the tunnel and makes sure they don't move. It applies a load to the tunnel, like a
force acting on it. By solving a set of equations, the code can nd out how much the tunnel displaces at different
points and how much stress it experiences.

At the end, the code shows the displacements (how much the tunnel moves) and stresses (how much force it
feels) as the nal results. These results help us understand how the tunnel behaves and if it can withstand the
forces acting upon it.

Overall, this code helps engineers study and analyze tunnels to ensure they are safe and can handle different
conditions.

#plotting stresses
x_elements = np.linspace(0, length, num_elements)

plt.figure(figsize=(12, 8)) # Set the figure size to 12 inches by 8 inches

plt.plot(x_elements, stresses, '-.', color='green', marker='s', markersize=15)

plt.xlabel('Position along the tunnel (m)')


plt.ylabel('Stress (Pa)')
plt.title('Stresses along the tunnel')
plt.grid(True)
plt.show()
plt.figure(figsize=(12, 6))
node_coordinates = np.linspace(0, length, num_elements + 1)
y = np.zeros(num_elements + 1)
plt.plot(node_coordinates, y, color='blue', marker='o', linestyle='-.', markersize=10)
plt.xlabel('Position along the tunnel (m)')
plt.ylabel('Depth (m)')
plt.title('Model Shape')
plt.grid(True)
plt.show()
I have done this nite analysis for tunnel excavation by Python.

import jovian

jovian.commit()

You might also like