mod_species_composition Module

Named composition parser for user-facing species input.

Supports strings such as "CH4:1.0,O2:0.233,N2:0.767" and maps the names into the solver/Cantera species ordering. This avoids fragile assumptions about numeric species indices when a mechanism such as GRI30 dynamically defines the transported species list.



Functions

public function composition_string_is_set(text)

Returns true if the composition input string is populated and non-empty.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: text

String representation of initial composition to test.

Return Value logical


Subroutines

public subroutine parse_named_composition(text, species_names, nspecies, values, owner, normalize, require_sum_positive)

Systematically parses a composition string and maps values to species array indexes.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: text

The composition input string to parse.

character(len=*), intent(in) :: species_names(:)
integer, intent(in) :: nspecies

Number of active species.

real(kind=rk), intent(out) :: values(:)
character(len=*), intent(in) :: owner

Name of the calling subsystem for error traceback.

logical, intent(in), optional :: normalize

Optional flag to normalize values to sum to 1.0 (default true).

logical, intent(in), optional :: require_sum_positive

Optional flag to mandate a non-zero sum (default true).