diff --git a/ImageD11/stress.py b/ImageD11/stress.py index 8145a6c5..91b2e3f0 100644 --- a/ImageD11/stress.py +++ b/ImageD11/stress.py @@ -212,8 +212,8 @@ def strain2stress_Lab(self, m=1, debug=0): """ Compute elastic strain and stress in Lab coordinates for all ubis, using the stiffness matrix in self.Cij. Computation is done first in the grain coordinate system, and then stress in lab coordinates is obtained by rotating the 3x3 stress tensor from the grain to the lab - coordinate system using the following transormation : σ' = UT.Cij.U where U is the rotation matrix yielded by the polar decomposition - of the finite deormation gradient tensor F. + coordinate system using the following transormation : σ' = RT.σ.R where R is the rotation matrix yielded by the polar decomposition + of the finite deformation gradient tensor F. Returns strain and stress as two lists of 3x3 symmetric tensors 'eps_Lab' and 'sigma_Lab'. @@ -332,37 +332,43 @@ def deviatoric_tensors(self, debug=0): - def invariant_props(self, dname): + def invariant_props(self, dname): + # NOTE : not sure about the expression of von Mises strain. In any case it is related to √J2 by a multiplication factor k, but it seems to be different from + # the definition of von Mises stress √(3.J2). see https://www.continuummechanics.org/vonmisesstress.html """ compute invariant properties for selected data column + compute invariant properties for selected data column: volumetric strain / pressure (-I1/3) and von mises strain /stress (√3.J2) dname (str) : name of the input data column. Must be a non-deviatoric 3x3 tensors Returns ---------- New instances added to EpsSigSolver, containing list of floats + if strain tensor in input + dname+'_vol' : volumetric strain + dname+'_vM' : von Mises strain (√2.J2) + if stress tensor in input: dname+'_P_hyd' : hydrostatic Pressure (if stress tensor in input) - dname+'_vol' : volumetric strain (if strain tensor in input) - dname+'_tau_oct' : octahedral shear strain /stress + dname+'_vM' : von Mises stress (√3.J2) """ assert dname in dir(self), 'dname not recognized' - + assert '_d_' not in dname, 'tensor is deviatoric. Please use the non-deviatoric tensor' + tensor_list = self.__getattribute__(dname) assert np.all([T.shape == (3,3) for T in tensor_list]) - - Invts = [invariants_quantities(T) for T in tensor_list] - Inv1 = [i[0] for i in Invts] - Inv2 = [i[1] for i in Invts] - - # tensor is already deviatoric : - assert '_d_' not in dname, 'tensor is deviatoric. Please use the non-deviatoric tensor' - + + tensor_list_dev = [deviatoric(T) for T in tensors_list] + Invts = [invariants(T) for T in tensor_list] + Invts_dev = [invariants(T) for T in tensor_list_dev] + + Inv1 = [-i[0]/3 for i in Invts] + Inv2 = [np.sqrt(3*i[1]) for i in Invts_dev] + if 'eps' in dname: setattr(self, dname+'_vol', Inv1) else: setattr(self, dname+'_P_hyd', Inv1) - - setattr(self, dname+'_tau_oct', Inv2) + setattr(self, dname+'_vM', Inv2) @@ -480,7 +486,7 @@ def vector_to_full_3x3(vec, input_format='default', is_strain=True): def rotate_3x3_tensor(S, R, tol = 1e-6): - """Express 3x3 matrix in rotated coordinate system + """Return 3x3 matrix in rotated coordinate system Parameters ----------- @@ -502,7 +508,7 @@ def rotate_3x3_tensor(S, R, tol = 1e-6): def build_6x6_rot_mat(R, tol): """ - Return 6x6 transormation matrix corresponding to rotation R for a 6x6 stiffness / compliance tensor + Return 6x6 transormation matrix corresponding to rotation R for a Voigt 6x6 stiffness tensor Parameters ----------- @@ -585,6 +591,8 @@ def invariants(T): I3 = np.linalg.det(T) return I1, I2, I3 + + # Cij_symmetry for stiffness tensor (from Mouhat & Coudert 2014) ########################