question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

slice plane when extracting results

See original GitHub issue

First, great work with pyansys!

I have a code that, for a given section of my 3D model, I extract the maximum temperatures of that section, in my thermal transient analysis. Its like a slice tool.

NSEL,S,LOC,Z,0.045-TOL,0.045+TOL
    !===================
    *GET,num_nos,NODE,0,COUNT  
    *DIM,vet_nos,array,num_nos      
    *VGET,vet_nos,NODE,,NLIST       
    /POST26
    *CREATE,ansuitmp
    *CFOPEN,'my_file','txt',' ',APPEND
    *DO,ij,1,num_nos,1
        N=vet_nos(ij)         
        NSOL,2,N,TEMP     
        STORE
        *GET,XX,NODE,N,LOC,X
        *GET,YY,NODE,N,LOC,Y
        *GET,MAX_TEMP,vari,2,extrem,vmax  
        *VWRITE,XX,YY,MAX_TEMP,N,
        (2F12.8,2F10.2)
    *ENDDO
    *CFCLOS
    *END
    /INPUT,ansuitmp

Is it possible to retrieve the data in a similar way with pyansys? (don’t need to cfopen, just retrieve data from the loop at given section in NSEL)

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rodrigofarias-MECHcommented, Sep 24, 2020

Ran into an issue with this mesh type and I’ll have to update the latest release to read it in. Broke somewhere around pyansys==0.41.1, so prior to that it should work.

Otherwise, slicing works out of the box. I’ll write up an example and add it to the docs, but you should be able to work with it “as-is” in an older version:

import pyansys
rst = pyansys.read_result('ts_simu_termica.rth')
nnum, temp = rst.nodal_temperature(100)
single_slice = rst.grid.slice(normal=[0, 0, 1], origin=[0, 0, 0.01])
single_slice.plot()

image

Decided to add some animation to it as well. I’ll have that out in the next release:

example

Thank you so much my friend! This is exactly what I wanted. And the animation was perfect, really good.

I will continue to develop my models and give feedback on pyansys. If you need more sample files to post to pyansys documents, feel free to contact me.

0reactions
rodrigofarias-MECHcommented, Oct 1, 2020

I just edited the last line to single_slice.plot(scalars='temperature', show_edges=True)

Now it works 😃 !

Read more comments on GitHub >

github_iconTop Results From Across the Web

slice plane when extracting results · Issue #265 · pyansys/pymapdl ...
First, great work with pyansys! I have a code that, for a given section of my 3D model, I extract the maximum temperatures...
Read more >
Extracting exact coordinates of slice intersecting with the domain
Hi Leonidas, To extract a slice, you want to make sure the slice is in the desired location. Then you go to Data...
Read more >
extract data from a cut plane - python - Stack Overflow
this is what I would do, to write out the data: self._reader.GetOutput().GetPointData().SetActiveScalars("Intensity") planeCut = vtk.
Read more >
EXTRACT_SLICE - L3HarrisGeospatial.com
The EXTRACT_SLICE function extracts a specified planar slice of volumetric data. This function allows for a rotation or vector form of the slice...
Read more >
How to extract results from a cut plane in Simulation CFD
Solution: Results can be extracted from a cut plane in a few ways. Using the bulk calculator (from the ribbon) will allow you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found