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

Gradient of Hydrstatic Stress becomes Zero

0 votes

I have calculated Stress and Hydrostatic stress again while calculating gradient of Hydrostatic stress It becomes Zero, Can anyone point out my mistake,

def h_term(c_old,u_old):
term1 =  0.5*(grad(u_old) + grad(u_old).T) - Omega*c_old*Identity(2)
sigma = (E*term1)/(3*(1-2*nu))
sigma_h = (tr(sigma) + nu*tr(sigma))/3
h_term = grad(sigma_h)    
return h_term

here c_old and u_old is the previous time step solution and I am solving Plane strain problem.

Thanks in advance

asked Nov 17, 2016 by hirshikesh FEniCS User (1,890 points)

what is the order of the function space that are you using for the displacements?

2 Answers

0 votes
 
Best answer

Hi Hirshikesh

you forgot to project result to get the grad

def h_term(c_old,u_old, mesh):
    d = u_old.geometric_dimension()
    term1 =  0.5*(grad(u_old) + grad(u_old).T) - Omega*c_old*Identity(d)
    sigma = (E*term1)/(3*(1-2*nu))
    sigma_h = (tr(sigma) + nu*tr(sigma))/3
    V1 = FunctionSpace(mesh, 'P', 1)
    sigma_h = project(sigma_h, V1)
    h_term = grad(sigma_h)    
    return h_term
answered Feb 21, 2017 by LeoCosta FEniCS User (1,190 points)
selected Feb 21, 2017 by hirshikesh

Thank you so much

0 votes

I am using 2 order (VectorFunctionSpace(meshn,'CG',2))

answered Nov 17, 2016 by hirshikesh FEniCS User (1,890 points)

Could you do a more detailed question? a minimal non working example of your code is a good start point.

Thanks for your reply, I have got the answer. Actually I was not updating my solution

...