Ejemplo n.º 1
0
        public ThermoState getStateFromTempDensity(double tmp, double dens)
        {
            StringVector outputs = new StringVector(new string[] {
                "P",
                "U",
                "H",
                "L",
                "V",
                "C"
            });
            DoubleVector temps = new DoubleVector(new double[] { tmp + 273.15 });
            DoubleVector dmass = new DoubleVector(new double[] { dens });

            double[] result = CoolProp.PropsSImulti(outputs, "T", temps, "D", dmass, propsDatabase, new StringVector(new string[] { FluidName }), new DoubleVector(new double[] { 1 }))[0].ToArray();
            return(new ThermoState(tmp, result[0] * 0.001, result[2] * 0.001, dens, result[1] * 0.001, result[3], result[4], result[5]));
        }
Ejemplo n.º 2
0
        public ThermoState getStateFromInternDensity(double internalenergy, double dens)
        {
            StringVector outputs = new StringVector(new string[] {
                "T",
                "P",
                "H",
                "L",
                "V",
                "C"
            });
            DoubleVector umass = new DoubleVector(new double[] { internalenergy * 1000 });
            DoubleVector dmass = new DoubleVector(new double[] { dens });

            double[] result = CoolProp.PropsSImulti(outputs, "U", umass, "D", dmass, propsDatabase, new StringVector(new string[] { FluidName }), new DoubleVector(new double[] { 1 }))[0].ToArray();
            return(new ThermoState(result[0] - 273.15, result[1] * 0.001, result[2] * 0.001, dens, internalenergy, result[3], result[4], result[5]));
        }