我有一个以下MATLAB图,它由一个带圆孔的矩形域组成:
我正在模拟通过该矩形多孔介质的流动。我绘制了表征流程的流线型。但是,流线穿过整个网格,这意味着它们也会穿过绘图上的圆孔。我想从这些漏洞中删除流线。
有关如何做到这一点的任何建议吗?
以下是我用来创建该剧情的代码:
x = linspace(min(X_plot(:,1)), max(X_plot(:,1)), 100);
y = linspace(min(X_plot(:,2)), max(X_plot(:,2)), 100);
[xg, yg] = meshgrid(x, y);
Fx = TriScatteredInterp(X_plot(:,1), X_plot(:,2), qx);
Fy = TriScatteredInterp(X_plot(:,1), X_plot(:,2), qy);
qxg = Fx(xg,yg);
qyg = Fy(xg,yg);
figure(1); hold on;
hl = streamslice(xg, yg, qxg, qyg);
set(hl, 'color', 'b','Linewidth',0.5);
在我使用的图表上绘制圆圈(和椭圆):
hold on
P2 = [2,-1.5];
r2=.6;
tt = linspace(0,pi*2);
xx = P2(1) + r2*cos(tt);
yy = P2(2) + r2*sin(tt);
plot(xx,yy,'--','Color',[.7 .7 0])
hold on
P3 = [3,1.5];
r3=1.3;
tt = linspace(0,pi*2);
xx = P3(1) + r3*cos(tt);
yy = P3(2) + r3*sin(tt);
plot(xx,yy,'--','Color',[1 .7 0])
hold on
P5 = [5,-1.5];
r5=.8;
tt = linspace(0,pi*2);
xx = P5(1) + r5*cos(tt);
yy = P5(2) + r5*sin(tt);
plot(xx,yy,'--','Color',[1 .7 0])
hold on
P6 = [6,1.5];
r6=.6;
tt = linspace(0,pi*2);
xx = P6(1) + r6*cos(tt);
yy = P6(2) + r6*sin(tt);
plot(xx,yy,'--','Color',[1 .7 0])
hold on
P4 = [9,0];
r41=.5;
r42=2.4;
tt = linspace(0,pi*2);
xx = P4(1) + r41*cos(tt);
yy = P4(2) + r42*sin(tt);
plot(xx,yy,'--','Color',[.9 .7 0])