Beispiel #1
0
 public Substance(string name, SubstanceType type, int casNo, string formula, double molWt,
                  ThermalPropsAndCoeffs propsAndCoeffs, CriticalProperties criticalProps)
 {
     this.name           = name;
     this.type           = type;
     this.casRegistryNo  = casNo;
     this.formula        = formula;
     this.molarWeight    = molWt;
     this.IsUserDefined  = false;
     this.propsAndCoeffs = propsAndCoeffs;
     this.criticalProps  = criticalProps;
 }
Beispiel #2
0
//      public SubstanceCatalog(IList list) {
//         allSubstanceList = list;
//      }
//
        private void InitializeCatalog()
        {
            double[] airGasCpCoeffs       = { 0.2896e5, 0.0939e5, 3.012e3, 0.0758e5, 1484.0 };
            double[] airLiqCpCoeffs       = { -2.1446e5, 9.1851e3, -1.0612e2, 4.1616e-1, 0 };
            double[] airEvapHeatCoeffs    = null;
            double[] airVapPressureCoeffs = null;
            double[] airLiqKCoeffs        = null;
            double[] airGasKCoeffs        = null;
            double[] airLiqViscCoeffs     = null;
            double[] airGasViscCoeffs     = null;
            double[] airLiqDensityCoeffs  = null;
            ThermalPropsAndCoeffs thermalPropsAndCoeffs = new ThermalPropsAndCoeffs(airLiqCpCoeffs, airGasCpCoeffs,
                                                                                    airEvapHeatCoeffs, airVapPressureCoeffs, airLiqKCoeffs, airGasKCoeffs,
                                                                                    airLiqViscCoeffs, airGasViscCoeffs, airLiqDensityCoeffs);
            CriticalProperties criticalProps = new CriticalProperties(132.45, 3.79e6, 92.0, 0.318, 0.0);
            Substance          substance     = new Substance("Air", SubstanceType.Inorganic, 132259100, "", 28.951, thermalPropsAndCoeffs, null);

            gasSubstanceList.Add(substance);
            allSubstanceList.Add(substance);

            //from Perry's
            double[] waterLiqCpCoeffs       = { 2.7637e5, -2.0901e3, 8.125, -1.4116e-2, 9.3701e-6 };
            double[] waterGasCpCoeffs       = { 0.3336e5, 0.2679e5, 2.6105e3, 0.089e5, 1169 };
            double[] waterEvapHeatCoeffs    = { 5.2053e7, 0.3199, -0.212, 0.25795 };
            double[] waterVapPressureCoeffs = { 73.649, -7258.2, -7.3037, 4.1653e-6, 2.0 };
            double[] waterLiqDensityCoeffs  = { 5.459, 0.30542, 647.13, 0.081 };
            //from Yaws's
            double[] waterLiqKCoeffs    = { -0.2758, 4.6120e-3, -5.5391e-6 };
            double[] waterGasKCoeffs    = { 0.00053, 4.7093e-5, 4.9551e-8 };
            double[] waterLiqViscCoeffs = { -10.2158, 1.7925e3, 1.773e-2, -1.2631e-5 };
            double[] waterGasViscCoeffs = { -36.826, 0.429, 1.62e-5 };
            thermalPropsAndCoeffs = new ThermalPropsAndCoeffs(waterLiqCpCoeffs, waterGasCpCoeffs,
                                                              waterEvapHeatCoeffs, waterVapPressureCoeffs, waterLiqKCoeffs, waterGasKCoeffs,
                                                              waterLiqViscCoeffs, waterGasViscCoeffs, waterLiqDensityCoeffs);

            //from Perry's
            criticalProps = new CriticalProperties(647.13, 21.94e6, 56.0, 0.228, 0.343);
            substance     = new Substance("Water", SubstanceType.Inorganic, 7732185, "", 18.015, thermalPropsAndCoeffs, criticalProps);
            moistureSubstanceList.Add(substance);
            allSubstanceList.Add(substance);

            CreateMaterialSubstance("Dry Material", SubstanceType.Inorganic);
            CreateMaterialSubstance("Carbohydrate", SubstanceType.Organic);
            CreateMaterialSubstance("Ash", SubstanceType.Organic);
            CreateMaterialSubstance("Fiber", SubstanceType.Organic);
            CreateMaterialSubstance("Fat", SubstanceType.Organic);
            CreateMaterialSubstance("Protein", SubstanceType.Organic);
        }
Beispiel #3
0
        public override void SetObjectData()
        {
            base.SetObjectData();
            int persistedClassVersion = (int)info.GetValue("ClassPersistenceVersionSubstance", typeof(int));

            if (persistedClassVersion == 1)
            {
                this.name           = (string)info.GetValue("Name", typeof(string));
                this.casRegistryNo  = (int)info.GetValue("CasRegistryNo", typeof(int));
                this.formula        = (string)info.GetValue("Formula", typeof(string));
                this.molarWeight    = (double)info.GetValue("MolarWeight", typeof(double));
                this.isUserDefined  = (bool)info.GetValue("IsUserDefined", typeof(bool));
                this.type           = (SubstanceType)info.GetValue("Type", typeof(SubstanceType));
                this.propsAndCoeffs = info.GetValue("PropsAndCoeffs", typeof(ThermalPropsAndCoeffs)) as ThermalPropsAndCoeffs;
                this.criticalProps  = info.GetValue("CriticalProps", typeof(CriticalProperties)) as CriticalProperties;
            }
        }