Hello everyone , I am new to this community , but hope I could get some help on this project , as I have had a persistent error in my attempt to implement a cohesive element trough inp file generation.
In my main project , I am trying to model the fiber and matrix interaction trough a cohesive layer , that having to "coat " a complex geometry of a fiber needs to be generated trough code in the form of an inp file to fit the shape.
To debug this feature , I tried implementing it in a simple sandwich structure.
Nonetheless , I keep getting this error :
Underlying element 1 instance cohesive-1 can not have spos as a face identifier
Underlying element 2 instance cohesive-1 can not have spos as a face identifier
Underlying element 3 instance cohesive-1 can not have spos as a face identifier
.... (it repeats until the simulation aborts)
I dont really know how to fix this , I have checked the mesh stack orientation of the part originating from the inp file of the cohesive layer , and abaqus reports that all the elements in the mesh are oriented consistently , so I dont really know what this error might be tied to.
To make it more clear how I implemented the model , I pasted both the inp file of the cohesive layer generated trough code (simply has the location of the nodes and then the combiantion for the elements) and also the script that you can directly run through abaqus to see the model yourself (you only need to changhe the directory so that it finds the location the inp file was saved in).
I hope that maybe some of you guys with more experience with cohesive elements / inp files could help me understand better what the source of this problem is.
Lastly, here is the inp file of the cohesive layer (can just be pasted in the text editor and saved with .inp) and at the end if you scroll down there is also the script to run directly in abaqus (just save it as a python file)
I understand this is a lot but I didnt want to leave anything out just in case , any help would be appreciated :) .
-> START OF INP FILE ( copy after this line)
*Part, name=COHESIVE-SANDWICH
*Node
1, 0.000000, 0.000000, 0.000000
2, 2.000000, 0.000000, 0.000000
3, 4.000000, 0.000000, 0.000000
4, 6.000000, 0.000000, 0.000000
5, 8.000000, 0.000000, 0.000000
6, 10.000000, 0.000000, 0.000000
7, 12.000000, 0.000000, 0.000000
8, 14.000000, 0.000000, 0.000000
9, 16.000000, 0.000000, 0.000000
10, 18.000000, 0.000000, 0.000000
11, 20.000000, 0.000000, 0.000000
12, 0.000000, 2.000000, 0.000000
13, 2.000000, 2.000000, 0.000000
14, 4.000000, 2.000000, 0.000000
15, 6.000000, 2.000000, 0.000000
16, 8.000000, 2.000000, 0.000000
17, 10.000000, 2.000000, 0.000000
18, 12.000000, 2.000000, 0.000000
19, 14.000000, 2.000000, 0.000000
20, 16.000000, 2.000000, 0.000000
21, 18.000000, 2.000000, 0.000000
22, 20.000000, 2.000000, 0.000000
23, 0.000000, 4.000000, 0.000000
24, 2.000000, 4.000000, 0.000000
25, 4.000000, 4.000000, 0.000000
26, 6.000000, 4.000000, 0.000000
27, 8.000000, 4.000000, 0.000000
28, 10.000000, 4.000000, 0.000000
29, 12.000000, 4.000000, 0.000000
30, 14.000000, 4.000000, 0.000000
31, 16.000000, 4.000000, 0.000000
32, 18.000000, 4.000000, 0.000000
33, 20.000000, 4.000000, 0.000000
34, 0.000000, 6.000000, 0.000000
35, 2.000000, 6.000000, 0.000000
36, 4.000000, 6.000000, 0.000000
37, 6.000000, 6.000000, 0.000000
38, 8.000000, 6.000000, 0.000000
39, 10.000000, 6.000000, 0.000000
40, 12.000000, 6.000000, 0.000000
41, 14.000000, 6.000000, 0.000000
42, 16.000000, 6.000000, 0.000000
43, 18.000000, 6.000000, 0.000000
44, 20.000000, 6.000000, 0.000000
45, 0.000000, 8.000000, 0.000000
46, 2.000000, 8.000000, 0.000000
47, 4.000000, 8.000000, 0.000000
48, 6.000000, 8.000000, 0.000000
49, 8.000000, 8.000000, 0.000000
50, 10.000000, 8.000000, 0.000000
51, 12.000000, 8.000000, 0.000000
52, 14.000000, 8.000000, 0.000000
53, 16.000000, 8.000000, 0.000000
54, 18.000000, 8.000000, 0.000000
55, 20.000000, 8.000000, 0.000000
56, 0.000000, 10.000000, 0.000000
57, 2.000000, 10.000000, 0.000000
58, 4.000000, 10.000000, 0.000000
59, 6.000000, 10.000000, 0.000000
60, 8.000000, 10.000000, 0.000000
61, 10.000000, 10.000000, 0.000000
62, 12.000000, 10.000000, 0.000000
63, 14.000000, 10.000000, 0.000000
64, 16.000000, 10.000000, 0.000000
65, 18.000000, 10.000000, 0.000000
66, 20.000000, 10.000000, 0.000000
67, 0.000000, 0.000000, 0.000000
68, 2.000000, 0.000000, 0.000000
69, 4.000000, 0.000000, 0.000000
70, 6.000000, 0.000000, 0.000000
71, 8.000000, 0.000000, 0.000000
72, 10.000000, 0.000000, 0.000000
73, 12.000000, 0.000000, 0.000000
74, 14.000000, 0.000000, 0.000000
75, 16.000000, 0.000000, 0.000000
76, 18.000000, 0.000000, 0.000000
77, 20.000000, 0.000000, 0.000000
78, 0.000000, 2.000000, 0.000000
79, 2.000000, 2.000000, 0.000000
80, 4.000000, 2.000000, 0.000000
81, 6.000000, 2.000000, 0.000000
82, 8.000000, 2.000000, 0.000000
83, 10.000000, 2.000000, 0.000000
84, 12.000000, 2.000000, 0.000000
85, 14.000000, 2.000000, 0.000000
86, 16.000000, 2.000000, 0.000000
87, 18.000000, 2.000000, 0.000000
88, 20.000000, 2.000000, 0.000000
89, 0.000000, 4.000000, 0.000000
90, 2.000000, 4.000000, 0.000000
91, 4.000000, 4.000000, 0.000000
92, 6.000000, 4.000000, 0.000000
93, 8.000000, 4.000000, 0.000000
94, 10.000000, 4.000000, 0.000000
95, 12.000000, 4.000000, 0.000000
96, 14.000000, 4.000000, 0.000000
97, 16.000000, 4.000000, 0.000000
98, 18.000000, 4.000000, 0.000000
99, 20.000000, 4.000000, 0.000000
100, 0.000000, 6.000000, 0.000000
101, 2.000000, 6.000000, 0.000000
102, 4.000000, 6.000000, 0.000000
103, 6.000000, 6.000000, 0.000000
104, 8.000000, 6.000000, 0.000000
105, 10.000000, 6.000000, 0.000000
106, 12.000000, 6.000000, 0.000000
107, 14.000000, 6.000000, 0.000000
108, 16.000000, 6.000000, 0.000000
109, 18.000000, 6.000000, 0.000000
110, 20.000000, 6.000000, 0.000000
111, 0.000000, 8.000000, 0.000000
112, 2.000000, 8.000000, 0.000000
113, 4.000000, 8.000000, 0.000000
114, 6.000000, 8.000000, 0.000000
115, 8.000000, 8.000000, 0.000000
116, 10.000000, 8.000000, 0.000000
117, 12.000000, 8.000000, 0.000000
118, 14.000000, 8.000000, 0.000000
119, 16.000000, 8.000000, 0.000000
120, 18.000000, 8.000000, 0.000000
121, 20.000000, 8.000000, 0.000000
122, 0.000000, 10.000000, 0.000000
123, 2.000000, 10.000000, 0.000000
124, 4.000000, 10.000000, 0.000000
125, 6.000000, 10.000000, 0.000000
126, 8.000000, 10.000000, 0.000000
127, 10.000000, 10.000000, 0.000000
128, 12.000000, 10.000000, 0.000000
129, 14.000000, 10.000000, 0.000000
130, 16.000000, 10.000000, 0.000000
131, 18.000000, 10.000000, 0.000000
132, 20.000000, 10.000000, 0.000000
*Element, type=COH3D8
1, 1, 2, 13, 12, 67, 68, 79, 78
2, 2, 3, 14, 13, 68, 69, 80, 79
3, 3, 4, 15, 14, 69, 70, 81, 80
4, 4, 5, 16, 15, 70, 71, 82, 81
5, 5, 6, 17, 16, 71, 72, 83, 82
6, 6, 7, 18, 17, 72, 73, 84, 83
7, 7, 8, 19, 18, 73, 74, 85, 84
8, 8, 9, 20, 19, 74, 75, 86, 85
9, 9, 10, 21, 20, 75, 76, 87, 86
10, 10, 11, 22, 21, 76, 77, 88, 87
11, 12, 13, 24, 23, 78, 79, 90, 89
12, 13, 14, 25, 24, 79, 80, 91, 90
13, 14, 15, 26, 25, 80, 81, 92, 91
14, 15, 16, 27, 26, 81, 82, 93, 92
15, 16, 17, 28, 27, 82, 83, 94, 93
16, 17, 18, 29, 28, 83, 84, 95, 94
17, 18, 19, 30, 29, 84, 85, 96, 95
18, 19, 20, 31, 30, 85, 86, 97, 96
19, 20, 21, 32, 31, 86, 87, 98, 97
20, 21, 22, 33, 32, 87, 88, 99, 98
21, 23, 24, 35, 34, 89, 90, 101, 100
22, 24, 25, 36, 35, 90, 91, 102, 101
23, 25, 26, 37, 36, 91, 92, 103, 102
24, 26, 27, 38, 37, 92, 93, 104, 103
25, 27, 28, 39, 38, 93, 94, 105, 104
26, 28, 29, 40, 39, 94, 95, 106, 105
27, 29, 30, 41, 40, 95, 96, 107, 106
28, 30, 31, 42, 41, 96, 97, 108, 107
29, 31, 32, 43, 42, 97, 98, 109, 108
30, 32, 33, 44, 43, 98, 99, 110, 109
31, 34, 35, 46, 45, 100, 101, 112, 111
32, 35, 36, 47, 46, 101, 102, 113, 112
33, 36, 37, 48, 47, 102, 103, 114, 113
34, 37, 38, 49, 48, 103, 104, 115, 114
35, 38, 39, 50, 49, 104, 105, 116, 115
36, 39, 40, 51, 50, 105, 106, 117, 116
37, 40, 41, 52, 51, 106, 107, 118, 117
38, 41, 42, 53, 52, 107, 108, 119, 118
39, 42, 43, 54, 53, 108, 109, 120, 119
40, 43, 44, 55, 54, 109, 110, 121, 120
41, 45, 46, 57, 56, 111, 112, 123, 122
42, 46, 47, 58, 57, 112, 113, 124, 123
43, 47, 48, 59, 58, 113, 114, 125, 124
44, 48, 49, 60, 59, 114, 115, 126, 125
45, 49, 50, 61, 60, 115, 116, 127, 126
46, 50, 51, 62, 61, 116, 117, 128, 127
47, 51, 52, 63, 62, 117, 118, 129, 128
48, 52, 53, 64, 63, 118, 119, 130, 129
49, 53, 54, 65, 64, 119, 120, 131, 130
50, 54, 55, 66, 65, 120, 121, 132, 131
*End Part
-> END OF INP FILE ( this line is not part of the inp file)
This is now the Abaqus script:
from abaqus import *
from abaqusConstants import *
from caeModules import *
import os, mesh, regionToolset
# --- Settings & Parameters ---
# --- IMPORTANT: Update this path to the absolute path of your .inp file ---
COHESIVE_INP_PATH = r'c:\\Users\\debugging\\Abaqus_Sandwich_Test\\sandwich_cohesive_layer.inp'
# Part names
MATRIX_PART_NAME = 'MATRIX-BLOCK'
COHESIVE_PART_NAME = 'COHESIVE-SANDWICH'
# Sandwich dimensions
LENGTH = 20.0 # X-axis
WIDTH = 10.0 # Y-axis
MATRIX_THICKNESS = 2.5 # Z-axis (thickness of one matrix block)
# Material Properties
MATRIX_E_MODULUS = 3000.0
MATRIX_POISSON = 0.35
COH_STIFFNESS = 1.0E+06
COH_MAX_STRESS = 50.0
COH_FRACTURE_ENERGY = 2.0
COH_BK_POWER = 1.45
# --- Main Execution ---
Mdb()
myModel = mdb.models['Model-1']
myAssembly = myModel.rootAssembly
# --- 1. Create Matrix Part ---
mySketch = myModel.ConstrainedSketch(name='matrix_profile', sheetSize=200.0)
mySketch.rectangle(point1=(0, 0), point2=(LENGTH, WIDTH))
myMatrixPart = myModel.Part(name=MATRIX_PART_NAME, dimensionality=THREE_D, type=DEFORMABLE_BODY)
myMatrixPart.BaseSolidExtrude(sketch=mySketch, depth=MATRIX_THICKNESS)
del myModel.sketches['matrix_profile']
# --- 2. Import Cohesive Layer Part ---
myModel.PartFromInputFile(inputFileName=COHESIVE_INP_PATH)
p_matrix = myModel.parts[MATRIX_PART_NAME]
p_cohesive = myModel.parts[COHESIVE_PART_NAME]
# --- 3. Materials and Sections ---
myModel.Material(name='MATRIX_MAT'); myModel.materials['MATRIX_MAT'].Elastic(table=((MATRIX_E_MODULUS, MATRIX_POISSON), ))
myModel.HomogeneousSolidSection(name='Matrix-Sec', material='MATRIX_MAT')
p_matrix.SectionAssignment(region=regionToolset.Region(cells=p_matrix.cells), sectionName='Matrix-Sec')
myModel.Material(name='COHESIVE_MAT'); myModel.materials['COHESIVE_MAT'].Elastic(type=TRACTION, table=((COH_STIFFNESS,)*3, )); myModel.materials['COHESIVE_MAT'].MaxsDamageInitiation(table=((COH_MAX_STRESS,)*3, )); myModel.materials['COHESIVE_MAT'].maxsDamageInitiation.DamageEvolution(type=ENERGY, mixedModeBehavior=BK, power=COH_BK_POWER, table=((COH_FRACTURE_ENERGY,)*3, ))
myModel.CohesiveSection(name='Cohesive-Sec', material='COHESIVE_MAT', response=TRACTION_SEPARATION)
p_cohesive.SectionAssignment(region=regionToolset.Region(elements=p_cohesive.elements), sectionName='Cohesive-Sec')
# --- 4. Assembly ---
inst_matrix_bottom = myAssembly.Instance(name='Matrix-Bottom-1', part=p_matrix, dependent=ON)
inst_cohesive = myAssembly.Instance(name='Cohesive-1', part=p_cohesive, dependent=ON)
inst_matrix_top = myAssembly.Instance(name='Matrix-Top-1', part=p_matrix, dependent=ON)
myAssembly.translate(instanceList=('Matrix-Bottom-1',), vector=(0.0, 0.0, -MATRIX_THICKNESS))
# --- 5. Tie Constraints ---
# Surfaces on the Matrix parts
bottom_matrix_top_face = inst_matrix_bottom.faces.findAt(coordinates=((LENGTH/2, WIDTH/2, 0.0),))
myAssembly.Surface(name='Surf-Matrix-Bottom-Top', side1Faces=bottom_matrix_top_face)
top_matrix_bottom_face = inst_matrix_top.faces.findAt(coordinates=((LENGTH/2, WIDTH/2, 0.0),))
myAssembly.Surface(name='Surf-Matrix-Top-Bottom', side1Faces=top_matrix_bottom_face)
# Surfaces on the Cohesive part using element faces
myAssembly.Surface(name='Surf-Coh-Bottom', side1Elements=inst_cohesive.elements)
myAssembly.Surface(name='Surf-Coh-Top', side2Elements=inst_cohesive.elements)
# The solid MATRIX surfaces are assigned as main.
# The COHESIVE surfaces are assigned as secondary.
# tried both options , didn´t changhe anything
myModel.Tie(name='Tie-Bottom',
main=myAssembly.surfaces['Surf-Matrix-Bottom-Top'],
secondary=myAssembly.surfaces['Surf-Coh-Bottom'],
positionToleranceMethod=COMPUTED, adjust=ON, tieRotations=ON, thickness=ON)
myModel.Tie(name='Tie-Top',
main=myAssembly.surfaces['Surf-Matrix-Top-Bottom'],
secondary=myAssembly.surfaces['Surf-Coh-Top'],
positionToleranceMethod=COMPUTED, adjust=ON, tieRotations=ON, thickness=ON)
# --- 6. Meshing ---
p_matrix.seedPart(size=MATRIX_THICKNESS / 2.0, deviationFactor=0.1)
elemType_matrix = mesh.ElemType(elemCode=C3D8R, elemLibrary=STANDARD)
p_matrix.setElementType(regions=(p_matrix.cells,), elemTypes=(elemType_matrix,))
p_matrix.generateMesh()
myAssembly.regenerate()
# --- 7. Step, BCs, and Job ---
myModel.StaticStep(name='Pull-Step', previous='Initial', nlgeom=ON, initialInc=0.1)
bottom_face_to_fix = inst_matrix_bottom.faces.findAt(coordinates=((LENGTH/2, WIDTH/2, -MATRIX_THICKNESS),))
myAssembly.Set(name='Set-Fixed-Bottom', faces=bottom_face_to_fix)
myModel.EncastreBC(name='BC-Fixed', createStepName='Initial', region=myAssembly.sets['Set-Fixed-Bottom'])
top_face_to_pull = inst_matrix_top.faces.findAt(coordinates=((LENGTH/2, WIDTH/2, MATRIX_THICKNESS),))
myAssembly.Set(name='Set-Pull-Top', faces=top_face_to_pull)
myModel.DisplacementBC(name='BC-Pull', createStepName='Pull-Step', region=myAssembly.sets['Set-Pull-Top'], u3=0.1)
mdb.Job(name='Sandwich_Debug_Job', model='Model-1', numCpus=1, memory=90, memoryUnits=PERCENTAGE)
print("SUCCESS")