Error looking for centroid NL principal stress values

32 views
Skip to first unread message

Eric Roulo

unread,
Dec 4, 2012, 10:33:05 PM12/4/12
to pynast...@googlegroups.com
Everyone:

I'm trying to extract principal stresses from non-linear CQUAD4 output. I had the following code working for my linear model output.

max_major=max(stressCase.majorP[eid]['C'][0],stressCase.majorP[eid]['C'][1])

The error is:
Traceback (most recent call last):
  File "Z:\octaweb\1103\read_op2_v3.py", line 44, in <module>
    max_major=max(stressCase.majorP[eid]['C'][0],stressCase.majorP[eid]['C'][1])
KeyError: 'C'

So, the op2 file has both stress and nlstress being plotted. How can I request the non-linear vs. linear stress with the op2 reader?

Also, I know that principal is not output directly in the stress-strain item codes. Do I need to compute the value manually?

Thanks.

-ejr

-- 
Eric J. Roulo
Owner, Roulo Consulting, Inc.
Engineering Analysis, Design, & Training


Steve Doyle

unread,
Dec 5, 2012, 12:19:39 PM12/5/12
to pynast...@googlegroups.com
My guess is you're not using the element type you think you are.  The data stored on the CQUAD4 is different in the linear and nonlinear cases, so you can check the type to find out the class and then look at the docs.  What you want is probably in op2.nonlinearPlateStress and not op2.plateStress.

Also, your max_major formula is only valid for a CQUAD4/CTRIA3 with a PSHELL with a Z0 and Z1.  A PCOMP with multiple layers would return the wrong value.

pyNastran doesn't create any generate any data that wasn't in the OP2, so if you can generate the table in the F06, there will be a corresponding one in the OP2.  Any value that doesn't exist in a table is not computed.  Some values that are in the F06/OP2 are not stored, but have functions to compute their values.

Steve
Reply all
Reply to author
Forward
0 new messages