CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Bugs

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

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

Like Tree2Likes
  • 2 Post By chegdan

LinkBack Thread Tools Display Modes
Old   February 18, 2013, 18:27
Default localMin does not report correct value of local min between owner and neighbor cells
Senior Member
chegdan's Avatar
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 613
Rep Power: 22
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

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

            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, 4 views)
carowjp and immortality like this.

Find me on
Twitter @dancombest
chegdan is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

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