Example #1
0
    /*
     * public static int region_given_pvt(double p, double v, double t)
     * {
     * IF97.IF97REGIONS r = IF97.RegionDetermination_TP(t, p/1000000.0);
     * switch(r)
     * {
     *  case 1: //liquid
     *    return 0; //subcooled liquid
     *  case 2: //vapor
     *    return 2; //superheated vapor
     *  case 3:
     *  case 4: //two-phase
     *  case 5:
     *    return 1; //two-phase
     * }
     * return -1;
     * }
     */
    public static int region_given_ph(double p, double h)
    {
        int r = IF97.Region_ph(p / 1000000.0, h / 1000.0);

        switch (r)
        {
        case 1:        //liquid
            return(0); //subcooled liquid

        case 2:        //vapor
            return(2); //superheated vapor

        case 3:
        case 4:        //two-phase
        case 5:
            return(1); //two-phase
        }
        return(-1);
    }