[Nek5000-users] Integrate Temperature Over Volume

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Mon Apr 15 11:12:05 CDT 2013



Hi Mike,

The standard way to do this in userchk is (say):


       n = nx1*ny1*nz1*nelt
       tbar = glsc2(t,bm1,n)/voltm1
       write(6,1) istep,time,tbar
     1 format(i9,1p2e12.5,' tbar')


Some Background:

Note that tbar is computed as follows:

                    /
      t_integral := | 1*t dV
                    /

                  =  1^T B t

where the second line is the discrete inner product of 
the "1" vector with Temperature (t) using the diagonal
mass matrix B.

In nek, this is expressed as sum_i bm1_i t_i, which
is evaluated using the global-scalar-product, with 2 
arguments,  glsc2() function shown above.  glsc2()
incorporates the requisite global communication to
gather contributions from all processors.  (Hence,
it must also be called by all processors; a local
variant is vlsc2().)

Finally, voltm1 is just the volume of the temperature
domain on mesh 1 (i.e., on the velocity/temperature
mesh, no on the pressure mesh).

Note that

     voltm1 = glsum(bm1,n)


Cheers,

Paul









On Mon, 15 Apr 2013, nek5000-users at lists.mcs.anl.gov wrote:

> Hello Neks.
>
> I would like to integrate the temperature field over the volume of my mesh, and normalize that by the total volume.
>
> I'm hoping this can be accomplished with a line or two in the .usr file.
>
> Can you please either point me toward the correct example problem in the repo, or let me know what to enter.
>
> Thanks!
> --Mike
>
> _______________________________________________
> Nek5000-users mailing list
> Nek5000-users at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
>


More information about the Nek5000-users mailing list