KTH framework for Nek5000 toolboxes; testing version  0.0.1
Post-processing of 3D statistics

Set of post-processing routines for 3D statistics. More...

+ Collaboration diagram for Post-processing of 3D statistics:

Files

file  pstat3D.f
 Post processing for statistics module.
 
file  pstat3D_IO.f
 Post processing I/O routines for statistics module.
 

Functions

subroutine pstat3d_register ()
 Register post processing statistics module. More...
 
subroutine pstat3d_init ()
 Initilise pstat module. More...
 
logical function pstat3d_is_initialised ()
 Check if module was initialised. More...
 
subroutine pstat3d_main
 Main interface of pstat module. More...
 
subroutine pstat3d_sts_avg
 Read in fields and average them. More...
 
subroutine pstat3d_nfield
 Calculate new fileds. More...
 
subroutine pstat3d_interp
 Interpolate int the set of points. More...
 
subroutine pstat3d_mfo
 Write field data data to the file. More...
 
subroutine pstat3d_mfi_interp
 Read interpolation points position and redistribute them. More...
 
subroutine pstat3d_mfo_interp
 Geather data and write it down. More...
 
subroutine pstat3d_field_out (int_field, fldim, ierr)
 Geather single field data and write it down. More...
 

Detailed Description

Set of post-processing routines for 3D statistics.

This tools allows post-processing of 3D statistics files generated by the stats tool. In particular, it allows to do two things:

In addition, when doing the above the tool will compute a number of extra fields, including the components of the turbulent kinetic energy budget. Details below.

The following workflow is suggested to use the module:

As a result, the tool will produce a set of files with prefix a01 to a22 containing data averaged across STS_NFILE of the provided s01-s11 files, excluding those collected at times less than STS_STIME. The list of fields and their distributon acros the files is given in field_list.txt in this folder.

The interpolated point data is saved to a file called int_fld. It can be read using the functions in reader_int_fld.py Python file.

List of fields generated by the PSTAT3D tool and their distributon
across files prefixed a01 to a22.
The following nomenclature is adopted for the terms in the transport equations
for Reynolds stresses.
P - production
D - dissipation
VD - viscous diffusion
C - convection
T - turbulent transport
Pi - pressure-velocity-gradient tensor
PT - pressure transport
PS - pressure strain
See eqs. (5)-(12) in https://publications.anl.gov/anlpubs/2017/03/133610.pdf
for exact definition
"k" indicates the corresponding term in the kinetic energy equation, e.g.
Pk - production of k.
Please observe that <uu> stands for <u'u'> since the mean has been already subtracted.
- a01
<u>
<v>
<w>
<uu>
- a02
<vv>
<ww>
<uv>
<uw>
- a03
<vw>
<p>
<pp>
<ppp>
- a04
<pppp>
<uuu>
<vvv>
<www>
- a05
<uuv>
<uuw>
<uvv>
<vvw>
- a06
<uww>
<vww>
<uvw>
Pxx
- a07
Pyy
Pzz
Pxy
Pxz
- a08
Pyz
Dxx
Dyy
Dzz
- a09
Dxy
Dxz
Dyz
Txx
- a10
Tyy
Tzz
Txy
Txz
- a11
Tyz
VDxx
VDyy
VDzz
- a12
VDxy
VDxz
VDyz
Pixx
- a13
Piyy
Pizz
Pixy
Pixz
- a14
Piyz
Cxx
Cyy
Czz
- a15
Cxy
Cxz
Cyz
Pk
- a16
Dk
Tk
VDk
Pik
- a17
Ck
Resk (Residual from all the terms)
PTxx
PTyy
- a18
PTzz
PTxy
PTxz
PTyz
- a19
PSxx
PSyy
PSzz
PSxy
- a20
PSxz
PTyz
<du/dx>
<du/dy>
- a21
<du/dz>
<du/dx>
<dv/dy>
<dv/dz>
- a22
<dw/dx>
<dw/dy>
<dw/dz>
Tk
subroutine files
Definition: drive2.f:413
The nomenclature of the interpolating fields saved by Nek into the binary file int_fld is here explained u
Definition: field_list.txt:2
The nomenclature of the interpolating fields saved by Nek into the binary file int_fld is here explained v
Definition: field_list.txt:2
The nomenclature of the interpolating fields saved by Nek into the binary file int_fld is here explained w
Definition: field_list.txt:2
Module interface:
Global interface list:
  1. pstat3d_register
  2. pstat3d_init
  3. pstat3d_main
Global interface dependency:
Interface required:
  1. multiple interfaces from Runtime parameters and Monitoring module modules
  2. io_mfo_fname from Input/output module module
  3. io_file_freeid from Input/output module module (debugging only)
Module interface usage:
!======================================================================
subroutine userchk
include 'TSTEP'
if (istep.eq.0) then
! start framework
endif
! monitor simulation
! collect statistics
call pstat3d_main()
! Force running for only one iteration
lastep=1
! finalise framework
if (istep.eq.nsteps.or.lastep.eq.1) then
call frame_end
endif
return
end
!======================================================================
subroutine frame_usr_register
implicit none
include 'SIZE'
include 'FRAMELP'
!-----------------------------------------------------------------------
! register modules
return
end subroutine
!======================================================================
subroutine frame_usr_init
implicit none
include 'SIZE'
include 'FRAMELP'
!-----------------------------------------------------------------------
! initialise modules
return
end subroutine
!======================================================================
subroutine frame_usr_end
implicit none
return
end subroutine
!======================================================================
subroutine frame_monitor
Simulataion monitoring.
Definition: frame.f:59
subroutine frame_start
Start framework.
Definition: frame.f:12
subroutine frame_end
Finalise framework.
Definition: frame.f:76
subroutine pstat3d_init()
Initilise pstat module.
Definition: pstat3D.f:96
subroutine pstat3d_register()
Register post processing statistics module.
Definition: pstat3D.f:11
subroutine pstat3d_main
Main interface of pstat module.
Definition: pstat3D.f:174
Module parameters:
Global parameter list:
Parameters provided by pstat3d module (include file - PSTAT3D):
Varaible Type Runtime parameter Description
pstat_nfile integer _pstat3d:STS_NFILE Number of collected s01-s11 files
pstat_stime float _pstat3d:STS_STIME Statistics starting time
pstat_nstep integer _pstat3d:STS_NSTEP Number of steps between averaging in collected s01-s11 files
Module parameter usage:
[_PSTAT3D] # Runtime paramere section for pstat module
STS_NFILE = 2 # Number of collected s01-s11 files
STS_STIME = 0.69968783E+02 # Statistics starting time
STS_NSTEP = 10 # Number of steps between averaging in collected s01-s11 files

Function Documentation

◆ pstat3d_field_out()

subroutine pstat3d_field_out ( real, dimension(fldim*lhis)  int_field,
integer  fldim,
integer  ierr 
)

Geather single field data and write it down.

Parameters
[in]int_fieldinterpolated field
[in]fldimfield dimension
[out]ierrerror flag

Definition at line 588 of file pstat3D_IO.f.

References byte_write, copy(), copyx4(), crecv2(), and csend().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pstat3d_init()

subroutine pstat3d_init

Initilise pstat module.

Note
This routine should be called in frame_usr_init

Definition at line 95 of file pstat3D.f.

References icopy(), mntr_tmr_add(), mntr_warn(), and rprm_rp_get().

+ Here is the call graph for this function:

◆ pstat3d_interp()

subroutine pstat3d_interp

Interpolate int the set of points.

Definition at line 790 of file pstat3D.f.

References io_file_freeid(), mntr_abort(), pstat3d_mfi_interp(), and pstat3d_mfo_interp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pstat3d_is_initialised()

logical function pstat3d_is_initialised

Check if module was initialised.

Returns
pstat3d_is_initialised

Definition at line 160 of file pstat3D.f.

◆ pstat3d_main()

subroutine pstat3d_main

Main interface of pstat module.

Definition at line 173 of file pstat3D.f.

References mntr_log(), mntr_tmr_add(), pstat3d_interp(), pstat3d_nfield(), and pstat3d_sts_avg().

+ Here is the call graph for this function:

◆ pstat3d_mfi_interp()

subroutine pstat3d_mfi_interp

Read interpolation points position and redistribute them.

Definition at line 82 of file pstat3D_IO.f.

References bcast(), blank(), byte_close, byte_open, byte_read, byte_reverse, byte_reverse8, copy(), copy4r(), crecv2(), csend(), io_file_freeid(), mntr_check_abort(), and mntr_logi().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pstat3d_mfo()

subroutine pstat3d_mfo

Write field data data to the file.

Definition at line 9 of file pstat3D_IO.f.

References outpost().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pstat3d_mfo_interp()

subroutine pstat3d_mfo_interp

Geather data and write it down.

Definition at line 275 of file pstat3D_IO.f.

References byte_close, byte_open, byte_write, mntr_check_abort(), and pstat3d_field_out().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pstat3d_nfield()

subroutine pstat3d_nfield

Calculate new fileds.

Definition at line 353 of file pstat3D.f.

References add2(), add3(), add4(), admcol3(), chsign(), cmult(), col3(), copy(), gradm1(), pstat3d_mfo(), rzero(), sub2(), sub3(), subcol3(), subcol4(), and vdot3().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pstat3d_register()

subroutine pstat3d_register

Register post processing statistics module.

Note
This routine should be called in frame_usr_register

Definition at line 10 of file pstat3D.f.

References mntr_abort(), mntr_mod_is_name_reg(), mntr_mod_reg(), mntr_tmr_add(), mntr_tmr_is_name_reg(), mntr_tmr_reg(), mntr_warn(), rprm_rp_reg(), rprm_sec_reg(), and rprm_sec_set_act().

+ Here is the call graph for this function:

◆ pstat3d_sts_avg()

subroutine pstat3d_sts_avg

Read in fields and average them.

Definition at line 215 of file pstat3D.f.

References add2s2(), addfid(), cmult(), io_init(), io_mfo_fname(), mfi(), outpost(), and rzero().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: