radiation_compute_spectral_test Subroutine

public subroutine radiation_compute_spectral_test(mesh, context, state, source, source_scale)

Arguments

Type IntentOptional Attributes Name
type(mesh_t), intent(in) :: mesh
type(radiation_context_t), intent(in) :: context
type(radiation_state_t), intent(in) :: state
type(radiation_source_t), intent(inout) :: source
real(kind=rk), intent(in) :: source_scale

Source Code

   subroutine radiation_compute_spectral_test(mesh, context, state, source, source_scale)
      type(mesh_t), intent(in) :: mesh
      type(radiation_context_t), intent(in) :: context
      type(radiation_state_t), intent(in) :: state
      type(radiation_source_t), intent(inout) :: source
      real(rk), intent(in) :: source_scale
      integer :: c, j, s
      real(rk) :: y_weight, spectral_weight

      source%qrad = zero
      if (context%n_wavenumbers <= 0) return
      spectral_weight = source_scale / real(max(1, context%n_wavenumbers), rk)

      do j = context%wn_first, context%wn_last
         if (j <= 0) cycle
         do c = 1, mesh%ncells
            y_weight = 1.0_rk
            if (allocated(state%Y) .and. state%n_species > 0) then
               y_weight = zero
               do s = 1, state%n_species
                  y_weight = y_weight + max(zero, state%Y(s, c))
               end do
            end if
            source%qrad(c) = source%qrad(c) + spectral_weight * y_weight
         end do
      end do
   end subroutine radiation_compute_spectral_test