SpectralRadius Function

public function SpectralRadius(ql, qr, inputs, c1, c2)

Calculate the spectral radius

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(1:n_var):: ql
real(kind=wp), intent(in), dimension(1:n_var):: qr
real(kind=wp), intent(in), dimension(1:7):: inputs
real(kind=wp), intent(in), dimension(1:3):: c1
real(kind=wp), intent(in), dimension(1:3):: c2

Return Value real(kind=wp)


Called by

proc~~spectralradius~2~~CalledByGraph proc~spectralradius~2 SpectralRadius proc~update_sa_variables~2 update_SA_variables proc~update_sa_variables~2->proc~spectralradius~2 proc~update_kkl_variables update_KKL_variables proc~update_kkl_variables->proc~spectralradius~2 proc~update_sst_variables~2 update_SST_variables proc~update_sst_variables~2->proc~spectralradius~2 proc~update_lctm2015~2 update_lctm2015 proc~update_lctm2015~2->proc~spectralradius~2 proc~update_laminar_variables~2 update_laminar_variables proc~update_laminar_variables~2->proc~spectralradius~2 proc~update_with_lusgs update_with_lusgs proc~update_with_lusgs->proc~update_sa_variables~2 proc~update_with_lusgs->proc~update_kkl_variables proc~update_with_lusgs->proc~update_sst_variables~2 proc~update_with_lusgs->proc~update_lctm2015~2 proc~update_with_lusgs->proc~update_laminar_variables~2 proc~get_next_solution get_next_solution proc~get_next_solution->proc~update_with_lusgs proc~iterate_one_more_time_step iterate_one_more_time_step proc~iterate_one_more_time_step->proc~get_next_solution program~main main program~main->proc~iterate_one_more_time_step

Contents

Source Code


Source Code

    function SpectralRadius(ql, qr, inputs, c1, c2)
      !< Calculate the spectral radius 
      implicit none
      real(wp), dimension(1:n_var), intent(in) :: ql
      real(wp), dimension(1:n_var), intent(in) :: qr
      real(wp), dimension(1:7)    , intent(in) :: inputs
      real(wp), dimension(1:3)    , intent(in) :: c1
      real(wp), dimension(1:3)    , intent(in) :: c2

      ! 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 = gm * (mm/pr + tm/tpr) / ( rho * distance )
      SpectralRadius = ( NormalSpeed + SpeedOfSound + vis) * Area

    end function SpectralRadius