# How to calculate double integration in OpenFOAM

 Register Blogs Members List Search Today's Posts Mark Forums Read

 December 9, 2010, 02:18 How to calculate double integration in OpenFOAM #1 Senior Member   Vishal Nandigana Join Date: Mar 2009 Location: Champaign, Illinois, U.S.A Posts: 208 Rep Power: 10 Dear Foamers, I would like to know if we could integrate a variable over x and y at the same time respectively. I know integrate variable function can perform integration along x or y direction at a time. But is it possible to perform double integration in OpenFOAM. Kindly let me know. Thanks Vishal Nandigana

 December 9, 2010, 09:15 #2 New Member   Bill Rosemurgy Join Date: Mar 2009 Location: Ann Arbor, MI Posts: 20 Rep Power: 9 Hi Vishal, Could you provide some more information about what you are trying to integrate and what it is you are trying to integrate over? I think I can help... What is the name of the 1-D integration function that you mentioned? - Bill

 December 9, 2010, 12:52 #3 Senior Member   Vishal Nandigana Join Date: Mar 2009 Location: Champaign, Illinois, U.S.A Posts: 208 Rep Power: 10 Dear Bill, Thanks for the response. Basically I have a rectangular channel and I want to integrate a variable say 'u' along a desired length (say from x1 to x2) and across the entire cross section of the channel (i.e from y1 to y2). I would like you to throw some light with regard to this. I hope I made my point more clear now. The function I was talking about to integrate in 1-D is integratevariable function in paraview. Thanks Vishal Nandigana

 December 9, 2010, 14:38 #4 New Member   Bill Rosemurgy Join Date: Mar 2009 Location: Ann Arbor, MI Posts: 20 Rep Power: 9 Ok, so the method I was thinking of involves simply (or not so simply...) editing the actual solver that you are using to perform the integration for you. A for loop and some if-statements would do the trick, but only if you're comfortable doing that. Otherwise, it may be possible in Paraview, but I don't know how you'd do it. - Bill

 December 9, 2010, 14:57 #5 Senior Member   Vishal Nandigana Join Date: Mar 2009 Location: Champaign, Illinois, U.S.A Posts: 208 Rep Power: 10 Dear Bill, Thanks for the reply. The problem is the area I would like to integrate is not constant for all cases. The y direction is constant but not in x direction. I have to view the result and only then perform the x integration. So I wonder if changing the solver would help. Do correct me if I am wrong. Thanks Vishal Nandigana

 September 1, 2011, 06:41 #6 Senior Member   isabel Join Date: Apr 2009 Location: Spain Posts: 171 Rep Power: 9 Dear everybody, I need to integrate a variable over x and y in a boundary condition. Can somebody write an example of how to do it? Thanks in advance Last edited by isabel; September 1, 2011 at 08:27.

 September 1, 2011, 11:01 #8 Senior Member   Bernhard Join Date: Sep 2009 Location: Delft Posts: 790 Rep Power: 14 Maybe this piece of code may be helpfull? http://foam.sourceforge.net/docs/cpp/a03267_source.html