?? convect.edp
字號:
// This a the rotating hill problem with one turn.// First 1/2 turn is a convection equation and second 1/2 a convection diffusionborder a(t=0, 2*pi) { x = cos(t); y = sin(t); }; // the unit circlemesh th = buildmesh(a(70)); // triangulates the diskfespace Vh(th,P1);func real hill(real r2){return exp(-10*(r2));}Vh v = hill( (x-0.3)^2 +(y-0.3)^2); // initial conditionplot(v);real dt = 0.17,t=0; // time stepVh u1 = y, u2 = -x; // rotation velocityint i;Vh vv,vo; // work Finite element function for ( i=0; i< 20 ; i++) { t += dt; vo=v; v=convect([u1,u2],-dt,vo); // convect v by u1,u2, dt seconds, results in f // convec(u1,u2,dt,v,v) won't work plot(v,cmm="convection: t="+t + ", min=" + v[].min + ", max=" + v[].max,wait=0);};problem A(v,vv,solver=CG) = int2d(th)(v*vv/dt + 0.01*(dx(v)*dx(vv)+dy(v)*dy(vv)) ) + int2d(th)(-vv*convect([u1,u2],-dt,vo)/dt) + on(a,v=0); plot(v,wait=1);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -