Is it possible to convert the Nastran .op4 file to Ansys readable file.?

Hi @AKD-Scripting-Team

I have .op4 (Nastran) file, want to open in Ansys it could be in csv or .cdb formats
If possible through scripts any suggestions would be helpful

Regards
Naveen Kumar B

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Member, Employee Posts: 256
    50 Answers 100 Comments 100 Likes Second Anniversary
    ✭✭✭✭
  • Member Posts: 90
    10 Comments 5 Likes First Answer First Anniversary
    **

    Hi @Rajesh Meena & @M Thanks for your quick response.

    With the help of those websites, I created this script yesterday:

    `
    import numpy as np
    from pyyeti.nastran import op4
    file_path = "nastran.op4"
    matrices = op4.read(file_path, justmatrix=True)
    print("Available Matrices:", matrices.keys())

    matrix_name = list(matrices.keys())[0]
    matrix_data = matrices[matrix_name]

    print(f"Matrix {matrix_name}:")
    print(matrix_data)
    matrix_data = matrices[matrix_name]
    if isinstance(matrix_data, tuple):
    matrix_data = matrix_data[0] # Extract only the numerical matrix
    matrix_data = np.atleast_2d(matrix_data)
    np.savetxt(f"{matrix_name}.csv", matrix_data, fmt="%.6f", delimiter=" ")
    `

    but it doesn't work well as expected

  • Member, Moderator, Employee Posts: 888
    100 Answers 500 Comments 250 Likes Second Anniversary
    ✭✭✭✭

    Hi @Naveen Kumar Begari , this is not enough information for us to help. What is the expected behavior ? What is not working ? Do you have an error message ?

  • Member Posts: 90
    10 Comments 5 Likes First Answer First Anniversary
    **

    @Pernelle Marone-Hitz how can I read the .csv file or any other supported file for Ansys which was generated by Nastran .op4 file.

    No error message it is getting.

  • Member, Moderator, Employee Posts: 888
    100 Answers 500 Comments 250 Likes Second Anniversary
    ✭✭✭✭

    @Naveen Kumar Begari What I meant if, from the code you shared, what is not working? Also tagging @Pierre Thieffry who might have done this in the past.

  • Member, Moderator, Employee Posts: 109
    25 Answers Second Anniversary 10 Comments 25 Likes
    ✭✭✭✭

    @Naveen Kumar Begari what do you want to do with the matrices from the op4 file?

  • Member Posts: 90
    10 Comments 5 Likes First Answer First Anniversary
    **

    @Pierre Thieffry

    In Nastran, the .op4 file contains matrix data used in finite element analysis (FEA). The element matrix is used for several reasons:

    Structural Stiffness – It represents the stiffness contribution of individual elements in the global system.

    Mass and Damping – It stores mass and damping matrices for dynamic analysis.

    Load Influence – Helps in calculating response due to applied loads.

    Modal Analysis – Used to compute eigenvalues and eigenvectors for vibration analysis.

Welcome!

It looks like you're new here. Sign in or register to get started.