Esempio n. 1
0
def micropolar(u, phi, parameters, coords=(x, y, z), h_vec=(1, 1, 1)):
    """
    Micropolar operator of a vector function u, as defined
    in [NOW]_.

    Parameters
    ----------
    u : Matrix (3, 1), list
        Displacement vector function to apply the micropolar operator.
    phi : Matrix (3, 1), list
        Microrrotation (pseudo)-vector function to apply the
        micropolar operator.
    parameters : tuple
        Material parameters in the following order:

        lamda : float
            Lamé's first parameter.
        mu : float, > 0
            Lamé's second parameter.
        alpha : float, > 0
            Micropolar parameter.
        beta : float
            Micropolar parameter.
        gamma : float, > 0
            Micropolar parameter.
        epsilon : float, > 0
            Micropolar parameter.
    coords : Tuple (3), optional
        Coordinates for the new reference system. This is an optional
        parameter it takes (x, y, z) as default.
    h_vec : Tuple (3), optional
        Scale coefficients for the new coordinate system. It takes
        (1, 1, 1), as default.

    Returns
    -------
    disp_op : Matrix (3, 1)
        Displacement components.
    rot_op : Matrix (3, 1)
        Microrrotational components.

    References
    ----------
    .. [NOW] Witold Nowacki. Theory of micropolar elasticity.
        International centre for mechanical sciences,
        Courses and lectures, No. 25. Berlin: Springer, 1972.
    """
    lamda, mu, alpha, beta, gamma, epsilon = parameters
    u = Matrix(u)
    phi = Matrix(phi)
    u_op = (lamda + 2*mu) * grad(div(u, coords, h_vec), coords, h_vec) \
         - (mu + alpha) * curl(curl(u, coords, h_vec), coords, h_vec) \
         + 2*alpha*curl(phi, coords, h_vec)
    phi_op = (beta + 2*gamma) * grad(div(phi, coords, h_vec), coords, h_vec)\
           - (gamma + epsilon) * curl(curl(phi, coords, h_vec), coords, h_vec)\
           + 2*alpha*curl(u, coords, h_vec) - 4*alpha*phi
    return simplify(u_op), simplify(phi_op)
Esempio n. 2
0
def navier_cauchy(u, parameters, coords=(x, y, z), h_vec=(1, 1, 1)):
    """
    Navier-Cauchy operator of a vector function u.

    Parameters
    ----------
    u : Matrix (3, 1), list
        Vector function to apply the Navier-Cauchy operator.
    parameters : tuple
        Material parameters in the following order:

        lamda : float
            Lamé's first parameter.
        mu : float, > 0
            Lamé's second parameter.
    coords : Tuple (3), optional
        Coordinates for the new reference system. This is an optional
        parameter it takes (x, y, z) as default.
    h_vec : Tuple (3), optional
        Scale coefficients for the new coordinate system. It takes
        (1, 1, 1), as default.

    Returns
    -------
    navier_op : Matrix (3, 1)
        Components of the Navier-Cauchy operator applied to the
        displacement vector.
    """
    lamda, mu = parameters
    u = Matrix(u)
    term1 = (lamda + 2 * mu) * grad(div(u, coords, h_vec), coords, h_vec)
    term2 = mu * curl(curl(u, coords, h_vec), coords, h_vec)

    return simplify(term1 - term2)
Esempio n. 3
0
def c_cst(u, parameters, coords=(x, y, z), h_vec=(1, 1, 1)):
    """
    Corrected-Couple-Stress-Theory (C-CST) elasticity operator of a
    vector function u, as presented in [CST]_.

    Parameters
    ----------
    u : Matrix (3, 1), list
        Vector function to apply the Navier-Cauchy operator.
    parameters : tuple
        Material parameters in the following order:

        lamda : float
            Lamé's first parameter.
        mu : float, > 0
            Lamé's second parameter.
        eta : float, > 0
            Couple stress modulus in C-CST.
    coords : Tuple (3), optional
        Coordinates for the new reference system. This is an optional
        parameter it takes (x, y, z) as default.
    h_vec : Tuple (3), optional
        Scale coefficients for the new coordinate system. It takes
        (1, 1, 1), as default.

    Returns
    -------
    c_cst : Matrix (3, 1)
        Components of the C-CST operator applied to the
        displacement vector

    References
    ----------

    .. [CST] Ali R. Hadhesfandiari, Gary F. Dargush.
        Couple stress theory for solids. International Journal
        for Solids and Structures, 2011, 48, 2496-2510.
    """
    lamda, mu, eta = parameters
    u = Matrix(u)
    term1 = (lamda + 2 * mu) * grad(div(u, coords, h_vec), coords, h_vec)
    term2 = mu * curl(curl(u, coords, h_vec), coords, h_vec)
    term3 = eta * lap_vec(curl(curl(u, coords, h_vec), coords, h_vec), coords,
                          h_vec)
    return simplify(term1 - term2 + term3)
Esempio n. 4
0
def test_grad():
    gradient = grad(-(cos(x)**2 + cos(y)**2)**2)
    expected_gradient = Matrix(
        [[4 * (cos(x)**2 + cos(y)**2) * sin(x) * cos(x)],
         [4 * (cos(x)**2 + cos(y)**2) * sin(y) * cos(y)], [0]])
    assert gradient.equals(expected_gradient)