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

localMin does not report correct value of local min between owner and neighbor cells

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By chegdan

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 18, 2013, 17:27
Default localMin does not report correct value of local min between owner and neighbor cells
  #1
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
Bug Description
localMin does not report correct value of local min between owner and neighbor cells of a face if owner and neighbor values are equal in magnitude but opposite sign. I have attached a snippet of code and test case to reproduce the error. Both numbers reported in the snippet should be equal to 40, which is found by inspecting paraview for the L field and counting the faces straddling the two regions of opposite sign. The relevance of this is in case someone was scanning a domain to find a face that is straddling two cells that are opposite in sign (e.g. level-set method).

Steps to Reproduce
compile the provided code with wmake.
Run the "box" test case with Allrun, where the script runs blockMesh, setFields, and localMinTest executables. It should report two numbers that should be equal.

Status of Bug
Bug has been reported here

Quick or Possible Fix
in $FOAM_SRC/finiteVolume/interpolation/surfaceInterpolation/schemes/localMin/localMin.H, line ~158

Code:
            forAll(vff, facei)
            {
                vff[facei] = minMod(vf[own[facei]], vf[nei[facei]]);
            }
where the line might want to read

Code:
            forAll(vff, facei)
            {
                vff[facei] = min(vf[own[facei]], vf[nei[facei]]);
            }
After this change, i get the expected number of faces. When checking the min of owner neighbor cells on coupled boundaries, the method uses min instead of minMod as expected. Unless I'm missing something, the function min should be used on internal faces instead of minMod.

Additional Note
Thorough testing of this change has not been done, so be careful. This is just being recorded here so that other versions or those searching cfd-online experiencing the same problems will not file a duplicate bug. if anyone sees any issue with this then let me know.
Attached Files
File Type: gz localMinTest.tar.gz (18.5 KB, 5 views)
chegdan 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



All times are GMT -4. The time now is 14:10.