Inviscid Flow in Mathematica
Elementary Planar Irrotational Flows
A. N. M. Ansari , ansarina.ir , 20181221- R1
Inviscid Flow in Mathematica
Elementary Planar Irrotational Flows
A. N. M. Ansari , ansarina.ir , 20181221- R1
In[111]:= imageSize=Medium;
Building Block 1[LongDash]Uniform Stream
In[112]:= V=1;
[Psi]=V y;
u1=D[[Psi],y];
v1= D[-[Psi], x];
StreamPlot[{{u1,v1},{-v1,u1}},{x,-3,3},{y,-3,3},StreamStyle->{{Blue},{Red,Dashed,Arrowheads[0]}},ImageSize-> imageSize]
Uniform stream inclined at angle [Alpha]
In[117]:= V=1;
[Alpha]=10 Degree;
[Psi]=V (y Cos[[Alpha]] – x Sin[[Alpha]]);
u=D[[Psi],y];
v= D[-[Psi], x];
StreamPlot[{{u,v},{-v,u}},{x,-3,3},{y,-3,3},StreamStyle->{{Blue},{Red,Dashed,Arrowheads[0]}},ImageSize-> imageSize]
Building Block 2[LongDash]Line Source or Line Sink
In[123]:= A=1;
[Theta] = ArcTan[y/x];
[Psi]=A/(2[Pi]) [Theta];
u2=D[[Psi],y];
v2= D[-[Psi], x];
StreamPlot[{{u2,v2},{-v2,u2}},{x,-3,3},{y,-3,3},StreamStyle->{{Blue},{Red,Dashed,Arrowheads[0]}},ImageSize-> imageSize]
Line source located at some arbitrary point (a, b) in the xy-plane
In[129]:= A=1;
a=1;
b=0;
[Theta] = ArcTan[(y-b)/(x-a)];
[Psi]=A/(2[Pi]) [Theta];
u21=D[[Psi],y];
v21= D[-[Psi], x];
StreamPlot[{{u21,v21},{-v21,u21}},{x,-3,3},{y,-3,3},StreamStyle->{{Blue},{Red,Dashed,Arrowheads[0]}},ImageSize-> imageSize]
Building Block 3[LongDash]Line Vortex
In[137]:= B=1;
r= Sqrt[y^2+x^2];
[Psi]=-B/(2[Pi]) Log[r];
u3=D[[Psi],y];
v3= D[-[Psi], x];
StreamPlot[{{u3,v3},{-v3,u3}},{x,-3,3},{y,-3,3},StreamStyle->{{Blue},{Red,Dashed,Arrowheads[0]}},ImageSize-> imageSize]
superposition of a line sink and a line vortex at the origin
In[143]:= StreamPlot[{{u3+u2,v3+v2},{-v3-v2,u3+u2}},{x,-3,3},{y,-3,3},StreamStyle->{{Blue},{Red,Dashed,Arrowheads[0]}},ImageSize-> imageSize]
Building Block 4[LongDash]Doublet
In[144]:= A=1;
a=0.01;
[Theta]1 = ArcTan[y/(x+a)];
[Theta]2 = ArcTan[y/(x-a)];
[Psi]=A/(2[Pi]) ([Theta]1-[Theta]2);
u4=D[[Psi],y];
v4= D[-[Psi], x];
StreamPlot[{{u4,v4},{-v4,u4}},{x,-3,3},{y,-3,3},StreamStyle->{{Blue},{Red,Dashed,Arrowheads[0]}},ImageSize-> imageSize]
Superposition of a Uniform Stream and a Doublet – Flow over a Circular Cylinder
In[152]:= StreamPlot[{{1000 u4+u1,1000v4+v1},{-1000v4-v1,1000u4+u1}},{x,-3,3},{y,-3,3},StreamStyle->{{Blue},{Red,Dashed,Arrowheads[0]}},ImageSize-> imageSize]