CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Bug in patchIntegrateC OF15 (http://www.cfd-online.com/Forums/openfoam-bugs/62393-bug-patchintegratec-of15.html)

anger September 24, 2008 05:08

Hello, I noticed that patch
 
Hello,

I noticed that patchIntegrate delivers the same area magnitude vector for any patch.
To calculate the area vector of the patch actually under consideration, change line 78 of patchIntegrate.C to read:

Info<< " Patch area = " << sumCmptMag(mesh.boundaryMesh()[patchi].faceAreas()) << endl;

which (at least for my testcase) delivers correct values.

Best regards,
-Thomas

anger September 24, 2008 05:31

Just a note on the above "fix"
 
Just a note on the above "fix":
for patches which have "positive" and "negative" faceAreas, the outcome of this calculation is wrong.
If, for example, the frontal area of a wing is calculated, the result will be two times as large as the correct one because the wing surface is closed; not only the visible part is taken into account, but also the "invisible" part lying downstream of the point of largest profile thickness. Anyone knows how to calculate the "visible" part generally?

Best regards,
-Thomas

henry September 24, 2008 05:41

Thanks for the bug report. To
 
Thanks for the bug report. To be consistent with the usage the patch area should be output as

Info<< " Patch area = " << sum(mesh.Sf().boundaryField()[patchi]) << endl;

I will push this fix into our git repository.

H

wikstrom October 27, 2008 12:14

Hi, further, patchIntegrate
 
Hi,

further, patchIntegrate and patchAverage are not presently parallelised:

Solution: replacing sum with gSum in "integration" works nicely.

n.

henry October 27, 2008 12:41

Good point, I will make this c
 
Good point, I will make this change

Thanks

H

wikstrom October 27, 2008 13:14

Henry, you guys are doing a
 
Henry,

you guys are doing a great job.

Thank you all!

n

schmidt_d May 28, 2009 12:06

Henry,
The gsum(mesh.Sf().boundaryField()[patchi]) adds up the surface normal vectors over the patch. May I suggest changing this to be magSf instead? The sum of the vectors is not really an area. What if you were integrating a quantity over a closed surface!?

Regards,
David

henry May 29, 2009 02:56

David,

> The gsum(mesh.Sf().boundaryField()[patchi]) adds up the surface normal vectors
> over the patch.

Correct

> May I suggest changing this to be magSf instead?

We could do this additionally.

> The sum of the vectors is not really an area.

It is an area, it is the directed area.

> What if you were integrating a quantity over a closed surface!?

That is true, it may not be what you want in this case but in many cases it is what you want.

Henry.

henry May 29, 2009 04:36

I have pushed some enhancements to patchIntegrate to 1.5.x.

Henry


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