load crvp variables to set initial condition
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | conf |
lua state type |
|||
integer, | intent(in) | :: | thandle |
aotus parent handle |
||
type(ic_2dcrvp_type), | intent(out) | :: | me |
Global gauss pulse data type |
subroutine load_ic_2dcrvp( conf, thandle, me )
! ---------------------------------------------------------------------------
!> lua state type
type(flu_State) :: conf
!> aotus parent handle
integer, intent(in) :: thandle
!> Global gauss pulse data type
type(ic_2dcrvp_type), intent(out) :: me
! ---------------------------------------------------------------------------
integer :: cent_handle
integer :: i
integer :: iError
! ---------------------------------------------------------------------------
!center
call aot_table_open( L = conf, &
& parent = thandle, &
& thandle = cent_handle, &
& key = 'center' )
if (aot_table_length(L=conf, thandle=cent_handle) == 3) then
do i=1,3
call aot_get_val( L = conf, &
& thandle = cent_handle, &
& pos = i, &
& val = me%center(i), &
& ErrCode = iError)
end do
else
write(*,*) 'ERROR while reading the center of a vortices,'
write(*,*) 'should have 3 entries for each coordinate!'
STOP
end if
call aot_table_close(conf, cent_handle)
write(logUnit(1),*) ' * center =', me%center
! get physical time steps dx and dt
call aot_get_val( L = conf, &
& thandle = thandle, &
& key = 't', &
& val = me%t, &
& ErrCode = iError, &
& default = 0._rk )
call aot_get_val( L = conf, &
& thandle = thandle, &
& key = 'kappa', &
& val = me%kappa, &
& ErrCode = iError, &
& default = 1._rk )
call aot_get_val( L = conf, &
& thandle = thandle, &
& key = 'p0', &
& val = me%p0, &
& ErrCode = iError, &
& default = 0._rk )
call aot_get_val( L = conf, &
& thandle = thandle, &
& key = 'rho0', &
& val = me%rho0, &
& ErrCode = iError, &
& default = 1._rk )
call aot_get_val( L = conf, &
& thandle = thandle, &
& key = 'cs', &
& val = me%cs, &
& ErrCode = iError )
if(( iError .gt. 0 )) then
if( me%p0 .le. 0._rk ) then
write(logUnit(1),*)' No speed of sound is given and the reference '
write(logUnit(1),*)' pressure for CRVP is 0. Choose > 0! '
write(logUnit(1),*)' Either give the speed of sound cs = ... or use '
write(logUnit(1),*)' a reference pressure > 0'
call tem_abort
end if
me%cs = sqrt( me%kappa*me%p0/me%rho0 )
end if
if( me%cs .le. 0._rk ) then
write(logUnit(1),*)' Error: Speed of sound <= 0 '
call tem_abort
end if
! Gaussian vortex core model for pressure
call aot_get_val( L = conf, &
& thandle = thandle, &
& key = 'gpmodel', &
& val = me%pressGaussModel, &
& ErrCode = iError, &
& default = .true. )
me%matchFactor = 2.2_rk
if( me%pressGaussModel ) then
write(logUnit(1),*) ' * gaussian model for pressure in rC'
else
write(logUnit(1),*) ' * no model for pressure in rC'
end if
! Rankine vortex core model for velocity
call aot_get_val( L = conf, &
& thandle = thandle, &
& key = 'rankine', &
& val = me%rankineModel, &
& ErrCode = iError, &
& default = .true. )
if( me%rankineModel ) then
write(logUnit(1),*) ' * Rankine vortex core model'
end if
!halfwidth
call aot_get_val( L = conf, &
& thandle = thandle, &
& key = 'radius_rot', &
& val = me%radius_rot, &
& ErrCode = iError )
write(logUnit(1),*) ' * radius_rot =', me%radius_rot
me%radius_C = me%radius_rot / 3._rk
!amplitude
call aot_get_val( L = conf, &
& thandle = thandle, &
& key = 'circulation', &
& val = me%circulation, &
& ErrCode = iError )
write(logUnit(1),*) ' * circulation =', me%circulation
me%Ma = me%circulation/(4._rk*pi*me%radius_rot*me%cs)
! some more info to the crvp initialization
write(logUnit(1),*) ' * Ma_rot =', me%Ma
! Set the cutoff definition
call aot_get_val( L = conf, &
& thandle = thandle, &
& key = 'cutoff_length', &
& val = me%cutoff%length, &
& ErrCode = iError )
if ( btest( iError, aotErr_NonExistent ) ) then
me%cutoff%active = .false.
else
me%cutoff%active = .true.
endif
!me%cutoff%r_min = 0.6_rk
!me%cutoff%r_max = 0.95_rk
call aot_get_val( L = conf, &
& thandle = thandle, &
& key = 'cutoff_rmin', &
& val = me%cutoff%r_min, &
& ErrCode = iError, &
& default = huge(me%cutoff%r_min))
call aot_get_val( L = conf, &
& thandle = thandle, &
& key = 'cutoff_rmax', &
& val = me%cutoff%r_max, &
& ErrCode = iError, &
& default = huge(me%cutoff%r_max))
if( me%cutoff%active ) then
me%cutoff%linear = .false.
me%cutoff%quadratic = .true.
write(logUnit(1),*)' * Cutoff length = ', me%cutoff%length
if( me%cutoff%linear ) then
write(logUnit(1),*)' * Cutoff progress linear'
end if
if( me%cutoff%quadratic ) then
write(logUnit(1),*)' * Cutoff progress quadratic'
end if
endif
end subroutine load_ic_2dcrvp