MATH529 L25 
Potential flow

Utility functions

Map of Cartesian coordinate lines

Clear["Global`*"];
CartesianConformalMap[w_,x1_,x2_,y1_,y2_,dx_,dy_,fW_,fH_]:=Module[{xidplts,yidplts,yimplts,ximplts,W,H},
W=fW(x2-x1); H=fH(y2-y1);
xidplts= Show[Table[ParametricPlot[{x,y},{y,y1,y2},PlotStyle->{Red,Thin},Axes->True,PlotRange->{{x1-W,x2+W},{y1-H,y2+H}}],{x,x1,x2,dx}]];
yidplts= Show[Table[ParametricPlot[{x,y},{x,x1,x2},PlotStyle->{Blue,Thin},Axes->True,PlotRange->{{x1-W,x2+W},{y1-H,y2+H}}],{y,y1,y2,dy}]];
ximplts= Show[Table[ParametricPlot[{Re[w[x+I y]],Im[w[x+I y]]},{y,y1,y2},PlotStyle->Red,Axes->True,PlotRange->{{x1-W,x2+W},{y1-H,y2+H}}],{x,x1,x2,dx}]];
yimplts= Show[Table[ParametricPlot[{Re[w[x+I y]],Im[w[x+I y]]},{x,x1,x2},PlotStyle->Blue,Axes->True,PlotRange->{{x1-W,x2+W},{y1-H,y2+H}}],{y,y1,y2,dy}]];
Show[{xidplts,yidplts,ximplts,yimplts},AspectRatio->1]
]

Map of polar  coordinate lines

PolarConformalMap[w_,r1_,r2_,θ1_,θ2_,dr_,dθ_,fW_,fH_]:=Module[{ridplts,θidplts,rimplts,θimplts,W,H,x1,x2,y1,y2},
x1 = -r2; x2=r2; y1=-r2; y2=r2;
W=fW(x2-x1); H=fH(y2-y1);
ridplts= Show[Table[ParametricPlot[{r Cos[θ],r Sin[θ]},{θ,θ1,θ2},PlotStyle->{Red,Thin},Axes->True,PlotRange->{{x1-W,x2+W},{y1-H,y2+H}}],{r,r1,r2,dr}]];
θidplts= Show[Table[ParametricPlot[{r Cos[θ],r Sin[θ]},{r,r1,r2},PlotStyle->{Blue,Thin},Axes->True,PlotRange->{{x1-W,x2+W},{y1-H,y2+H}}],{θ,θ1,θ2,dθ}]];
rimplts= Show[Table[ParametricPlot[{Re[w[r Exp[I θ]]],Im[w[r Exp[I θ]]]},{θ,θ1,θ2},PlotStyle->Red,Axes->True,PlotRange->{{x1-W,x2+W},{y1-H,y2+H}}],{r,r1,r2,dr}]];
θimplts= Show[Table[ParametricPlot[{Re[w[r Exp[I θ]]],Im[w[r Exp[I θ]]]},{r,r1,r2},PlotStyle->Blue,Axes->True,PlotRange->{{x1-W,x2+W},{y1-H,y2+H}}],{θ,θ1,θ2,dθ}]];
Show[{ridplts,θidplts,rimplts,θimplts},AspectRatio->Automatic]
]

Joukowski  transform

Manipulate[PolarConformalMap[(#-ρ (E^(I ϕ))+(1/(#-ρ (E^(I ϕ)))))&,0.999,1.001,0,2π,.001,π/9.,0.6,0.6],{{ρ,0.36},0.2,0.4},{{ϕ,-1.4},-π/2,-π/4}]

Flow around a circle

F[Z_,α_]=(E^(I α)) Z+1/((E^(I α)) Z); F[X_,Y_,α_]=F[X+I Y,α]

Φ[X_,Y_,α_]=Re[F[X,Y,α]];Ψ[X_,Y_,α_]=Im[F[X,Y,α]];

streamlines=ContourPlot[Ψ[X,Y,0],{X,-6,6},{Y,-3,3},Contours->40,AspectRatio->Automatic,ContourShading->None]

equipotentiallines=ContourPlot[Φ[X,Y,0],{X,-6,6},{Y,-3,3},Contours->40,AspectRatio->Automatic,ContourStyle->Blue,PlotLegends->Automatic]

Show[{equipotentiallines,streamlines}]

Velocity field around a circle

W[Z_,α_]=D[F[Z,α],Z]

W[X_,Y_,α_]=W[X+I Y,α];

VectorPlot[{Re[W[X, Y,0]],-Im[W[X,Y,0]]},{X,-6,6},{Y,-2,2},AspectRatio->Automatic,VectorPoints->{80,30}]

Flow around a   Joukowski  airfoil

F[Z_,α_]=(E^(I α)) Z+1/((E^(I α)) Z); F[X_,Y_,α_]=F[X+I Y,α];
z[Z_,δ_]=Z+δ+(1/(Z+δ)); z[X_,Y_,δ_]=z[X+I Y,δ];

δ0=0.3 (E^(-1.38I)); α0=0.; δ0=0.;
ϕ=Table[{Re[z[X, Y,δ0]],Im[z[X, Y,δ0]],Re[F[X,Y,α0]]},{X,-6.01,6,0.1},{Y,-2,2,0.05}];

ListContourPlot[ϕ,AspectRatio->Automatic,PlotRange->All]

Flow around   Joukowski airfoil