Hello, I hope someone can help me with a simple FEM question. I have some code that is used for simulation but now I want to read some values for visualization of strain/stress analysis, which the code didn't do before. Since it was only used for simulation it only tracks deformation at the nodes, so now that I want to read "internal" stresses between nodes, I have to write the interpolation myself and I'm a bit stuck. A linear shape function is assumed.
I am working with an internal code base and I'm new to FEM so please excuse the abstract and possibly poorly-worded question. Basically I am trying to take some code that calculates a strain and stress for a tetrahedron, and use that to find the strain and stress at a particular point inside the tetrahedron, e.g. to make a smoothly shaded cross-sectional diagram. I just want to know if I'm doing this theoretically correctly, because it does not seem to be giving me correct values. I'll keep this to strain for now, because even that doesn't quite work, so stress would be the next step.
Basically the code takes, for each node, the position difference (after correcting for rotation) and constructs a vector u
, and also constructs a matrix B
. u
is of size 12, and B
is of size 6x12, so I get a strain vector of size 6. So far so good.
That is, after constructing u
and B
for all four nodes, then the code does:
strainVec = B * u;
If I plot this, it appears to be correct. However this strain is over the whole tetrahedron. (Is this a "constant strain tetrahedron" in the literature and not a "linear strain tetrahedron"?) I want to know the value at a point p
inside the tetrahedron. I have barycentric coordinate weights w[4]
for each node that have been pre-calculated.
So my idea was to calculate u
and B
separately for each node instead of as one large matrix each, and mix them using w
. Then, u
is a 3-vector, and B
is 6x3, so I get a 6-vector for each node:
for (i=0; i<4; i++) strainV[i] = B[i] * u[i]; strainAtP = w[0] * strainV[0] + w[1] * strainV[1] + w[2] * strainV[2] + w[3] * strainV[3];
Unfortunately this gives me weird results. Does it make sense to calculate B
and u
separately for each node, or is that intuition way off?
The only other way I could see to do it would be to calculate strain for all tetrahedra, and then interpolate p
from the center values of the surrounding tetrahedra, but that seems more complicated and I'm not sure it's correct either. Also it seems it would smooth the values too much.
Thanks for any insight you can offer!
[link] [comments]
from The ME Hang Out http://bit.ly/2Su58wv https://ift.tt/eA8V8J
Comments
Post a Comment