<br><font size=2 face="sans-serif">Thanks Paul</font>
<br><font size=2 face="sans-serif">Rich</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>nek5000-users@lists.mcs.anl.gov</b>
</font>
<br><font size=1 face="sans-serif">Sent by: nek5000-users-bounces@lists.mcs.anl.gov</font>
<p><font size=1 face="sans-serif">07/12/2012 10:35 AM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
nek5000-users@lists.mcs.anl.gov</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">nek5000-users@lists.mcs.anl.gov</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [Nek5000-users] calling avg_all</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2><br>
Hi Rich,<br>
<br>
avg_all keeps a running tally, normalized by number of<br>
steps in the tally, of serveral quantities, and then<br>
dumps these and restarts the tallies after each "iastep" (p68)<br>
or iostep, if p68=0.   So, if p68=500, each tally will be<br>
an average entailing 500 timesteps.   You can subsequently<br>
average these files together to get longer-time averages.<br>
<br>
The reason you might not want to simply, say, step p68 to<br>
5000 is that sometimes jobs terminate early -- your queue<br>
slot ends at lower step than anticipated, etc.  So this <br>
approach gives the flexibility to subsequently post-process<br>
long-time averages.<br>
<br>
In order to constuct averages from sequences of averages,<br>
we need tallies of, for example, u and u^2.  This allows<br>
one to compute the average,<br>
<br>
        _            
  _<br>
(1)    u =(1/n) sum_i  u_i ,<br>
<br>
and the average of the square,<br>
<br>
       ____              
 _    _<br>
(2)   (uu)  =(1/n) sum_i  u_i  u_i  ,<br>
<br>
from which we can compute the rms (squared)<br>
       ____       ____    _  
  _<br>
(3)   (u')^2  =  (uu)  - u  *  u<br>
<br>
<br>
In order to able to easily compue the rms from a sequence of <br>
files (e.g., as illustrated in (1)--(3)), the rms file contains<br>
the u^2 average, the avg file contains the u-average, and these<br>
are then combined either with other files, as in (1) and (2),<br>
and then together, as in (3), to get the rms.<br>
<br>
Different users have taken different approaches to (1)--(3).<br>
We have some ad hoc averaging tools for the .fld files.  For<br>
larger runs, most people average by loading multiple f0000 or<br>
.fld files into nek5000, from which one can perform all the<br>
steps.  For many cases,  step (3) can also be done in postx.<br>
<br>
I believe that (3) can also be done in Visit by defining a<br>
function of variables -- one tricky thing there is that the<br>
u-bar and u^2-bar are coming from different files and I believe<br>
that Visit operations are generally applied to operands from<br>
the _same_ file (e.g., the same nominal timeslice).<br>
<br>
Note that the rm2 file contains the cross product running<br>
averages, <uv> <vw> <uw>, from which you can get Reynolds<br>
stresses, etc.<br>
<br>
Paul<br>
<br>
<br>
<br>
<br>
<br>
<br>
On Thu, 12 Jul 2012, nek5000-users@lists.mcs.anl.gov wrote:<br>
<br>
> Dear Nek people:<br>
><br>
> I am performing DNS  and I want to compute the time mean velocities
and<br>
> pressure as well as the Reynolds stresses. So I tried just doing a
simple<br>
> call to subroutine avg_all from subroutine userchk in the .usr file
with<br>
> no restrictions (no specific time steps, just evey time step).<br>
<br>
> 1st question. Does this accomplish a running time average for the
desired<br>
> variables?<br>
<br>
> 2nd question. I don't want the associated files listing all of the<br>
> associated variables printed out every time step, only so often. Is
this<br>
> accomplished by setting parameter 68 (iastep) to the frequency of
desired<br>
> outputs? Or does iastep determine how often subroutine avg_all is
called<br>
> as is implied in the .rea file.<br>
<br>
> 3rd question. I tried to look at obtained results in the rms an rms2
files<br>
> in Visit, but it doesn't recognize the time mean/rms variables. What's
up<br>
> with that?<br>
><br>
> Thanks<br>
> Rich<br>
><br>
_______________________________________________<br>
Nek5000-users mailing list<br>
Nek5000-users@lists.mcs.anl.gov<br>
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users<br>
</font></tt>
<br>