CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   localMin does not report correct value of local min between owner and neighbor cells (http://www.cfd-online.com/Forums/openfoam-bugs/113371-localmin-does-not-report-correct-value-local-min-between-owner-neighbor-cells.html)

chegdan February 18, 2013 18:27

localMin does not report correct value of local min between owner and neighbor cells
 
1 Attachment(s)
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.


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