def postprocess_cauchy_stress(self, displacement): """ Compute Cauchy stress from given numerical solution. Parameters ---------- displacement: Function Computed numerical displacement """ assert hasattr(self, "_elastic_ratio") assert hasattr(self, "_I") assert isinstance(displacement, dlfn.function.function.Function) # displacement gradient H = grad(displacement) # deformation gradient F = self._I + H # right Cauchy-Green tensor C = F.T * F # volume ratio J = dlfn.det(F) # dimensionless 2. Piola-Kirchhoff stress tensor (symbolic) S = self._I - J**(-self._elastic_ratio) * inv(C) # dimensionless Cauchy stress tensor (symbolic) sigma = (F * S * F.T) / J return sigma
def dw_int(self, u, v): """ Construct internal energy. Parameters ---------- u: Function v: TestFunction """ # u Function (in the nonlinear case) assert isinstance(u, dlfn.function.function.Function) # v TestFunction assert isinstance(v, dlfn.function.argument.Argument) assert hasattr(self, "_elastic_ratio") assert hasattr(self, "_I") # deformation gradient F = self._I + grad(u) # right Cauchy-Green tensor C = F.T * F # volume ratio J = dlfn.det(F) # 2. Piola-Kirchhoff stress S = self._I - J**(-self._elastic_ratio) * inv(C) dE = dlfn.Constant(0.5) * (F.T * grad(v) + grad(v).T * F) return inner(S, dE)
def evolEqG(C, Cv, Cv_step): Iv1 = tr(Cv) Ce = C * inv(Cv) CvinvC = inv(Cv) * C Ie1 = tr(Ce) # define etaK A2 = m1 * (Ie1 / 3)**(a1 - 1) + m2 * (Ie1 / 3)**(a2 - 1) G = ( A2 / (etaInf + (eta0 - etaInf + K1 * (Iv1**bta1 - 3**bta1)) / (1 + (K2 * ((-(Ie1**2) / 6.0 + 1.0 / 2 * inner(CvinvC, Ce)) * A2**2))**bta2)) * (C - Ie1 / 3.0 * Cv)) dl_interp(G, Cv_step)
def freeEnergy(C, Cv): J = sqrt(det(C)) I1 = tr(C) Ce = C * inv(Cv) Ie1 = tr(Ce) Je = J / sqrt(det(Cv)) psiEq = (3**(1 - alph1) / (2.0 * alph1) * mu1 * (I1**alph1 - 3**alph1) + 3**(1 - alph2) / (2.0 * alph2) * mu2 * (I1**alph2 - 3**alph2) - (mu1 + mu2) * ln(J) + mu_pr / 2 * (J - 1)**2) psiNeq = (3**(1 - a1) / (2.0 * a1) * m1 * (Ie1**a1 - 3**a1) + 3**(1 - a2) / (2.0 * a2) * m2 * (Ie1**a2 - 3**a2) - (m1 + m2) * ln(Je)) return psiEq + psiNeq
def dS_dFg(self, u_, p_, ivar, theta_old_, dt): theta_ = ivar["theta"] Cmat = self.S(u_, p_, ivar, tang=True) i, j, k, l, m, n = indices(6) # elastic material tangent (living in intermediate growth configuration) Cmat_e = dot( self.F_g(theta_), dot(self.F_g(theta_), dot(Cmat, dot(self.F_g(theta_).T, self.F_g(theta_).T)))) Fginv_outertop_S = as_tensor( inv(self.F_g(theta_))[i, k] * self.S(u_, p_, ivar=ivar)[j, l], (i, j, k, l)) S_outerbot_Fginv = as_tensor( self.S(u_, p_, ivar=ivar)[i, l] * inv(self.F_g(theta_))[j, k], (i, j, k, l)) Fginv_outertop_Fginv = as_tensor( inv(self.F_g(theta_))[i, k] * inv(self.F_g(theta_))[j, l], (i, j, k, l)) FginvT_outertop_Ce = as_tensor( inv(self.F_g(theta_)).T[i, k] * self.C_e(self.kin.C(u_), theta_)[j, l], (i, j, k, l)) Ce_outerbot_FginvT = as_tensor( self.C_e(self.kin.C(u_), theta_)[i, l] * inv(self.F_g(theta_)).T[j, k], (i, j, k, l)) Cmat_e_with_C_e = 0.5 * as_tensor( Cmat_e[i, j, m, n] * (FginvT_outertop_Ce[m, n, k, l] + Ce_outerbot_FginvT[m, n, k, l]), (i, j, k, l)) Fginv_outertop_Fginv_with_Cmat_e_with_C_e = as_tensor( Fginv_outertop_Fginv[i, j, m, n] * Cmat_e_with_C_e[m, n, k, l], (i, j, k, l)) return -(Fginv_outertop_S + S_outerbot_Fginv) - Fginv_outertop_Fginv_with_Cmat_e_with_C_e
def A(self): return self.F() * inv(self.G)
def e(self, u_): return 0.5*(self.I - inv(self.b(u_)))
def L(self, theta_, theta_old, dt): return dot((self.F_g(theta_) - self.F_g(theta_old))/dt, inv(self.F_g(theta_)))
def J_e(self, u_, theta_): return det(self.kin.F(u_)*inv(self.F_g(theta_)))
def C_e(self, C_, theta_): return inv(self.F_g(theta_)) * C_ * inv(self.F_g(theta_)).T
# External forces T = Coefficient(u_element) p0 = Coefficient(p_element) # Material parameters FIXME rho = Constant(cell) K = Constant(cell) c00 = Constant(cell) c11 = Constant(cell) c22 = Constant(cell) # Deformation gradient I = Identity(d) F = I + grad(u) F = variable(F) Finv = inv(F) J = det(F) # Left Cauchy-Green deformation tensor B = F * F.T I1_B = tr(B) I2_B = (I1_B**2 - tr(B * B)) / 2 I3_B = J**2 # Right Cauchy-Green deformation tensor C = F.T * F I1_C = tr(C) I2_C = (I1_C**2 - tr(C * C)) / 2 I3_C = J**2 # Green strain tensor