# Understanding the tavg function terms

**URL:** <https://pyfr.discourse.group/t/understanding-the-tavg-function-terms/920>\
**Category:** Cases\
**Tags:** config, plugins\
**Created:** [15 September 2023 08:00 UTC](https://pyfr.discourse.group/t/understanding-the-tavg-function-terms/920 "2023-09-15T08:00:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![studyhardhardhard](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/studyhardhardhard/32/555_2.png) [@studyhardhardhard](https://pyfr.discourse.group/u/studyhardhardhard)\
**Post date:** [15 September 2023 08:00 UTC](https://pyfr.discourse.group/t/understanding-the-tavg-function-terms/920/1 "2023-09-15T08:00:10Z")

</div>

I’m sorry for my ignorance; I didn’t quite grasp the meaning and physical significance of the ‘fun-avg-upup’ expression.

What is ‘uu’? I’m not sure when such parameters were set.

What is ‘fun-avg-upup’? I’m guessing based on my simulation results that it represents the time-averaged velocity fluctuation of the flow velocity component, i.e., the velocity turbulence. It should be expressed as the true velocity minus the mean velocity. I don’t quite understand why ‘uu - u\*u’ matches its meaning.

Of course, it’s also possible that my understanding is completely wrong.

I’m eager to know the answer to this question.

Thank you for your response.

---

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [15 September 2023 08:54 UTC](https://pyfr.discourse.group/t/understanding-the-tavg-function-terms/920/2 "2023-09-15T08:54:08Z")

</div>

In the time averager plugin there are two types of expressions that can be defined: averages and functions of averages.

As per the documentation, the `avg` expression can be defined such as:

```ini
avg-{some name} = {some expression}

```

ie

```ini
avg-somefancyexpression = sqrt(0.5*rho*u*u + p)
avg-u = u

```

These `avg` expressions are evaluated and added to the accumulator every time the plugin is called.

The `fun-avg` expressions are functions of the averages you have defined using the names you set when you defined the averages. These are evaluated when the average files are written using the current average values.

ie

```ini
fun-avg-thing = somefancyexpression*u

```

---

<div class="post-metadata">

**Author:** ![studyhardhardhard](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/studyhardhardhard/32/555_2.png) [@studyhardhardhard](https://pyfr.discourse.group/u/studyhardhardhard)\
**Post date:** [15 September 2023 15:32 UTC](https://pyfr.discourse.group/t/understanding-the-tavg-function-terms/920/3 "2023-09-15T15:32:34Z")

</div>

Ok, let me think.

In the default ‘tavg’ plugin settings, ‘fun-avg-upup’ is indeed defined as ’ uu - u \* u ', which can be expanded as follows:  
‘fun-avg-upup = (avg-uu) - (avg-u)\*(avg-u)’

This can be understood as:  
‘fun-avg-upup = u\_instantaneous \* u\_instantaneous - u\_average \* u\_average’  
Is my understanding correct?

Thank you for explaining ‘functions of averages’; I’m so glad it was helpful.  
However, I still don’t fully understand the physical significance of ‘fun-avg-upup’ and the significance of the letter ‘p’ in ‘upup.’ I look forward to your explanation.

Lastly, if you want to obtain the time-averaged velocity fluctuation of the flow velocity component u, its value should indeed be ‘(u\_instantaneous - u\_average)’.  
If my reasoning is correct, then the correct expression for the time-averaged velocity fluctuation of the flow velocity component ‘u’ would be ‘fun-avg-upup / (u\_instantaneous + u\_average).’  
Is my understanding correct?

Best Regards.

---

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [16 September 2023 07:37 UTC](https://pyfr.discourse.group/t/understanding-the-tavg-function-terms/920/4 "2023-09-16T07:37:30Z")

</div>

The `upup` in `fun-avg-upup` is just a name. However, I often use the notation of p for prime  
and so this function average is

\overline{u^\prime u^\prime} = \overline{uu}-(\overline{u})(\overline{u})

This is one of the Reynolds stresses and is commonly used, for example when trying to characterize the turbulence kinetic energy budget of a flow.
