示例#1
0
        void InitConstruct()
        {
            RUNSPEC runspec = new RUNSPEC("RUNSPEC");

            this.Key.Add(runspec);

            GRID grid = new GRID("GRID");

            this.Key.Add(grid);

            EDIT edit = new EDIT("EDIT");

            this.Key.Add(edit);

            PROPS props = new PROPS("PROPS");

            this.Key.Add(props);

            REGIONS regions = new REGIONS("REGIONS");

            this.Key.Add(regions);

            SOLUTION solution = new SOLUTION("SOLUTION");

            this.Key.Add(solution);

            SUMMARY summary = new SUMMARY("SUMMARY");

            this.Key.Add(summary);

            SCHEDULE schedule = new SCHEDULE("SCHEDULE");

            this.Key.Add(schedule);
        }
示例#2
0
        /// <summary> 将Eclipse数模文件转换成SimON数模文件 </summary>
        public SimONData ConvertToSimON(EclipseData ecl)
        {
            // Todo :Eclipse里面的修改参数没有解析成SimON中修改参数
            ecl.RunModify();

            RUNSPEC  runspec  = ecl.Key.Find <RUNSPEC>();
            GRID     grid     = ecl.Key.Find <GRID>();
            SOLUTION solution = ecl.Key.Find <SOLUTION>();
            SUMMARY  summary  = ecl.Key.Find <SUMMARY>();
            SCHEDULE schedule = ecl.Key.Find <SCHEDULE>();
            REGIONS  regions  = ecl.Key.Find <REGIONS>();
            PROPS    props    = ecl.Key.Find <PROPS>();

            SimONData simon = new SimONData();

            simon.FileName   = ecl.FileName;
            simon.FilePath   = ecl.FilePath;
            simon.MmfDirPath = ecl.MmfDirPath;
            simon.InitConstruct();

            simon.X = ecl.X;
            simon.Y = ecl.Y;
            simon.Z = ecl.Z;

            //  模型定义

            #region - 起始时间 -

            SOLVECTRL tuning = new SOLVECTRL("TUNING");

            tuning.Date = ecl.Key.Find <START>().StartTime;

            simon.Key.Add(tuning);

            #endregion

            #region - 维数定义 -

            RSVSIZE rsvsize = new RSVSIZE("RSVSIZE");

            DIMENS dimens = ecl.Key.Find <DIMENS>();

            rsvsize.X = dimens.X;
            rsvsize.Y = dimens.Y;
            rsvsize.Z = dimens.Z;



            simon.Key.Add(rsvsize);

            #endregion

            #region - 单位类型 -

            UnitType unitType = UnitType.METRIC;

            //  读到METRIC公制单位
            METRIC metric = ecl.Key.Find <METRIC>();

            if (metric != null)
            {
                simon.Key.Add(metric);
                unitType = UnitType.METRIC;
            }

            //  单位类型
            FIELD field = ecl.Key.Find <FIELD>();

            if (field != null)
            {
                simon.Key.Add(field);
                unitType = UnitType.FIELD;
            }

            #endregion

            #region - 流体类型 -

            MODELTYPE modeltype = new MODELTYPE("MODELTYPE");

            //  流体类型
            OIL    oil    = runspec.Find <OIL>();
            WATER  water  = runspec.Find <WATER>();
            GAS    gas    = runspec.Find <GAS>();
            DISGAS disgas = runspec.Find <DISGAS>();
            VAPOIL vapoil = runspec.Find <VAPOIL>();

            //  黑油
            if (oil != null && water != null && gas != null && disgas != null && vapoil == null)
            {
                modeltype.MetricType = MetricType.BLACKOIL;
            }
            //  油水
            else if (oil != null && water != null && gas == null && disgas == null && vapoil == null)
            {
                modeltype.MetricType = MetricType.OILWATER;
            }
            //  气水
            else if (oil == null && water != null && gas != null && disgas == null && vapoil == null)
            {
                modeltype.MetricType = MetricType.GASWATER;
            }
            //  挥发油
            else if (oil != null && water != null && gas != null && disgas != null && vapoil != null)
            {
                modeltype.MetricType = MetricType.HFOIL;
            }
            else
            {
                modeltype.MetricType = MetricType.BLACKOIL;
            }
            simon.Key.Add(modeltype);
            #endregion

            #region - 分区维数 -

            EQUILREG equilreg = new EQUILREG("EQUILREG");
            FIPREG   fipreg   = new FIPREG("FIPREG");
            ROCKREG  rockreg  = new ROCKREG("ROCKREG");
            SATREG   satreg   = new SATREG("SATREG");
            PVTREG   pvtreg   = new PVTREG("PVTREG");

            simon.Key.Add(equilreg);
            simon.Key.Add(fipreg);
            simon.Key.Add(rockreg);
            simon.Key.Add(satreg);
            simon.Key.Add(pvtreg);

            TABDIMS tabdims = runspec.Find <TABDIMS>();

            if (tabdims != null)
            {
                fipreg.X  = tabdims.Fipfqzds4.ToString();
                rockreg.X = tabdims.Yslxgs12.ToString();
                satreg.X  = tabdims.Bhdbs0.ToString();
                pvtreg.X  = tabdims.Pvtbs1.ToString();

                //fipreg.X = "1";
                //rockreg.X = "1";
                //satreg.X = "1";
                //pvtreg.X = "1";
            }

            EQLDIMS eqldims = runspec.Find <EQLDIMS>();

            if (eqldims != null)
            {
                //equilreg.X = "1";
                equilreg.X = eqldims.Phfqs0.ToString();
            }

            OVERBURD overburd = props.Find <OVERBURD>();
            if (overburd != null)
            {
                //rockreg.X = overburd.Regions.Count.ToString();
            }

            EQUILMAP equilmap = new EQUILMAP("EQUILMAP");
            FIPMAP   fipmap   = new FIPMAP("FIPMAP");
            ROCKMAP  rockmap  = new ROCKMAP("ROCKMAP");
            SATMAP   satmap   = new SATMAP("SATMAP");
            PVTMAP   pvtmap   = new PVTMAP("PVTMAP");

            if (regions != null)
            {
                EQLNUM eqlnum = regions.Find <EQLNUM>();

                if (eqlnum != null)
                {
                    equilmap = eqlnum.ToTableKey <EQUILMAP>();
                    solution.Add(equilmap);
                    eqlnum.Delete();
                    eqlnum.Dispose();
                }

                // Todo :非平衡初始化压力需要转换
                var pressure = solution.Find <PRESSURE>();
                if (pressure != null)
                {
                    POIL poil = pressure.ToTableKey <POIL>();
                    solution.Add(poil);
                    pressure.Delete();
                    pressure.Dispose();
                }

                if (regions != null)
                {
                    FIPNUM fipnum = regions.Find <FIPNUM>();

                    if (fipnum != null)
                    {
                        fipmap = fipnum.ToTableKey <FIPMAP>();
                        grid.Add(fipmap);
                        fipnum.Delete();
                        fipnum.Dispose();
                    }
                    ROCKNUM rocknum = regions.Find <ROCKNUM>();

                    if (rocknum != null)
                    {
                        rockmap = rocknum.TransToTableKeyByName("ROCKMAP", true) as ROCKMAP;
                        grid.Add(rockmap);
                        rocknum.Delete();
                        rocknum.Dispose();
                    }

                    SATNUM satnum = regions.Find <SATNUM>();

                    if (satnum != null)
                    {
                        satmap = satnum.ToTableKey <SATMAP>();
                        grid.Add(satmap);
                        satnum.Delete();
                        satnum.Dispose();
                    }


                    PVTNUM pvtnum = regions.Find <PVTNUM>();

                    if (pvtnum != null)
                    {
                        pvtmap = pvtnum.ToTableKey <PVTMAP>();
                        grid.Add(pvtmap);
                        pvtnum.Delete();
                        pvtnum.Dispose();
                    }
                }
            }



            #endregion

            #region - 地质模型 -

            simon.Key.Add(grid);

            #endregion

            #region - 断层 -
            //var eclFaults = grid.FindAll<OPT.Product.SimalorManager.RegisterKeys.Eclipse.FAULTS>();

            //foreach (var v in eclFaults)
            //{
            //grid.AddRange(this.ConvertToSimON(v));

            //v.Delete();
            //}
            #endregion

            #region - 水体 -

            //AQUFETP AQUFETP=

            // Todo :Fetkovich水体数据转换
            var ct = solution.Find <OPT.Product.SimalorManager.RegisterKeys.Eclipse.AQUCT>();

            if (ct != null)
            {
                var newFetp = this.ConvertToSimON(ct);

                solution.Add(newFetp);

                ct.Delete();
            }

            // Todo :Fetkovich水体数据转换
            var fetp = solution.Find <OPT.Product.SimalorManager.RegisterKeys.Eclipse.AQUFETP>();

            if (fetp != null)
            {
                var newFetp = this.ConvertToSimON(fetp);

                solution.Add(newFetp);

                fetp.Delete();
            }

            // Todo :水体连接数据转换
            var aquancon = solution.Find <OPT.Product.SimalorManager.RegisterKeys.Eclipse.AQUANCON>();

            if (aquancon != null)
            {
                var newFetp = this.ConvertToSimON(aquancon);

                solution.Add(newFetp);

                aquancon.Delete();
            }

            #endregion

            #region - 流体模型 岩石模型-

            GRAVITY gravity = ecl.Key.Find <GRAVITY>();

            if (gravity != null)
            {
                // Todo :SimON只解析绝对密度
                DENSITY density = this.ConvertTo(gravity, unitType);

                gravity.ParentKey.Add(density);

                gravity.Delete();
            }

            List <IRegionInterface> regSoltionKeys = solution.FindAll <IRegionInterface>();

            regSoltionKeys.ForEach(l => l.TransToSimONRegion());
            simon.Key.Add(solution);
            //
            List <IRegionInterface> regPropsKeys = props.FindAll <IRegionInterface>();
            regPropsKeys.ForEach(l => l.TransToSimONRegion());

            //// Todo :SGWFN 需要特殊转换为 SWGF
            //SGWFN sgwfn = props.Find<SGWFN>();
            //if (sgwfn != null)
            //{
            //    //props.AddRange(sgwfn.ConvertTo());

            //    simon.Key.AddRange<SWGF>(sgwfn.ConvertTo());
            //}

            simon.Key.Add(props);



            #endregion

            #region - 初始化模型 -

            List <EQUIL> equil = solution.FindAll <EQUIL>();
            foreach (var item in equil)
            {
                EQUILPAR   equilpar = new EQUILPAR("EQUILPAR");
                EQUIL.Item it       = item.GetSingleRegion().GetSingleItem();

                equilpar.Szstzdhs0   = it.cksd0;
                equilpar.Szstljs1    = it.ckyl1;
                equilpar.Ctstyxhs2   = it.ysjmsd2;
                equilpar.Ctstyxzdhs3 = it.ysjmcmgyl3.ToDefalt("0");
                //equilpar.Jxstzds4 = it.yqjmsd4;
                equilpar.E100wgzds5   = it.yqjmsd4;
                equilpar.E300jxstzds6 = it.yqjmcmgyl5;

                item.ParentKey.Add(equilpar);
                item.Delete();
            }

            #endregion

            #region - 生产模型 -

            WELL well = new WELL("WELL");


            // Todo :添加完井数据 (注意要放到生产模型前面)
            simon.Key.Add(well);

            //  生产模型
            simon.Key.Add(this.ConvertToSimON(schedule, well, ecl.Key.Find <START>().StartTime, simon.HistoryData));


            #endregion

            // Todo :转换修正关键字
            List <ModifyKey> modifys = ecl.Key.FindAll <ModifyKey>();

            grid.AddRange(modifys);

            return(simon);
        }
示例#3
0
        /// <summary> 清理父节点 </summary>
        public void InitParentKey()
        {
            RUNSPEC runspec = this.Key.CreateSingle <RUNSPEC>("RUNSPEC");

            GRID grid = this.Key.CreateSingle <GRID>("GRID");

            if (grid != null)
            {
                INCLUDE include = new INCLUDE("INCLUDE");
                include.FileName = this.FileName.GetFileNameWithoutExtension() + "_grid.inc";
                include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName;
                grid.Add(include);

                INCLUDE include1 = new INCLUDE("INCLUDE");
                include1.FileName = this.FileName.GetFileNameWithoutExtension() + "_faults.inc";
                include1.FilePath = this.FilePath.GetDirectoryName() + "\\" + include1.FileName;
                grid.Add(include1);

                INCLUDE include2 = new INCLUDE("INCLUDE");
                include2.FileName = this.FileName.GetFileNameWithoutExtension() + "_aquifer.inc";
                include2.FilePath = this.FilePath.GetDirectoryName() + "\\" + include1.FileName;
                grid.Add(include2);
            }

            EDIT edit = this.Key.Find <EDIT>();

            if (edit != null)
            {
                INCLUDE include = new INCLUDE("INCLUDE");
                include.FileName = this.FileName.GetFileNameWithoutExtension() + "_edit.inc";
                include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName;
                edit.Add(include);
            }



            PROPS props = this.Key.CreateSingle <PROPS>("PROPS");

            if (props != null)
            {
                INCLUDE include = new INCLUDE("INCLUDE");
                include.FileName = this.FileName.GetFileNameWithoutExtension() + "_pvt.inc";
                include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName;
                props.Add(include);

                include          = new INCLUDE("INCLUDE");
                include.FileName = this.FileName.GetFileNameWithoutExtension() + "_rp.inc";
                include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName;
                props.Add(include);
            }


            SOLUTION solution = this.Key.CreateSingle <SOLUTION>("SOLUTION");

            if (solution != null)
            {
                INCLUDE include = new INCLUDE("INCLUDE");
                include.FileName = this.FileName.GetFileNameWithoutExtension() + "_init.inc";
                include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName;
                solution.Add(include);
            }



            REGIONS region = this.Key.CreateSingle <REGIONS>("REGIONS");

            if (region != null)
            {
                INCLUDE include = new INCLUDE("INCLUDE");
                include.FileName = this.FileName.GetFileNameWithoutExtension() + "_regs.inc";
                include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName;
                region.Add(include);
            }

            SUMMARY summary = this.Key.CreateSingle <SUMMARY>("SUMMARY");

            if (summary != null)
            {
                INCLUDE include = new INCLUDE("INCLUDE");
                include.FileName = this.FileName.GetFileNameWithoutExtension() + "_sum.inc";
                include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName;
                summary.Add(include);

                //if (include.Keys.Count == 0)
                //{
                //    ALL all = new ALL("ALL");
                //    include.Add(all);
                //}
            }

            SCHEDULE schedule = this.Key.CreateSingle <SCHEDULE>("SCHEDULE");

            if (schedule != null)
            {
                INCLUDE include = new INCLUDE("INCLUDE");
                include.FileName = this.FileName.GetFileNameWithoutExtension() + "_sch.inc";
                include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName;
                schedule.Add(include);
            }


            END end = this.Key.CreateSingle <END>("END");
        }
示例#4
0
 private static void HelpOnHelp()
 {
     Add("The command syntax for requesting additional help with NuGetHandler is:");
     Add();
     Add("  NuGetHandler -h <subject>");
     Add();
     Add("where <subject> is the desired section of help to be acquired. Given that the");
     Add("length of some of the subject matter is quite long, it is recommended that the");
     Add("output of the help system be piped to a text file for later review.");
     Add();
     Add("Some subjects will also yield the actual settings as derived from values");
     Add("present on the command line and from the various app.*.config files.");
     Add(@"To cause those values to be displayed, a verbosity value of ""detailed""");
     Add("to the command line e.g. -v detailed");
     Add();
     Add("The list of subjects follows:");
     Add(HelpSections.ToString());
     SectionBreak("Content of help sections");
     Add($"{"<none>".PadItRight()}The program summary plus this help description.");
     Add();
     Add($"{ALL.PadItRight()}Generate the entire help content (best");
     Add($"{String.Empty.PadItLeft()}redirected to a file for further perusal).");
     Add();
     Add($"{APP_CONFIG_SETTINGS.PadItRight()}Just the information as found in the appSettings");
     Add($"{String.Empty.PadItLeft()}portion of the app.config file and its possible");
     Add($"{String.Empty.PadItLeft()}app.optional.config files.");
     Add();
     Add($"{APP_CONFIG_NUSPEC_DOTNET.PadItRight()}Just the information as found in the");
     Add($"{String.Empty.PadItLeft()}DotNetNuSpecSettings section of the app.config");
     Add($"{String.Empty.PadItLeft()}file and its possible app.optional.config files.");
     Add();
     Add($"{APP_CONFIG_NUSPEC_NUGET.PadItRight()}");
     Add($"{String.Empty.PadItLeft()}NuGetNuSpecSettings section of the app.config file");
     Add($"{String.Empty.PadItLeft()}and its possible app.optional.config files.");
     Add();
     Add($"{COMMAND_LINE.PadItRight()}Help on the command line switches and named value");
     Add($"{String.Empty.PadItLeft()}pairs plus the command line introduction.");
     Add();
     Add($"{COMMAND_LINE_SWITCHES.PadItRight()}Help on just the command line switches.");
     Add();
     Add($"{COMMAND_LINE_NAMED_VALUES.PadItRight()}Help on just the command line named values.");
     Add();
     Add($"{COMMAND_SEQUENCE.PadItRight()}Complete list of commands and their respective");
     Add($"{String.Empty.PadItLeft()}command line parameters as supported in");
     Add($"{String.Empty.PadItLeft()}NuGetHandler");
     Add();
     Add($"{COMMAND_SEQUENCE_DOTNET_CORE.PadItRight()}Just the command sequence that supports .net Core");
     Add($"{String.Empty.PadItLeft()}projects (dotnet.exe)");
     Add();
     Add($"{COMMAND_SEQUENCE_NUGET.PadItRight()}Just the command sequence that supports full");
     Add($"{String.Empty.PadItLeft()}framework projects (nuget.exe)");
     Add();
     Add($"{COMMAND_SEQUENCE_DOTNET_STANDARD.PadItRight()}Just the comnmand sequence that supports .net");
     Add($"{String.Empty.PadItLeft()}standard projects (dotnet.exe)");
     Add();
     Add($"{CONFIG_INFO.PadItRight()}Display the settings for the final app.config,");
     Add($"{String.Empty.PadItLeft()}command line calculated values and other");
     Add($"{String.Empty.PadItLeft()}information as determined by the program when");
     Add($"{String.Empty.PadItLeft()}executed. If a project was designated,");
     Add($"{String.Empty.PadItLeft()}the processed project information will be");
     Add($"{String.Empty.PadItLeft()}displayed.");
     Add();
     Add($"{ENVIRONMENT.PadItRight()}Help and content for the program environment.");
     Add();
     Add($"{HELP.PadItRight()}This help description.");
     Add();
     Add($"{NUGET_PUSH.PadItRight()}The combined information concerning the locations");
     Add($"{String.Empty.PadItLeft()}(Push Repositories) of the various nuget servers");
     Add($"{String.Empty.PadItLeft()}and the corresponding destinations (Push");
     Add($"{String.Empty.PadItLeft()}Destinations) that match the repositories.");
     Add();
     Add($"{NUGET_PUSH_REPOS.PadItRight()}Just the information on the nuget server");
     Add($"{String.Empty.PadItLeft()}repositories");
     Add();
     Add($"{NUGET_PUSH_DESTINATIONS.PadItRight()}Just the information on the nuget server");
     Add($"{String.Empty.PadItLeft()}repository destinations.");
     Add();
     Add($"{POSTBUILD.PadItRight()}Emit the necessary code that should be placed");
     Add($"{String.Empty.PadItLeft()}in the Post-Build event section of the properties");
     Add($"{String.Empty.PadItLeft()}of a given project.");
     Add();
     Add($"{SETUP.PadItRight()}How to prepare to install the NuGetHandler");
     Add($"{String.Empty.PadItLeft()}program.");
     Add();
     Add($"{SUMMARY.PadItRight()}Just the summary information for the NuGetHandler");
     Add($"{String.Empty.PadItLeft()}program.");
     Add();
     Add($"{TOKENS.PadItRight()}Help on the replaceable tokens as found in the");
     Add($"{String.Empty.PadItLeft()}app.config file.");
     Add();
 }