########################################################### # # # 1D consolidation using fully coupled, u-p formulation. # # Cohesive soil. Option of single or double drainage. # # # # Created by: HyungSuk Shin # # Chris McGann # # Pedro Arduino # # --University of Washington-- # # # # Python version of 1Dconsolidation.tcl # # # # ---> Basic units are kN, m, and sec (unless specified) # # # ########################################################### import openseespy.opensees as ops ops.wipe() # specify desired drainage type; 1 --> single drainage, 2 --> double drainage drainage = 1 #------------------------------------------------------------------------------------------- # 1. DEFINE MESH GEOMETRY #------------------------------------------------------------------------------------------- # number of elements in horizontal direction numEleX = 1 # size of elements in horizontal direction (m) sizeEleX = 1.0 # number of nodes in horizontal direction numNodeX = 2 * numEleX + 1 # number of elements in vertical direction numEleY = 10 # size of elements in vertical direction (m) sizeEleY = 1.0 # number of nodes in vertical direction numNodeY = 2 * numEleY + 1 # total number of nodes totalNumNode = 3 * numNodeY # total number of elements totalNumEle = numEleY * numEleX #------------------------------------------------------------------------------------------- # 2. DEFINE CORNER NODES #------------------------------------------------------------------------------------------- # corner nodes are created in 2D with 3 DOF ops.model('BasicBuilder', '-ndm', 2, '-ndf', 3) # loop in horizontal direction for i in range(1, numNodeX + 1, 2): # loop in vertical direction for j in range(1, numNodeY + 1, 2): xCoord = (i - 1) * sizeEleX / 2 yCoord = (j - 1) * sizeEleX / 2 nodeNum = i + (j - 1) * numNodeX ops.node(nodeNum, xCoord, yCoord) print(f'node {nodeNum} {xCoord} {yCoord}') print('Finished creating corner soil nodes...') #------------------------------------------------------------------------------------------- # 3. DEFINE BOUNDARY CONDITIONS FOR CORNER NODES #------------------------------------------------------------------------------------------- # boundary conditions for base nodes depending upon selected drainage type if drainage == 1: ops.fix(1, 1, 1, 0) ops.fix(3, 1, 1, 0) elif drainage == 2: ops.fix(1, 1, 1, 1) ops.fix(3, 1, 1, 1) # fix horizontal displacement and porepressure DOF for nodes at the top ops.fix(totalNumNode - 2, 1, 0, 1) ops.fix(totalNumNode, 1, 0, 1) # fix horizontal displacement for all remaining nodes (base nodes 1 and 3 are already fixed) for i in range(7, 3 * numNodeY - 6 + 1, 6): ops.fix(i, 1, 0, 0) ops.fix(i + 2, 1, 0, 0) print(f'fix {i} 1 0 0') print(f'fix {i + 2} 1 0 0') print('Finished creating boundary conditions for corner nodes...') #------------------------------------------------------------------------------------------- # 4. DEFINE INTERIOR NODES #------------------------------------------------------------------------------------------- # interior nodes are created in 2D with 2 DOF ops.model('BasicBuilder', '-ndm', 2, '-ndf', 2) # central column of nodes xCoord = sizeEleX / 2 for j in range(1, numNodeY + 1): yCoord = (j - 1) * sizeEleX / 2 nodeNum = 3 * j - 1 ops.node(nodeNum, xCoord, yCoord) print(f'node {nodeNum} {xCoord} {yCoord}') # interior nodes on the element edges for j in range(1, numEleY + 1): yCoord = j - 0.5 nodeNumL = 6 * j - 2 nodeNumR = nodeNumL + 2 ops.node(nodeNumL, 0.0, yCoord) ops.node(nodeNumR, sizeEleX, yCoord) print(f'node {nodeNumL} 0.0 {yCoord}') print(f'node {nodeNumR} {sizeEleX} {yCoord}') print('Finished creating all soil nodes...') #------------------------------------------------------------------------------------------- # 5. DEFINE BOUNDARY CONDITIONS FOR INTERIOR NODES #------------------------------------------------------------------------------------------- # fix displacement DOF for node at the base ops.fix(2, 1, 1) # fix horizontal displacement of nodes on edge of elements for i in range(1, numEleY + 1): nodeNumL = 6 * i - 2 nodeNumR = nodeNumL + 2 ops.fix(nodeNumL, 1, 0) ops.fix(nodeNumR, 1, 0) print(f'fix {nodeNumL} 1 0') print(f'fix {nodeNumR} 1 0') # define equalDOF for surface nodes ops.equalDOF(totalNumNode - 1, totalNumNode - 2, 1, 2) ops.equalDOF(totalNumNode - 1, totalNumNode, 1, 2) print('Finished creating all boundary conditions and equalDOF...') #------------------------------------------------------------------------------------------- # 6. DEFINE MATERIAL PROPERTIES OF SOIL #------------------------------------------------------------------------------------------- # saturated mass density (Mg/m3) satDensity = 2.3 # fluid mass density (Mg/m3) H2ODensity = 1.0 # shear modulus (kPa) shear = 2.5e4 # bulk modulus (kPa) bulk = 6.2e5 # undrained bulk modulus (kPa) uBulk = 2.2e5 # vertical permeability, input value in m/s, units are modified to suit constitutive model mPermV = 5.0e-5 vPerm = mPermV / 9.81 / H2ODensity # horizontal permeability, input value in m/s, units are modified to suit constitutive model mPermH = 5.0e-5 hPerm = mPermH / 9.81 / H2ODensity # cohesion (kPa) cohesion = 45.0 # friction angle (degrees) phi = 0.0 # peak shear strain gammaPeak = 0.1 # reference pressure (kPa) refPress = 80.0 # pressure dependency coefficient pressCoeff = 0.0 # number of yield surfaces numSurf = 22 #------------------------------------------------------------------------------------------- # 7. DEFINE SOIL MATERIALS #------------------------------------------------------------------------------------------- matTag = 1 ops.nDMaterial('PressureIndependMultiYield', matTag, 2, satDensity, shear, bulk, cohesion, gammaPeak, phi, refPress, pressCoeff, numSurf) print('Finished creating all soil materials...') #------------------------------------------------------------------------------------------- # 8. DEFINE SOIL ELEMENTS #------------------------------------------------------------------------------------------- thick = 1.0 wgtX = 0.0 wgtY = -9.81 for j in range(1, numEleY + 1): nI = 6 * j - 5 nJ = nI + 2 nK = nI + 8 nL = nI + 6 nM = nI + 1 nN = nI + 5 nP = nI + 7 nQ = nI + 3 nR = nI + 4 ops.element('9_4_QuadUP', j, nI, nJ, nK, nL, nM, nN, nP, nQ, nR, thick, matTag, bulk, H2ODensity, hPerm, vPerm, wgtX, wgtY) # update material stage to zero for elastic behavior ops.updateMaterialStage('-material', matTag, '-stage', 0) print('Finished creating all soil elements...') #------------------------------------------------------------------------------------------- # 8. APPLY GRAVITY LOADING #------------------------------------------------------------------------------------------- # Newmark parameters gamma = 0.5 beta = 0.25 # analysis objects ops.constraints('Transformation') ops.test('NormDispIncr', 1e-5, 30, 1) ops.algorithm('Newton') ops.numberer('RCM') ops.system('ProfileSPD') ops.integrator('Newmark', gamma, beta) ops.analysis('Transient') ops.analyze(10, 5.0e2) print('Finished with elastic gravity analysis...') #------------------------------------------------------------------------------------------- # 9. UPDATE SOIL MATERIAL STAGE #------------------------------------------------------------------------------------------- # update material stage to consider elastoplastic behavior ops.updateMaterialStage('-material', matTag, '-stage', 1) ops.analyze(40, 5.0e2) print('Finished with plastic gravity analysis...') #------------------------------------------------------------------------------------------- # 10. CREATE RECORDERS #------------------------------------------------------------------------------------------- # record nodal displacments and porewater pressures ops.recorder('Node', '-file', 'displacement.out', '-time', '-nodeRange', 1, totalNumNode, '-dof', 1, 2, 'disp') ops.recorder('Node', '-file', 'porepressure.out', '-time', '-nodeRange', 1, totalNumNode, '-dof', 3, 'vel') # record stress and strain at the ninth Gauss point in the elements (center of element) ops.recorder('Element', '-file', 'stress.out', '-time', '-eleRange', 1, numEleY, 'material', 9, 'stress') ops.recorder('Element', '-file', 'strain.out', '-time', '-eleRange', 1, numEleY, 'material', 9, 'strain') print('Finished creating all recorders...') #------------------------------------------------------------------------------------------- # 11. CONSOLIDATION ANALYSIS #------------------------------------------------------------------------------------------- ops.setTime(0.0) ops.wipeAnalysis() overburden = -1000.0 # constant loading applied at the surface ops.timeSeries('Constant', 1) ops.pattern('Plain', 1, 1) ops.load(totalNumNode - 1, 0.0, overburden) print('Consolidation loading created...') # analysis objects ops.constraints('Penalty', 1.0e16, 1.0e16) ops.test('NormDispIncr', 1e-4, 30, 1) ops.algorithm('Newton') ops.numberer('RCM') ops.system('ProfileSPD') ops.integrator('Newmark', gamma, beta) ops.rayleigh(0.5, 0.2, 0.0, 0.0) ops.analysis('Transient') # time step and number of steps (double drainage needs a smaller time step to converge) if drainage == 1: dT = 0.25 nSteps = 800 else: dT = 0.125 nSteps = 1600 ops.analyze(nSteps, dT) print('Finished with consolidation analysis...') ops.wipe()