|
[Sponsors] |
May 22, 2019, 03:48 |
Integrate variables feature
|
#1 |
New Member
Fab
Join Date: Apr 2019
Posts: 27
Rep Power: 7 |
Hello everyone.
I'm very new at using paraview and I still have some trouble treating all my data efficiently. What I want to do is integrating quantities on successive slices in my domain. I know how to do multiple slices with a given spacing in the "slice" feature and I know how to calculate quantities using the calculator feature and integrate them with integrate variables. But what I want to do is create, let's say, 50 slices and integrate my quantities on each slice individually so that I could obtain a chart with the number/coordinates of the 50 slices and all the quantities. The problem I have is that when I do multiple slices, they all are united in one unique "slice". Also, I don't know how to use "integrate variables" on multiple objects in the tree. Any help will be greatly appreciated. Thank you for reading and I'm sorry if what I ask for is trivia. |
|
May 28, 2019, 14:04 |
|
#2 |
Member
Damian Berghof
Join Date: May 2019
Posts: 41
Rep Power: 10 |
Hi Fab,
this should not be a big problem at all ! 1.) you may either use the programmable filter 2.) or perform it with a short python script Could you please upload your test case or some pictures ? Damian Last edited by virengos; May 28, 2019 at 14:05. Reason: typo |
|
May 29, 2019, 07:22 |
|
#3 |
New Member
Fab
Join Date: Apr 2019
Posts: 27
Rep Power: 7 |
Hi Damian, thank you for your reply.
I hardly ever used python. I looked into the programmable filter but I'm afraid anything code-related is hardly understandable for me. I don't know how my case could help as my question is general about paraview. Well, at least I can cut slices one by one and integrate the variables I want over them. I might try to look more into python and programming scripts... Looks like a usefull, handy tool. |
|
May 29, 2019, 09:04 |
|
#4 |
Senior Member
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 12 |
||
May 30, 2019, 11:59 |
|
#5 |
Member
Damian Berghof
Join Date: May 2019
Posts: 41
Rep Power: 10 |
Hi Fab,
I did a simple test example. Maybe it's helpful for you. Perform following steps in ParaView: 1.) Load your data 2.) Create all required slices (see my screenshot) 3.) Add the "Programmable Filter" to the pipe line 4.) Add my code and press "Apply" 5.) Afterwards you can import the *.csv file into ParaView and plot your data or process the data with other tools The code should do following:
Code:
import paraview.simple as pv import os folder = "C:"+"/temp/" os.chdir(folder) print(os.getcwd()) source0 = pv.FindSource('Wavelet1') sliceArea = [] all_sources = pv.GetSources() with open('areaSlice.csv','w') as file: for key, value in all_sources.keys(): if 'Slice' in key: print(key) slice = pv.FindSource(key) source = pv.SetActiveSource(slice) newIntg = pv.IntegrateVariables(Input=source) sliceArea.append(newIntg.CellData.GetArray('Area').GetRange()[0]) print(sliceArea[-1]) pv.Delete(newIntg) file.write('Slice: {} Area: {}\n'.format(key,sliceArea[-1])) 2019-05-30_17h39_23.jpg |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[General] IntergateVariables filter. How to select variables to integrate? | Antech | ParaView | 0 | June 4, 2015 02:38 |
[General] Surface Flow or Integrate Variables | lenkri | ParaView | 0 | February 26, 2015 23:20 |
[snappyHexMesh] Explicit feature edge ref&snap in OF2.2 | Eloise | OpenFOAM Meshing & Mesh Conversion | 0 | May 9, 2014 11:39 |
Problem Accessing Obscure Data Variables in Fluent | randomPhil | Fluent UDF and Scheme Programming | 3 | December 12, 2013 11:42 |
ADDITIONAL VARIABLES LIMITERS | N.P | CFX | 5 | December 1, 2011 07:47 |