CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Time average value of a UDS (https://www.cfd-online.com/Forums/fluent/33506-time-average-value-uds.html)

ap April 17, 2004 08:01

Time average value of a UDS
 
I need to calculate the time average value of a User Defined Scalar in my simulation.

Is there a macro which does this?

Hi and thanks :)

ap

Ajay April 17, 2004 11:44

Re: Time average value of a UDS
 
FLUENT has this option "Data sampling for Time statistics" when you do an unsteady calculation in the iterate panel that might help. I havent used it before. -Ajay

ap April 17, 2004 15:10

Re: Time average value of a UDS
 
Thank you. But that option just enable statistics for a small set of variables, and not for a UDS.

Hi :)

ap

thomas April 18, 2004 07:46

Re: Time average value of a UDS
 
hello, The Data sampling for Time statistics should not be very difficult to compute via UDF. Just need 2 variables: - A: one to store your UDS value at each time step. - B: a second one to store the number of time step (= to the number of UDS values store in the first variable). - your time average is A/B

That can be done using a DEFINE_EXECUTE_AT_END (with an UDMI inside) and the command C -> '=+' for each variable. Post-treating the UDMI will give you your UDS time average.

Hope this help, Thomas


ap April 18, 2004 15:25

Re: Time average value of a UDS
 
Thank you Thomas.

I thought to that method, but I have to use a really small time step (0.0001 s) to simulate a long time (1 to 2 minutes), so, if I sum all values I think I'll obtain an overflow. Any idea?

Hi :)

ap

thomas April 19, 2004 02:56

Re: Time average value of a UDS
 
Maybe do your averaging every 10 time step or so.


All times are GMT -4. The time now is 10:57.