︠9cf927c6-6668-421a-8364-b6a49816b68ai︠ %html
In this worksheet, we take a look at potential flow around a cylinder with circulation. We study the effect of varying the circulation on the topology of the streamlines. The standard reference for this system is Batchelor, paragraph 6.6.
︡f473e73e-2002-4eac-aa1a-a6f5bf6946fb︡{"html": "\r\n\r\n
In this worksheet, we take a look at potential flow around a cylinder with circulation. We study the effect of varying the circulation on the topology of the streamlines. The standard reference for this system is Batchelor, paragraph 6.6.
"}︡ ︠88112fb1-f11d-48d1-9d4e-7f3f02642f1f︠ x, y, U, Gamma, R = var('x, y, U, Gamma, R') ︡ffa51c6e-7b45-458c-8c6c-df26da82099b︡︡ ︠4a830aa8-02f3-4800-9fdf-78847165ffadi︠ %htmlSage has some capabilities to calculate the stream function directly from the complex potential. However, in the interest of speed it is best to define psi directly.
︡e91bf4bd-00a5-420a-b16d-4c3275b841f1︡{"html": "Sage has some capabilities to calculate the stream function directly from the complex potential. However, in the interest of speed it is best to define psi directly.
"}︡ ︠8d03fc96-5576-4fcd-922f-8746ee4efdb9︠ psi(x, y, U, Gamma, R) = U*(1 - R^2/(x^2 + y^2))*y - Gamma/(4*pi)*log(x^2 + y^2) ︡6c149590-30f6-4b2d-b952-c546a99c7b69︡︡ ︠bc63ac64-bf8c-4e4f-b125-135a702013f2︠ import matplotlib.cm from sage.ext.fast_eval import fast_float ︡89362fd4-fb15-4b9a-bba0-9937d050791b︡︡ ︠44f2b87d-20f5-4efe-8131-e8a334447d13︠ # We now fix U = 1.0 and R = 1.0 and let Gamma be a free parameter # # (The 'fast_float' command below optimizes the stream function for fast evaluation) psi_fast = fast_float(psi(x, y, 1.0, Gamma, 1.0), 'x', 'y', 'Gamma') ︡2af8e0a1-6817-4f34-a33f-d4a57b0308bf︡︡ ︠c7d85831-6c47-46ba-b085-edb7ac3d879ei︠ %htmlNote that psi becomes unbounded when we approach the origin. If we were to feed psi to the contour_plot command directly, this singularity would obscure all other features of the plot. To avoid this, we define a new function which returns infinity when evaluated on a point inside the circle. These points will be left out of the contour_plot.
︡be23ba80-19d7-4259-a858-d572872f6467︡{"html": "
Note that psi becomes unbounded when we approach the origin. If we were to feed psi to the contour_plot command directly, this singularity would obscure all other features of the plot. To avoid this, we define a new function which returns infinity when evaluated on a point inside the circle. These points will be left out of the contour_plot.
"}︡
︠bf04e24b-991f-49d2-aaf6-613cfb2dbd56︠
# The following is a helper function which does all the dirty work for us:
def plot_body_flow(Gamma):
psi_body = lambda x, y: psi_fast(x, y, Gamma) if x^2 + y^2 > 1.0 else oo
contour_plot(psi_body, (x, -2, 2), (y, -2, 2), cmap='jet', contours=50, aspect_ratio=1).show()
︡cbae33d2-3da4-4028-8ee3-8ae028fbef94︡︡
︠1246df85-dd7b-4ccf-9285-1d88efa40f3b︠
# For Gamma = 0.0, we clearly observe steady flow around a circular body
plot_body_flow(0.0)
︡88b0f99e-b428-4205-baa4-d92dd51206c5︡{"html": ""}︡
︠ecc98dd6-48c0-4919-9ea2-c775744f91fc︠
# We clearly see the effect of increasing the circulation:
plot_body_flow(8.0)
︡7b316018-f3e8-43d7-87c9-257e36538ecc︡{"html": "
"}︡
︠1aa09e0c-3e73-411d-92ec-376525f79f98︠
# When Gamma = 4*pi, the solution changes quantitatively: the two stagnation points on the boundary of the body coalesce.
plot_body_flow(4*pi)
︡f96bf13f-2647-4571-838f-074befbec40e︡{"html": "
"}︡
︠b081cba4-a3df-4e67-ac00-7201a34a8695︠
# When Gamma is increased even further, the stagnation point moves off the boundary of the rigid body and into the flow.
# The streamlines close to the rigid body are closed curves, while far away they are unbounded.
plot_body_flow(4*pi + 0.5)
︡533d37ca-6678-462c-8e9c-06fe6bcc57a8︡{"html": "
"}︡