Skip to content

Commit

Permalink
Made ex18 example more consistent with the others in user doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinnala committed Oct 2, 2018
1 parent b3a2b55 commit a458971
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
Binary file removed examples/ex18-stream-lines.png
Binary file not shown.
Binary file removed examples/ex18-velocity-vectors.png
Binary file not shown.
2 changes: 0 additions & 2 deletions examples/ex18.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def unit_rotation(v, dv, ddv, w):
print('phi0 = {} (cf. exact = 1/64 = {})'.format(Psi0, 1/64))

ax = mesh.draw()
ax.set_title('stream-lines')
fig = ax.get_figure()
ax.tricontour(Triangulation(M.p[0, :], M.p[1, :], M.t.T), Psi)
ax.axis('off')
Expand All @@ -70,7 +69,6 @@ def unit_rotation(v, dv, ddv, w):
velocity = np.vstack([derivative(Psi, refbasis, refbasis, 1),
-derivative(Psi, refbasis, refbasis, 0)])
ax = mesh.draw()
ax.set_title('velocity vectors coloured by buoyancy')
sparsity_factor = 2**3 # subsample the arrows
vector_factor = 2**3 # lengthen the arrows
x = M.p[:, ::sparsity_factor]
Expand Down
18 changes: 11 additions & 7 deletions examples/ex18.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ The stream-function :math:`\psi` for two-dimensional creeping flow is
governed by the biharmonic equation

.. math::
\nu \Delta^2\psi = \mathop{rot} f
\nu \Delta^2\psi = \mathrm{rot}\,f
where :math:`\nu` is the kinematic viscosity (assumed constant),
:math:`f` the volumetric body-force, and :math:`\mathop{rot} f =
:math:`f` the volumetric body-force, and :math:`\mathrm{rot}\,f =
(\partial f/\partial y, -\partial f/\partial x)`. The boundary
conditions at a wall are that :math:`\psi` be constant (the wall is
impermeable) and that the normal component of its gradient vanish (no
conditions at a wall are that :math:`\psi` is constant (the wall is
impermeable) and that the normal component of its gradient vanishes (no
slip). Thus, the boundary value problem is analogous to that of
bending a clamped plate, and may be treated with Morley elements as in
`ex10`.
`Kirchhoff plate`_ example.

Here we consider a buoyancy force :math:`f = x\hat{j}`, which arises in
the Boussinesq approximation of natural convection with a horizontal
Expand All @@ -30,9 +30,13 @@ polynomial solution with circular stream-lines:
The resulting stream-lines and velocity vectors are given
in the following figures:

.. figure:: ../examples/ex18-stream-lines.png
.. figure:: ../examples/ex18_stream-lines.png

.. figure:: ../examples/ex18-velocity-vectors.png
The stream-lines.

.. figure:: ../examples/ex18_velocity-vectors.png

The velocity vectors colored by buoyancy.

The complete source code reads as follows:

Expand Down
Binary file added examples/ex18_stream-lines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/ex18_velocity-vectors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a458971

Please sign in to comment.