This tutorial walks through a submerged excavation using a diaphragm wall, interfaces, and a fixed-end anchor.
It reuses concepts from Tutorial 1 and adds staged excavation, anchor activation, and water pressures.
Objectives:
Model soil–structure interaction with interfaces.
Use the Hardening Soil model with drained sand and undrained clay.
Define a fixed-end anchor and strut material.
Simulate staged excavation with multiple phases.
2️⃣ Connect to the Remote Scripting Server
Ensure PLAXIS Input and Output servers run on ports 10000 and 10001. Store the password in an environment variable for security.
import os
from pathlib import Path
from plxscripting.easy import *
PLAXIS_PASSWORD = os.getenv("PLAXIS_PASSWORD")
if not PLAXIS_PASSWORD:
raise RuntimeError("Environment variable PLAXIS_PASSWORD is not set")
s_i, g_i = new_server('localhost', 10000, password=PLAXIS_PASSWORD)
s_o, g_o = new_server('localhost', 10001, password=PLAXIS_PASSWORD)
print("✅ Connected to PLAXIS Remote Scripting Server")
Save often to preserve staged-construction states.
4️⃣ Set Project Properties
Set title, comments, model type, and element type.
g_i.Project.Title.set("Lesson 3")
g_i.Project.Comments.set("Submerged construction of an excavation")
g_i.Project.ModelType.set("plane strain")
g_i.Project.ElementType = "15-Noded"
5️⃣ Define Soil Contour
Set model boundaries: xmin = 0, xmax = 65 m, ymin = -30 m, ymax = 20 m.
Create a borehole at x = 0 m and define stratigraphy.
borehole_BH_1 = g_i.borehole(0)
# First layer: top 20 m (20 to 0)
g_i.soillayer(20)
g_i.setsoillayerlevel(borehole_BH_1, 0, 20)
g_i.setsoillayerlevel(borehole_BH_1, 1, 0)
# Second layer: 30 m thickness
g_i.soillayer(30)
# Groundwater head
borehole_BH_1.Head = 18
Use echo() to inspect borehole attributes when needed.
7️⃣ Define Materials (Hardening Soil)
Create drained sand and undrained clay materials using the Hardening Soil model.