Ejemplo n.º 1
0
        public List <WellData> ParseSkv(string filename)
        {
            Converter converter = new Converter();

            var result = new List <WellData>();
            var sr     = new StreamReader(filename);

            string[] buf;
            sr.ReadLine();
            sr.ReadLine();
            sr.ReadLine();
            while (!sr.EndOfStream)
            {
                buf = sr.ReadLine().Split(new char[] { ' ', '\t' });
                if ((buf.Count() == 8) && (buf.Count(x => x == "") == 0))
                {
                    result.Add(new WellData
                    {
                        Name = buf[0],
                        Data = new wells_measurements()
                        {
                            measure_date = Convert.ToDateTime(buf[1]),
                            gas_output   = (float)(Convert.ToDouble(buf[2]) * 1000 / converter.ToSec(1, Units.Day)),
                            cond_output  = (float)(converter.ToKG(Convert.ToDouble(buf[3]), Units.T) / converter.ToSec(1, Units.Day)),
                            wellhead_P   = (float)(converter.ToPascal(Convert.ToDouble(buf[4]))),
                            wellhead_T   = (float)(converter.ToK(Convert.ToDouble(buf[5]), Units.C)),
                            inlet_P      = (float)(converter.ToPascal(Convert.ToDouble(buf[6]))),
                            inlet_T      = (float)(converter.ToK(Convert.ToDouble(buf[7]), Units.C))
                        }
                    });
                }
            }
            return(result);
        }
Ejemplo n.º 2
0
        public List <PipeData> ParsePipes(string filename)
        {
            Converter converter = new Converter();
            var       result    = new List <PipeData>();
            var       sr        = new StreamReader(filename);

            string[] buf;
            sr.ReadLine();
            while (!sr.EndOfStream)
            {
                buf = sr.ReadLine().Split(new char[] { ' ', '\t' });
                if (buf.Count() != 0)
                {
                    result.Add(new PipeData()
                    {
                        Num       = Convert.ToInt32(buf[0]),
                        Length    = Convert.ToDouble(buf[1]),
                        OuterD    = converter.ToM(Convert.ToDouble(buf[2]), Units.Mm),
                        Width     = converter.ToM(Convert.ToDouble(buf[3]), Units.Mm),
                        InnerD    = converter.ToM(Convert.ToDouble(buf[4]), Units.Mm),
                        Roughness = converter.ToM(Convert.ToDouble(buf[5]), Units.Mm),
                        StartNode = buf[6],
                        EndNode   = buf[7],
                        OuterT    = converter.ToK(Convert.ToDouble(buf[8]), Units.C)
                    });
                }
            }
            return(result);
        }
Ejemplo n.º 3
0
        public List <SborData> ParseSbor(string filename)
        {
            Converter converter = new Converter();

            var result = new List <SborData>();
            var sr     = new StreamReader(filename);

            string[] buf;
            sr.ReadLine();
            sr.ReadLine();
            sr.ReadLine();
            while (!sr.EndOfStream)
            {
                buf = sr.ReadLine().Split(new char[] { ' ', '\t' });
                if ((buf.Count() == 3) && (buf.Count(x => x == "") == 0))
                {
                    result.Add(new SborData
                    {
                        Date = Convert.ToDateTime(buf[0]),
                        P    = converter.ToPascal(Convert.ToDouble(buf[1])),
                        T    = converter.ToK(Convert.ToDouble(buf[2]), Units.C)
                    });
                }
            }
            return(result);
        }
Ejemplo n.º 4
0
        public List<WellData> ParseSkv(string filename)
        {
            Converter converter = new Converter();

            var result = new List<WellData>();
            var sr = new StreamReader(filename);
            string[] buf;
            sr.ReadLine();
            sr.ReadLine();
            sr.ReadLine();
            while (!sr.EndOfStream)
            {
                buf = sr.ReadLine().Split(new char[] { ' ', '\t' });
                if ((buf.Count() == 8)&&(buf.Count(x => x == "") == 0))
                    result.Add(new WellData
                    {
                        Name = buf[0],
                        Data = new wells_measurements()
                        {
                            measure_date = Convert.ToDateTime(buf[1]),
                            gas_output = (float)(Convert.ToDouble(buf[2]) * 1000 / converter.ToSec(1, Units.Day)),
                            cond_output = (float)(converter.ToKG(Convert.ToDouble(buf[3]), Units.T) / converter.ToSec(1, Units.Day)),
                            wellhead_P = (float)(converter.ToPascal(Convert.ToDouble(buf[4]))),
                            wellhead_T = (float)(converter.ToK(Convert.ToDouble(buf[5]), Units.C)),
                            inlet_P = (float)(converter.ToPascal(Convert.ToDouble(buf[6]))),
                            inlet_T = (float)(converter.ToK(Convert.ToDouble(buf[7]), Units.C))
                        }
                    });
            }
            return result;
        }
Ejemplo n.º 5
0
        public List<SborData> ParseSbor(string filename)
        {
            Converter converter = new Converter();

            var result = new List<SborData>();
            var sr = new StreamReader(filename);
            string[] buf;
            sr.ReadLine();
            sr.ReadLine();
            sr.ReadLine();
            while (!sr.EndOfStream)
            {
                buf = sr.ReadLine().Split(new char[] { ' ', '\t' });
                if ((buf.Count() == 3)&&(buf.Count(x => x == "") == 0))
                    result.Add(new SborData
                    {
                        Date = Convert.ToDateTime(buf[0]),
                        P = converter.ToPascal(Convert.ToDouble(buf[1])),
                        T = converter.ToK(Convert.ToDouble(buf[2]), Units.C)
                    });
            }
            return result;
        }
Ejemplo n.º 6
0
 public List<PipeData> ParsePipes(string filename)
 {
     Converter converter = new Converter();
     var result = new List<PipeData>();
     var sr = new StreamReader(filename);
     string[] buf;
     sr.ReadLine();
     while (!sr.EndOfStream)
     {
         buf = sr.ReadLine().Split(new char[] { ' ', '\t' });
         if (buf.Count() != 0)
             result.Add(new PipeData()
             {
                 Num = Convert.ToInt32(buf[0]),
                 Length = Convert.ToDouble(buf[1]),
                 OuterD = converter.ToM(Convert.ToDouble(buf[2]), Units.Mm),
                 Width = converter.ToM(Convert.ToDouble(buf[3]), Units.Mm),
                 InnerD = converter.ToM(Convert.ToDouble(buf[4]), Units.Mm),
                 Roughness = converter.ToM(Convert.ToDouble(buf[5]), Units.Mm),
                 StartNode = buf[6],
                 EndNode = buf[7],
                 OuterT = converter.ToK(Convert.ToDouble(buf[8]), Units.C)
             });
     }
     return result;
 }