void _ReadWaterProperties(
     DGObjects objs,
     string tableNameSQL,
     string conditionSQL,
     string orderSQL)
 {
     ReadRawData(objs, tableNameSQL, orderSQL, conditionSQL);
     DataTable table = objs.rawDataSet.Tables[0];
     foreach (DataRow reader in table.Rows)
     {
         if (IsDbNull(reader, "ID"))
             continue;
         WaterProperty wp = new WaterProperty(reader);
         wp.ID = ReadInt(reader, "ID").Value;
         wp.BoreholeName = ReadString(reader, "BoreholeName");
         wp.Cl = ReadDouble(reader, "Cl");
         wp.SO4 = ReadDouble(reader, "SO4");
         wp.Mg = ReadDouble(reader, "Mg");
         wp.NH = ReadDouble(reader, "NH");
         wp.pH = ReadDouble(reader, "pH");
         wp.CO2 = ReadDouble(reader, "CO2");
         wp.Corrosion = ReadString(reader, "Corrosion");
         objs[wp.key] = wp;
     }
 }
예제 #2
0
 public WaterPropertyDTO(WaterProperty wp)
 {
     BoreholeName = wp.BoreholeName;
     Cl           = wp.Cl;
     SO4          = wp.SO4;
     Mg           = wp.Mg;
     NH           = wp.NH;
     pH           = wp.pH;
     CO2          = wp.CO2;
     Corrosion    = wp.Corrosion;
 }
예제 #3
0
        internal double GetHg(double P)
        {
            double result = 0;

            if (Type == "UserDefine")
            {
                //当使用自定义模型的时候,返回输入的hg
                result = HG;
            }
            else
            {
                WaterProperty.P2HG(P, out result, out Range);
            }
            return(result);
        }
예제 #4
0
        internal double GetDensity(double T, double P = 0)
        {
            double ReturnValue = 0;

            //如果为自定义类型
            if (Type == "UserDefine")
            {
                //比T小的最大序列
                int x = 0;
                //比T大的最小序列
                int y = FluidPropertys.Count;

                for (int i = 0; i < FluidPropertys.Count; i++)
                {
                    if (FluidPropertys[i].T < T && i >= x)
                    {
                        x = i;
                    }
                    else if (FluidPropertys[i].T > T && i <= y)
                    {
                        y = i;
                    }
                    else if (FluidPropertys[i].T == T)
                    {
                        return(FluidPropertys[i].Density);
                    }
                }
                ReturnValue = (T - FluidPropertys[x].T) / (FluidPropertys[y].T - FluidPropertys[x].T) * (FluidPropertys[y].Density - FluidPropertys[x].Density) + FluidPropertys[x].Density;
            }
            //如果类型为默认类型
            else if (Type == "GetPropertyByName")
            {
                WaterProperty.PT2V(P, T, out ReturnValue, out Range);

                ReturnValue = 1 / ReturnValue;
            }

            return(ReturnValue);
        }
예제 #5
0
        /// <summary>根据温度返回比焓</summary>
        internal double GetH(double T, double P = 0)
        {
            double ReturnH = 0;

            //如果为自定义类型
            if (Type == "UserDefine")
            {
                //比T小的最大序列
                int x = 0;
                //比T大的最小序列
                int y = FluidPropertys.Count;

                for (int i = 0; i < FluidPropertys.Count; i++)
                {
                    if (FluidPropertys[i].T < T && i >= x)
                    {
                        x = i;
                    }
                    else if (FluidPropertys[i].T > T && i <= y)
                    {
                        y = i;
                    }
                    else if (FluidPropertys[i].T == T)
                    {
                        return(FluidPropertys[i].H);
                    }
                }
                ReturnH = (T - FluidPropertys[x].T) / (FluidPropertys[y].T - FluidPropertys[x].T) * (FluidPropertys[y].H - FluidPropertys[x].H) + FluidPropertys[x].H;
            }
            //如果类型为默认类型
            else if (Type == "GetPropertyByName")
            {
                WaterProperty.PT2H(P, T, out ReturnH, out Range);
                //Debug.WriteLine("内置物性比焓为:"+ReturnH);
            }

            return(ReturnH);
        }
예제 #6
0
        internal double GetT(double H, double P = 0)
        {
            double ReturnValue = 0;

            //如果为自定义类型
            if (Type == "UserDefine")
            {
                //比T小的最大序列
                int x = 0;
                //比T大的最小序列
                int y = FluidPropertys.Count;

                for (int i = 0; i < FluidPropertys.Count; i++)
                {
                    if (FluidPropertys[i].H < H && i >= x)
                    {
                        x = i;
                    }
                    else if (FluidPropertys[i].H > H && i <= y)
                    {
                        y = i;
                    }
                    else if (FluidPropertys[i].H == H)
                    {
                        return(FluidPropertys[i].Density);
                    }
                }
                ReturnValue = (H - FluidPropertys[x].H) / (FluidPropertys[y].H - FluidPropertys[x].H) * (FluidPropertys[y].T - FluidPropertys[x].T) + FluidPropertys[x].T;
            }
            //如果类型为默认类型
            else if (Type == "GetPropertyByName")
            {
                WaterProperty.PH2T(P, H, out ReturnValue, out Range);
            }

            return(ReturnValue);
        }
예제 #7
0
        /// <summary>根据温度返回运动粘度</summary>
        internal double GetKv(double T, double P = 0)
        {
            double ReturnValue = 0;

            //如果为自定义类型
            if (Type == "UserDefine")
            {
                //比T小的最大序列
                int x = 0;
                //比T大的最小序列
                int y = FluidPropertys.Count;

                for (int i = 0; i < FluidPropertys.Count; i++)
                {
                    if (FluidPropertys[i].T < T && i >= x)
                    {
                        x = i;
                    }
                    else if (FluidPropertys[i].T > T && i <= y)
                    {
                        y = i;
                    }
                    else if (FluidPropertys[i].T == T)
                    {
                        return(FluidPropertys[i].Kv);
                    }
                }
                ReturnValue = (T - FluidPropertys[x].T) / (FluidPropertys[y].T - FluidPropertys[x].T) * (FluidPropertys[y].Kv - FluidPropertys[x].Kv) + FluidPropertys[x].Kv;
            }
            //如果类型为默认类型
            else if (Type == "GetPropertyByName")
            {
                WaterProperty.PT2U(P, T, out ReturnValue, out Range);
            }
            //Debug.WriteLine(ReturnValue + "!!!!!");
            return(ReturnValue);
        }
예제 #8
0
        public WaterPropertyDTO getWaterPropertyById(string project, int id)
        {
            WaterProperty pw = getObjectById <WaterProperty>(project, id);

            return(new WaterPropertyDTO(pw));
        }