CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   problem interrogating min/max face velocity (http://www.cfd-online.com/Forums/openfoam-programming-development/73661-problem-interrogating-min-max-face-velocity.html)

boger March 13, 2010 16:27

problem interrogating min/max face velocity
 
In CourantNo.H, the max magnitude of the velocity at a face is reported as

Code:

velMag = max(mag(phi)/mesh.magSf()).value();
I'd like to interrogate the result in detail, so I add the following:

Code:

Info << "max phi/magSf = " << max(phi/mesh.magSf()).value() << endl;
Info << "min phi/magSf = " << min(phi/mesh.magSf()).value() << endl;
forAll(phi,i)
{
  Info << i << " " << phi[i]
            << " " << mesh.magSf()[i]
            << " " << phi[i]/mesh.magSf()[i]
            << endl;
}

With this bit of code, and using 1.6.x, I am able to find agreement with the max operator (i.e. the loop reports a max value of 5410 which is the same value reported by the max operator), but I am not able to find agreement with the min operator. The min operator reports a value of -12472 while the loop reports a min value of "only" -2710.

This is serial execution -- all faces belong to a single mesh on a single processor. The number of values reported in the loop, phi.size(), and magSf().size() are all equal.

Any ideas how I might be getting this wrong?

Thanks,
David

boger March 13, 2010 17:11

Sorry -- I realize now that the extreme value is in the boundaryField.


All times are GMT -4. The time now is 09:55.