functiondetermineWaterIndex

Determine the index of water in a 2-component medium model

Information

Given an array of strings representing substance names, this function returns the integer index of the substance named "water" (case-insensitive).

This function is useful to automate lookup up the index of water within a media so as to avoid hard-coding or guessing what the index will be. Typically, this function would be run once at initialization time.

Inputs

TypeNameDefaultDescription
StringsubstanceNamesNames of substances of media

Outputs

TypeNameDefaultDescription
IntegeridxWatIndex of water

Revisions

  • April 19, 2017, by Michael Wetter:
    Removed assertion as function is valid also for other values than N==2.
  • March 17, 2017, by Michael O'Keefe:
    First implementation.