CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   How to write Maximum, average and Minimum velocity within a solver? (https://www.cfd-online.com/Forums/openfoam-programming-development/173013-how-write-maximum-average-minimum-velocity-within-solver.html)

pupo June 11, 2016 06:14

How to write Maximum, average and Minimum velocity within a solver?
 
I've been using the following line of code to show during the iterative process the max/Avg/min Temperature in the field:

Code:

Info<< "T  max/avg/min : " << gMax(thermo.T())    << " " << gAverage(thermo.T())    << " " << gMin(thermo.T())    << endl;
I would like to the same for the velocity field, but showing the max/avg/min for the z component. How can i achieve this? I've tried U.z() , U.componet(2) and some other solutions that pop on google, but none of them works.


Thank you.


All times are GMT -4. The time now is 00:01.