CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   how to get average velocity in a given domain (https://www.cfd-online.com/Forums/fluent/44610-how-get-average-velocity-given-domain.html)

W. W. Zhang May 5, 2007 22:51

how to get average velocity in a given domain
 
In my UDF programe,I want to get average velocity in a given domain. But the given domain is not the whole simulation domain.How to get average velocity?

Phil May 6, 2007 12:25

Re: how to get average velocity in a given domain
 
You need to loop over all the cells in the domain and add all the velocities together then divide this by the total number of cells to get the average. You should look up c operators in the udf user guide and also look at examples of udf's in the user guide- most use the loop function.

The individual cell velocities are given in components(xyz) so you need to use pythagoras to get single cell velocity magnitudes.


All times are GMT -4. The time now is 19:50.