pyNastran
pyNastran copied to clipboard
convert stresses to a global coordinate system
Good evening,
is it possible to convert stresses read from the op2 file from the element local coordinate system to a global coordinate system?
In order to do that the program must know what is the coordinate system of the stresses and how to transform the stress from one CS to another.
Thank you. Emanuele
No. The element coordinate system transforms have not been calculated except for CBAR/CBEAM and shells. They're not organized though into a working code though. I'm also really unclear about how to do solids.
What is support is transforming to from the elemental coordinate system to the material coordinate system.
So, (I think) the steps are:
- Transform the stress from the elemental frame to the global (cid=0) frame, which requires calculating a lot of element transformation matrices. 2a. Transform the stress for the global (cid=0) frame to say the cid=1 rectangular frame. This step is fairly easy to do, but doesn't exist. 2b. Transform the stress for the global (cid=0) frame to say the cid=2 cylindrical frame. I'm just starting working on this in order to handle CD frames for displacements and forces.
Thank you. I guess the best options is to use a python notebook and numpy. Correct?
On Thu, 23 Aug 2018, 21:17 Steven Doyle, [email protected] wrote:
No. The element coordinate system transforms have not been calculated except for CBAR/CBEAM and shells. They're not organized though into a working code though. I'm also really unclear about how to do solids.
What is support is transforming to from the elemental coordinate system to the material coordinate system.
So, (I think) the steps are:
- Transform the stress from the elemental frame to the global (cid=0) frame, which requires calculating a lot of element transformation matrices. 2a. Transform the stress for the global (cid=0) frame to say the cid=1 rectangular frame. This step is fairly easy to do, but doesn't exist. 2b. Transform the stress for the global (cid=0) frame to say the cid=2 cylindrical frame. I'm just starting working on this in order to handle CD frames for displacements and forces.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SteveDoyle2/pyNastran/issues/524#issuecomment-415557189, or mute the thread https://github.com/notifications/unsubscribe-auth/AChOqKJ_0dA_CRgRAwOqQaQs4RoLtY9Mks5uTw28gaJpZM4WKJdK .
Numpy definitely, but the notebook part is really a preference thing. I think what really needs to be done in order to keep things fast is to use sparse matrices (so scipy).
I'd expect the elemental coordinate systems can be vectorized fairly easily (assuming the formulas are known). hurlei punted me a function, to determine the y/z vectors of a CROD, so that'll help. I'd expect this would be (nelements,3,3).
I think the building the global (cid=0) to cylindrical local coordinate systems (cid=2) step is also fairly easy. I'd expect this would be (nelements,3,3).
Where I think it gets tricky is 100k (3x3) triple products. That's why I was thinking sparse matrices. Then it's just creative use of dot products.
What kind of elements are you interested in?
I think some are easier than others. The general equation is:
sigma_global = [T.T][sigma_elemental][T]
For a rod:
T = [i, faked_j, faked_k] # easy to compute
sigma_elemental = [oxx,txy,0], [txy,0,0],[0,0,0]
For a shell, there are 2 layers of:
T = [xmaterial or xelement, y, normal] # easy to compute
sigma_elemental = [oxx,txy,0], [txy,oyy,0],[0,0,0]
For a bar and beam, its:
T = [i, j, k] # easy to compute
sigma_elemental = [oxx,0,0], [0,0,0],[0,0,0]
...
for axial, and points C, D, E, F
Solids stresses are at least easy with:
r, s, t = f(n1...n8)
origin = intersection of r, s, t
T = vectors that are "close" to r, s, and t (not sure what that means)
sigma_elemental = [oxx,txy,txz], [txy,oyy,tyz],[txz,tyz,ozz]
I could very well be wrong on some of these.
@SteveDoyle2 I would firstly like to say thank you for the assistance with #679 and that I would like to confirm that your proposed solution(s) did indeed fix my problem, which I really appreciated the help with.
Furthermore, in relation to this current issue, is it indeed still the case that one cannot do element coordinate system transforms in pyNastran? My intention with using data_in_material_coord
(as in #679) was actually to convert my strains from the element coordinate system to the global coordinate system, using the material coordinate system as a proxy for the global coordinate system (as I had defined my material coordinate system to be the same as the global one in Patran).
I simply wanted to confirm that this is indeed the case, i.e. that this is perhaps the only way to do it in pyNastran currently, although if there is indeed a "better" way to do it using pyNastran, any advice would be appreciated.
Yeah that's the only way to do it outside of writing your own script. It's not the highest priority for me and the other method was written by someone else. I've just never found a use for it outside of when I'm say using FEMAP.
If you want to add it yourself and make some tests, I'd be happy to accept a pull request.
Thanks for the confirmation @SteveDoyle2, that makes sense.
I'm unfortunately busy with my thesis at the moment, although if no one else has got to it by the end of the year (when I've submitted my thesis), I'm sure between my research supervisor and me that we'd be willing and able to contribute something.