KTH framework for Nek5000 toolboxes; testing version
0.0.1
|
Set of routines to collect 44 fields for statistics. More...
Files | |
file | stat.f |
2D and 3D statistics module | |
file | stat_IO.f |
IO routines for 2D/3D statistics module. | |
Functions | |
subroutine | stat_register () |
Register 2D and 3D statistics module. More... | |
subroutine | stat_init () |
Initilise statistics module. More... | |
subroutine | stat_end () |
Finalise statistics module. More... | |
logical function | stat_is_initialised () |
Check if module was initialised. More... | |
subroutine | stat_avg |
Main interface of statistics module. More... | |
subroutine | stat_init_int1d () |
Get local integration coefficients. More... | |
subroutine | stat_reshufflev (rvar, var, nl) |
Array reshuffle. More... | |
subroutine | stat_compute_1dav1 (lvar, npos, alpha, beta) |
Perform local 1D integration on 1 variable. More... | |
subroutine | stat_compute_1dav2 (lvar1, lvar2, npos, alpha, beta) |
Perform local 1D integration on multiplication of 2 variables. More... | |
subroutine | stat_gs_sum |
Global statistics summation. More... | |
subroutine | stat_compute () |
Compute statistics. More... | |
subroutine | stat_mfo () |
Main interface for saving statistics. More... | |
subroutine | stat_mfo_outfld3d () |
Statistics muti-file output of 3D data. More... | |
subroutine | stat_mfo_outfld2d () |
Statistics muti-file output of 2D data. More... | |
subroutine | stat_mfo_write_hdr2d |
Write hdr, byte key, global ordering of 2D data. More... | |
subroutine | stat_mfo_write_stat2d |
Write additional data at the end of the file. More... | |
subroutine | stat_mfo_crd2d |
Write element centres to the file (in case of AMR level as well) More... | |
Set of routines to collect 44 fields for statistics.
This set of routines performs temporal, and, in case of the 2D version, spanwise averaging of some 44 different fields, which include selected statistical moments of velocity and pressure up to fourth order. A full list of fields is provided in the field_list.txt file located in the same directory as this file. 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'>.
As metioned above, the module can operate in two regimes, 2D and 3D. In the 3D case, the fields are only averaged in time, whereas in 2D the they are also averaged spatially along a chosen homogeneous direction. To select the mode of operation, the parameter stat_rdim
defined in the include file STATD
should be set to either 1 for 2D statistics or 0 for 3D. A template for this file is provided in this directory, you should copy it to your case folder and rename it to STATD
.
In the case of 2D statistics, the index of the homogeneous direction should be selected as well. This is done by setting the idir
variable in the user_map2d_get
subroutine, which should be copied into your .usr
file. The module will compute the statistics based on sampling the solution every AVSTEP
iterations. At each IOSTEP
iteration, two files will be output with prefix c2D
and sts
, respectively. Important: the whole simulation must be run on the same number of ranks!
Each sts
file will hold the data averaged over IOSTEP
iterations. IOSTEP
is thus both the averaging window length and the frequency of output. The sts
files are in the same format as Nek5000 output files, meaning that they can, for example, be opened with Paraview or other tools. See also pstat2d
in this Toolbox for ways of extracting data from sts
files: averaging across sts files, computing additional fields, extracting data at arbitrary points.
The c2D
files store the element numbering in the sts
-file mesh, the centres of these elements, and also the level of refinement (used for adaptive mesh refinement). This information is used by the pstat2d
tool.
In the case of 3D statistics, 11 files, s01*
to s11*
will be written each IOSTEP
iterations. Like with the 2D statistics, these will hold quantities averaged over IOSTEP
iterations. Each file holds 4 fields, the distribtuion of quantities across the files is provided in the field_list.txt
file in this directory. The files can also be opened in e.g. Paraview, but one should be aware that the names of the fields are always x_velocity
, y_velocity
, z_velocity
and temerature
. These names have nothing to do with the physical quantity stored. Instead, one should consult field_list.txt
and map the 4 quantities listed there to the names above, in the order listed. Post-processing of the produced fields can also be performed with the pstat3d
tool.
Varaible | Type | Runtime parameter | Description |
---|---|---|---|
stat_avstep | integer | _stat:AvStep | frequency of averaging |
stat_skstep | integer | _stat:SkStep | skipped initial steps |
stat_IOstep | integer | _stat:IOStep | frequency of saving data to the disc |
subroutine stat_avg |
Main interface of statistics module.
This routine performs time averaging and file writing.
Definition at line 236 of file stat.f.
References mntr_log(), mntr_tmr_add(), rzero(), stat_compute(), stat_gs_sum(), and stat_mfo().
subroutine stat_compute |
Compute statistics.
Definition at line 762 of file stat.f.
References add2(), col3(), copy(), mappr(), mntr_log(), stat_compute_1dav1(), stat_compute_1dav2(), and stat_reshufflev().
subroutine stat_compute_1dav1 | ( | real, dimension(lx1,ly1,lz1,lelt) | lvar, |
integer | npos, | ||
real | alpha, | ||
real | beta | ||
) |
Perform local 1D integration on 1 variable.
[in] | lvar | integrated variable |
[in] | npos | position in stat_ruavg |
[in] | alpha,beta | time averaging parameters |
Definition at line 565 of file stat.f.
References add2sxy(), mntr_abort(), and rzero().
subroutine stat_compute_1dav2 | ( | real, dimension(lx1,ly1,lz1,lelt) | lvar1, |
real, dimension(lx1,ly1,lz1,lelt) | lvar2, | ||
integer | npos, | ||
real | alpha, | ||
real | beta | ||
) |
Perform local 1D integration on multiplication of 2 variables.
[in] | lvar1,lvar2 | integrated variable |
[in] | npos | position in stat_ruavg |
[in] | alpha,beta | time averaging parameters |
Definition at line 622 of file stat.f.
References add2sxy(), col3(), mntr_abort(), and rzero().
subroutine stat_end |
Finalise statistics module.
Definition at line 185 of file stat.f.
References mntr_log(), mntr_tmr_add(), stat_gs_sum(), and stat_mfo().
subroutine stat_gs_sum |
subroutine stat_init |
Initilise statistics module.
Definition at line 110 of file stat.f.
References map2d_init(), mntr_log(), mntr_tmr_add(), mntr_warn(), rprm_rp_get(), rzero(), and stat_init_int1d().
subroutine stat_init_int1d |
Get local integration coefficients.
This version does 1D integration over one of the directions R,S,T. It supports curved coordinate systems, however axisymmetric 2.5D cases are not supported
Definition at line 309 of file stat.f.
References add2(), copy(), mntr_abort(), mxm(), rzero(), stat_reshufflev(), vsq(), and vsqrt().
logical function stat_is_initialised |
subroutine stat_mfo |
Main interface for saving statistics.
Definition at line 12 of file stat_IO.f.
References stat_mfo_outfld2d(), and stat_mfo_outfld3d().
subroutine stat_mfo_crd2d |
Write element centres to the file (in case of AMR level as well)
Definition at line 484 of file stat_IO.f.
References blank(), byte_close, byte_close_mpi(), byte_set_view(), byte_write, byte_write_mpi(), crecv(), csend(), igllm(), mfo_open_files(), mntr_check_abort(), mxm(), and zwgll().
subroutine stat_mfo_outfld2d |
Statistics muti-file output of 2D data.
This routine is just modification of mfo_outfld
Definition at line 102 of file stat_IO.f.
References byte_close, byte_close_mpi(), byte_set_view(), copy(), mfo_open_files(), mfo_outs(), mntr_check_abort(), stat_mfo_crd2d(), stat_mfo_write_hdr2d(), and stat_mfo_write_stat2d().
subroutine stat_mfo_outfld3d |
subroutine stat_mfo_write_hdr2d |
Write hdr, byte key, global ordering of 2D data.
This routine is just modification of mfo_write_hdr
Definition at line 318 of file stat_IO.f.
References blank(), byte_set_view(), byte_write, byte_write_mpi(), crecv(), csend(), and mntr_check_abort().
subroutine stat_mfo_write_stat2d |
subroutine stat_register |
Register 2D and 3D statistics module.
Definition at line 12 of file stat.f.
References map2d_register(), 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().
subroutine stat_reshufflev | ( | real, dimension(lx1,ly1,lz1,lelt) | rvar, |
real, dimension(lx1,ly1,lz1,lelt) | var, | ||
integer | nl | ||
) |
Array reshuffle.
Reorder directions in such a way that the uniform direction corresponds to the the first index
[out] | rvar | reshuffled array |
[in] | var | input array |
[in] | nl | element number to reshuffle |
Definition at line 496 of file stat.f.
References copy().