Apply a one-time spherical ignition kernel during initialization.
The current first version supports one spherical overwrite kernel. It is skipped automatically for restart runs so restart state is not modified by fresh-run initialization controls.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh | |||
| type(flow_mpi_t), | intent(in) | :: | flow | |||
| type(case_params_t), | intent(in) | :: | params | |||
| type(species_fields_t), | intent(inout) | :: | species | |||
| type(energy_fields_t), | intent(inout) | :: | energy |
subroutine apply_ignition_kernel(mesh, flow, params, species, energy) type(mesh_t), intent(in) :: mesh type(flow_mpi_t), intent(in) :: flow type(case_params_t), intent(in) :: params type(species_fields_t), intent(inout) :: species type(energy_fields_t), intent(inout) :: energy integer :: c, affected_cells real(rk) :: delta(3), radius2 real(rk) :: kernel_Y(max_species) logical :: set_composition if (.not. params%enable_ignition_kernel) return if (.not. params%enable_energy) return if (.not. energy%initialized) return affected_cells = 0 radius2 = params%ignition_kernel_radius * params%ignition_kernel_radius set_composition = .false. kernel_Y = zero if (params%enable_species .and. species%nspecies > 0 .and. & composition_string_is_set(params%ignition_kernel_composition)) then call parse_named_composition(params%ignition_kernel_composition, species%names, species%nspecies, & kernel_Y, 'ignition_kernel_composition', & normalize=.true., require_sum_positive=.true.) set_composition = .true. end if do c = 1, mesh%ncells delta = mesh%cells(c)%center - params%ignition_kernel_center if (dot_product(delta, delta) <= radius2) then energy%T(c) = params%ignition_kernel_T if (set_composition) species%Y(1:species%nspecies, c) = kernel_Y(1:species%nspecies) affected_cells = affected_cells + 1 end if end do if (set_composition) then species%Y_old = species%Y species%rhs_old = zero species%rhs_old_valid = .false. end if if (flow%rank == 0) then write(output_unit,'(a,i0,a,es12.5,a,3(1x,es12.5))') & 'Ignition kernel initialized: cells=', affected_cells, & ' T=', params%ignition_kernel_T, ' center=', params%ignition_kernel_center end if end subroutine apply_ignition_kernel