예제 #1
0
    def update_state(self, dt, d, stress, xtra):
        """Compute updated stress given strain increment

        Parameters
        ----------
        dt : float
            Time step

        d : array_like
            Deformation rate

        stress : array_like
            Stress at beginning of step

        xtra : array_like
            Extra variables at beginning of step

        Returns
        -------
        S : array_like
            Updated stress

        dep : float
            Updated equivalent plastic strain

        """

        dstrain = d * dt
        dep = self.deplas(dt, stress, xtra, dstrain)
        xtra[0] += dep

        # Bulk modulus, Youngs modulus and Poissons ratio
        E = self._params[self.Ei]
        nu = self._params[self.Nui]
        K = E / (3. * (1. - 2. * nu))


        devol = np.sum(dstrain[:3])
        p = trace(stress)

        # S is the deviatoric stress predictor
        S = stress - p / 3. * I6 + E / (1 + nu) * dev(dstrain)
        se = np.sqrt(1.5 * np.sum(S * S))

        if se > 0:
            beta = 1. - 1.5 * E * dep / ((1 + nu) * se)

        else:
            beta = 1.;

        # S now stores the full stress tensor
        S = beta * S + (p / 3. + K * devol) * I6

        return S, xtra
예제 #2
0
    def update_state(self, dt, d, stress, xtra):
        """Compute updated stress given strain increment

        Parameters
        ----------
        dt : float
            Time step

        d : array_like
            Deformation rate

        stress : array_like
            Stress at beginning of step

        xtra : array_like
            Extra variables at beginning of step

        Returns
        -------
        S : array_like
            Updated stress

        dep : float
            Updated equivalent plastic strain

        """

        dstrain = d * dt
        dep = self.deplas(dt, stress, xtra, dstrain)
        xtra[0] += dep

        # Bulk modulus, Youngs modulus and Poissons ratio
        E = self._params[self.Ei]
        nu = self._params[self.Nui]
        K = E / (3. * (1. - 2. * nu))

        devol = np.sum(dstrain[:3])
        p = trace(stress)

        # S is the deviatoric stress predictor
        S = stress - p / 3. * I6 + E / (1 + nu) * dev(dstrain)
        se = np.sqrt(1.5 * np.sum(S * S))

        if se > 0:
            beta = 1. - 1.5 * E * dep / ((1 + nu) * se)

        else:
            beta = 1.

        # S now stores the full stress tensor
        S = beta * S + (p / 3. + K * devol) * I6

        return S, xtra
예제 #3
0
    def stiffness(self, dt, d, stress, xtra):
        """Compute the material stiffness tensor

        Parameters
        ----------
        dt : float
            time step

        d : array_like
            Deformation rate

        stress : array_like
            Stress at beginning of step

        xtra : float
            Extra variables

        Returns
        -------
        C : array_like
            The material stiffness

        Notes
        -----
        Currently coded either for plane strain or general 3D. Note that in
        this procedure `stress' is the current estimate for stress at the end
        of the increment S_n+1

        """
        dstrain = d * dt
        eplas = xtra[0]
        E = self._params[self.Ei]
        nu = self._params[self.Nui]
        K = E / (3. * (1. - 2. * nu))
        G = 3. * K * E / (9. * K - E)
        e0 = self._params[self.E0i]
        n = self._params[self.Ni]
        m = self._params[self.Mi]

        devol = trace(dstrain)
        p = trace(stress)

        S = dev(stress)
        se = np.sqrt(1.5 * np.sum(S * S))

        # tjfulle: fix model
        dep = 0.

        if se * dep > 0:
            beta = 1. / (1. + 1.5 * E * dep / ((1. + nu) * se))
            gamma = beta * (1.5 * E / ((1 + nu) * se)
                            + (1 / (n * (e0 + eplas + dep)) + 1. / (m * dep)))
            factor = 1.5 * 1.5 * E * (dep - 1. / gamma) / ((1. + nu) * se ** 3)
        else:
            beta = 1.
            factor = 0.

        C = np.zeros((6, 6))
        for i in range(3):
            for j in range(3):
                for k in range(3):
                    for l in range(3):
                        ik = reduce_map((i, k), 3)
                        jl = reduce_map((j, l), 3)
                        jk = reduce_map((j, k), 3)
                        il = reduce_map((i, l), 3)
                        ij = reduce_map((i, j), 3)
                        kl = reduce_map((k, l), 3)
                        w = ((I6[ik] * I6[jl] + I6[jk] * I6[il]) / 2.,
                             -I6[ij] * I6[kl] / 3.,
                             factor * S[ij] * S[kl])
                        c = (beta  *  E / (1 + nu) * (w[0] + w[1] + w[2]),
                             K * I6[ij] * I6[kl])
                        C[ij, kl] = c[0] + c[1]
                        continue
                    continue
                continue
            continue

        return C
예제 #4
0
    def stiffness(self, dt, d, stress, xtra):
        """Compute the material stiffness tensor

        Parameters
        ----------
        dt : float
            time step

        d : array_like
            Deformation rate

        stress : array_like
            Stress at beginning of step

        xtra : float
            Extra variables

        Returns
        -------
        C : array_like
            The material stiffness

        Notes
        -----
        Currently coded either for plane strain or general 3D. Note that in
        this procedure `stress' is the current estimate for stress at the end
        of the increment S_n+1

        """
        dstrain = d * dt
        eplas = xtra[0]
        E = self._params[self.Ei]
        nu = self._params[self.Nui]
        K = E / (3. * (1. - 2. * nu))
        G = 3. * K * E / (9. * K - E)
        e0 = self._params[self.E0i]
        n = self._params[self.Ni]
        m = self._params[self.Mi]

        devol = trace(dstrain)
        p = trace(stress)

        S = dev(stress)
        se = np.sqrt(1.5 * np.sum(S * S))

        # tjfulle: fix model
        dep = 0.

        if se * dep > 0:
            beta = 1. / (1. + 1.5 * E * dep / ((1. + nu) * se))
            gamma = beta * (1.5 * E / ((1 + nu) * se) +
                            (1 / (n * (e0 + eplas + dep)) + 1. / (m * dep)))
            factor = 1.5 * 1.5 * E * (dep - 1. / gamma) / ((1. + nu) * se**3)
        else:
            beta = 1.
            factor = 0.

        C = np.zeros((6, 6))
        for i in range(3):
            for j in range(3):
                for k in range(3):
                    for l in range(3):
                        ik = reduce_map((i, k), 3)
                        jl = reduce_map((j, l), 3)
                        jk = reduce_map((j, k), 3)
                        il = reduce_map((i, l), 3)
                        ij = reduce_map((i, j), 3)
                        kl = reduce_map((k, l), 3)
                        w = ((I6[ik] * I6[jl] + I6[jk] * I6[il]) / 2.,
                             -I6[ij] * I6[kl] / 3., factor * S[ij] * S[kl])
                        c = (beta * E / (1 + nu) * (w[0] + w[1] + w[2]),
                             K * I6[ij] * I6[kl])
                        C[ij, kl] = c[0] + c[1]
                        continue
                    continue
                continue
            continue

        return C