KTH framework for Nek5000 toolboxes; testing version  0.0.1

Sponge/fringe for simple box mesh. More...

+ Collaboration diagram for Sponge box:

Files

file  spnb.f
 Sponge/fringe for simple box mesh.
 

Functions

subroutine spnb_register ()
 Register sponge box module. More...
 
subroutine spnb_init (lvx, lvy, lvz)
 Initilise sponge box module. More...
 
logical function spnb_is_initialised ()
 Check if module was initialised. More...
 
subroutine spnb_forcing (ffx, ffy, ffz, ix, iy, iz, ieg)
 Get sponge forcing. More...
 

Detailed Description

Sponge/fringe for simple box mesh.

Set of routines to apply sponge (fringe in periodic domains) for simple box mesh. It calculates a volume forcing

\[ \vec F = \lambda(x) \left( \vec U - \vec u\right),\]

with $ \lambda(x) $ being non-negative sponge/fringe function, $ \vec U$ and $ \vec u$ being constant in time reference velocity field and current velocity field respectively. 1-dimensional sponge function is defined as

\[ \lambda(x) = \lambda_{max} * \left[ S\left((x_{min} - x) / \left(\Delta_{wl} - \Delta_{dl} \right)\right) + S\left((x - x_{max}) / \left(\Delta_{wr} - \Delta_{dr} \right)\right) \right],\]

where:

In our implementation each dimension is treated separately and the final 3-dimensional function takes a maximum value of its 1-dimensional components. $ \Delta_{wl}$ and $ \Delta_{wr} $ can be set to zero.

Todo:
Add a figure to make parameter section clearer.
Module interface:
Global interface list:
Interface provided:
  1. spnb_register
  2. spnb_init
  3. spnb_forcing
  4. spnb_is_initialised
Global interface dependency:
Interface required:
  1. multiple interfaces from Runtime parameters and Monitoring module modules
  2. math_stepf from Math module
Module interface usage:
subroutine userf (ix,iy,iz,ieg)
include 'SIZE'
include 'NEKUSE' ! FF[XYZ]
ffx = 0.0
ffy = 0.0
ffz = 0.0
! add sponge
call spnb_forcing(ffx,ffy,ffz,ix,iy,iz,ieg)
return
end
!-----------------------------------------------------------------------
subroutine userchk
implicit none
include 'SIZE'
include 'TSTEP'
! start framework
if (istep.eq.0) call frame_start
! monitor simulation
! 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 'SOLN'
include 'FRAMELP'
!-----------------------------------------------------------------------
! initialise modules
! initialise sponge box module with reference velocities
! (in this case initial condition)
call spnb_init(vx, vy, vz)
return
end subroutine
!======================================================================
subroutine frame_usr_end
implicit none
include 'SIZE'
include 'FRAMELP'
!-----------------------------------------------------------------------
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 spnb_init(lvx, lvy, lvz)
Initilise sponge box module.
Definition: spnb.f:123
subroutine spnb_forcing(ffx, ffy, ffz, ix, iy, iz, ieg)
Get sponge forcing.
Definition: spnb.f:350
subroutine spnb_register()
Register sponge box module.
Definition: spnb.f:11
Module parameters:
Global parameter list:
Parameters provided by sponge box module (include file - SPNBD):
Varaible Type Runtime parameter Default value Description
spnb_str real _spnb:strenght 0.0 sponge strength
spnb_wl(1) real _spnb:widthlx 0.0 sponge left section width; dimension X
spnb_wl(2) real _spnb:widthly 0.0 sponge left section width; dimension Y
spnb_wl(3) real _spnb:widthlz 0.0 sponge left section width; dimension Z
spnb_wr(1) real _spnb:widthrx 0.0 sponge right section width; dimension X
spnb_wr(2) real _spnb:widthry 0.0 sponge right section width; dimension Y
spnb_wr(3) real _spnb:widthrz 0.0 sponge right section width; dimension Z
spnb_dl(1) real _spnb:droplx 0.0 sponge left drop/rise section width; dimension X
spnb_dl(2) real _spnb:droply 0.0 sponge left drop/rise section width; dimension Y
spnb_dl(3) real _spnb:droplz 0.0 sponge left drop/rise section width; dimension Z
spnb_dr(1) real _spnb:droprx 0.0 sponge right drop/rise section width; dimension X
spnb_dr(2) real _spnb:dropry 0.0 sponge right drop/rise section width; dimension Y
spnb_dr(3) real _spnb:droprz 0.0 sponge right drop/rise section width; dimension Z
Module parameter usage:
[_SPNB]
strength = 1.0
widthlx = 4.0
widthly = 0.0
widthlz = 0.0
widthrx = 4.0
widthry = 0.0
widthrz = 0.0
droplx = 2.0
droply = 0.0
droplz = 0.0
droprx = 2.0
dropry = 0.0
droprz = 0.0

Function Documentation

◆ spnb_forcing()

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

Get sponge forcing.

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

Definition at line 349 of file spnb.f.

References gllel().

+ Here is the call graph for this function:

◆ spnb_init()

subroutine spnb_init ( real, dimension(lx1*ly1*lz1*lelv)  lvx,
real, dimension(lx1*ly1*lz1*lelv)  lvy,
real, dimension(lx1*ly1*lz1*lelv)  lvz 
)

Initilise sponge box module.

Parameters
[in]lvx,lvy,lvzvelocity field to be stored as reference field
Note
This routine should be called in frame_usr_init
Remarks
This routine uses global scratch space SCRUZ

Definition at line 122 of file spnb.f.

References copy(), mntr_abort(), mntr_log(), mntr_tmr_add(), mntr_warn(), outpost2(), rprm_rp_get(), and rzero().

+ Here is the call graph for this function:

◆ spnb_is_initialised()

logical function spnb_is_initialised

Check if module was initialised.

Returns
spnb_is_initialised

Definition at line 333 of file spnb.f.

◆ spnb_register()

subroutine spnb_register

Register sponge box module.

Note
This routine should be called in frame_usr_register

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