CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Runtime Integration and using the result to correct a field (

Egge September 2, 2018 05:25

Runtime Integration and using the result to correct a field

I am calculating a pipe flow with heat transfer (Neumann-BC) using cyclic boundary conditions.

I modified the solver pimplefoam to solve for the "modified Temperature field", so the temperature stays more or less constant over the time. This has to be done due to the cyclic boundary conditions.

But unfortunately the temperature changes a little bit. The definition of the "modified temperature field" implies that the modified bulk temperature is zero, which appears to be not the case according to my post-processing

As a solution I want to substract the "modified bulk temperature" from each time step from the "modified temperature" at each time step.

And here is were my question occurs. I clicked through several threads but did not find the exact answer I was looking for, maybe one of you had a similiar problem in the past.

Def. Bulk Temp.: \frac{\int U_z \cdot T dA}{\int u_z dA}

So I need to do a surface integral to get the Bulk temperature, which is in my case the pipe cross section.
My algorithm so far would be:
1. average along the axial direction of the pipe (here z-direction)
2. integrate above the cross section and get a scalar value
3. read the bulk temperature in a vector corresponding to the length of uncorrected

temperature field
4. substract the bulk temperature

Step 3 and 4 I at least guess it would not be a problem, the opposites holds for 1 and 2.

My Problems are:
1. How can I average along the axial-direction. Can I tell openfoam to average all elements along the axis?

2. I know there is something like patchIntegrate from swak4foam, BUT I guess it cannot handle the averaged Values, because there is not patch which contains the information. Or can I define one? I mean it could be arbitary, because Only the face integral is important not the axial position anymore. But it must have the same geometric characteristics of the e.g. inlet or outlet or any cross section in the pipe.

3. is there a already existing face integration option in openfoam, because the way over swak4foam could be more complicated than using an existing option.

Thanks in advance for you comments

best regards

superkelle May 5, 2020 11:11

Did you find a solution? I am tackling a similar problem.

All times are GMT -4. The time now is 18:54.