SteveDoyle2 / pyNastran

A Python-based interface tool for Nastran's file formats
Other
396 stars 154 forks source link

OP2 problem loading eigenvalues #320

Closed alby3z closed 8 years ago

alby3z commented 8 years ago

(using Python 3.5, pyNastran 0.7.2)

I have read an op2 containing the ouput of a SOL103 and pyNastran does not read:

I have loaded the op2 in Hypermesh and everything is fine.

The command:

'>>> model.eigenvectors' NB: model is an op2 instance

Outputs the following:

{1: type=RealEigenvectorArray ntimes=15 nnodes=15 data: [t1, t2, t3, r1, r2, r3] shape=[15, 15, 6] dtype=float32 gridTypes modes = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] eigrs = [-1.5916157281026244e-12, 421.669677734375, 1792.2642822265625, 3350.52001953125, 108371.5859375, 130293.6875, 136295.375, 240061.15625, 266324.6875, 846113.375, 972801.75, 2150268.25, 2172194.25, 2862372.0, 3432723.75] mode_cycles = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}

The command:

'>>> model.displacements'

Outputs the following:

{}

SteveDoyle2 commented 8 years ago

The model.eigenvalues entry (LAMA, the standard eigenvalue summary table) is created by:

PARAM   POST          -2
PARAM   POSTEXT YES 

You can get most of the data from model.eigenvectors, but it'll be in a less nice form.

I'm not sure why you have displacements in a SOL 103 though. I'd need to see an example. Hypermesh may be doing something weird.

saullocastro commented 8 years ago

I (probably) know the answer to this case. HyperMesh has a bug and does not write CEND after the executive section. Try adding by yourself and run again.

Regards On Jul 13, 2016 14:46, "SteveDoyle2" notifications@github.com wrote:

The model.eigenvalues entry (LAMA, the standard eigenvalue summary table) is created by:

PARAM POST -2 PARAM POSTEXT YES

You can get most of the data from model.eigenvectors, but it'll be in a less nice form.

I'm not sure why you have displacements in a SOL 103 though. I'd need to see an example. Hypermesh may be doing something weird.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SteveDoyle2/pyNastran/issues/320#issuecomment-232432632, or mute the thread https://github.com/notifications/unsubscribe/ADtam3KL-ATwhvrp2cBiYosmCmBaYJh1ks5qVSRdgaJpZM4JLogf .

alby3z commented 8 years ago

Modal displacement in SOL103 analysis are of paramount importance in dynamic analysis, to require them I write DISP(PLOT) = ALL in the case control deck.

All other outputs (forces, stresses, strains) are evaluated on the base of a scale factor selected in displacement normalization. (EIGRL normalization field).

Below a bdf containing a simple case of an elastic beam where modal displacement and modal force are requested:

SOL103_modal_displacementBDF.txt

Attached also the f06 file to let you inspect the eigenvector output in terms of displacement (and forces respectively):

SOL103_modal_displacementF06.txt

SteveDoyle2 commented 8 years ago

If you run test_op2 SOL103_modal_displacementBDF.op2:

---stats for sol103_modal_displacementbdf.op2---
eigenvectors[1]
  isubcase = 1
  type=RealEigenvectorArray ntimes=10 nnodes=12
  data: [t1, t2, t3, r1, r2, r3] shape=[10, 12, 6] dtype=float32
  gridTypes
  sort1
  modes = [ 1  2  3  4  5  6  7  8  9 10]
  eigrs = [    214.821     214.821    3435.271    3435.271   17385.15    17385.15
   54982.113   54982.113  134593.438  134593.438]
  mode_cycles = [0 0 0 0 0 0 0 0 0 0]

cbar_force[1]
  type=RealCBarForceArray ntimes=10 nelements=10
  data: [ntimes, nnodes, 8] where 8=[bending_moment_a1, bending_moment_a2, bending_moment_b1, bending_moment_b2, shear1, shear2, axial, torque]
  data.shape = (10, 10, 8)
  element name: CBAR-34
  sort1
  modes = [ 1  2  3  4  5  6  7  8  9 10]
  eigrs = [    214.821     214.821    3435.271    3435.271   17385.15    17385.15
   54982.113   54982.113  134593.438  134593.438]

eigenvalues[TRAVE]
  type=RealEigenvalues neigenvalues=10
  title, extraction_order, eigenvalues, radians, cycles, generalized_mass, generalized_stiffness

That's got all the data I think you're after.

Modal displacement in SOL103 analysis are of paramount importance in dynamic analysis, to require them I write DISP(PLOT) = ALL in the case control deck.

I think your confusion is that Nastran writes out an eigenvector table regardless of DISP(PLOT)=ALL or VECTOR(PLOT)=ALL. They're synonyms in terms of the output (same as FORC vs. FORCE vs. ELFORCE or STRE vs STRESS). It's a SOL 103 results, so the modal displacements is called eigenvector. If you look in the F06, you'll see R E A L E I G E N V E C T O R N O . 1. Regardless of what you type (DISP vs. VECTOR), you will get the same output.

If you run buckling, which requires an initial deflection state, as a single subcase, you will get a displacement result and an eigenvector result in the same subcase. If you split the cases, you will get the static result in the first case and the eigenvector result in the second case. You will also get multiple result types if you run a preload transient case (static + transient displacements), a preloaded frequency response (static + frequency), or an optimization.

alby3z commented 8 years ago

Thank you @SteveDoyle2, I've always misinterpreted the actual op2 NASTRAN output. This is partially due to the fact that I was accustomed to use pre-post sw without entering into a deep comprehension of the NASTRAN output blocks.

Now using your answer I was able to read and post-process the eigenvectors.

Still I have a couple of comments:

  1. Why the mode cycles (i.e. frequency) are still all zero? mode_cycles = [0 0 0 0 0 0 0 0 0 0] (I know that I can readily pass from eigenvalues to frequency by sqrt(eigrs)/2/pi)
  2. Are the complex modes supported?
  3. How do I recover the grid positions with respect to (e.g.) the global coordinate system? Do I need to read the read also the respective bdf or I have access to this information through the op2?

Thanks a lot for your work!

SteveDoyle2 commented 8 years ago

Why the mode cycles (i.e. frequency) are still all zero?

That's the raw data Nastran has. You're right though; it doesn't really make sense. I've updated the code to create the value properly if it's 0. The correct value will still be found if the real eigenvalue is 0. The naming is somewhat inconsistent across objects and is only done for real modal results, but it's a start.

Are the complex modes supported?

Yes.

How do I recover the grid positions with respect to (e.g.) the global coordinate system?

i_transform, transforms = bdf_model.get_displacement_index_transforms()
op2_model.transform_displacements_to_global(i_transform, transforms)

You can only get data with respect to the global frame. I know it's not right for complex cylindrical/spherical analysis results, but I'm not sure what the issue is. I'd recommend plotting the real results in the GUI just to verify they look right.

Do I need to read the read also the respective bdf or I have access to this information through the op2?

You can use:

from pyNastran.op2.op2_geom import OP2Geom, read_op2_geom
model = read_op2_geom(op2_filename)
i_transform, transforms = model.get_displacement_index_transforms()
model.transform_displacements_to_global(i_transform, transforms)

It's not as robust/complete though.

alby3z commented 8 years ago

@SteveDoyle2

Apparently I don't have a module called from named OP2Geom, neither the bdf attribute get_displacement_index_transforms:

from pyNastran.op2.op2_geom import OP2Geom, read_op2_geom

ImportError: No module named 'pyNastran.op2.op2_geom'

object_attributes(pyNastran.op2) Out[81]: ['fortran_format', 'op2', 'op2Codes', 'op2_common', 'op2_f06_common', 'op2_helper', 'op2_scalar', 'resultObjects', 'result_set', 'tables']

i_transform, transforms = bdfnew.get_displacement_index_transforms()

AttributeError: 'BDF' object has no attribute 'get_displacement_index_transforms'

I am using pyNastran 0.7.2 version.

Thanks a lot