This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Deviatoric stress components with UFL

+3 votes

How might I write deviatoric stress components:

deviatoric stress components

with UFL?

My best effort is:

I = Identity(d)
delta_ij = I[i,j]

def tauij(u, mu) :
    return \
        mu  *   \
            (   Dx(u[i],j)  \
                + Dx(u[j],i) \
                - (2.0/3.0) * delta_ij \
                    * Dx( u[k] ,k)  \
            )
asked Nov 15, 2013 by Charles FEniCS User (4,220 points)

2 Answers

+9 votes
 
Best answer

Hi

You may write it as

def tau(u, mu):
    n = u.geometric_dimension()
    return mu*(grad(u)+grad(u).T-2./n*div(u)*Identity(n))

The 2/3 part in your form only works for the deviatoric tensor in 3D, not in 2D. A more general form can also make use of the UFL functions sym and dev, like this:

def tau(u, mu):
    return mu*dev(2*sym(grad(u)))

where

sym(grad(u)) = 0.5(grad(u)+grad(u).T)

and

dev(A) = A - 1/n trace(A) Identity(n)
answered Nov 15, 2013 by mikael-mortensen FEniCS Expert (29,340 points)
selected Nov 16, 2013 by Charles

Thank you :)

+1 vote

I don't have the program on this computer - but according to the UFL Specification and User Manual, there are a couple of functions in there that you might be able to create your tensor with, in section 2.8.8 there is a "dev" function that is described as the deviatoric part of a matrix.

answered Nov 15, 2013 by tim_m FEniCS Novice (170 points)
...