BuildSysPro.IBPSA.Fluid.HeatExchangers.BaseClasses.determineWaterIndex

# .BuildSysPro.IBPSA.Fluid.HeatExchangers.BaseClasses.determineWaterIndex

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.

#### Interface

>     function determineWaterIndex
>       input String[:] substanceNames "Names of substances of media";
>       output Integer idxWat "Index of water";
>     end determineWaterIndex;

## 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.

Generated at 2026-05-12T20:19:03Z by OpenModelicaOpenModelica 1.26.7 using GenerateDoc.mos