General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Exporting face data from a transient coupled simulation

    • hzm0074
      Subscriber

      Hello,

      I've generated transient solution data with Workbench, coupling ANSYS Mechanical to Fluent. I have a 2.5D domain with a membrane fluttering in a fluid stream. The membrane is clamped at its leading edge and undergoes self-excited oscillations. This screenshot shows the FEM geometry with the undeformed mesh. The upper horizontal face of the membrane is highlighted in green. The FSI interface includes the upper and lower horizontal faces, as well as the semicylindrical face of the trailing edge.

      I want to export a number of quantities from the upper and lower surfaces to process the result data outside of Mechanical (e.g., MATLAB), as a function of time:

      • Location
      • Velocity
      • Acceleration
      • Load transferred from Fluent (pressure and shear)

      Eventually, I want to merge the data from the upper and lower surfaces into a 1D-description of the membrane, to express displacement, velocity, acceleration, and pressure difference as a function of a Lagrangian coordinate, "s", along the membrane. To achieve this, I'd like to get a file for each time step of the solution, each file containing a list of nodes (or faces, or coordinates along the face) and the associated quantities, one column per quantity.

      With the GUI of Mechanical I don't find a way to export the nodal data of a face, even not at a single instant of time. Please provide guidance on how I should approach this task, and where to find resources that explain what I need to know. Maybe I need to write a Python script, or an APDL script? If so, where to learn how to do that?

       

      Thank you in advance for any constructive replies.

    • Aniket
      Forum Moderator

      Have you tried exporting results by right-clicking on it and using export to text file:

      -Aniket

      Forum Rules & Guidelines

    • hzm0074
      Subscriber

      Thank you, Aniket, for your reply. Yes, I've tried that. It yields a text file for a single time step with the node locations (x,y,z) and total deformations for all nodes. I need the complete time history of locations (x,y,z) etc. for only a subset of nodes, though.

    • Erik Kostson
      Ansys Employee

       

       

       

       

       

       

      Hi

       

      You can use dpf in the mechanical script console to export these results into a text file.

      This example shows that (just needs some minor changes e.g., to get the displacement instead of the temperature: dpf.operators.result.temperature – change temperature part in this to say displacement or displacement_Y).

      https://discuss.ansys.com/discussion/2383/print-temperatures-node-ids-and-locations-using-dpf-inside-mechanical

      Alternative is just to use the act mechanical scripting (not dpf as above) - see link below:

      https://discuss.ansys.com/discussion/2544/how-can-i-using-scripting-get-displacements-as-function-of-time-at-certain-areas/p1?new=1

       

      All the best

      Erik

       

       

       

       

       

       

    • hzm0074
      Subscriber

       

      Hello again,

      Thanks for the suggestions. For the matter of completeness, I’d like to share what solution served my purpose in the end. Although the act mechanical script suggested above by Erik functioned in priciple, it did not give me access to all quantities of interest, in particular not to the fluid loads. So, rather than using Mechanical, I exported the data from the interface of the CFD mesh using CFD-Post. The Export dialog enables the user to export variables (X, Y, Z, pressure, shear…) from a selected location. I did the settings according to my needs, and then ran this script in the Command Editor to repeat the export for all time steps of interest:

      !$start = 2;
      !$finish = 4242;
      !for($i = $start; $i<=$finish; $i=$i+2){
      > load timestep = $i


      EXPORT:
      Export File = D:/export_exp$i.csv
      END

      > export
      !}

       

Viewing 4 reply threads
  • The topic ‘Exporting face data from a transient coupled simulation’ is closed to new replies.