Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrilleBonamy committed Feb 4, 2020
1 parent 7e4bf40 commit 6df262b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions examples/plot_contour_unstructured.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@


###############################################################################
# Plots the contour of the interpolted scalarfield phi and add a patch
# --------------------------------------------------------------------
# Plots the contour of the interpolted scalarfield phi, streamlines and a patch
# -----------------------------------------------------------------------------
#
# .. note:: The scalar field phi reprensents the concentration of sediment in
# in a 2D two-phase flow simulation of erosion below a pipeline
Expand All @@ -94,14 +94,10 @@
levels = np.arange(0.1, 0.63, 0.001)
plt.contourf(xi/d, yi/d, phi_i, cmap=plt.cm.Reds, levels=levels)


###############################################################################
# Calculates and adds the streamlines on the same plot
# ----------------------------------------------------
#
# Calculation of the streamline width as a function of the velociy magnitude
vel_i = np.sqrt(velx_i**2 + vely_i**2)
lw = pow(vel_i, 1.5)/vel_i.max()

# Plots the streamlines
plt.streamplot(xi/d, yi/d, velx_i, vely_i, color='C0', density=[2, 1],
linewidth=lw, arrowsize=0.05)

0 comments on commit 6df262b

Please sign in to comment.