CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Bugs

Bug in patchIntegrateC OF15

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 24, 2008, 06:08
Default Hello, I noticed that patch
  #1
Member
 
Thomas Wolfanger
Join Date: Mar 2009
Location: South West Germany
Posts: 62
Rep Power: 17
anger is on a distinguished road
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 is offline   Reply With Quote

Old   September 24, 2008, 06:31
Default Just a note on the above "fix"
  #2
Member
 
Thomas Wolfanger
Join Date: Mar 2009
Location: South West Germany
Posts: 62
Rep Power: 17
anger is on a distinguished road
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
anger is offline   Reply With Quote

Old   September 24, 2008, 06:41
Default Thanks for the bug report. To
  #3
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
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
henry is offline   Reply With Quote

Old   October 27, 2008, 12:14
Default Hi, further, patchIntegrate
  #4
Member
 
Niklas Wikstrom
Join Date: Mar 2009
Posts: 86
Rep Power: 17
wikstrom is on a distinguished road
Hi,

further, patchIntegrate and patchAverage are not presently parallelised:

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

n.
wikstrom is offline   Reply With Quote

Old   October 27, 2008, 12:41
Default Good point, I will make this c
  #5
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
Good point, I will make this change

Thanks

H
henry is offline   Reply With Quote

Old   October 27, 2008, 13:14
Default Henry, you guys are doing a
  #6
Member
 
Niklas Wikstrom
Join Date: Mar 2009
Posts: 86
Rep Power: 17
wikstrom is on a distinguished road
Henry,

you guys are doing a great job.

Thank you all!

n
wikstrom is offline   Reply With Quote

Old   May 28, 2009, 13:06
Default
  #7
Member
 
David P. Schmidt
Join Date: Mar 2009
Posts: 72
Rep Power: 17
schmidt_d is on a distinguished road
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
schmidt_d is offline   Reply With Quote

Old   May 29, 2009, 03:56
Default
  #8
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
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 is offline   Reply With Quote

Old   May 29, 2009, 05:36
Default
  #9
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
I have pushed some enhancements to patchIntegrate to 1.5.x.

Henry
henry 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
CoupledFvScalarMatrix in OF15 fisher OpenFOAM Running, Solving & CFD 9 May 27, 2020 10:40
Forces in OF15 richard OpenFOAM Running, Solving & CFD 180 July 9, 2018 11:54
Fan type BC in OF15 hsieh OpenFOAM Running, Solving & CFD 31 July 30, 2015 13:22
Is it a bug in Userbs Guide for OF15 kai OpenFOAM Bugs 1 October 2, 2008 09:07
Bug or a feature of OF15 rafal OpenFOAM Bugs 5 July 25, 2008 06:25


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