SpectralRadius Function

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

Calculated spectral radius

Arguments

Type IntentOptional AttributesName
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

Return Value real(kind=wp)


Called by

proc~~spectralradius~~CalledByGraph proc~spectralradius SpectralRadius proc~update_sst_variables update_SST_variables proc~update_sst_variables->proc~spectralradius proc~update_sa_variables update_SA_variables proc~update_sa_variables->proc~spectralradius proc~update_laminar_variables update_laminar_variables proc~update_laminar_variables->proc~spectralradius proc~update_lctm2015 update_lctm2015 proc~update_lctm2015->proc~spectralradius proc~update_with_plusgs update_with_plusgs proc~update_with_plusgs->proc~update_sst_variables proc~update_with_plusgs->proc~update_sa_variables proc~update_with_plusgs->proc~update_laminar_variables proc~update_with_plusgs->proc~update_lctm2015 proc~get_next_solution get_next_solution proc~get_next_solution->proc~update_with_plusgs 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,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