Calculated spectral radius
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(1:n_var) | :: | ql | left state |
|
real(kind=wp), | intent(in), | dimension(1:n_var) | :: | qr | right state |
|
real(kind=wp), | intent(in), | dimension(1:7) | :: | inputs | ||
real(kind=wp), | intent(in), | dimension(1:3) | :: | c1 | cell center 1 |
|
real(kind=wp), | intent(in), | dimension(1:3) | :: | c2 | cell center 2 |
|
real(kind=wp), | intent(in) | :: | eps |
function SpectralRadius(ql, qr, inputs, c1, c2,eps)
!< Calculated spectral radius
implicit none
real(wp), dimension(1:n_var), intent(in) :: ql!<left state
real(wp), dimension(1:n_var), intent(in) :: qr!<right state
real(wp), dimension(1:7) , intent(in) :: inputs
real(wp), dimension(1:3) , intent(in) :: c1!<cell center 1
real(wp), dimension(1:3) , intent(in) :: c2!<cell center 2
real(wp) , intent(in) :: eps
! local variables
real(wp) :: SpectralRadius
real(wp) :: NormalSpeed
real(wp) :: SpeedOfSound
real(wp) :: vis
real(wp) :: mu
real(wp) :: rho
real(wp) :: distance
!extract inputs
real(wp) :: Area
real(wp) :: nx
real(wp) :: ny
real(wp) :: nz
real(wp) :: volume
real(wp) :: mm
real(wp) :: tm
Area = inputs(1)
nx = inputs(2)
ny = inputs(3)
nz = inputs(4)
volume = inputs(5)
mm = inputs(6)
tm = inputs(7)
! in state vector q (2-4) are the cell center velocity
NormalSpeed = 0.5 * ( ( ( ql(2) + qr(2) ) * nx ) &
+ ( ( ql(3) + qr(3) ) * ny ) &
+ ( ( ql(4) + qr(4) ) * nz ) &
)
NormalSpeed = abs(NormalSpeed)
SpeedOfSound = 0.5*( sqrt(gm*ql(5)/ql(1)) + sqrt(gm*qr(5)/qr(1)) )
! visocus part
mu = mm/Pr + tm/tPr
rho = 0.5*( ql(1) + qr(1) )
distance = sqrt((c1(1)-c2(1))**2 + (c1(2)-c2(2))**2 +(c1(3)-c2(3))**2)
vis = 2.0* gm * (mm/pr + tm/tpr) / ( rho * distance )
SpectralRadius = ( 0.5*((1.0+eps)*NormalSpeed &
+ sqrt(((eps-1.0)**2)*(NormalSpeed**2) &
+ 4*eps*(SpeedOfSound**2))) + vis) * Area
end function SpectralRadius