This subroutine load data for standard plane sponge layer Example:
spatial = {
-- supported options: 'spongelayer_plane', 'spongelayer_plane_1d',
-- 'spongelayer_plane_2d', 'viscous_spongelayer_plane'
predefined = 'spongelayer',
origin = {0.0,0.0,0.0},
normal = {1.0, 0.0, 0.0},
thickness = 0.5,
damp_profile = 'linear', --'exponential', 'polynomial_n5', 'polynomial_n6'
damp_factor = 0.5,
damp_exponent = 1.0,
target_state = {
Default: density, velocityX, velocityY, velocityZ and pressure
density = 1.0,
pressure = 1.0,
velocityX = 0.0, velocityY = 0.0, velocityZ = 0.0
}
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_spongeLayer_plane_type), | intent(out) | :: | me |
Plane spongeLayer data type |
||
type(flu_State) | :: | conf |
lua state type |
|||
integer, | intent(in) | :: | thandle |
aotus parent handle |
||
integer, | intent(in) | :: | nDim |
number of Dimension for nonViscous sponges |
||
integer, | intent(in) | :: | nComp |
Number of component of St-Fun variable under which this spatial function is defined |
||
character(len=*), | intent(in), | optional | :: | stateName |
Load stateName from target_state table |
subroutine tem_load_spongeLayer_plane(me, conf, thandle, ndim, nComp, & & stateName) ! -------------------------------------------------------------------------- !> Plane spongeLayer data type type(tem_spongeLayer_plane_type), intent(out) :: me !> lua state type type(flu_State) :: conf !> aotus parent handle integer, intent(in) :: thandle !> number of Dimension for nonViscous sponges integer, intent(in) :: nDim !> Number of component of St-Fun variable under which this spatial function !! is defined integer, intent(in) :: nComp !> Load stateName from target_state table character(len=*), intent(in), optional :: stateName ! -------------------------------------------------------------------------- integer :: vError(3), errfatal(3) real(kind=rk) :: thickness ! -------------------------------------------------------------------------- errfatal = aotErr_Fatal ! Plane_origin call aot_get_val( L = conf, & & thandle = thandle, & & key = 'origin', & & val = me%origin, & & ErrCode = vError ) if (any(btest( vError, errFatal )) ) then write(logUnit(1),*) 'ERROR reading the plane_origin of sponge layer. ' & & // 'It should have 3 entries for each coordinate.' call tem_abort() end if write(logUnit(1),*) ' * Origin =', me%origin ! Plane_normal call aot_get_val( L = conf, & & thandle = thandle, & & key = 'normal', & & val = me%normal, & & ErrCode = vError ) if (any(btest( vError, errFatal )) ) then write(logUnit(1),*) 'ERROR reading the plane_normal of sponge layer. ' & & // 'It should have 3 entries for each coordinate.' call tem_abort() end if write(logUnit(1),*) ' * Normal =', me%normal ! Compute thickness from normal and use it only if thickness is not ! defined seperately. thickness = sqrt(me%normal(1)**2 + me%normal(2)**2 + me%normal(3)**2) ! Normalize the normal me%normal = me%normal/thickness write(logUnit(1),*) ' * Normalized normal =', me%normal ! Load base information required for sponge layer definition like ! damp_factor, damp_exponent and target_state call load_spongeLayer( conf = conf, & & thandle = thandle, & & me = me%spongeLayer_base_type, & & nDim = nDim, & & nComp = nComp, & & stateName = stateName, & & thickness = thickness ) end subroutine tem_load_spongeLayer_plane