# patchIntegrate in OF-6 & previous versions

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

 December 15, 2018, 14:13 patchIntegrate in OF-6 & previous versions #1 New Member   Join Date: Dec 2018 Posts: 1 Rep Power: 0 Hello Foamers, I am doing a simulation for heat transfer in a CPU cooler using laplacianFoam. I want to calculate the integral of a field (e.g. gradTz) over a boundary/patch. In OF-2.1.1, patchIntegrate utility gives the output: Time = 240 Area vector of patch EXCHANGE_SURFACE[0] = (-1.10854e-17 1.18664e-19 0.0013702) Area magnitude of patch EXCHANGE_SURFACE[0] = 0.0188973 Reading volScalarField gradTz Integral of gradTz over vector area of patch EXCHANGE_SURFACE[0] = (1.0814e-08 -7.43949e-08 -0.00792159) Integral of gradTz over area magnitude of patch EXCHANGE_SURFACE[0] = -2.36515 End In OF-6, patchIntegrate utility is replaced by a postProcess function which gives the following output: surfaceFieldValue patchIntegrate(name=EXCHANGE_SURFACE,gradTz): total faces = 52131 total area = 0.0188973 Time = 240 Reading fields: volScalarFields: gradTz Executing functionObjects surfaceFieldValue patchIntegrate(name=EXCHANGE_SURFACE,gradTz) write: areaIntegrate(EXCHANGE_SURFACE) of gradTz = -2.36514 End My queries are: 1) How can I get integral-over-vector-area (xValue yValue zValue) along with the magnitude in OF-6 as it shows in OF-2.1.1? 2) Integral-over-area magnitude is not the magnitude of integral-over-vector-area vector. What is the relation b/w integral over vector area and integral over area magnitude?

 August 30, 2019, 12:15 #2 New Member   Rodrigo Miranda Join Date: Aug 2019 Posts: 1 Rep Power: 0 Hello, I am having the same trouble. Did you find the solution?

May 13, 2020, 05:25
#3
Member

Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 84
Rep Power: 3
Quote:
 Originally Posted by rodrigo_barret0 Hello, I am having the same trouble. Did you find the solution?
hello, I am facing a similar issue (without the experience of using past versions)
I am using OF v7. and I can not succesfully achive to have integrate a field in a patch.... I have done a research in the forum and finish with this (averaged pressure over the boundary and this New Documentation: Field Function Objects) but I can not make them work, maybe because it is for 1912v? i dont know.... and I could not find any documentation in OF v7 to solve this...
have any of you succesfully done it?
I only want to extract the average T from a scalarTransport simulation for each time, and the mass flow average in inlet/outlet and pressure inlet at the last time in a simpleFoam simulation. I wanted to add them to the controlDict so they are all together in the same file . I have sepend at least two days looking only how to do this, without succes...
best regards

 May 13, 2020, 16:43 #4 Senior Member     Herpes Free Engineer Join Date: Sep 2019 Location: The Home Under The Ground with the Lost Boys Posts: 788 Rep Power: 8 Hi - Various functionalities do not exist within all the OpenFOAM variants. Therefore, one functionality may exist only in a single variant. Yet it is usually manageable to transfer them across. But the easiest solution is to install all variants at the same time. - You can use `fieldAverage` FO on `T` to obtain time-averaged T? - Or if you want to sample `T`, you can use various `sample` functionalities. - To monitor the mass flow through given patches, you can use various functionalities. One can be surfaceFieldValue function object. Hope this helps. __________________ The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak-FSB OpenFOAM Governance and Technical Committees Report bugs/Request features: OpenFOAM (ESI-OpenCFD-Trademark) Report bugs/Request features: FOAM-Extend (Wikki-FSB) Report bugs: OpenFOAM.org How to create a MWE. Journal New: Primer

May 13, 2020, 18:34
#5
Member

Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 84
Rep Power: 3
Quote:
 Originally Posted by HPE Hi - Various functionalities do not exist within all the OpenFOAM variants. Therefore, one functionality may exist only in a single variant. Yet it is usually manageable to transfer them across. But the easiest solution is to install all variants at the same time. - You can use `fieldAverage` FO on `T` to obtain time-averaged T? - Or if you want to sample `T`, you can use various `sample` functionalities. - To monitor the mass flow through given patches, you can use various functionalities. One can be surfaceFieldValue function object. Hope this helps.
hi HPE,
postProcess -latestTime -func 'patchIntegrate(name=inlet,p)' gived me the average as i was looking for, and also i can used with U but at least from my pre test it was not the correct answer as postProcess -latestTime -func 'patchIntegrate(name=inlet,U)' did not gave me the same value that i fixed in the inlet patch (was a fixed value in U file).
I assume that postProcess -func 'patchIntegrate(name=inlet,T)' and postProcess -func 'patchIntegrate(name=outlet,T)' will give me what i am looking for (average T at inlet and outlet, as i am trying to measure an RTD and not temperature...). but this is for post process so I can use it only in the stocked writenTimes, when if I could use it at the same time as the solver, i could stock only this average T in the inlet and oultet at all times even if I decide not to write the rest of the information.
And this https://www.openfoam.com/documentati...ieldValue.html was exactly what i was trying to do, i saw your original post, and find the field function, read it, but when i tried in V7. it didnot work, i found some surfacesFieldValue in etc folder, but it was quiet cryptic, and non information at all in the V7 guide user. sadly i need to develop in this version as we have a small server to run it and i can not install the other vr. but yes, surfaceFieldValue was exactly what i was trying to do....

 May 18, 2020, 17:02 #6 Senior Member     Herpes Free Engineer Join Date: Sep 2019 Location: The Home Under The Ground with the Lost Boys Posts: 788 Rep Power: 8 Hi, Can't you compile these function objects of OF1912 into OF7? __________________ The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak-FSB OpenFOAM Governance and Technical Committees Report bugs/Request features: OpenFOAM (ESI-OpenCFD-Trademark) Report bugs/Request features: FOAM-Extend (Wikki-FSB) Report bugs: OpenFOAM.org How to create a MWE. Journal New: Primer

May 20, 2020, 05:15
#7
Member

Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 84
Rep Power: 3
Quote:
 Originally Posted by HPE Hi, Can't you compile these function objects of OF1912 into OF7?
hello, just to clarify, I found the function objects in OF7 the issue is that the "writeControl" options are differents and OF7 does not recognize the options from 1912.

best regards, franco

 Tags boundary, integrate field, patch, patchintegrate