Esempio n. 1
0
        public void Init()
        {
            m_brs = new BasicReactionSupporter();
            m_computedVaporPressureIn = new Hashtable();

            string testDataDir = (Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? ".") + @"\TestData\";

            _propertiesFile = testDataDir + @"\PureComponentProperties.csv";
            Assert.IsTrue(File.Exists(_propertiesFile), "Properties data file not found - " + _propertiesFile);

            _testDataFile = testDataDir + @"\emissionTest_12345-10.xml";
            Assert.IsTrue(File.Exists(_testDataFile), "Test data file not found - " + _testDataFile);


            string[][] data = Load(_propertiesFile);

            foreach (string[] row in data)
            {
                string name                = row[0];
                string chemAbstractNum     = row[1];
                string classification      = row[2];
                double densityGramPerLiter = double.Parse(row[3]);
                double densityLbsPerGal    = double.Parse(row[4]);
                double molWt               = double.Parse(row[5]);
                //double diffusivityInAir = double.Parse(row[6]);
                string henrysLawConstant = row[7];
                string antoineA          = row[8];
                string antoineB          = row[9];
                string antoineC          = row[10];
                double calcVPmmhg        = double.Parse(row[11]);
                double calcVP_psi        = double.Parse(row[12]);

                double       specGrav = densityGramPerLiter / 1000.0;           // kg/liter equiv to SpecGrav.
                MaterialType mt       = new MaterialType(null, name, Guid.NewGuid(), specGrav, 1.0, MaterialState.Liquid, molWt, 1.0);
                if (antoineA != "" && antoineB != "" && antoineC != "")
                {
                    mt.SetAntoinesCoefficients3(double.Parse(antoineA), double.Parse(antoineB), double.Parse(antoineC), PressureUnits.mmHg, TemperatureUnits.Celsius);
                }

                if (mt.Name.Equals("Hydrazine"))
                {
                    mt.SetAntoinesCoefficientsExt(76.858, -7245.2, 0, 0, -8.22, .0061557, 1, double.NaN, double.NaN);
                }
                m_brs.MyMaterialCatalog.Add(mt);
                m_computedVaporPressureIn.Add(mt.Name, calcVPmmhg);
            }

            MaterialType mt2 = new MaterialType(null, "Unknown", Guid.NewGuid(), 1.0, 1.0, MaterialState.Liquid, 196.0, 1.0);

            m_brs.MyMaterialCatalog.Add(mt2);
        }