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 rhoSimpleFOAM (OF-1.6.x) (http://www.cfd-online.com/Forums/openfoam-bugs/75447-bug-rhosimplefoam-1-6-x.html)

johannesk April 26, 2010 08:01

Bug in rhoSimpleFOAM (OF-1.6.x)
 
Hi,

lines 44 to 47 in OpenFOAM-1.6.x/applications/solvers/compressible/rhoSimpleFoam/pEqn.H read:
Code:

#44        if (nonOrth == nNonOrthCorr)
#45        {
#46            phi == pEqn.flux();
#47        }

I think line#46 should be an assignment not a comparison (also compare to line #77) and should be replaced with:
phi -= pEqn.flux();

I haven't fully gone through the whole rhoSimpleFoam code, so I'm not sure if my suggestion is physically correct. Can someone with more OF experience have a look at this?

olesen April 27, 2010 02:18

Quote:

Originally Posted by johannesk (Post 256319)
]I think line#46 should be an assignment not a comparison (also compare to line #77) ...

For C++ non-primitives, an 'operator==' is not necessary a comparison.
Eg, http://foam.sourceforge.net/doc/Doxygen/html/classFoam_1_1GeometricField.html#6381380e7eabc0bb2 2e86f2513a2c1d5
and http://foam.sourceforge.net/doc/Doxy...ce.html#l01090

alberto April 27, 2010 13:09

Let's say it's a confusing notation at a first sight ;)


All times are GMT -4. The time now is 03:56.