FEM: stress and strain components, use more comon order and notation

This commit is contained in:
Bernd Hahnebach
2019-03-15 21:06:15 +01:00
committed by Yorik van Havre
parent 194a68001d
commit 86dc590a8a
2 changed files with 13 additions and 7 deletions

View File

@@ -425,7 +425,10 @@ def read_frd_result(frd_input):
stress_4 = float(line[49:61])
stress_5 = float(line[61:73])
stress_6 = float(line[73:85])
mode_stress[elem] = (stress_1, stress_2, stress_3, stress_4, stress_5, stress_6)
# CalculiX frd files: (Sxx, Syy, Szz, Sxy, Syz, Szx)
# FreeCAD: (Sxx, Syy, Szz, Sxy, Sxz, Syz)
# thus exchange the last two entries
mode_stress[elem] = (stress_1, stress_2, stress_3, stress_4, stress_6, stress_5)
# Check if we found strain section
if line[5:13] == "TOSTRAIN":
@@ -439,7 +442,10 @@ def read_frd_result(frd_input):
strain_4 = float(line[49:61])
strain_5 = float(line[61:73])
strain_6 = float(line[73:85])
mode_strain[elem] = (strain_1, strain_2, strain_3, strain_4, strain_5, strain_6)
# CalculiX frd files: (Exx, Eyy, Ezz, Exy, Eyz, Ezx)
# FreeCAD: (Exx, Eyy, Ezz, Exy, Exz, Eyz)
# thus exchange the last two entries
mode_strain[elem] = (strain_1, strain_2, strain_3, strain_4, strain_6, strain_5)
# Check if we found an equivalent plastic strain section
if line[5:7] == "PE":

View File

@@ -349,8 +349,8 @@ def calculate_von_mises(i):
s22 = i[1]
s33 = i[2]
s12 = i[3]
s23 = i[4]
s31 = i[5]
s31 = i[4]
s23 = i[5]
s11s22 = pow(s11 - s22, 2)
s22s33 = pow(s22 - s33, 2)
s33s11 = pow(s33 - s11, 2)
@@ -360,9 +360,9 @@ def calculate_von_mises(i):
def calculate_principal_stress(i):
sigma = np.array([[i[0], i[3], i[5]],
[i[3], i[1], i[4]],
[i[5], i[4], i[2]]]) # https://forum.freecadweb.org/viewtopic.php?f=18&t=24637&start=10#p240408
sigma = np.array([[i[0], i[3], i[4]],
[i[3], i[1], i[5]],
[i[4], i[5], i[2]]]) # https://forum.freecadweb.org/viewtopic.php?f=18&t=24637&start=10#p240408
try: # it will fail if NaN is inside the array,
# compute principal stresses