CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] Integrate variables feature

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By virengos

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 22, 2019, 03:48
Default Integrate variables feature
  #1
New Member
 
Fab
Join Date: Apr 2019
Posts: 27
Rep Power: 7
Rotidpor is on a distinguished road
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.
Rotidpor is offline   Reply With Quote

Old   May 28, 2019, 14:04
Default
  #2
Member
 
Damian Berghof
Join Date: May 2019
Posts: 41
Rep Power: 10
virengos will become famous soon enough
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
virengos is offline   Reply With Quote

Old   May 29, 2019, 07:22
Default
  #3
New Member
 
Fab
Join Date: Apr 2019
Posts: 27
Rep Power: 7
Rotidpor is on a distinguished road
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.
Rotidpor is offline   Reply With Quote

Old   May 29, 2019, 09:04
Default
  #4
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 12
Flowkersma is on a distinguished road
Hi Fab,

If you want an example of very similar Python script, have a look at this thread
Flowkersma is offline   Reply With Quote

Old   May 30, 2019, 11:59
Default
  #5
Member
 
Damian Berghof
Join Date: May 2019
Posts: 41
Rep Power: 10
virengos will become famous soon enough
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:
  • iterate over all slices
  • create an Integrate Variable Filter
  • write all the slice areas to the file 'areaSlice.csv'

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]))
The test was performed with ParaView 5.6 on Windows 10
2019-05-30_17h39_23.jpg
cmbv and mcfdma like this.
virengos is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 01:30.