Inquire about the max() function in OpenFOAM
Hey there!
I'm confused about how the max() function works. Currently I'm making a AMR sensor using gradrho &gradU Code as following: In rhoCentralFoam.C ,I add this lines. Code:
//----------------------------sensor-------------------------------------// For using as sensor I want it ranges from 0-1. gradrhoN works fine,and it's value range from 0-1. But,the range of gradUyyN or gradUtN (which has the same value) shows a changing range approximately from a non-zero extremly small value to about 0.5. Why the max value / max value is not 1? thank you:) |
Are you testing this code in parallel?
|
hi
Quote:
I just find the solution. Use gMax instead of max gives the correct value. |
Exactly, that's why I asked. But if you are running on single processor, max() should work fine.
|
Quote:
gradrhoMag = mag(gradrho); gradrhoMax = max(gradrhoMag); when I check the value of gradrhoMag and gradrhoMax, the maximum of gradrhoMag=gradrhoMax, but when I use max() for doing gradU,it's not work. the value is almost twice bigger than the maximum of gradUMag. |
All times are GMT -4. The time now is 06:29. |