﻿{"id":2041,"date":"2023-03-24T03:13:50","date_gmt":"2023-03-24T03:13:50","guid":{"rendered":"http:\/\/81.70.49.155\/?p=2041"},"modified":"2023-03-24T03:13:50","modified_gmt":"2023-03-24T03:13:50","slug":"%e5%be%ae%e6%b5%81%e6%8e%a7%e6%8a%80%e6%9c%af%e4%b8%8e%e5%bb%ba%e6%a8%a1%e8%af%be%e7%a8%8b%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"http:\/\/81.70.49.155\/?p=2041","title":{"rendered":"\u5fae\u6d41\u63a7\u6280\u672f\u4e0e\u5efa\u6a21\u8bfe\u7a0b\u4ee3\u7801"},"content":{"rendered":"<p>\n\t<span style=\"background-color:#E53333;\">Main.m<\/span>\n<\/p>\n<p>\n\tclc; clear; close;<br \/>\ncolormap jet<br \/>\nlx=300;&nbsp; &nbsp; ly=60;<br \/>\ncs=1\/3^0.5; c_squ=cs^2;&nbsp;<br \/>\nt1=4\/9; t2=1\/9; t3=1\/36;&nbsp;<br \/>\nRe=100;<br \/>\nUin=0.05;<br \/>\nnu=(ly-1)*Uin\/Re;<br \/>\ntau=3*nu+0.5;<br \/>\nomega=1\/tau;<br \/>\noppo=[5,6,7,8,1,2,3,4,9];&nbsp;<br \/>\nt= [1\/9,1\/36,1\/9,1\/36,1\/9,1\/36,1\/9,1\/36,4\/9];%D2Q9\u6743\u91cd<br \/>\nex=[1, 1, 0, -1, -1, -1, 0, 1, 0];&nbsp; &nbsp; &nbsp;% D2Q9\u65b9\u5411\u5411\u91cf<br \/>\ney=[0, 1, 1, 1, 0, -1, -1, -1, 0];&nbsp; &nbsp; &nbsp;% D2Q9\u65b9\u5411\u5411\u91cf<br \/>\nrho=ones(ly,lx);<br \/>\nUX=zeros(ly,lx);&nbsp;<br \/>\nUX(:,1:lx\/2)=0.1;&nbsp;<br \/>\nUY=zeros(ly,lx);&nbsp;<br \/>\nF=zeros(ly,lx,9);<br \/>\nF=FEQf(UX,UY,rho,t1,t2,t3,c_squ);<br \/>\nfor i=1:10000<br \/>\nF=stream(F,ly,lx);<br \/>\nrho = sum(F,3);<span> <\/span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;%\u8ba1\u7b97\u5bc6\u5ea6<br \/>\nUX=(sum(F(:,:,[1 2 8]),3)-sum(F(:,:,[4 5 6]),3)).\/rho;&nbsp; &nbsp; &nbsp; &nbsp; %\u8ba1\u7b97x\u901f\u5ea6<br \/>\nUY=(sum(F(:,:,[2 3 4]),3)-sum(F(:,:,[6 7 8]),3)).\/rho;&nbsp; &nbsp; &nbsp; &nbsp; %\u8ba1\u7b97y\u901f\u5ea6<br \/>\nP=cs^2*rho;<br \/>\nUX([1,ly],:)=0;UY([1,ly],:)=0; %\u58c1\u9762<br \/>\nUX(:,1)=Uin; UY(:,1)=0;&nbsp; %\u5de6\u5165\u53e3<br \/>\nrho(:,1)=rho(:,2);<br \/>\nUX(:,lx)=UX(:,lx-1); UY(:,lx)=0;&nbsp; %\u53f3\u51fa\u53e3<br \/>\nrho(:,1)=1;<br \/>\nFEQ=FEQf(UX,UY,rho,t1,t2,t3,c_squ);<br \/>\nFb=F;<br \/>\nF=omega*FEQ+(1-omega)*F;&nbsp; %\u78b0\u649e<br \/>\nF([1,ly],:,:)=Fb([1,ly],:,oppo);<br \/>\nF(:,1,:)=FEQ(:,1,:)+(F(:,2,:)-FEQ(:,2,:));<br \/>\nF(:,lx,:)=FEQ(:,lx,:)+(F(:,lx-1,:)-FEQ(:,lx-1,:));<br \/>\nif mod(i,20)==0<br \/>\nU= (UX.^2+ UY.^2).^0.5;<br \/>\nimagesc(U);<br \/>\naxis equal<br \/>\ndrawnow<br \/>\naxis xy&nbsp;<br \/>\nend<br \/>\nend\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t<span style=\"background-color:#E53333;\">stream.m<\/span>\n<\/p>\n<p>\n\tfunction F=stream(F,ly,lx)<br \/>\nF(:,:,1)=F(:,[lx 1:lx-1],1);<br \/>\nF(:,:,2)=F([ly 1:ly-1], [lx 1:lx-1],2);<br \/>\nF(:,:,3)=F([ly 1:ly-1],:,3);<br \/>\nF(:,:,4)=F( [ly 1:ly-1], [2:lx 1],4);<br \/>\nF(:,:,5)=F(:,[2:lx 1],5);<br \/>\nF(:,:,6)=F([2:ly 1], [2:lx 1],6);<br \/>\nF(:,:,7)=F([2:ly 1],:,7);<br \/>\nF(:,:,8)=F([2:ly 1],[lx 1:lx-1],8);<\/p>\n<p>\n\t\t\n\t<\/p>\n<p>\n\t\t<span style=\"background-color:#E53333;\">FEQf.m<\/span>\n\t<\/p>\n<p>function FEQ=FEQf(UX,UY,rho,t1,t2,t3,c_squ)<br \/>\n<span> <\/span>U_SQU=UX.^2+UY.^2;&nbsp; &nbsp; &nbsp; U_C2=UX+UY;<br \/>\n<span> <\/span>U_C4=-UX+UY;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; U_C6=-U_C2;<br \/>\n<span> <\/span>U_C8=-U_C4;<br \/>\n<span> <\/span>FEQ(:,:,1)=t2*rho.*(1+UX\/c_squ+0.5*(UX\/c_squ).^2-U_SQU\/(2*c_squ));<br \/>\n<span> <\/span>FEQ(:,:,3)=t2*rho.*(1+UY\/c_squ+0.5*(UY\/c_squ).^2-U_SQU\/(2*c_squ));<br \/>\n<span> <\/span>FEQ(:,:,5)=t2*rho.*(1-UX\/c_squ+0.5*(UX\/c_squ).^2-U_SQU\/(2*c_squ));<br \/>\n<span> <\/span>FEQ(:,:,7)=t2*rho.*(1-UY\/c_squ+0.5*(UY\/c_squ).^2-U_SQU\/(2*c_squ));<br \/>\n<span> <\/span>FEQ(:,:,2)=t3*rho.*(1+U_C2\/c_squ+0.5*(U_C2\/c_squ).^2-U_SQU\/(2*c_squ));<br \/>\n<span> <\/span>FEQ(:,:,4)=t3*rho.*(1+U_C4\/c_squ+0.5*(U_C4\/c_squ).^2-U_SQU\/(2*c_squ));<br \/>\n<span> <\/span>FEQ(:,:,6)=t3*rho.*(1+U_C6\/c_squ+0.5*(U_C6\/c_squ).^2-U_SQU\/(2*c_squ));<br \/>\n<span> <\/span>FEQ(:,:,8)=t3*rho.*(1+U_C8\/c_squ+0.5*(U_C8\/c_squ).^2-U_SQU\/(2*c_squ));<br \/>\n<span> <\/span>FEQ(:,:,9)=t1*rho.*(1-U_SQU\/(2*c_squ));<\/p>\n<div>\n\t\t\n\t<\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Main.m clc; clear; close; colormap jet lx=300;&nbsp; &#038;n &hellip; <a href=\"http:\/\/81.70.49.155\/?p=2041\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u5fae\u6d41\u63a7\u6280\u672f\u4e0e\u5efa\u6a21\u8bfe\u7a0b\u4ee3\u7801\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"views":799,"_links":{"self":[{"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/posts\/2041"}],"collection":[{"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/81.70.49.155\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2041"}],"version-history":[{"count":1,"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/posts\/2041\/revisions"}],"predecessor-version":[{"id":2042,"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/posts\/2041\/revisions\/2042"}],"wp:attachment":[{"href":"http:\/\/81.70.49.155\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/81.70.49.155\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2041"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/81.70.49.155\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}