update_thermo_from_temperature_cantera Subroutine

private subroutine update_thermo_from_temperature_cantera(mesh, params, energy, species_Y)

Update h, cp, lambda, and diagnostic thermo density from current T.

Arguments

Type IntentOptional Attributes Name
type(mesh_t), intent(in) :: mesh
type(case_params_t), intent(in) :: params
type(energy_fields_t), intent(inout) :: energy
real(kind=rk), intent(in), optional :: species_Y(:,:)

Calls

proc~~update_thermo_from_temperature_cantera~~CallsGraph proc~update_thermo_from_temperature_cantera mod_energy::update_thermo_from_temperature_cantera interface~cantera_update_thermo_c mod_energy::cantera_update_thermo_c proc~update_thermo_from_temperature_cantera->interface~cantera_update_thermo_c proc~build_c_species_names mod_energy::build_c_species_names proc~update_thermo_from_temperature_cantera->proc~build_c_species_names proc~build_thermo_y mod_energy::build_thermo_Y proc~update_thermo_from_temperature_cantera->proc~build_thermo_y proc~fatal_error mod_kinds::fatal_error proc~update_thermo_from_temperature_cantera->proc~fatal_error proc~build_thermo_y->proc~fatal_error

Called by

proc~~update_thermo_from_temperature_cantera~~CalledByGraph proc~update_thermo_from_temperature_cantera mod_energy::update_thermo_from_temperature_cantera proc~initialize_energy mod_energy::initialize_energy proc~initialize_energy->proc~update_thermo_from_temperature_cantera program~lowmach_react_hex lowmach_react_hex program~lowmach_react_hex->proc~initialize_energy

Source Code

   subroutine update_thermo_from_temperature_cantera(mesh, params, energy, species_Y)
      type(mesh_t), intent(in) :: mesh
      type(case_params_t), intent(in) :: params
      type(energy_fields_t), intent(inout) :: energy
      real(rk), intent(in), optional :: species_Y(:,:)

      integer :: n_len
      real(rk), allocatable :: P_arr(:), Y_local(:,:)
      character(kind=c_char), allocatable :: c_names_flat(:)

      if (.not. params%enable_cantera_thermo) return

      if (params%nspecies <= 0) then
         call fatal_error('energy', 'enable_cantera_thermo requires at least one inert thermo species')
      end if

      allocate(P_arr(mesh%ncells))
      P_arr = params%background_press
      call build_thermo_Y(params, mesh%ncells, Y_local, species_Y)
      call build_c_species_names(params, c_names_flat, n_len)

      call cantera_update_thermo_c(mesh%ncells, energy%T, P_arr, params%nspecies, Y_local, &
                                   energy%h, energy%cp, energy%lambda, energy%rho_thermo, &
                                   params%energy_reference_T, c_names_flat, n_len)

      deallocate(P_arr)
      deallocate(Y_local)
      deallocate(c_names_flat)
   end subroutine update_thermo_from_temperature_cantera