KTH framework for Nek5000 toolboxes; testing version  0.0.1

Set of rutine for Selective Frequency Damping. More...

+ Collaboration diagram for SFD module:

Files

file  sfd.f
 Selective frequency damping (SFD) in nekton.
 

Functions

subroutine sfd_register ()
 Register SFD module. More...
 
subroutine sfd_init ()
 Initialise SFD module. More...
 
logical function sfd_is_initialised ()
 Check if module was initialised. More...
 
subroutine sfd_end
 Finalise SFD. More...
 
subroutine sfd_main
 Main SFD interface. More...
 
subroutine sfd_forcing (ffx, ffy, ffz, ix, iy, iz, ieg)
 Calcualte SFD forcing. More...
 
subroutine sfd_solve
 Update filtered velocity field. More...
 
subroutine sfd_rst_write
 Create checkpoint. More...
 
subroutine sfd_rst_read
 Read from checkpoint. More...
 
subroutine sfd_mfo (fname)
 Store SFD restart file. More...
 
subroutine sfd_mfi (fname)
 Load SFD restart file. More...
 

Detailed Description

Set of rutine for Selective Frequency Damping.

The base flow is computed using Selective Frequency Damping (SFD) method [1], which damps the oscillations of the unsteady part of the solution using a temporal low-pass filter by setting the forcing term to $\vec{f} = - \chi (\vec{u} - \vec{\bar{u}}),$ where $\vec{u}$ is the solution of the non–linear Navier-Stokes equations, and $\vec{\bar{u}}$ is a temporally low–pass–filtered state given by the differential exponential filter $\dot{\vec{\bar{u}}} = (\vec{u} - \vec{\bar{u}})/\Delta.$ The filter parameters $\chi$ and $\Delta$ (control coefficient and filter width) can be determined based on the DNS simulations of the studied case. During the calculations we control the magnitude of the forcing term $\epsilon=\|(\vec{u} - \vec{\bar{u}})\|$ in $\Omega$, which is a good indicator of convergence. Description of the implementation and performed tests can be found in [4].

Module interface:
Global interface list:
Interface provided:
  1. sfd_register
  2. sfd_init
  3. sfd_forcing
  4. sfd_main
Global interface dependency:
Interface required:
  1. multiple interfaces from Runtime parameters and Monitoring module modules
  2. io_file_freeid, io_mfo_fname, io_mbyte_open, io_mfov, io_mbyte_close and io_mfiv from Input/output module module
  3. chkpt_get_fset from Checkpointing routines module
  4. chkptms_map_gll from Multistep checkpointing module
Module interface usage:
!======================================================================
subroutine userf (ix,iy,iz,ieg)
include 'SIZE'
include 'NEKUSE' ! FF[XYZ]
include 'SOLN' ! V[XYZ]
ffx = 0.0
ffy = 0.0
ffz = 0.0
! add sfd forcing
call sfd_forcing(ffx,ffy,ffz,ix,iy,iz,ieg)
return
end
!======================================================================
subroutine userchk
include 'TSTEP'
if (istep.eq.0) then
! start framework
endif
! monitor simulation
! save/load files for full-restart
! SFD evolution
call sfd_main
! 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
call sfd_init
return
end subroutine
!======================================================================
subroutine frame_usr_end
implicit none
include 'SIZE'
include 'FRAMELP'
!-----------------------------------------------------------------------
! finlise modules
call sfd_end
return
end subroutine
!======================================================================
subroutine chkpt_init()
Initilise checkpointing module.
Definition: chkpt.f:87
subroutine chkpt_main
Main checkpoint interface.
Definition: chkpt.f:201
subroutine chkpt_register()
Register checkpointing module.
Definition: chkpt.f:11
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 sfd_main
Main SFD interface.
Definition: sfd.f:363
subroutine sfd_register()
Register SFD module.
Definition: sfd.f:11
subroutine sfd_forcing(ffx, ffy, ffz, ix, iy, iz, ieg)
Calcualte SFD forcing.
Definition: sfd.f:377
subroutine sfd_end
Finalise SFD.
Definition: sfd.f:287
subroutine sfd_init()
Initialise SFD module.
Definition: sfd.f:101
Warning
This module's restart prosedure depends on multistep checkpointing. As multisetep checpointeing sets the number of the restart file set chkpt_main must be called before sfd_main.
Module parameters:
Global parameter list:
Parameters provided by sfd module (include file - SFDD):
Varaible Type Runtime parameter Description
sfd_dlt real _sfd:FilterWdth filter width
sfd_chi real _sfd:ControlCff control coefficient
sfd_tol real _sfd:ResidualTol tolerance for residual
sfd_cnv integer _sfd:LogInterval frequency for logging convegence data
sfd_ifrst logical _sfd:SFDReadChkpt SFD; restat from checkpoint
Global parameter dependency:
Parameters required by sfd module:
  1. Checkpointing routines :
    • _chkpt:readchkpt - start simulation form checkpoint
    • _chkpt:chkpFnumber - restart file number
    • _chkpt:chkpInterval - checkpiont dump frequency (number of time steps)
  2. Nek5000
    • PARAM(27)
    • IFTRAN
    • IFPERT
Module parameter usage:
[_SFD]
runsfd = yes
filtwdth = 1.05
controlcff = 0.5
residualtol = 0.1E-06
loginterval = 50

Function Documentation

◆ sfd_end()

subroutine sfd_end

Finalise SFD.

Note
This routine should be called in frame_usr_end

Definition at line 286 of file sfd.f.

References mntr_log(), mntr_logr(), mntr_tmr_add(), and outpost2().

+ Here is the call graph for this function:

◆ sfd_forcing()

subroutine sfd_forcing ( real  ffx,
real  ffy,
real  ffz,
integer  ix,
integer  iy,
integer  iz,
integer  ieg 
)

Calcualte SFD forcing.

Parameters
[in,out]ffx,ffy,ffzforcing; x,y,z component
[in]ix,iy,izGLL point index
[in]iegglobal element number

Definition at line 376 of file sfd.f.

References gllel().

+ Here is the call graph for this function:

◆ sfd_init()

subroutine sfd_init

Initialise SFD module.

Note
This routine should be called in frame_usr_init

Definition at line 100 of file sfd.f.

References io_file_freeid(), mntr_abort(), mntr_check_abort(), mntr_mod_is_name_reg(), mntr_tmr_add(), mntr_warn(), opcopy(), opsub3(), rprm_rp_get(), rprm_rp_is_name_reg(), rprm_sec_is_name_reg(), rzero(), and sfd_rst_read().

+ Here is the call graph for this function:

◆ sfd_is_initialised()

logical function sfd_is_initialised

Check if module was initialised.

Returns
sfd_is_initialised

Definition at line 272 of file sfd.f.

◆ sfd_main()

subroutine sfd_main

Main SFD interface.

Definition at line 362 of file sfd.f.

References sfd_rst_write(), and sfd_solve().

+ Here is the call graph for this function:

◆ sfd_mfi()

subroutine sfd_mfi ( character*132  fname)

Load SFD restart file.

This rouotine is version of mfi adjusted ofr SFD restart.

Parameters
[in]fnamefile name
Note
This routine uses standard header reader and cannot pass additiona information in the file. That is why I read whole lag spce irrespective of sfd_nsnap value.
Remarks
This routine uses global scratch space SCRUZ.

Definition at line 800 of file sfd.f.

References chkptms_map_gll(), io_mbyte_close(), io_mfiv(), mfi_prepare(), mntr_abort(), mntr_check_abort(), mntr_log(), mntr_logi(), and mntr_logr().

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

◆ sfd_mfo()

subroutine sfd_mfo ( character*132  fname)

Store SFD restart file.

This rouotine is version of mfo_outfld adjusted for SFD restart.

Parameters
[in]fnamefile name
Note
This routine uses standard header wirter so cannot pass additional information in the file header. That is why I save whole lag spce irrespective of chpm_nsnap value.

Definition at line 714 of file sfd.f.

References io_mbyte_close(), io_mbyte_open(), io_mfov(), mfo_write_hdr(), mntr_check_abort(), mntr_log(), mntr_logi(), and mntr_logr().

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

◆ sfd_register()

subroutine sfd_register

Register SFD module.

Note
This routine should be called in frame_usr_register

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

◆ sfd_rst_read()

subroutine sfd_rst_read

Read from checkpoint.

Remarks
This routine uses global scratch space SCRUZ.

Definition at line 646 of file sfd.f.

References io_init(), io_mfo_fname(), mntr_check_abort(), mntr_log(), opcopy(), and sfd_mfi().

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

◆ sfd_rst_write()

subroutine sfd_rst_write

Create checkpoint.

Definition at line 550 of file sfd.f.

References chkpt_get_fset(), io_init(), io_mfo_fname(), mntr_check_abort(), mntr_get_step_delay(), mntr_log(), mntr_tmr_add(), and sfd_mfo().

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

◆ sfd_solve()

subroutine sfd_solve

Update filtered velocity field.

Sum up contributions to kth order extrapolation scheme and get new filtered velocity field. This subroutine is based on makeabf and makebdf

Remarks
This routine uses global scratch space SCRUZ.

Definition at line 405 of file sfd.f.

References add2s1(), add3s2(), copy(), mntr_log(), mntr_logr(), mntr_set_conv(), mntr_tmr_add(), opadd2cm(), opcmult(), opcopy(), and opsub3().

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