//验证wellHead layerData数据是否唯一

        public void dataCheckWellHeadAndLayerUnique()
        {
            cProjectData.sErrLineInfor = "";

            List <ItemWellHead> listWellHead = cIOinputWellHead.readWellHead2Struct();

            for (int i = 0; i < listWellHead.Count; i++)
            {
                ItemWellHead wellHead1 = listWellHead[i];
                for (int j = i + 1; j < listWellHead.Count; j++)
                {
                    ItemWellHead wellHead2 = listWellHead[j];
                    if (wellHead1.sJH == wellHead2.sJH)
                    {
                        cProjectData.sErrLineInfor += "wellHead  " + (i + 1).ToString() + "行" + wellHead1.sJH + "在行" + (j + 1).ToString() + "重复。\r\n";
                    }
                }
            }



            if (cProjectData.sErrLineInfor == "")
            {
                MessageBox.Show("井头文件和分层数据文件唯一。");
            }
            else
            {
                MessageBox.Show("数据有一些错误,请点击查看。");
                cPublicMethodForm.outputErrInfor2Text(cProjectData.sErrLineInfor);
            }
        }
Beispiel #2
0
        void InitFormControl(string _sJH)
        {
            this.sJH = _sJH;

            List <string> ltStrWellType = new List <string>();

            ltStrWellType.Add("(0)Undefined");
            ltStrWellType.Add("(1)Proposed");
            ltStrWellType.Add("(2)Dry");
            ltStrWellType.Add("(3)Oil");
            ltStrWellType.Add("(4)Minor Oil");
            ltStrWellType.Add("(5)Gas");
            ltStrWellType.Add("(6)Minor gas");
            ltStrWellType.Add("(7)Condensate");
            ltStrWellType.Add("(8)Platform");
            ltStrWellType.Add("(9)Abandoned oil and gas ");
            ltStrWellType.Add("(10)Abandoned oil Minor gas ");
            ltStrWellType.Add("(11)Abandoned oil Condensate ");
            ltStrWellType.Add("(12)Abandoned gas residual oil ");
            ltStrWellType.Add("(13)Abandoned gas condensate ");
            ltStrWellType.Add("(14)Abandoned minor oil and gas ");
            ltStrWellType.Add("(15)Inject water");
            ltStrWellType.Add("(16)Inject gas");
            ltStrWellType.Add("(17)Shallow boreHole");
            ltStrWellType.Add("(18)Drilling well");
            cPublicMethodForm.inialComboBox(cbbWellType, ltStrWellType);
            ItemWellHead itemnew = new ItemWellHead(sJH);

            this.tbxWellName.Text          = sJH;
            this.tbxDX.Text                = itemnew.dbX.ToString();
            this.tbxDY.Text                = itemnew.dbY.ToString();
            this.tbxKB.Text                = itemnew.fKB.ToString();
            this.cbbWellType.SelectedIndex = itemnew.iWellType;
            this.tbxWellBase.Text          = itemnew.fWellBase.ToString();
        }
Beispiel #3
0
        public static void creatWellGeoFile(string _sJH)
        {
            List <float> fListMD      = new List <float>();
            List <float> fListInc     = new List <float>();
            List <float> fListAzimuth = new List <float>();

            ItemWellHead wellHead      = cIOinputWellHead.getWellHeadByJH(_sJH);
            string       inputFilePath =
                Path.Combine(cProjectManager.dirPathWellDir, _sJH, cProjectManager.fileNameInputWellPath);

            if (File.Exists(inputFilePath))
            {
                using (StreamReader sr = new StreamReader(inputFilePath))
                {
                    String line;
                    int    _indexLine = 0;
                    while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0
                    {
                        _indexLine++;
                        string[] split = line.Trim().Split(new char[] { ' ', '\t', ',' }, StringSplitOptions.RemoveEmptyEntries);
                        if (_indexLine >= 1)
                        {
                            fListMD.Add(float.Parse(split[1]));
                            fListInc.Add(float.Parse(split[2]));
                            fListAzimuth.Add(float.Parse(split[3]));
                        }
                    }
                }
            }
            if (fListMD.Count > 2)
            {
                List <ItemDicWellPath> itemsWellPath = phzqf2Struct(_sJH, fListMD, fListInc, fListAzimuth);
                creatWellGeoFile(_sJH, itemsWellPath);
            }
        }
Beispiel #4
0
        public static ItemWellHead getWellHeadByJH(string _sJH)
        {
            ItemWellHead item = new ItemWellHead();

            if (File.Exists(cProjectManager.filePathInputWellhead))
            {
                using (StreamReader sr = new StreamReader(cProjectManager.filePathInputWellhead, System.Text.Encoding.UTF8))
                {
                    String line;
                    while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0
                    {
                        string[] split = line.Trim().Split();
                        if (split[0] == _sJH)
                        {
                            item.sJH = split[0];
                            double.TryParse(split[1], out item.dbX);
                            double.TryParse(split[2], out item.dbY);
                            float.TryParse(split[3], out item.fKB);
                            int.TryParse(split[4], out item.iWellType);
                            if (split.Length >= 6)
                            {
                                float.TryParse(split[5], out item.fWellBase);
                            }
                            return(item);
                        }
                    }
                }
            }
            return(item);
        }
        public static Point getPointViewByJH(string sJH)
        {
            ItemWellHead wellHead  = cIOinputWellHead.getWellHeadByJH(sJH);
            Point        pointView = transRealPointF2ViewPoint(wellHead.dbX, wellHead.dbY,
                                                               cProjectData.dfMapXrealRefer, cProjectData.dfMapYrealRefer, cProjectData.dfMapScale);

            return(pointView);
        }
Beispiel #6
0
        public ItemWellMapPosition(string sJH)
        {
            ItemWellHead item = cIOinputWellHead.getWellHeadByJH(sJH);

            this.sJH       = sJH;
            this.sXCM      = "0";
            this.dbX       = item.dbX;
            this.dbY       = item.dbY;
            this.iWellType = item.iWellType;
            this.iWellType = cProjectData.ltProjectWell.Find(p => p.sJH == item.sJH).iWellType;
        }
Beispiel #7
0
 public static void updateWellInfor2Project(ItemWellHead sttNewWell)
 {
     cIOinputWellHead.updateWellHead(sttNewWell);
     cProjectManager.createWellDir(sttNewWell.sJH);
     if (cProjectData.ltStrProjectJH.IndexOf(sttNewWell.sJH) < 0)
     {
         cProjectData.ltStrProjectJH.Add(sttNewWell.sJH);
     }
     cProjectData.setProjectWellsInfor();
     MessageBox.Show(sttNewWell.sJH + "入库成功。");
 }
Beispiel #8
0
        public static string item2string(ItemWellHead item)
        {
            List <string> ltStrWrited = new List <string>();

            ltStrWrited.Add(item.sJH);
            ltStrWrited.Add(item.dbX.ToString());
            ltStrWrited.Add(item.dbY.ToString());
            ltStrWrited.Add(item.fKB.ToString());
            ltStrWrited.Add(item.iWellType.ToString());
            ltStrWrited.Add(item.fWellBase.ToString());
            return(string.Join("\t", ltStrWrited.ToArray()));
        }
Beispiel #9
0
        private void btnMap_Click(object sender, EventArgs e)
        {
            string filenameSVGMap;

            if (this.tbxMapTitleName.Text == "")
            {
                filenameSVGMap = sSelectedYYYYMM + "-InjectProductMap.svg";
            }
            else
            {
                filenameSVGMap = this.tbxMapTitleName.Text + ".svg";
            }

            cSVGDocLayerMapProduction cLayerProductionMap = new cSVGDocLayerMapProduction(800, 1000, 0, 0);
            XmlElement returnElemment;

            if (this.cbxAddWellConnect.Checked == true)
            {
                using (StreamReader sr = new StreamReader(fileDrawMapSourceConnect, Encoding.UTF8))
                {
                    String   line;
                    string[] split;
                    while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0
                    {
                        split = line.Trim().Split(new char[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries);
                        string           sWellInject        = split[0];
                        string           sWellProduct       = split[1];
                        cIOinputWellHead fileWellHead       = new cIOinputWellHead();
                        ItemWellHead     WellHeadItemJH1    = fileWellHead.listWellHead.Find(p => p.sJH == sWellInject);
                        ItemWellHead     WellHeadItemJH2    = fileWellHead.listWellHead.Find(p => p.sJH == sWellProduct);
                        Point            point1Convert2View = cCordinationTransform.transRealPointF2ViewPoint(WellHeadItemJH1.dbX, WellHeadItemJH1.dbY,
                                                                                                              cProjectData.dfMapXrealRefer, cProjectData.dfMapYrealRefer, cProjectData.dfMapScale);
                        Point point2Convert2View = cCordinationTransform.transRealPointF2ViewPoint(WellHeadItemJH2.dbX, WellHeadItemJH2.dbY,
                                                                                                   cProjectData.dfMapXrealRefer, cProjectData.dfMapYrealRefer, cProjectData.dfMapScale);
                        returnElemment = cLayerProductionMap.addgConnectLine(point1Convert2View, point2Convert2View,
                                                                             Color.RoyalBlue.Name, 2, Color.RoyalBlue.Name);
                        cLayerProductionMap.addgElement2BaseLayer(returnElemment, 0, 0);
                    }
                }
            }

            if (this.cbxScaleRulerShowed.Checked == true)
            {
                ;
            }


            if (this.cbxCompassShowed.Checked == true)
            {
                cLayerProductionMap.svgRoot.AppendChild(cLayerProductionMap.gCompass(300, 100));
            }
        }
Beispiel #10
0
        private void btnAddWell_Click(object sender, EventArgs e)
        {
            ItemWellHead sttNewWell = new ItemWellHead();

            sttNewWell.sJH       = tbxWellName.Text;
            sttNewWell.dbX       = double.Parse(tbxDX.Text);
            sttNewWell.dbY       = double.Parse(tbxDY.Text);
            sttNewWell.fKB       = float.Parse(tbxKB.Text);
            sttNewWell.iWellType = cbbWellType.SelectedIndex;
            sttNewWell.fWellBase = float.Parse(tbxWellBase.Text);
            cProjectManager.updateWellInfor2Project(sttNewWell);
            this.Close();
        }
Beispiel #11
0
        public ItemWell(string _sJH)
        {
            this.sJH = _sJH;

            ItemWellHead currentItemWellHead = cIOinputWellHead.getWellHeadByJH(_sJH);

            this.dbX       = currentItemWellHead.dbX;
            this.dbY       = currentItemWellHead.dbY;
            this.fKB       = currentItemWellHead.fKB;
            this.iWellType = currentItemWellHead.iWellType;
            this.fWellBase = currentItemWellHead.fWellBase;
            WellPathList   = cIOinputWellPath.readWellPath2Struct(_sJH);
        }
Beispiel #12
0
        public ItemWellView(string sJH)
        {
            ItemWellHead item = cIOinputWellHead.getWellHeadByJH(sJH);

            this.sJH       = sJH;
            this.dbX       = item.dbX;
            this.dbY       = item.dbY;
            this.iWellType = item.iWellType;
            Point pointConvert2View = cCordinationTransform.transRealPointF2ViewPoint(item.dbX, item.dbY, cProjectData.dfMapXrealRefer, cProjectData.dfMapYrealRefer, cProjectData.dfMapScale);

            this.iXview = pointConvert2View.X;
            this.iYview = pointConvert2View.Y;
        }
Beispiel #13
0
 public ItemDicWellPath(ItemWellHead wellHead)
 {
     sJH       = wellHead.sJH;
     dbX       = wellHead.dbX;
     dbY       = wellHead.dbY;
     dfZ       = wellHead.fKB;
     f_md      = 0.0f;
     f_incl    = 0.0f;
     f_azim    = 0.0f;
     f_dx      = 0.0f;
     f_dy      = 0.0f;
     f_TVD     = 0.0f;
     f_CalcDLS = 0.0f;
 }
Beispiel #14
0
        public static void creatWellGeoFile(string sJH, List <ItemDicWellPath> listWellPath)
        {
            ItemWellHead wellHead   = cIOinputWellHead.getWellHeadByJH(sJH);
            string       filePath   = Path.Combine(cProjectManager.dirPathWellDir, wellHead.sJH, cProjectManager.fileNameWellPath);
            string       sFirstLine = cProjectManager.fileNameWellPath + wellHead.sJH + " " + wellHead.dbX.ToString() + " " + wellHead.dbY.ToString() + " " + wellHead.fKB.ToString();

            creatWellGeoHeadFile(wellHead.sJH, filePath, sFirstLine);
            List <string> ltStrLine = new List <string>();

            foreach (ItemDicWellPath _item in listWellPath)
            {
                ltStrLine.Add(ItemDicWellPath.item2string(_item));
            }
            cIOGeoEarthText.addDataLines2GeoEarTxt(filePath, ltStrLine);
        }
Beispiel #15
0
        public static void creatVerticalWellPathGeoFile(string sJH)
        {
            ItemWellHead    wellHead       = cIOinputWellHead.getWellHeadByJH(sJH);
            ItemDicWellPath wellPathTop    = new ItemDicWellPath(wellHead);
            ItemDicWellPath wellPathBottom = new ItemDicWellPath(wellHead);

            wellPathBottom.dfZ   = wellPathTop.dfZ - wellHead.fWellBase;
            wellPathBottom.f_md  = wellHead.fWellBase;
            wellPathBottom.f_TVD = wellHead.fWellBase;
            List <ItemDicWellPath> listItem = new List <ItemDicWellPath>();

            listItem.Add(wellPathTop);
            listItem.Add(wellPathBottom);
            creatWellGeoFile(sJH, listItem);
        }
Beispiel #16
0
        public static XElement wellNode(string _sJH)
        {
            ItemWellHead WellHeadItem = cIOinputWellHead.readWellHead2Struct().Find(p => p.sJH == _sJH);;
            Point        pWellView    = cCordinationTransform.transRealPointF2ViewPointByCurrentSystemSetting
                                            (WellHeadItem.dbX, WellHeadItem.dbY);
            XElement newWellNode = new XElement("Well", new XAttribute("id", _sJH),
                                                new XElement("X", WellHeadItem.dbX.ToString()),
                                                new XElement("Y", WellHeadItem.dbY.ToString()),
                                                new XElement("KB", WellHeadItem.fKB.ToString()),
                                                new XElement("TypeWell", WellHeadItem.iWellType.ToString()),
                                                new XElement("Xview", pWellView.X.ToString()),
                                                new XElement("Yview", pWellView.Y.ToString())
                                                );

            return(newWellNode);
        }
Beispiel #17
0
        public static List <ItemWellHead> readWellHead2Struct()
        {
            List <ItemWellHead> listWellHead = new List <ItemWellHead>();

            try
            {
                if (File.Exists(cProjectManager.filePathInputWellhead))
                {
                    using (StreamReader sr = new StreamReader(cProjectManager.filePathInputWellhead, System.Text.Encoding.UTF8))
                    {
                        String line;
                        while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0
                        {
                            ItemWellHead sttWellHead = new ItemWellHead();
                            sttWellHead.dbX       = 0.0;
                            sttWellHead.dbY       = 0.0;
                            sttWellHead.fKB       = 0.0f;
                            sttWellHead.iWellType = 0;
                            sttWellHead.fWellBase = 0.0f;

                            string[] split = line.Trim().Split();

                            sttWellHead.sJH = split[0];
                            if (split.Length >= 6)
                            {
                                double.TryParse(split[1], out sttWellHead.dbX);
                                double.TryParse(split[2], out sttWellHead.dbY);
                                float.TryParse(split[3], out sttWellHead.fKB);
                                int.TryParse(split[4], out sttWellHead.iWellType);
                                float.TryParse(split[5], out sttWellHead.fWellBase);
                            }
                            listWellHead.Add(sttWellHead);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
            return(listWellHead);
        }
Beispiel #18
0
        static public void codeReplaceWellHead()
        {
            cProjectData.sErrLineInfor = "";
            string       fileNameTempWellhead = cProjectManager.dirPathTemp + "wellHead.txt";
            StreamWriter swWellHead           = new StreamWriter(fileNameTempWellhead, false, Encoding.UTF8);

            using (StreamReader sr = new StreamReader(cProjectManager.filePathInputWellhead, System.Text.Encoding.UTF8))
            {
                String line;
                while ((line = sr.ReadLine()) != null) //delete the line whose legth is 0
                {
                    string[] split = line.Trim().Split(new char[] { ' ', '\t', ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
                    split[4] = ItemWellHead.codeReplace(split[4]);
                    swWellHead.WriteLine(string.Join("\t", split));
                }
            }
            swWellHead.Close();

            File.Copy(fileNameTempWellhead, cProjectManager.filePathInputWellhead, true);
            File.Delete(fileNameTempWellhead);
        }
Beispiel #19
0
        public static void copyTemplate(string xtlFileName, string goalFilePath, string sJH, double depthTopShow, double depthBotShow)
        {
            //加载模板
            string       xtmPath = Path.Combine(cProjectManager.dirPathTemplate, xtlFileName);
            ItemWellHead item    = new ItemWellHead(sJH);

            File.Copy(xtmPath, goalFilePath, true);
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(goalFilePath);
            cXmlBase.setNodeInnerText(xmlDoc, cXmlDocSectionWell.fullPathJH, sJH);
            cXmlBase.setNodeInnerText(xmlDoc, cXEWellPage.fullPathMapTitle, sJH);
            cXmlBase.setNodeInnerText(xmlDoc, cXEWellPage.fullPathTopDepth, depthTopShow.ToString("0.00"));
            cXmlBase.setNodeInnerText(xmlDoc, cXEWellPage.fullPathBotDepth, depthBotShow.ToString("0.00"));
            cXmlBase.setNodeInnerText(xmlDoc, cXmlDocSectionWell.fullPathX, item.dbX.ToString());
            cXmlBase.setNodeInnerText(xmlDoc, cXmlDocSectionWell.fullPathY, item.dbY.ToString());
            cXmlBase.setNodeInnerText(xmlDoc, cXmlDocSectionWell.fullPathKB, item.fKB.ToString());
            cXmlBase.setNodeInnerText(xmlDoc, cXmlDocSectionWell.fullPathBase, item.fWellBase.ToString("0.00"));
            XmlNode currentNode = xmlDoc.SelectSingleNode(cXmlDocSectionWell.fullPathTrackCollection);

            cXmlDocSectionWell.remakeIDofNode(currentNode);
            //换ID
            xmlDoc.Save(goalFilePath);
        }
Beispiel #20
0
        public static List <ItemDicWellPath> phzqf2Struct(string sJH, List <float> fListMD, List <float> fListInc, List <float> fListAzimuth)
        {
            ItemWellHead wellHead = cIOinputWellHead.getWellHeadByJH(sJH);

            return(phzqf2Struct(wellHead.sJH, wellHead.dbX, wellHead.dbY, wellHead.fKB, fListMD, fListInc, fListAzimuth));
        }
Beispiel #21
0
        public void generateLayerData()
        {
            //更新算法,保证计算后的数据字典完善:
            //如果这口井有有效厚度而没有孔隙度,渗透率,饱和度,那么找临近的几口井,根据厚度相近的原则,取孔隙度,渗透率
            //数据缺失的先用地层厚度为-999填充标记,然后正着扫一遍,再反着扫一遍 把所有的值填充合理
            List <ItemDicLayerDataStatic> listLayerDataDic = new List <ItemDicLayerDataStatic>();

            if (cProjectData.ltStrProjectJH.Count > 0 && cProjectData.ltStrProjectXCM.Count > 0)
            {
                for (int i = 0; i < cProjectData.ltStrProjectJH.Count; i++)
                {
                    for (int j = 0; j < cProjectData.ltStrProjectXCM.Count; j++)
                    {
                        string                   sCurrentJH      = cProjectData.ltStrProjectJH[i].ToString();
                        string                   sCurrentXCM     = cProjectData.ltStrProjectXCM[j].ToString();
                        ItemWellHead             currentWellHead = cIOinputWellHead.getWellHeadByJH(sCurrentJH);
                        List <ItemDicLayerDepth> listLayerDepth  = cIOinputLayerDepth.readLayerDepth2Struct(sCurrentJH);
                        List <ItemJSJL>          listJSJL        = cIOinputJSJL.readJSJL2Struct(sCurrentJH);

                        double dfCurrentLayerX = 0;
                        double dfCurrentLayerY = 0;
                        double dfCurrentLayerZ = 0;

                        float fCurrentLayerDS1           = 0;    //当前层位的顶面测深
                        float fCurrentLayerDS2           = 0;    //当前层位的底面测深
                        float fCurrentLayerTVD           = 0;    //顶面TVD
                        float fCurrentLayerDCHD          = -999; //当前层位的地层测深 需要测算 -999代表缺失
                        float fCurrentLayerSandThickness = -999; //当前层位的砂岩厚度
                        float fCurrentLayerYXHD          = 0;    //当前层位的有效厚度

                        float fCurrentLayerKXD = 0;              //当前层位的厚度加权孔隙度
                        float fCurrentLayerSTL = 0;              //当前层位的厚度加权渗透率
                        float fCurrentLayerBHD = 0;              //当前层位的厚度加权饱和度


                        //读取层位顶底深,获取fCurrentLayerDS1,fCurrentLayerDS2
                        //没找到的情况要重新考虑下!
                        bool bFoundInLayerDepth             = false;
                        ItemDicLayerDepth currentLayerDepth = listLayerDepth.Find(p => p.sJH == sCurrentJH && p.sXCM == sCurrentXCM);

                        if (currentLayerDepth.sJH != null && currentLayerDepth.fDS1 <= currentLayerDepth.fDS2)
                        {
                            fCurrentLayerDS1 = currentLayerDepth.fDS1;
                            ItemDicWellPath currentDS1WellPathItem = cIOinputWellPath.getWellPathItemByJHAndMD(sCurrentJH, fCurrentLayerDS1);
                            ItemDicWellPath currentDS2WellPathItem = cIOinputWellPath.getWellPathItemByJHAndMD(sCurrentJH, fCurrentLayerDS2);
                            fCurrentLayerDS2   = currentLayerDepth.fDS2;
                            dfCurrentLayerX    = currentDS1WellPathItem.dbX;
                            dfCurrentLayerY    = currentDS1WellPathItem.dbY;
                            dfCurrentLayerZ    = currentDS1WellPathItem.dfZ;
                            fCurrentLayerTVD   = currentDS1WellPathItem.f_TVD;
                            fCurrentLayerDCHD  = currentDS2WellPathItem.f_TVD - currentDS1WellPathItem.f_TVD;
                            bFoundInLayerDepth = true;
                        }

                        //读取JSJL结果链表,获取fCurrentLayerKXD,fCurrentLayerSTL,fCurrentLayerBHD
                        if (bFoundInLayerDepth == true) //找到小层顶底深,才处理,否则直接跳过
                        {
                            List <ItemJSJL> listCurrentWellJSJL = listJSJL.Where(p => p.sJH == sCurrentJH && p.fDS1 >= fCurrentLayerDS1 && p.fDS2 <= fCurrentLayerDS2).ToList();

                            List <float> fListSH_temp   = new List <float>();
                            List <float> fListYXHD_temp = new List <float>();
                            List <float> fListKXD_temp  = new List <float>();
                            List <float> fListSTL_temp  = new List <float>();
                            List <float> fListBHD_temp  = new List <float>();

                            foreach (ItemJSJL item in listCurrentWellJSJL)
                            {
                                fListSH_temp.Add(item.fSandThickness);
                                fListYXHD_temp.Add(item.fNetPaySand);
                                fListKXD_temp.Add(item.fKXD);
                                fListSTL_temp.Add(item.fSTL);
                                fListBHD_temp.Add(item.fBHD);
                            }

                            {
                                fCurrentLayerDCHD          = fCurrentLayerDS2 - fCurrentLayerDS1;                       //地层厚度
                                fCurrentLayerSandThickness = fListSH_temp.Sum();                                        //当前层位的砂岩厚度
                                fCurrentLayerYXHD          = fListYXHD_temp.Sum();                                      //当前层位的有效厚度

                                fCurrentLayerKXD = weightedBYThickNessWithourInvalidValue(fListKXD_temp, fListSH_temp); //当前层位的厚度加权孔隙度
                                fCurrentLayerSTL = weightedBYThickNessWithourInvalidValue(fListSTL_temp, fListSH_temp); //当前层位的厚度加权渗透率
                                fCurrentLayerBHD = weightedBYThickNessWithourInvalidValue(fListBHD_temp, fListSH_temp); //当前层位的厚度加权饱和度
                            }
                        }

                        //写小层数据表

                        ItemDicLayerDataStatic itemLayerData = new ItemDicLayerDataStatic();
                        itemLayerData.sJH  = sCurrentJH;
                        itemLayerData.sXCM = sCurrentXCM;


                        //在LayerDepth表中找到数据层段的顶底
                        if (bFoundInLayerDepth == true)
                        {
                            itemLayerData.dbX      = dfCurrentLayerX;
                            itemLayerData.dbY      = dfCurrentLayerY;
                            itemLayerData.dbZ      = dfCurrentLayerZ;
                            itemLayerData.fDCHD    = fCurrentLayerDCHD;
                            itemLayerData.fSH      = fCurrentLayerSandThickness;
                            itemLayerData.fYXHD    = fCurrentLayerYXHD;
                            itemLayerData.fKXD     = fCurrentLayerKXD;
                            itemLayerData.fSTL     = fCurrentLayerSTL;
                            itemLayerData.fBHD     = fCurrentLayerBHD;
                            itemLayerData.fDS1_md  = fCurrentLayerDS1;
                            itemLayerData.fDS2_md  = fCurrentLayerDS2;
                            itemLayerData.fDS1_TVD = fCurrentLayerTVD;
                        }
                        else //未在LayerDepth表中找到数据 代表本井本层位缺失
                        {
                            itemLayerData.dbX      = 0.0;
                            itemLayerData.dbY      = 0.0;
                            itemLayerData.dbZ      = 0.0;
                            itemLayerData.fDCHD    = -999;
                            itemLayerData.fSH      = -999;
                            itemLayerData.fYXHD    = 0;
                            itemLayerData.fKXD     = -999;
                            itemLayerData.fSTL     = -999;
                            itemLayerData.fBHD     = -999;
                            itemLayerData.fDS1_md  = -999;
                            itemLayerData.fDS2_md  = -999;
                            itemLayerData.fDS1_TVD = -999;
                        }
                        listLayerDataDic.Add(itemLayerData);
                    }
                }
            }

            //正一遍 倒一遍,完善小层数据表

            for (int i = 0; i < listLayerDataDic.Count - 1; i++)
            {
                ItemDicLayerDataStatic currentItem = listLayerDataDic[i];
                if (currentItem.fDCHD < 0 && currentItem.sJH == listLayerDataDic[i + 1].sJH)
                {
                    ItemDicLayerDataStatic nextItem = listLayerDataDic[i + 1];
                    currentItem.dbX      = nextItem.dbX;
                    currentItem.dbY      = nextItem.dbY;
                    currentItem.dbZ      = nextItem.dbZ + nextItem.fDCHD;
                    currentItem.fDS1_md  = nextItem.fDS1_md;
                    currentItem.fDS2_md  = nextItem.fDS2_md;
                    currentItem.fDS1_TVD = nextItem.fDS1_TVD;
                    currentItem.fDCHD    = 0;
                    currentItem.fSH      = 0;
                }
                listLayerDataDic[i] = currentItem;
            }

            //完善 小层 孔渗为无效值的情况
            for (int i = 0; i < listLayerDataDic.Count - 1; i++)
            {
                ItemDicLayerDataStatic currentItem = listLayerDataDic[i];
                if (currentItem.fDCHD < 0 && currentItem.sJH == listLayerDataDic[i + 1].sJH)
                {
                    ItemDicLayerDataStatic nextItem = listLayerDataDic[i + 1];
                    currentItem.dbX      = nextItem.dbX;
                    currentItem.dbY      = nextItem.dbY;
                    currentItem.dbZ      = nextItem.dbZ + nextItem.fDCHD;
                    currentItem.fDS1_md  = nextItem.fDS1_md;
                    currentItem.fDS2_md  = nextItem.fDS2_md;
                    currentItem.fDS1_TVD = nextItem.fDS1_TVD;
                    currentItem.fDCHD    = 0;
                    currentItem.fSH      = 0;
                }
                listLayerDataDic[i] = currentItem;
            }
            for (int i = listLayerDataDic.Count - 1; i > 0; i--)
            {
                ItemDicLayerDataStatic currentItem = listLayerDataDic[i];
                if (currentItem.fSH > 0 && (currentItem.fKXD <= 0 || currentItem.fSTL <= 0)) //有砂厚,砂厚大于0的必须有孔隙度和渗透率,用于产量劈分,储量计算
                {
                    //从 listLayerDataDic中选择,无值的取层段平均值
                    List <ItemDicLayerDataStatic> listCurrentLayer = listLayerDataDic.FindAll(p => p.sXCM == currentItem.sXCM).ToList();
                    if (listCurrentLayer.Count > 0)
                    {
                        if (currentItem.fKXD <= 0 && listCurrentLayer.FindAll(p => p.fKXD > 0).Count > 0)
                        {
                            currentItem.fKXD = listCurrentLayer.FindAll(p => p.fKXD > 0).Select(p => p.fKXD).Average();
                        }
                        if (currentItem.fSTL <= 0 && listCurrentLayer.FindAll(p => p.fSTL > 0).Count > 0)
                        {
                            currentItem.fSTL = listCurrentLayer.FindAll(p => p.fSTL > 0).Select(p => p.fSTL).Average();
                        }
                    }
                }
                listLayerDataDic[i] = currentItem;
            }

            write2File(cProjectManager.filePathLayerDataDic, listLayerDataDic);
            // Format and display the TimeSpan value.
        }
Beispiel #22
0
 public static void updateWellHead(ItemWellHead itemNewWellHead)
 {
     cIOBase.replaceLineByFirstWord(cProjectManager.filePathInputWellhead, itemNewWellHead.sJH, ItemWellHead.item2string(itemNewWellHead));
 }