|
[Sponsors] |
Slicing extracted part of a volume in Python script |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 26, 2016, 09:34 |
Slicing extracted part of a volume in Python script
|
#1 |
New Member
Join Date: May 2009
Posts: 8
Rep Power: 17 |
[SOLVED]
Hi all. I try to set up a python script by tracing from inside paraview. What I did until now is importing an openfoam case to get finally slices from which I want to save the data in csv to do some post processing analysis in python for my own. The case contains tubes with returning bends thus there are two flows with opposite direction. Please see the picture. I just want to get informations on the tube segment downstream with the lower absolute pressure field (colored in blue). To avoid the upstream tube segment I selected through all cells up to some point at the return bend outlet and this marked section was extracted all other became hidden. So far so good. This worked as long as I just traced the steps and I did the extracting, slicing and exporting of the csv by hand. But when I wanted to automate this for other analog cases the extraction process was the weak part of the script. It effectively did not export anything as long as extracting was part of the script. Some strange processing took place with no output at all. Only processor/CPU load with no effective outcome. When I deleted this part it worked good. Thus I have two questions: 1. Is it possible in any form to do this automated selection and extraction process or 2. How can I ensure that the slicing is only done for the downstream tube segment. What is the syntax to limit the region of the overall geometry to this part only. Thanks in advance for your help. Hope it was clearly defined. Best regards Thore Last edited by wilmbas; April 28, 2016 at 18:14. |
|
April 27, 2016, 16:57 |
|
#2 |
New Member
Join Date: May 2009
Posts: 8
Rep Power: 17 |
Hm, no reaction so far. Is there anything not understood by my description?
|
|
April 28, 2016, 12:03 |
|
#3 |
Senior Member
|
Hi,
I am not sure why you want to use the "extracting part". Can you use a clip filter with a plane as clipping tool instead? It works similar to a plane slice. The export to CSV is something else, I am not sure if that can be scripted robustly, but maybe it can (since you said that you dit it if you did not use the extracting bit). Regards, Tom |
|
April 28, 2016, 16:08 |
|
#4 |
New Member
Join Date: May 2009
Posts: 8
Rep Power: 17 |
Dear Tom.
Thanks for your time. But clipping will just allow to review some part inside the tube segment. I want to post-process data sets from within the slice which results into two-dimensional, cross-sectional areas of the tube. This is different from a clipping procedure. Of course I could do this twice from both sides which would result into the same two-dimensional set of data. I don't think that's what I need. I still assume that the method of slicing is not wrong to get these cross-sections. But my lack of knowledge if there is a method to limit the slice to only a single segment and the automation of this step in Python is the issue. Please find below two slices. The first without extraction but having both segments being sliced and the second slicing after extraction. But that's the point this latter procedure is buggy being scripted with the tracing. Does anyone have an idea to get this in Python automated? Thanks in advance for your help. Every hint is appreciated! Regards. Thore |
|
April 28, 2016, 18:14 |
[solved]
|
#5 |
New Member
Join Date: May 2009
Posts: 8
Rep Power: 17 |
Hi all.
Got it solved by this description. Stupid simple but nice to share... Just do a clipping with a box instead of the default plane after(!) the slicing. Then no extraction is necessary! Please look here: https://cmake.org/pipermail/paraview...il/033908.html Best regards Thore |
|
Tags |
extract volume, python script, slices |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[General] Get data from Calculator filter in python script | taalf | ParaView | 17 | February 15, 2018 05:53 |
multiphaseEulerFoam (OF2.3.0) : Courant number explodes when running in parallel | Mehrez | OpenFOAM Running, Solving & CFD | 10 | May 18, 2016 12:44 |
[General] How can I use python script to generate animation from 2000 frames of vtk datasets | LieyuShi | ParaView | 3 | March 10, 2016 14:37 |
[General] Transfer variables into python script from bash-shell | cfdFreshman | ParaView | 0 | December 3, 2015 04:33 |
How to run python script to plot sth WITHOUT reconstructPar | ripperjack | OpenFOAM Post-Processing | 1 | September 2, 2013 20:35 |