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
| Type | Name | Default | Description |
|---|---|---|---|
| String | substanceNames | Names of substances of media |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | idxWat | Index of water |
Revisions
-
April 19, 2017, by Michael Wetter:
Removed assertion as function is valid also for other values thanN==2. -
March 17, 2017, by Michael O'Keefe:
First implementation.