资源描述:
《油藏数值模拟隐式差分MATLAB源程序》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、%隐式求解方法%t为投产后某一时刻,单位:天%d:迭代时间;%Pwfl:Wl井底流压;%Q2:W2井产油量;function[P/d,Pwfl/Q2]=implict(t)%油藏参数Pini=20;u=5e-3;C=2e-4;Ql=30;Pwf2=15;dx=200;dy=200;dt=24;n=t*24/dt;%迭代时间步数re=0.208*dx;rw=0.1;%渗透率K=[02592222001901801850000;259259222200190180185185000;310310240235228210195195000;3303
2、30290270250230205197.51801850;350350300280259222200190180185185;340340320290310240235228210195195;355355335315310290270250230205205;0000325300280240210215215;0000340320290260235225225;00003553353152952752550];%厚度H=K/50;%孔隙度Fai=(K.*0.02+15)/100;%地层压力P=Pini*ones(10,H);%P(l,:)
3、=0;%P(2:10,l)=0;%P(2:10zll)=0;%P(2:4,&10)=0;%P(&10,2:4)二0;%系数矩阵%初始化a=zeros(10,ll);b=zeros(10/ll);c=zeros(10,ll);d=zeros(10,ll);e=zeros(10,ll);%fori=2:9forj=2:10a(i』=3600~9水dt*2*H(ijJ)*K(iH广K(ij)/u/C/Fai(ij)/dx/dx/(H(ijJ)*K(ijJ)+H(ij广K(i』);b(iJ)=3600e-9*dt*2*H(iJ+l)*K(i/j+l)
4、*K(ij)/u/C/Fai(iJ)/dx/dx/(H(iJ+l)*K(iJ+l)+H(iJ)*K(ij));c(izj)=3600e-9*dt*2*H(i+lj)*K(i+lj)*K(ij)/u/C/Fai(i,j)/dx/dx/(H(i+l,j)*K(i+lj)+H(ij)*K(i,j));d(iJ)=3600e-9*dt*2*H(i-lj)*K(i-lj)*K(ij)/u/C/Fai(i/j)/dx/dx/(H(i-lj)*K(i-lj)+H(ij)*K(ij));e(ij)=-l-a(ij)-b(iJ)-c(ij)-d(ij);end
5、end%初始吋刻地层压力p=Pini*ones(52,l);%系数矩阵AA=zeros(52);%第9行A(l,l)=e(9,6);A(l,2)=b(9,6);A(l,6)=d(9,6);fori=2:4A(i,i-l)=a(9,i+5);A(i,i)=e(9/i+5);A(i,i+l)=b(9J+5);A(U+5)=d(9zi+5);endA(5z4)=a(9,10);A(5,5)=e(9,10)+b(9z10);A(5,10)=d(9,10);%第8行A(6,l)=c(8,6);A(6,6)=e(8/6);A(6,7)=b(8,6);A(
6、6,12)=d(8,6);fori=7:9A(iJ-5)=c(8,i);A(i,i-l)=a(8,i);A(iJ)=e(8,i);A(i,i+l)=b(8J);A(i,i+6)=d(8,i);endA(10,5)=c(8,10);A(10,9)=a(8,10);A(10,10)=e(8/10)+b(8z10);A(10,16)=d(&10);%第7行A(ll/ll)=e(7/5);A(ll/12)=b(7,5);A(ll,20)=d(7,5);fori=12:15A(iJ-6)=c⑺i・6);A(iJ-l)=a(7J-6);A(i/i)=e(
7、7,i-6);A(i/i+l)=b(7/i-6);A(iJ+9)=d(7J-6);endA(16,10)=c(7z10);A(16,15)=a(7,10);A(16,16)=e(7,10)+b(7z10);A(16z25)=d(7,10);%第6行A(17/17)=e(6/2)+a(6/2);A(17,18)=b(6,2);A(17/26)=d(6/2);fori=18:19A(iJ-l)=a(6J-15);A(iJ)=e(6J-15);A(i,i+l)=b(6J-15);A(i/i+9)=d(6/i-15);endfori=20:23A(i
8、J-9)=c(6J-15);A(iJ-l)=a(6J-15);A(i,i)=e(6,i-15);A(i,i+l)=b(6J-15);A(i,i+9)=d(6,i-1