﻿{"id":3194,"date":"2024-02-14T21:20:42","date_gmt":"2024-02-14T13:20:42","guid":{"rendered":"http:\/\/81.70.49.155\/?p=3194"},"modified":"2024-02-14T21:20:42","modified_gmt":"2024-02-14T13:20:42","slug":"%e4%bb%8e%e5%8d%95%e7%9b%b8%e6%b5%81%ef%bc%88%e9%80%9a%e9%81%93%e6%b5%81%e5%8a%a8%ef%bc%89%e6%94%b9%e4%b8%ba%e5%a4%9a%e7%9b%b8%e6%b5%81%ef%bc%88shanchen-model%ef%bc%89-step1","status":"publish","type":"post","link":"http:\/\/81.70.49.155\/?p=3194","title":{"rendered":"\u4ece\u5355\u76f8\u6d41\uff08\u901a\u9053\u6d41\u52a8\uff09\u6539\u4e3a\u591a\u76f8\u6d41\uff08Shan&#038;Chen model\uff09-Step1"},"content":{"rendered":"<h4>\n\tStep1 \u8fd9\u4e00\u6b65\u5c06\u4e00\u4e9b\u6a21\u5757\u5355\u72ec\u62ff\u51fa\u6765\u505a\u5916\u6302\u5b50\u7a0b\u5e8f\uff0c\u8fd9\u4e9b\u5b50\u7a0b\u5e8f\u662f\u9700\u8981\u8fdb\u884c\u590d\u7528\u7684\uff0c\u8fd9\u8981\u505a\u53ef\u4ee5\u7b80\u5316\u4e3b\u7a0b\u5e8f\u3002<br \/>\n<\/h4>\n<p>\n\t\n<\/p>\n<p>\n\t%\u7ea2\u8272\u4ee3\u7801\u4e3a\u589e\u52a0\u4ee3\u7801\uff1b\u7eff\u5e95\u4e3a\u5c4f\u853d\u7684\u4ee3\u7801\n<\/p>\n<p>\n%\u521d\u59cb\u5316<\/p>\n<p>clc; clear; close;&nbsp;&nbsp;<br \/>\nlx=40;&nbsp; ly=20;&nbsp; &nbsp;<br \/>\nRe=1.25;<br \/>\nyu=0.1;<br \/>\nfx0=Re*8*yu^2\/(ly-1)^3;&nbsp; &nbsp;<br \/>\nW=[4\/9,1\/9,1\/9,1\/9,1\/9,1\/36,1\/36,1\/36,1\/36];<br \/>\nex=[0, 1, 0, -1, 0&nbsp; 1,-1, -1, 1];<br \/>\ney=[0, 0, 1, 0, -1, 1, 1, -1,-1];<br \/>\ncs=1\/sqrt(3);<br \/>\nopposite=[1,4,5,2,3,8,9,6,7];<br \/>\nrho=ones(lx,ly);<br \/>\nu=zeros(lx,ly);<br \/>\nv=zeros(lx,ly);<br \/>\nfx=zeros(lx,ly)+fx0;<br \/>\nfy=zeros(lx,ly);<br \/>\nM1=W(1)*rho; M2=W(2)*rho; M3=W(6)*rho;<br \/>\nF= cat(3,M1,M2,M2,M2,M2,M3,M3,M3,M3);<br \/>\n<span style=\"background-color:#E53333;\">Feq=F; F0=F;<\/span><\/p>\n<p>%% \u4e3b\u5faa\u73af===========================================<br \/>\nfor tStep=1:20000<br \/>\n<span style=\"background-color:#E53333;\">F=Stream(F,F0,lx,ly);<\/span><\/p>\n<p>%\u8ba1\u7b97\u5b8f\u89c2\u91cf<br \/>\nrho=sum(F,3);<br \/>\nu=(sum(F(:,:,[2,6,9]),3)-sum(F(:,:,[4,7,8]),3)).\/rho+fx\/2.\/rho;<br \/>\nv=(sum(F(:,:,[3,6,7]),3)-sum(F(:,:,[5,8,9]),3)).\/rho+fy\/2.\/rho;<\/p>\n<p>%\u8bbe\u7f6e\u5b8f\u89c2\u8fb9\u754c<br \/>\nrho(:,1)=rho(:,2);<br \/>\nrho(:,ly)=rho(:,ly-1);<br \/>\nu(:,1)=0;&nbsp; u(:,ly)=0;<br \/>\nv(:,1)=0;&nbsp; v(:,ly)=0;<\/p>\n<p><span style=\"background-color:#E53333;\">Feq=Feqf(rho,u,v,ex,ey,W,cs);<\/span><\/p>\n<p>%\u78b0\u649e<br \/>\n<span style=\"background-color:#E53333;\">force=Calforce(u,v,fx,fy,ex,ey,W,yu);<\/span><br \/>\nF=F-1\/(0.5+3*yu)*(F-Feq)+force;<br \/>\n&nbsp; &nbsp;&nbsp;<br \/>\n%\u5fae\u89c2\u8fb9\u754c\u8bbe\u7f6e<br \/>\nF(:,[1,ly],:)=F(:,[1,ly],opposite);<br \/>\n% F(:,1,:)=Feq(:,1,:)+(F(:,2,:)-Feq(:,2,:));<br \/>\n% F(:,ly,:)=Feq(:,ly,:)+(F(:,ly-1,:)-Feq(:,ly-1,:));<\/p>\n<p>%\u540e\u5904\u7406<br \/>\nif mod(tStep,500)==0<br \/>\nclc;clf<br \/>\ntStep<br \/>\nU=(u.^2+v.^2).^0.5;<br \/>\nsubplot(1,2,1),imagesc(U');<br \/>\ncolormap jet<br \/>\naxis equal<br \/>\ncy=(ly-1)\/2;<br \/>\ny0=fx0\/2\/yu*(cy.^2-([0:ly-1]-cy).^2);<br \/>\nNi=floor(lx\/2);<br \/>\nsubplot(1,2,2),hold on,plot(y0,'k'),plot(u(Ni,:),'r'); hold off<br \/>\ndrawnow<br \/>\nend<\/p>\n<p>\n\tend&nbsp; % \u4e3b\u5faa\u73af\u7ed3\u675f============================\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t%%%%y\u4ee5\u4e0b\u4e3a\u5b50\u7a0b\u5e8f%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n<\/p>\n<p>\n\t<span style=\"background-color:#EE33EE;\">%1 Stream.m \u8fc1\u79fb\uff01<\/span>\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\tfunction F=Stream(F,F0,lx,ly)<\/p>\n<p>%\u8fc1\u79fb\u4e0b\u6807<br \/>\nD2x=[lx,1:lx-1]; D2y=[1:ly];<br \/>\nD3x=[1:lx];&nbsp; &nbsp; &nbsp; D3y=[ly,1:ly-1];<br \/>\nD4x=[2:lx,1];&nbsp; &nbsp; D4y=[1:ly];<br \/>\nD5x=[1:lx];&nbsp; &nbsp; &nbsp; D5y=[2:ly,1];<br \/>\nD6x=[lx,1:lx-1]; D6y=[ly,1:ly-1];<br \/>\nD7x=[2:lx,1];&nbsp; &nbsp; D7y=[ly,1:ly-1];<br \/>\nD8x=[2:lx,1];&nbsp; &nbsp; D8y=[2:ly,1];<br \/>\nD9x=[lx,1:lx-1]; D9y=[2:ly,1];<\/p>\n<p>% \u8fc1\u79fb<br \/>\nF0(:,:,1)=F(:,:,1);<br \/>\nF0(:,:,2)=F(D2x,D2y,2);<br \/>\nF0(:,:,3)=F(D3x,D3y,3);<br \/>\nF0(:,:,4)=F(D4x,D4y,4);<br \/>\nF0(:,:,5)=F(D5x,D5y,5);<br \/>\nF0(:,:,6)=F(D6x,D6y,6);<br \/>\nF0(:,:,7)=F(D7x,D7y,7);<br \/>\nF0(:,:,8)=F(D8x,D8y,8);<br \/>\nF0(:,:,9)=F(D9x,D9y,9);<br \/>\nF=F0;\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t<span style=\"background-color:#EE33EE;\">%2 Feqf.m \u8ba1\u7b97\u5e73\u8861\u6001\u5206\u5e03\u51fd\u6570<\/span>\n<\/p>\n<p>\n\t%function Feq=Feqf(rho,u,v,ex,ey,W,cs);<br \/>\n%\u8ba1\u7b97\u5e73\u8861\u6001\u51fd\u6570<br \/>\nfor i=1:9<br \/>\n&nbsp; &nbsp; &nbsp;M1=(ex(i)*u+ey(i)*v)\/cs^2;<br \/>\n&nbsp; &nbsp; &nbsp;M2=M1.^2\/2;<br \/>\n&nbsp; &nbsp; &nbsp;M3=(u.^2+v.^2)\/2\/cs^2;<br \/>\n&nbsp; &nbsp; &nbsp;Feq(:,:,i)=rho.*W(i).*(1+M1+M2-M3);<br \/>\nend<\/p>\n<p><span style=\"background-color:#EE33EE;\">%3&nbsp;<\/span><span style=\"background-color:#EE33EE;\">Calforce.m \u8ba1\u7b97\u5916\u529b\u683c\u5f0f\uff08\u78b0\u649e\u90e8\u5206\u4f7f\u7528\uff09<\/span>\n<\/p>\n<p>\n\tfunction force=Calforce(u,v,fx,fy,ex,ey,W,yu)<br \/>\nfor i=1:9<br \/>\n&nbsp; &nbsp; M1=3*(ex(i)-u).*fx+3*(ey(i)-v).*fy;<br \/>\n&nbsp; &nbsp; M2=9*(ex(i)*u+ey(i)*v).*(ex(i).*fx+ey(i).*fy);<br \/>\n&nbsp; &nbsp; force(:,:,i)=W(i)*(1-0.5\/(0.5+3*yu))*(M1+M2);<br \/>\nend<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step1 \u8fd9\u4e00\u6b65\u5c06\u4e00\u4e9b\u6a21\u5757\u5355\u72ec\u62ff\u51fa\u6765\u505a\u5916\u6302\u5b50\u7a0b\u5e8f\uff0c\u8fd9\u4e9b\u5b50\u7a0b\u5e8f\u662f\u9700\u8981\u8fdb\u884c\u590d\u7528\u7684\uff0c\u8fd9\u8981\u505a\u53ef\u4ee5\u7b80\u5316\u4e3b\u7a0b\u5e8f\u3002 %\u7ea2\u8272 &hellip; <a href=\"http:\/\/81.70.49.155\/?p=3194\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u4ece\u5355\u76f8\u6d41\uff08\u901a\u9053\u6d41\u52a8\uff09\u6539\u4e3a\u591a\u76f8\u6d41\uff08Shan&#038;Chen model\uff09-Step1\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":782,"_links":{"self":[{"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/posts\/3194"}],"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=3194"}],"version-history":[{"count":1,"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/posts\/3194\/revisions"}],"predecessor-version":[{"id":3195,"href":"http:\/\/81.70.49.155\/index.php?rest_route=\/wp\/v2\/posts\/3194\/revisions\/3195"}],"wp:attachment":[{"href":"http:\/\/81.70.49.155\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/81.70.49.155\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3194"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/81.70.49.155\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}