-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingleElementTestDB.py
293 lines (221 loc) · 15.8 KB
/
singleElementTestDB.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# Do not edit this file or it may not load correctly
# if you try to open it with the RSG Dialog Builder.
# Note: thisDir is defined by the Activator class when
# this file gets exec'd
from rsg.rsgGui import *
from abaqusConstants import INTEGER, FLOAT
import os
import json
dialogBox = RsgDialog(title='Calibrate, create single-elements and plot the results', kernelModule='CreateSingleElem', kernelFunction='CreateElms', includeApplyBtn=True, includeSeparator=True, okBtnText='OK', applyBtnText='Apply', execDir=thisDir)
# Get scritpt directory
absPath = os.path.abspath(__file__)
absDir = os.path.dirname(absPath)
scriptDir=str(absDir)+ '\\abaqus_plugins\\UniDamComp\\'
# Read default properties from file
with open(scriptDir+'MatData\\MatProps.json','r') as f:
d=json.load(f)
print(d["E11"])
# ************************************
# Define the material properties
# ******************************************************
RsgTabBook(name='TabBook_2', p='DialogBox', layout='0')
#-------------------
#Tab - Elastic Props
#-------------------
RsgTabItem(name='TabItem_3', p='TabBook_2', text='Elastic')
RsgHorizontalFrame(name='HFrame_2', p='TabItem_3', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_2', fileName=r'images/E_11.png')
RsgTextField(p='HFrame_2', fieldType='Float', ncols=9, labelText='', keyword='E11', default=d["E11"])
RsgLabel(p='HFrame_2', text='Longitudinal modulus', useBoldFont=False)
# e22
RsgHorizontalFrame(name='HFrame_3', p='TabItem_3', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_3', fileName=r'images/E_22.png')
RsgTextField(p='HFrame_3', fieldType='Float', ncols=9, labelText='', keyword='E22', default=d["E22"])
RsgLabel(p='HFrame_3', text='Transverse modulus (in-plane)', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_4', p='TabItem_3', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_4', fileName=r'images/E_33.png')
RsgTextField(p='HFrame_4', fieldType='Float', ncols=9, labelText='', keyword='E33', default=d["E33"])
RsgLabel(p='HFrame_4', text='Transverse modulus (out-of-plane)', useBoldFont=False)
RsgSeparator(p='TabItem_3')
RsgHorizontalFrame(name='HFrame_5', p='TabItem_3', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_5', fileName=r'images/G_12.png')
RsgTextField(p='HFrame_5', fieldType='Float', ncols=9, labelText='', keyword='G12', default=d["G12"])
RsgLabel(p='HFrame_5', text='Shear modulus (in-plane)', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_6', p='TabItem_3', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_6', fileName=r'images/G_13.png')
RsgTextField(p='HFrame_6', fieldType='Float', ncols=9, labelText='', keyword='G13', default=d["G13"])
RsgLabel(p='HFrame_6', text='Shear modulus (out-of-plane)', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_7', p='TabItem_3', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_7', fileName=r'images/G_23.png')
RsgTextField(p='HFrame_7', fieldType='Float', ncols=9, labelText='', keyword='G23', default=d["G23"])
RsgLabel(p='HFrame_7', text='Shear modulus (out-of-plane)', useBoldFont=False)
RsgSeparator(p='TabItem_3')
RsgHorizontalFrame(name='HFrame_8', p='TabItem_3', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_8', fileName=r'images/nu_12.png')
RsgTextField(p='HFrame_8', fieldType='Float', ncols=9, labelText='', keyword='nu12', default=d["nu12"])
RsgLabel(p='HFrame_8', text='Poisson'+'\''+'s ratio', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_10', p='TabItem_3', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_10', fileName=r'images/nu_13.png')
RsgTextField(p='HFrame_10', fieldType='Float', ncols=9, labelText='', keyword='nu13', default=d["nu13"])
RsgLabel(p='HFrame_10', text='Poisson'+'\''+'s ratio', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_9', p='TabItem_3', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_9', fileName=r'images/nu_23.png')
RsgTextField(p='HFrame_9', fieldType='Float', ncols=9, labelText='', keyword='nu32', default=d["nu32"])
RsgLabel(p='HFrame_9', text='Poisson'+'\''+'s ratio', useBoldFont=False)
#------------------
#Tab - Damage Props
#------------------
RsgTabItem(name='TabItem_8', p='TabBook_2', text='Strength/Toughness')
RsgHorizontalFrame(name='HFrame_11', p='TabItem_8', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_11', fileName=r'images/X_t.png')
RsgTextField(p='HFrame_11', fieldType='Float', ncols=9, labelText='', keyword='XT', default=d["XT"])#XT
RsgLabel(p='HFrame_11', text='Longitudinal tensile strength', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_13', p='TabItem_8', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_13', fileName=r'images/Y_t.png')
RsgTextField(p='HFrame_13', fieldType='Float', ncols=9, labelText='', keyword='YT',default=d["YT"])
RsgLabel(p='HFrame_13', text='Transverse tensile strength', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_14', p='TabItem_8', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_14', fileName=r'images/theta_i_12.png')
RsgTextField(p='HFrame_14', fieldType='Float', ncols=9, labelText='', keyword='thetai_12',default=d["thetai_12"])
RsgLabel(p='HFrame_14', text= 'Initial misalignment in-plane (Degrees)', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_15', p='TabItem_8', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_15', fileName=r'images/theta_i_13.png')
RsgTextField(p='HFrame_15', fieldType='Float', ncols=9, labelText='', keyword='thetai_13',default=d["thetai_13"])
RsgLabel(p='HFrame_15', text= 'Initial misalignment out-of-plane (Degrees)', useBoldFont=False)
RsgSeparator(p='TabItem_8')
RsgHorizontalFrame(name='HFrame_16', p='TabItem_8', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_16', fileName=r'images/Gft_Ic.png')
RsgTextField(p='HFrame_16', fieldType='Float', ncols=8, labelText='', keyword='GIc_ft', default=d["GIc_ft"])
RsgLabel(p='HFrame_16', text='Longitudinal tensile toughness', useBoldFont=False)
# RsgHorizontalFrame(name='HFrame_17', p='TabItem_8', layout='0', pl=0, pr=0, pt=0, pb=0)
# RsgIcon(p='HFrame_17', fileName=r'images/Gfc_Ic.png')
# RsgTextField(p='HFrame_17', fieldType='Float', ncols=8, labelText='', keyword='GIc_fc', default=d["GIc_fc"])
# RsgLabel(p='HFrame_17', text='Longitudinal compressive toughness', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_18', p='TabItem_8', layout='0', pl=0, pr=0, pt=0, pb=0)
#RsgIcon(p='HFrame_18', fileName=r'images/Gmt_Ic.png')
#RsgTextField(p='HFrame_18', fieldType='Float', ncols=8, labelText='', keyword='GIc_mt', default=d["GIc_mt"])
#RsgLabel(p='HFrame_18', text='Mode I toughness', useBoldFont=False)
#RsgHorizontalFrame(name='HFrame_19', p='TabItem_8', layout='0', pl=0, pr=0, pt=0, pb=0)
#RsgIcon(p='HFrame_19', fileName=r'images/Gmt_IIc.png')
#RsgTextField(p='HFrame_19', fieldType='Float', ncols=8, labelText='', keyword='GIIc_mt', default=d["GIIc_mt"])
#RsgLabel(p='HFrame_19', text='Mode II toughness', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_20', p='TabItem_8', layout='0', pl=0, pr=0, pt=0, pb=0)
#-----------------
#Tab - Crash Props
#-----------------
RsgTabItem(name='TabItem_9', p='TabBook_2', text='Calibration param.')
RsgHorizontalFrame(name='HFrame_21', p='TabItem_9', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_21', fileName=r'images/gammaCR_L.png')
RsgTextField(p='HFrame_21', fieldType='Float', ncols=6, labelText='', keyword='gammaLcr', default=d["gammaLcr"])
RsgLabel(p='HFrame_21', text='Longitudinal failure strain', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_22', p='TabItem_9', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_22', fileName=r'images/epsCR_2.png')
RsgTextField(p='HFrame_22', fieldType='Float', ncols=6, labelText='', keyword='eps2cr', default=d["eps2cr"])
RsgLabel(p='HFrame_22', text='In-plane failure strain (optional)', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_23', p='TabItem_9', layout='0', pl=1, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_23', fileName=r'images/epsCR_3.png')
RsgTextField(p='HFrame_23', fieldType='Float', ncols=6, labelText='', keyword='eps3cr', default=d["eps3cr"])
RsgLabel(p='HFrame_23', text='Out-of-plane failure strain (optional)', useBoldFont=False)
#RsgHorizontalFrame(name='HFrame_24', p='TabItem_9', layout='0', pl=0, pr=0, pt=0, pb=0)
#RsgIcon(p='HFrame_24', fileName=r'images/epsCR_N.png')
#RsgTextField(p='HFrame_24', fieldType='Float', ncols=6, labelText='', keyword='epsNcr', default=d["epsNcr"])
#RsgLabel(p='HFrame_24', text='Tensile failure strain', useBoldFont=False)
RsgSeparator(p='TabItem_9')
RsgHorizontalFrame(name='HFrame_14', p='TabItem_9', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_14', fileName=r'images/tau_0.png')
RsgTextField(p='HFrame_14', fieldType='Float', ncols=9, labelText='', keyword='tau0', default=d["tau0"])
RsgLabel(p='HFrame_14', text= 'Onset of shear non-linearity', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_21', p='TabItem_9', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_21', fileName=r'images/mu.png')
RsgTextField(p='HFrame_21', fieldType='Float', ncols=6, labelText='', keyword='MU',default=d["MU"])
RsgLabel(p='HFrame_21', text='Internal friction coefficient', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_22', p='TabItem_9', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_22', fileName=r'images/p_0.png')
RsgTextField(p='HFrame_22', fieldType='Float', ncols=6, labelText='', keyword='PO', default=d["PO"])
RsgLabel(p='HFrame_22', text='Internal pressure parameter', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_23', p='TabItem_9', layout='0', pl=1, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_23', fileName=r'images/exp.png')
RsgTextField(p='HFrame_23', fieldType='Float', ncols=6, labelText='', keyword='exp', default=d["exp"])
RsgLabel(p='HFrame_23', text='Shear curve fitting parameter', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_23', p='TabItem_9', layout='0', pl=1, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_23', fileName=r'images/volDist.png')
RsgTextField(p='HFrame_23', fieldType='Float', ncols=6, labelText='', keyword='volDist', default=d["volDist"])
RsgLabel(p='HFrame_23', text='Volume distortion (for element deletion)', useBoldFont=False)
RsgSeparator(p='TabItem_9')
RsgHorizontalFrame(name='HFrame_28', p='TabItem_9', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_28', fileName=r'images/Density.png')
RsgTextField(p='HFrame_28', fieldType='Float', ncols=13, labelText='', keyword='density', default=d["density"])
RsgLabel(p='HFrame_28', text='Material density', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_29', p='TabItem_9', layout='0', pl=0, pr=0, pt=0, pb=0)
# **************************************
# End of material parameters
# *************************************
RsgTabItem(name='TabItem_4', p='TabBook_2', text='Additional param.')
RsgLabel(p='TabItem_4', text='Properties used only for plotting:', useBoldFont=True)
RsgHorizontalFrame(name='HFrame_12', p='TabItem_4', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_12', fileName=r'images/X_c.png')
RsgTextField(p='HFrame_12', fieldType='Float', ncols=9, labelText='', keyword='XC', default=d["XC"])
RsgLabel(p='HFrame_12', text= 'Longitudinal compressive strength', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_31', p='TabItem_4', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_31', fileName=r'images/Y_c.png')
RsgTextField(p='HFrame_31', fieldType='Float', ncols=9, labelText='', keyword='YC',default=d["YC"])
RsgLabel(p='HFrame_31', text='Transverse compressive strength', useBoldFont=False)
RsgHorizontalFrame(name='HFrame_', p='TabItem_4', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_', fileName=r'images/S_12.png')
RsgTextField(p='HFrame_', fieldType='Float', ncols=9, labelText='', keyword='SL',default=d["SL"])
RsgLabel(p='HFrame_', text='Longitudinal shear strength', useBoldFont=False)
RsgSeparator(p='TabItem_4')
RsgHorizontalFrame(name='HFrame_69', p='TabItem_4', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_69', fileName=r'images/XC_eps.png')
RsgTextField(p='HFrame_69', fieldType='Float', ncols=9, labelText='', keyword='XC_eps', default=d["XC_eps"])
RsgHorizontalFrame(name='HFrame_70', p='TabItem_4', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_70', fileName=r'images/YC_eps.png')
RsgTextField(p='HFrame_70', fieldType='Float', ncols=9, labelText='', keyword='YC_eps', default=d["YC_eps"])
RsgHorizontalFrame(name='HFrame_71', p='TabItem_4', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame_71', fileName=r'images/SL_eps.png')
RsgTextField(p='HFrame_71', fieldType='Float', ncols=9, labelText='', keyword='SL_eps', default=d["SL_eps"])
RsgHorizontalFrame(name='HF', p='TabItem_4', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HF', fileName=r'images/XT_eps.png')
RsgTextField(p='HF', fieldType='Float', ncols=9, labelText='', keyword='XT_eps',default=d["XT_eps"])
RsgLabel(p='HF', text='Longitudinal tensile strain at failure', useBoldFont=False)
RsgHorizontalFrame(name='HFrame', p='TabItem_4', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgIcon(p='HFrame', fileName=r'images/YT_eps.png')
RsgTextField(p='HFrame', fieldType='Float', ncols=9, labelText='', keyword='YT_eps',default=d["YT_eps"])
RsgLabel(p='HFrame', text='Transverse tensile strain at failure', useBoldFont=False)
RsgSeparator(p='TabItem_4')
RsgFileTextField(p='TabItem_4', ncols=60, labelText='Save material parameters', keyword='matProps', default=scriptDir+'MatData\\MatProps.json', patterns='All files (*)')
# CREDITS
RsgTabItem(name='TabItem_5', p='TabBook_2', text='Reference')
RsgLabel(p='TabItem_5', text='Constitutive model reference :', useBoldFont=True)
RsgLabel(p='TabItem_5', text=' Costa S, Zrida H, Olsson R, Herraez M, Ostlund R, 2022', useBoldFont=False)
RsgLabel(p='TabItem_5', text=' A unified physically based finite deformation model for damage growth in composites ', useBoldFont=False)
RsgLabel(p='TabItem_5', text=' Composite Part A, 161: 107103', useBoldFont=False)
RsgSeparator(p='TabItem_5')
RsgLabel(p='TabItem_5', text='Abaqus plugin reference :', useBoldFont=True)
RsgLabel(p='TabItem_5', text=' Costa S, Herraez M, Chen X, 2024', useBoldFont=False)
RsgLabel(p='TabItem_5', text=' Development of an Abaqus Plugin for calibration and validation of a damage model for composites ', useBoldFont=False)
#RsgLabel(p='TabItem_5', text=' Composite Part A, 161: 107103', useBoldFont=False)
RsgSeparator(p='TabItem_5')
RsgLabel(p='TabItem_5', text='Credits 2024', useBoldFont=True)
RsgLabel(p='TabItem_5', text=' Front-end and back-end developed by: Sergio Costa @RISE AB and @DTU Wind', useBoldFont=False)
#RsgFileTextField(p='TabItem_4', ncols=35, labelText='Load/Update material parameters', keyword='matProps', default=d["matProps"], patterns='All files (*)')
# Shear Calibration
RsgGroupBox(name='GroupBox_4', p='DialogBox', text='', layout='0')
RsgTabBook(name='TabBook_4', p='GroupBox_4', layout='0')
RsgTabItem(name='TabItem_11', p='TabBook_4', text='Shear Calibration')
RsgIcon(p='TabItem_11', fileName=r'images/shear_calib.png')
RsgHorizontalFrame(name='HFrame_7', p='TabItem_11', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgFileTextField(p='HFrame_7', ncols=70, labelText='Exp. shear', keyword='sh12f', default=str(d["sh12f"]), patterns='All files (*)')
RsgHorizontalFrame(name='HFrame_7', p='TabItem_11', layout='0', pl=0, pr=0, pt=0, pb=0)
RsgRadioButton(p='TabItem_11', text='Calibrate the Model', keyword='HFrame1', default=True)
RsgTabItem(name='TabItem_10', p='TabBook_4', text='Create single elements')
RsgIcon(p='TabItem_10', fileName=r'images/cae_elements_small.png')
RsgRadioButton(p='TabItem_10', text='Create single elements', keyword='HFrame1', default=False)
RsgTabItem(name='TabItem_12', p='TabBook_4', text='Plot the results')
RsgIcon(p='TabItem_12', fileName=r'images/plot.png')
RsgRadioButton(p='TabItem_12', text='Plot the results', keyword='HFrame1', default=False)
# Decide between creating the model or plotting the results
RsgHorizontalFrame(name='HFrame_30', p='DialogBox', layout='0', pl=0, pr=0, pt=0, pb=0)
#RsgRadioButton(p='HFrame_30', text='Calibrate the Model', keyword='HFrame1', default=True)
#RsgRadioButton(p='HFrame_30', text='Plot the results', keyword='HFrame1', default=False)
dialogBox.show()