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

[OpenFOAM] Integrating a custom variable over a line

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By Tobi
  • 2 Post By babakflame

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 29, 2016, 12:57
Default Integrating a custom variable over a line
  #1
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15
babakflame is on a distinguished road
Dear Fellows

I have defined a custom variable as \rho_e U_x, where U_x is the component of velocity in x direction and \rho_e is the bulk charge density. My domain is a simple 2D rectangle.


Now I want to calculate the integral \int^L_0 (\rho_e U_x) \, dy ,where L is the height of the channel, on different x positions. I read previous threads. Some of them were mentioning patchIntegrate, However this utility calculates the integration on outlet and inlet, whereas I need this integral on different x positions in my domain.

Attached, please take a look at my domain and coordinates alongwith a distribution of the custom variable \rho_e U_x.

Regards
Attached Images
File Type: png rhoE_U_x.png (70.7 KB, 99 views)

Last edited by babakflame; November 29, 2016 at 15:05.
babakflame is offline   Reply With Quote

Old   November 29, 2016, 15:08
Default Integrate Variables filter in ParaView
  #2
New Member
 
Maryam
Join Date: Dec 2015
Posts: 13
Rep Power: 10
Persia is on a distinguished road
Have you tried the "Integrate Variables" filter in ParaView? You can slice your domain at different locations and then find the integral over each slice with this filter.
Persia is offline   Reply With Quote

Old   November 29, 2016, 15:43
Default
  #3
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15
babakflame is on a distinguished road
Hey Maryam,

Thanks for your reply. Actually I had seen integrate variable filter and had used it. It gives me just a value that I assume its over the surface of the slice i.e. it gives me

\int^H_0 \int^L_0 (\rho_e U_x) \, dy dx .


However, what I want is the integral over vertical lines not on whole surface of a slice.

I have attached a screen shot of my paraview with using integrateVariable Filter. Any further hint is appreciated.

Regards

Attached Images
File Type: jpg Screenshot from 2016-11-29 14:40:54.jpg (70.2 KB, 139 views)
babakflame is offline   Reply With Quote

Old   November 29, 2016, 16:09
Default
  #4
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15
babakflame is on a distinguished road
I am thinking of two consecutive slices one in Z normal and the second one in X normal direction, the result can be a line in the desired x position and then using integrateVariables on custom variable (\rho_e U_X). It gives me a value.

However, is that value the result of following integral??
\int^L_0 (\rho_e U_x) \, dy

Regards
babakflame is offline   Reply With Quote

Old   November 30, 2016, 17:30
Default
  #5
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi bobi,

The app is not showing the equations correct but your steps should lead to what you need. Using slices to generate a line an then integrate this one, should lead to the required integral. Maybe a simple test case should give you the proof. However, keep in mind that you introduce interpolation errors.

Cheers
babakflame likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 30, 2016, 20:43
Default
  #6
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15
babakflame is on a distinguished road
Thanks Tobi

Do you know any other filter that can be used for integration along one line?

I am thinking of a snippet for doing it inside the code. I will add that snippet soon.

Regards
babakflame is offline   Reply With Quote

Old   December 1, 2016, 22:51
Default
  #7
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15
babakflame is on a distinguished road
Dear Fellows

I will put this information here, It might be useful for others in future about integrateVariable filter.

If you want to use integrateVariable filter for integrating over a line, construct that line through consecutive slices, and then use integrateVariable filter. I compared the values from integrateVariable filter with a custom method. I think this filter performs well.


@Tobi: I compared values from plot_over_line (with sufficient numbers) against integrateVariable filter. They were comparable.

Regards
Tobi and Persia like this.
babakflame is offline   Reply With Quote

Old   October 11, 2017, 08:41
Default
  #8
New Member
 
Samarendra Panda
Join Date: Jun 2017
Posts: 8
Rep Power: 8
samar is on a distinguished road
how to use integrate variable filter in paraview?
samar is offline   Reply With Quote

Old   October 11, 2017, 08:57
Default
  #9
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
The easiest way is just to apply it on your domain but it depend what you would like to do. I suggest you to have a look here: https://www.paraview.org/paraview-guide/
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   May 19, 2019, 19:45
Default
  #10
Senior Member
 
Brett
Join Date: May 2013
Posts: 212
Rep Power: 13
Bdew8556 is on a distinguished road
Hey guys.

Im a bit confused on the maths behind integrate variables.
If I just have a simple duct, flow from left to right, and I put a slice perpendicular to the flow, then apply integrate variables am I getting:

Integral over surface (U.dA)/A. So the area weighted average velocity essentially?
Bdew8556 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
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 04:18
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09:56
emag beta feature: charge density charlotte CFX 4 March 22, 2011 09:14
Problems of Duns Codes! Martin J Main CFD Forum 8 August 14, 2003 23:19
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 20:09


All times are GMT -4. The time now is 08:10.