美文网首页
明确问题在哪

明确问题在哪

作者: harrytc | 来源:发表于2018-04-21 19:57 被阅读17次

本次的主题是“还好你没放弃,讲述一件你没放弃的事,一个没放弃的人,一个没放弃的梦想,一段没放弃的旅程......”

最近一段时间在处理油藏数值模拟内容
现在出现几个问题

  • 将testField的改变值传递给变量(基本解决)
  • 将压力曲线以什么样的形式表显示出来
  • 界面设计太简陋,输出的压力值放在哪里,压力曲线放在哪里

附上主程序的代码

public class OneDimension 
{
     static MyFrame frame;
    /*
     *This code is calculating for one dimension reservoir numerical simulation
     */
    public double φ=0.25;           //孔隙度
    double k=0.05;          //渗透率
    double μ = 1;           //粘度μ
    double con=0.0005;      //压缩系数 con
    double rw=10;           //井筒半径 rw
    double re=25000;        //供给边界半径 re
    int Pe= 100;            //供给边界压力 Pe
    int Pi=100;             //原始地层压力 Pi
    double qv=173.611;      //定产量 q
    int h = 500;            //油层厚度h
    int n=30;           //网格数
    int delta=30*86400; //两网格之间的时间差
    int tmax=360*86400; //最大生产时间
    
    double r[]=new double[31];
    double a[]=new double[31];
    double b[]=new double[31];
    double c[]=new double[31];
    double d[]=new double[31];
    double p[]=new double[31];
    double q[]=new double[31];
    
    
    double u[]=new double[31];
    double l[]=new double[31];
    double detx=Math.log(re / rw)/n;
    double xa[]=new double[30];
    double xb[]=new double[30];
    double xc[]=new double[30];
    double xd[]=new double[30];
    double m[]=new double[30];
    double lamd[]=new double[30];

    double dr[]=new double[30];
    double pch[]=new double[31];
    double pre[]=new double[31];

    
    double x[]=new double[31];
    double y[]=new double[31];
    
    
    public  OneDimension()
    {
        for (int i=1;i<=29;i++)
        {
            m[i]=Math.exp(2*i*detx)*φ*μ*con*detx*detx*rw*rw/(k*delta);
            lamd[i]=2+m[i];
        }
        
        for (int i=0;i<=29;i++)
        {
        pre[i]=100;
        }
        
        dr[0]=(qv*μ*detx)/(2*Math.PI*k*h);
        xa[0]=0;
        for(int i=1;i<=29;i++)
        {   
            xa[i] = 1;
        }   
            xb[0]=-1;
        for (int i=1;i<=29; i++)
            xb[i]=-lamd[i];
        for (int i=0; i<=28; i++)
            xc[i] = 1;
        
        xc[29] = 0;
        
        for (int i=1;i<=30;i++)
        {
            r[i] = Math.exp(i*detx ) *rw;
        }
    }

        
    public double[] lu(double pa[], double pb[], double pc[], double pd[])
    {
                 System. arraycopy(pa, 0, a, 1, pa.length);
                 System. arraycopy (pb, 0, b, 1, pb.length);
                 System. arraycopy(pc, 0, c, 1, pc.length);
                 System. arraycopy(pd, 0, d, 1, pd.length);
                 
                 u [ 1 ] = b [1];
                 for ( int i = 2 ; i <= 30 ; i ++ ) 
                 {
                     l[i] = a[i]/(u[i - 1]);
                     u[i] = b[i] - l[i]*c[i-1];
                 }
                 y[1] = d[1];
                 for ( int i = 2 ;i <= 30 ; i ++ ) 
                 {
                     y[i]=d[i] - l[i]*y[i - 1];
                 }
                 x[30] = y[30] / (u[30]); 
                 for ( int i = 29 ; i >= 1 ; i--)
                 {
                         x[i]=(y[i]-c[i]*x[i+1])/u[i];
                 }
                         return x;
    }
    public void compute() 
    {
                        
                         for(int i=1;i<=29; i++)
                             dr[i]=-m[i]*pre[i];
                         for(int i=0; i<=28; i++)
                             xd[i]=dr[i];
                         
            xd[29]=dr[29]-Pe;
            pch=lu(xa, xb, xc, xd);
            System.arraycopy(pch,1,pre, 0,(pch.length-1));
            pre[30] = 100 ; 
                                 
    }
    public void print() {
                            for ( int i = 1 ;i <= 30 ;i++)
                                
                            {
                                System.out.println(" pressure of the " + i +"th grid is "+pre[i]);
                            }
    }
                                
     public void start()
     {
                for ( int t = 1 ; t <= 12 ;t ++ ) {
                 compute();
                }
     }
                
    
     
     public static void main ( String[] args ) 
     {
         EventQueue.invokeLater(new Runnable() {
                public void run() {
                    try {
                        frame = new MyFrame();
                        frame.setVisible(true);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            });
    
            
         
         
         OneDimension test = new OneDimension();
         test. start();
         test. print();
         
     }
}

说实话在做的过程中遇到的很多问题,很多困难无从下手,但是还好我没有放弃,如果一碰到难题就退缩的话我也就不是我了,再做一周,少一些娱乐活动就OK

相关文章

  • 明确问题在哪

    本次的主题是“还好你没放弃,讲述一件你没放弃的事,一个没放弃的人,一个没放弃的梦想,一段没放弃的旅程......”...

  • 问题明确 回答明确

    今天安装电视 由女儿来跟我们沟通,她问的问题很准确,回答也很准确 ,当别人要我们手机号,她拒绝了。 姐姐的责任心是...

  • 明确问题

    理清思路,问题导向,目标导向,专注。

  • 听增收课~感悟自己四大错误

    自己知道修炼有问题,但不是很明确,听了白虹分享的增收课后更加明确的知道自己错在哪里! 一、未管理自己的注意力 1、...

  • 痛苦和快乐的优先级

    第一天:自律到底用在哪里? 课程主要内容: 目的: 澄清问题对于成长的意义 明确自律究竟用在哪里 澄清自律对于成长...

  • 明确理解问题

    明确和理解问题的三个步骤 (1)理解问题点是什么; (2)明确希望达到的目标; (3)明确可以利用的资源。 遇到问...

  • 19.2.21 明确问题!

    还是迷迷糊糊的状态啊~ 中午逼自己去的健身房,练完以后下午觉得精神状态好多了,身体状态也觉得舒服,而且好像春节回来...

  • 如何明确问题?

    当问题没有明确时,人的思维就像一团浆糊。 当问题明确时,就像找到了毛线球的线头,牵一发而动全身。 明确问题,应找到...

  • 真自由训练营Day1:自律到底在哪用

    笔记: 目的:解决痛点:总是被问题困住1、澄清问题对成长的意义2、明确自律到底用在哪?3、澄清自律对成长的价值真自...

  • 明确问题及理解问题

    第一步是明确及理解问题; 第二步是拆分及定位问题; 第三步才是提出解决方案; 第四步是总结问题。 其中拆分和定位问...

网友评论

      本文标题:明确问题在哪

      本文链接:https://www.haomeiwen.com/subject/czrflftx.html