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

Set of post-processing routines of 2D statistics. More...

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

Files

file  pstat2D.f
 Post processing for statistics module.
 
file  pstat2D_IO.f
 Post processing I/O routines for statistics module.
 

Functions

subroutine pstat2d_register ()
 Register post processing statistics module. More...
 
subroutine pstat2d_init ()
 Initilise pstat module. More...
 
logical function pstat2d_is_initialised ()
 Check if module was initialised. More...
 
subroutine pstat2d_main
 Main interface of pstat module. More...
 
subroutine pstat2d_mesh_amr
 Manipulate mesh to get proper AMR refinement. More...
 
subroutine pstat2d_mesh_map (ifrref)
 Find mapping of sts mesh to the existing in the run. More...
 
subroutine pstat2d_transfer ()
 Reshuffle elements between sts and current ordering. More...
 
subroutine pstat2d_sts_avg
 Read in fields and average them. More...
 
subroutine pstat2d_deriv
 Calculate derivatives. More...
 
subroutine pstat2d_interp
 Interpolate int the set of points. More...
 
subroutine pstat2d_mfi_crd2d (fidl)
 Read nonconforming data from the file. More...
 
subroutine pstat2d_mfi_interp
 Read interpolation points position and redistribute them. More...
 
subroutine pstat2d_mfo_interp
 Geather data and write it down. More...
 

Detailed Description

Set of post-processing routines of 2D statistics.

This tools allows post-processing of 2D 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. Details below.

The following workflow is suggested to use the module:

As a result, the tool will produce two files with prefix s1and s2 containing data averaged across STS_NFILE of the provided sts files, exlcluding those collected at times less than STS_STIME. The full list of fields computed, and their order is provided in the field_list.txt file in this directory. The s1 file will contain the same fields as in the sts files generated by the stats tool, but in slightly different order. The s2 file will contain the extra derivative fields. 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.

The nomenclature of the interpolating fields saved by Nek into the binary file int_fld is here explained.
u,v,w,p are instantaneous quantities averaged in time and the homogeneous direction
Please note that there is no abuse of notation in the names of the quantities,
e.g. <uu> actually means <uu> and not <u'u'>.
% 1. <u> % F1
% 2. <v> % F2
% 3. <w> % F3
% 4. <p> % F4
% 5. <uu> % F5
% 6. <vv> % F6
% 7. <ww> % F7
% 8. <pp> % F8
% 9. <uv> % F9
% 10. <vw> % F10
% 11. <uw> % F11
% 12. <pu> % F12
% 13. <pv> % F13
% 14. <pw> % F14
% 15. <pdudx> % F15
% 16. <pdudy> % F16
% 17. <pdudz> % F17
% 18. <pdvdx> % F18
% 19. <pdvdy> % F19
% 20. <pdvdz> % F20
% 21. <pdwdx> % F21
% 22. <pdwdy> % F22
% 23. <pdwdz> % F23
% 24. <uuu> % F24
% 25. <vvv> % F25
% 26. <www> % F26
% 27. <ppp> % F27
% 28. <uuv> % F28
% 29. <uuw> % F29
% 30. <vvu> % F30
% 31. <vvw> % F31
% 32. <wwu> % F32
% 33. <wwv> % F33
% 34. <uvw> % F34
% 35. <uuuu> % F35
% 36. <vvvv> % F36
% 37. <wwww> % F37
% 38. <pppp> % F38
% 39. e11: <((du/dx)^2+(du/dy)^2+(du/dz)^2)> % F39
% 40. e22: <((dv/dx)^2+(dv/dy)^2+(dv/dz)^2)> % F40
% 41. e33: <((dw/dx)^2+(dw/dy)^2+(dw/dz)^2)> % F41
% 42. e12: <(du/dx*dv/dx+du/dy*dv/dy+du/dz*dv/dz)> % F42
% 43. e13: <(du/dx*dw/dx+du/dy*dw/dy+du/dz*dw/dz)> % F43
% 44. e23: <(dv/dx*dw/dx+dv/dy*dw/dy+dv/dz*dw/dz)> % F44
%Derivative fields
% 1. dU/dx % D1
% 2. dU/dy % D2
% 3. dV/dx % D3
% 4. dV/dy % D4
% 5. dW/dx % D5
% 6. dW/dy % D6
% 7. dP/dx % D7
% 8. dP/dy % D8
% 9. d<uu>/dx % D9
% 10. d<uu>/dy % D10
% 11. d<vv>/dx % D11
% 12. d<vv>/dy % D12
% 13. d<ww>/dx % D13
% 14. d<ww>/dy % D14
% 15. d<pp>/dx % D15
% 16. d<pp>/dy % D16
% 17. d<uv>/dx % D17
% 18. d<uv>/dy % D18
% 19. d<vw>/dx % D19
% 20. d<vw>/dy % D20
% 21. d<uw>/dx % D21
% 22. d<uw>/dy % D22
% 23. d<uuu>/dx % D23
% 24. d<uuu>/dy % D24
% 25. d<vvv>/dx % D25
% 26. d<vvv>/dy % D26
% 27. d<www>/dx % D27
% 28. d<www>/dy % D28
% 29. d<ppp>/dx % D29
% 30. d<ppp>/dy % D30
% 31. d<uuv>/dx % D31
% 32. d<uuv>/dy % D32
% 33. d<uuw>/dx % D33
% 34. d<uuw>/dy % D34
% 35. d<vvu>/dx % D35
% 36. d<vvu>/dy % D36
% 37. d<vvw>/dx % D37
% 38. d<vvw>/dy % D38
% 39. d<wwu>/dx % D39
% 40. d<wwu>/dy % D40
% 41. d<wwv>/dx % D41
% 42. d<wwv>/dy % D42
% 43. d<uvw>/dx % D43
% 44. d<uvw>/dy % D44
% 45. d2U/dx2 % D45
% 46. d2U/dy2 % D46
% 47. d2V/dx2 % D47
% 48. d2V/dy2 % D48
% 49. d2W/dx2 % D49
% 50. d2W/dy2 % D50
% 51. d2<uu>/dx2 % D51
% 52. d2<uu>/dy2 % D52
% 53. d2<vv>/dx2 % D53
% 54. d2<vv>/dy2 % D54
% 55. d2<ww>/dx2 % D55
% 56. d2<ww>/dy2 % D56
% 57. d2<uv>/dx2 % D57
% 58. d2<uv>/dy2 % D58
% 59. d2<uw>/dx2 % D59
% 60. d2<uw>/dy2 % D60
% 61. d2<vw>/dx2 % D61
% 62. d2<vw>/dy2 % D62
% 63. d<pu>/dx % D63
% 64. d<pu>/dy % D64
% 65. d<pv>/dx % D65
% 66. d<pv>/dy % D66
% 67. d<pw>/dx % D67
% 68. d<pw>/dy % D68
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 p are instantaneous quantities averaged in time and the homogeneous direction Please note that there is no abuse of notation in the names of the quantities
Definition: field_list.txt:3
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. pstat2d_register
  2. pstat2d_init
  3. pstat2d_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 pstat2d_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 pstat2d_init()
Initilise pstat module.
Definition: pstat2D.f:100
subroutine pstat2d_register()
Register post processing statistics module.
Definition: pstat2D.f:11
subroutine pstat2d_main
Main interface of pstat module.
Definition: pstat2D.f:188
Module parameters:
Global parameter list:
Parameters provided by pstat2d module (include file - PSTAT2D):
Varaible Type Runtime parameter Description
pstat_amr_irnr integer _pstat2d:IOStep Nr. of inital refinements (AMR only)
pstat_ffile integer _pstat2d:STS_FFILE First sts file number
pstat_nfile integer _pstat2d:STS_NFILE Last sts file number
pstat_stime float _pstat2d:STS_STIME Statistics starting time
pstat_nstep integer _pstat2d:STS_NSTEP Number of steps between averaging in collected sts files
Module parameter usage:
[_PSTAT2D] # Runtime paramere section for pstat module
AMR_NREF = 5 # Nr. of initial refinemnt (AMR only)
STS_FFILE = 1 # First stat file number
STS_NFILE = 1 # Last stat file number
STS_STIME = 0.00000000E+00 # Statistics starting time
STS_NSTEP = 10 # Number of steps between averaging (in sts files)

Function Documentation

◆ pstat2d_deriv()

subroutine pstat2d_deriv

Calculate derivatives.

Definition at line 859 of file pstat2D.f.

References copy(), geom_reset(), gradm1(), outpost2(), and rzero().

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

◆ pstat2d_init()

subroutine pstat2d_init

Initilise pstat module.

Note
This routine should be called in frame_usr_init

Definition at line 99 of file pstat2D.f.

References mntr_log(), mntr_tmr_add(), mntr_warn(), pstat2d_mesh_amr(), pstat2d_mfi_crd2d(), and rprm_rp_get().

+ Here is the call graph for this function:

◆ pstat2d_interp()

subroutine pstat2d_interp

Interpolate int the set of points.

Definition at line 1138 of file pstat2D.f.

References io_file_freeid(), mntr_abort(), pstat2d_mfi_interp(), and pstat2d_mfo_interp().

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

◆ pstat2d_is_initialised()

logical function pstat2d_is_initialised

Check if module was initialised.

Returns
pstat2d_is_initialised

Definition at line 174 of file pstat2D.f.

◆ pstat2d_main()

subroutine pstat2d_main

Main interface of pstat module.

Definition at line 187 of file pstat2D.f.

References mntr_log(), mntr_tmr_add(), pstat2d_deriv(), pstat2d_interp(), and pstat2d_sts_avg().

+ Here is the call graph for this function:

◆ pstat2d_mesh_amr()

subroutine pstat2d_mesh_amr

Manipulate mesh to get proper AMR refinement.

Definition at line 229 of file pstat2D.f.

References mntr_abort(), mntr_logi(), and pstat2d_mesh_map().

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

◆ pstat2d_mesh_map()

subroutine pstat2d_mesh_map ( logical  ifrref)

Find mapping of sts mesh to the existing in the run.

Parameters
[in]ifrrefflag to return after refinement mark

Definition at line 282 of file pstat2D.f.

References gllel(), gllnid(), io_file_freeid(), ituple_sort(), mntr_abort(), and mntr_check_abort().

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

◆ pstat2d_mfi_crd2d()

subroutine pstat2d_mfi_crd2d ( integer  fidl)

Read nonconforming data from the file.

Parameters
[in]fidlfile number

Definition at line 10 of file pstat2D_IO.f.

References addfid(), bcast(), blank(), byte_close, byte_close_mpi(), byte_open, byte_open_mpi(), byte_read, byte_read_mpi(), byte_reverse, byte_set_view(), copy(), copy4r(), io_file_freeid(), io_init(), io_mfo_fname(), mntr_abort(), and mntr_check_abort().

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

◆ pstat2d_mfi_interp()

subroutine pstat2d_mfi_interp

Read interpolation points position and redistribute them.

Definition at line 198 of file pstat2D_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:

◆ pstat2d_mfo_interp()

subroutine pstat2d_mfo_interp

Geather data and write it down.

Definition at line 391 of file pstat2D_IO.f.

References byte_close, byte_open, byte_write, copy(), copyx4(), crecv2(), csend(), and mntr_check_abort().

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

◆ pstat2d_register()

subroutine pstat2d_register

Register post processing statistics module.

Note
This routine should be called in frame_usr_register

Definition at line 10 of file pstat2D.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:

◆ pstat2d_sts_avg()

subroutine pstat2d_sts_avg

Read in fields and average them.

Definition at line 713 of file pstat2D.f.

References add2s2(), addfid(), cmult(), copy(), io_init(), io_mfo_fname(), mfi(), mntr_abort(), mntr_logi(), outpost2(), pstat2d_mesh_map(), pstat2d_mfi_crd2d(), pstat2d_transfer(), and rzero().

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

◆ pstat2d_transfer()

subroutine pstat2d_transfer

Reshuffle elements between sts and current ordering.

Definition at line 610 of file pstat2D.f.

References gllel(), gllnid(), and mntr_abort().

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